Skip to content

Commit

Permalink
Merge pull request #571 from Psychedelic/fix/dip-20-transfer-args
Browse files Browse the repository at this point in the history
fix: dip 20 transfer args
  • Loading branch information
tomiir authored Aug 23, 2022
2 parents 74ebb99 + dc8e2fb commit 4ffdffe
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ const ICP_DECIMALS = 8;
export const getAssetData = (canisterId) => Object.values(TOKENS).find((token) => token.canisterId === canisterId);

const DIP20_AMOUNT_MAP = {
transfer: (args) => args?.[0]?.amount / (10 ** CYCLE_DECIMALS),
transfer: (args) => args?.[1] / (10 ** CYCLE_DECIMALS),
transferErc20: (args) => args?.[1] / (10 ** CYCLE_DECIMALS),
transferFrom: (args) => args?.[2] / (10 ** CYCLE_DECIMALS),

};

const ICP_AMOUNT_MAP = (args) => args?.[0]?.amount?.e8s / (10 ** ICP_DECIMALS);
Expand Down

0 comments on commit 4ffdffe

Please sign in to comment.