Skip to content

Commit

Permalink
moved logic to parse token data outside of return
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Taras authored and Nick Taras committed Nov 27, 2023
1 parent ed7af40 commit f25802f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions javascript/engine-js/src/view/TokenViewData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ export class TokenViewData {

const walletAdapter = await this.tokenScript.getEngine().getWalletAdapter();

return `
const currentTokenInstance = JSON.parse(`${JSON.stringify(tokenData).replace("^\\'", "\\'").replace(/[\u0000-\u001F]/g, "")}`);

const _currentTokenInstance = JSON.parse('${JSON.stringify(tokenData).replace("^\\'", "\\'").replace(/[\u0000-\u001F]/g, "")}');
return `
const _currentTokenInstance = ${currentTokenInstance};
const walletAddress = '${tokenData.ownerAddress}'
const addressHex = "${tokenData.ownerAddress}";
const rpcURL = "${walletAdapter.getRpcUrl(tokenData.chainId)}";
Expand Down

0 comments on commit f25802f

Please sign in to comment.