Skip to content

Commit

Permalink
parses asset code from hex to ascii
Browse files Browse the repository at this point in the history
  • Loading branch information
aristidesstaffieri committed Nov 29, 2023
1 parent 8d5a789 commit eadda55
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/service/mercury/helpers/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,13 @@ const transformAccountBalances = async (
}, {} as NonNullable<AccountBalancesInterface["balances"]>);

const classicBalances = classicBalanceData.reduce((prev, curr) => {
const codeAscii = Buffer.from(
curr.assetByAsset.code.substring(2),
"hex"
).toString("utf8");
prev[`${curr.assetByAsset.code}:${curr.assetByAsset.issuer}`] = {
token: {
code: curr.assetByAsset.code,
code: codeAscii,
issuer: {
key: curr.assetByAsset.issuer,
},
Expand Down

0 comments on commit eadda55

Please sign in to comment.