Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @tangled3/react

## 1.17.22

### Patch Changes

- fix/token metadata

## 1.17.21

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tangled3/react",
"private": false,
"version": "1.17.21",
"version": "1.17.22",
"type": "module",
"license": "MIT",
"main": "./src/index.ts",
Expand Down
30 changes: 30 additions & 0 deletions packages/react/src/actions/evm/getEVMToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,27 @@ export const getEVMTokenMetadata = async (address: string, chainId: number, wagm
decimals: 6,
};
}
if (chainId === 1689 && address === '0xb6dc6c8b71e88642cead3be1025565a9ee74d1c6') {
return {
name: 'WETH',
symbol: 'WETH',
decimals: 18,
};
}
if (chainId === 1689 && address === '0x97eec1c29f745dc7c267f90292aa663d997a601d') {
return {
name: 'USDC',
symbol: 'USDC',
decimals: 6,
};
}
if (chainId === 1689 && address === '0xff13a7a12fd485bc9687ff88d8ae1a6b655ab469') {
return {
name: 'USDT',
symbol: 'USDT',
decimals: 6,
};
}
const tokenData = await multicall(wagmiConfig, {
contracts: [
{
Expand Down Expand Up @@ -93,12 +114,21 @@ export const getEVMTokenBalanceAndAllowance = async (
args: [account as Address, spender as Address],
});
}
console.log('yoyoyo', calls);
const balanceAndAllowance = await multicall(wagmiConfig, {
contracts: calls,
chainId: Number(chainId),
allowFailure: false,
});

// const balance = await readContract(wagmiConfig,{
// address: address as Address,
// abi: erc20Abi,
// functionName: 'balanceOf',
// args: [account as Address],
// chainId,
// });
console.log('final yoyoyo', balanceAndAllowance);
return {
balance: BigInt(balanceAndAllowance[0]),
allowance: BigInt(balanceAndAllowance[1] ?? 0),
Expand Down
Loading