diff --git a/packages/sdk/src/contract/contracts/Erc20/Erc20Public.ts b/packages/sdk/src/contract/contracts/Erc20/Erc20Public.ts index adf6adec..bb40a652 100644 --- a/packages/sdk/src/contract/contracts/Erc20/Erc20Public.ts +++ b/packages/sdk/src/contract/contracts/Erc20/Erc20Public.ts @@ -28,7 +28,7 @@ export class Erc20Public implements BalanceContractInterface { const data = await this.#publicClient.readContract({ abi, address: this.#config.address as `0x${string}`, - args: [this.address], + args: this.#config.args, functionName: 'balanceOf', }); diff --git a/packages/sdk/src/getTransferData/getTransferData.utils.ts b/packages/sdk/src/getTransferData/getTransferData.utils.ts index ec989cd3..d2a68635 100644 --- a/packages/sdk/src/getTransferData/getTransferData.utils.ts +++ b/packages/sdk/src/getTransferData/getTransferData.utils.ts @@ -45,7 +45,9 @@ export async function getBalance({ chain as EvmParachain, ) as BalanceContractInterface; - return contract.getBalance(); + const balance = await contract.getBalance(); + + return balance; } export async function getDecimals({ diff --git a/packages/sdk/tests/acceptance/__snapshots__/sdk.test.ts.snap b/packages/sdk/tests/acceptance/__snapshots__/sdk.test.ts.snap index 6e17ff28..b9316698 100644 --- a/packages/sdk/tests/acceptance/__snapshots__/sdk.test.ts.snap +++ b/packages/sdk/tests/acceptance/__snapshots__/sdk.test.ts.snap @@ -201,7 +201,7 @@ exports[`sdk getParachainBalances should get expected balances for HydraDX for s exports[`sdk getParachainBalances should get expected balances for Moonbase Alpha 1`] = ` [ r { - "amount": 0n, + "amount": 1234567890000000000n, "decimals": 18, "key": "ftmwh", "originSymbol": "FTM.wh", @@ -264,7 +264,7 @@ exports[`sdk getParachainBalances should get expected balances for Moonbase Alph "symbol": "ALAN", }, r { - "amount": 0n, + "amount": 6543210000000000000n, "decimals": 18, "key": "dev", "originSymbol": "DEV", @@ -386,7 +386,7 @@ exports[`sdk getParachainBalances should get expected balances for Moonbeam 1`] "symbol": "USDT.Wh", }, r { - "amount": 374573n, + "amount": 0n, "decimals": 6, "key": "usdcwh", "originSymbol": "USDC.Wh",