Minor Changes
-
#4767
0def05663277a93e645bc28740a78bfc916810ecThanks @jxom! - Breaking (viem/tempo): Changed Tempo token balance and allowance reads to returnAmountobjects.-const balance = await client.token.getBalance({ token }) -// ^? bigint +const balance = await client.token.getBalance({ token }) +// ^? { amount: bigint; decimals: number; formatted: string } -const allowance = await client.token.getAllowance({ account, spender, token }) -// ^? bigint +const allowance = await client.token.getAllowance({ account, spender, token }) +// ^? { amount: bigint; decimals: number; formatted: string }
-
#4767
0def05663277a93e645bc28740a78bfc916810ecThanks @jxom! - Breaking (viem/tempo): Changed Tempo token.callhelpers to take the client before their action arguments.-Actions.token.transfer.call({ token, to, amount }) +Actions.token.transfer.call(client, { token, to, amount }) -Actions.token.getBalance.call({ account, token }) +Actions.token.getBalance.call(client, { account, token })
-
#4767
0def05663277a93e645bc28740a78bfc916810ecThanks @jxom! - Breaking: Changed ERC-20 token actions to resolve token symbols from the Clienttokensarray instead of built-in chaintokensconfig.import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' +import { usdc } from 'viem/tokens' -const client = createPublicClient({ chain: mainnet, transport: http() }) +const client = createPublicClient({ + chain: mainnet, + tokens: [usdc], + transport: http(), +}) const balance = await client.token.getBalance({ account, token: 'usdc' }) -
#4767
0def05663277a93e645bc28740a78bfc916810ecThanks @jxom! - Addedviem/tokensentrypoint.
Patch Changes
-
#4739
cc3c2ff6a50dbca96a665c8fc2ad635f86d94f53Thanks @Equious! - Added BattleChain Mainnet (chainId 626) toviem/chains. -
#4733
1caa5766109309d5fab48f1c4316deff5f504f9cThanks @2wheeh! - Added MarooTestnet chain. -
#4772
b0a0e1ccd158198d56903759d362f22716a6b1e7Thanks @jxom! - Added an RLP depth limit for decoding deeply nested payloads.