Skip to content

Commit

Permalink
chore: matchain multicall
Browse files Browse the repository at this point in the history
  • Loading branch information
jayeshbhole-rp committed Jan 7, 2025
1 parent 56b6981 commit 8563d20
Show file tree
Hide file tree
Showing 7 changed files with 362 additions and 605 deletions.
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.16.13

### Patch Changes

- chore: upgrade wagmi, viem

## 1.16.12

### Patch Changes
Expand Down
12 changes: 6 additions & 6 deletions 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.16.12",
"version": "1.16.13",
"type": "module",
"license": "MIT",
"main": "./src/index.ts",
Expand Down Expand Up @@ -52,14 +52,14 @@
"@tanstack/react-query": "^5.44.0",
"@tronweb3/tronwallet-abstract-adapter": "^1.1.8",
"@tronweb3/tronwallet-adapters": "^1.2.6",
"@wagmi/core": "^2.11.0",
"@wagmi/core": "^2.16.3",
"detect-browser": "^5.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tronweb": "^6.0.0",
"usehooks-ts": "^3.1.0",
"viem": "^2.21.51",
"wagmi": "^2.9.11",
"viem": "^2.22.2",
"wagmi": "2.14.6",
"zustand": "^4.5.2"
},
"devDependencies": {
Expand All @@ -78,7 +78,7 @@
"@wagmi/core": "^2.11.0",
"react": ">=18",
"react-dom": ">=18",
"viem": "^2.21.51",
"wagmi": "^2.9.11"
"viem": "2.22.2",
"wagmi": "2.14.6"
}
}
11 changes: 10 additions & 1 deletion packages/react/src/chains/evm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ export const firechain: EVMChain = { ...vFirechain, type: 'evm' } as const;
export const linea: EVMChain = { ...vLinea, type: 'evm' } as const;
export const manta: EVMChain = { ...vManta, type: 'evm' } as const;
export const mantle: EVMChain = { ...vMantle, type: 'evm' } as const;
export const matchain: EVMChain = { ...vMatchain, type: 'evm' } as const;
export const matchain: EVMChain = {
...vMatchain,
type: 'evm',
contracts: {
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 1,
},
},
} as const;
export const metis: EVMChain = { ...vMetis, type: 'evm' } as const;
export const mode: EVMChain = { ...vMode, type: 'evm' } as const;
export const optimism: EVMChain = { ...vOptimism, type: 'evm' } as const;
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/hooks/useToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const useToken = ({ chainId, token, ...queryOptions }: UseTokenParams) =>
queryKey: ['token', chain?.id, token],
queryFn: async () => {
if (!chain || !token) {
throw new Error('Missing required parameters');
throw new Error(`Missing required parameters: chainId: ${chain?.id}, token: ${token}`);
}
if (!connectionOrConfig) {
throw new Error('Connections or config not found');
Expand Down
4 changes: 3 additions & 1 deletion packages/react/src/hooks/useTokenForAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export const useTokenForAccount = ({ chainId, account, token, spender, ...queryO
queryKey: ['balance and allowance', chain?.id, token, account, spender, tokenMetadata?.decimals],
queryFn: async () => {
if (!account || !token || !tokenMetadata || !chain) {
throw new Error('Missing required parameters');
throw new Error(
`Missing required parameters: account: ${account}, token: ${token}, chain: ${chain?.id}, tokenMetadata: ${tokenMetadata}`,
);
}
if (!connectionOrConfig) {
throw new Error('Connections or config not found');
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/types/evm.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Evaluate } from '@wagmi/core/internal';
import { EIP1193Provider } from 'viem';
import { EIP1193Provider, Evaluate } from 'viem';

export type WalletProviderFlags = string;
export type WalletProvider = Evaluate<
Expand Down
929 changes: 335 additions & 594 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

0 comments on commit 8563d20

Please sign in to comment.