Skip to content

Commit

Permalink
v0.0.31
Browse files Browse the repository at this point in the history
  • Loading branch information
raymishtech committed Mar 25, 2023
1 parent 88caded commit a7a5fb8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zerochain/zus-sdk",
"version": "0.0.30",
"version": "0.0.31",
"description": "[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](./CONTRIBUTING.md)",
"main": "./lib/index.js",
"types": "lib/index.d.ts",
Expand Down
12 changes: 9 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,26 +497,32 @@ export const decodeAuthTicketWasm = async (authTicket) => {
}

if ("marker" in input) {
let str = input["marker"];
let str = input.marker;
let decodedMarker = Buffer.from(str, "base64");
console.log("decodedMarker", decodedMarker);

let markerInput = {};
try {
markerInput = JSON.parse(decodedMarker);
console.log("markerInput", markerInput);
} catch (err) {
console.error("error unmarshaling markerInput", err);
return [resp, err];
}
let lock = markerInput["free_tokens"];
let lock = markerInput.free_tokens;
console.log("lock", lock);
resp.Marker = JSON.stringify(markerInput);
let tokens = parseFloat(lock / Math.pow(10, 10));
console.log("tokens", tokens);
resp.Tokens = tokens;
}

if ("recipient_public_key" in input) {
let recipientPublicKey = input["recipient_public_key"];
let recipientPublicKey = input.recipient_public_key;
if (typeof recipientPublicKey !== "string") {
return [resp, new Error("recipient_public_key is required")];
}
console.log("recipientPublicKey", recipientPublicKey);
resp.RecipientPublicKey = recipientPublicKey;
}

Expand Down

0 comments on commit a7a5fb8

Please sign in to comment.