viem 2.47.5 → 2.47.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -0
- package/_cjs/actions/public/verifyHash.js +16 -6
- package/_cjs/actions/public/verifyHash.js.map +1 -1
- package/_cjs/actions/wallet/prepareTransactionRequest.js +14 -1
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_cjs/actions/wallet/sendTransaction.js +2 -2
- package/_cjs/actions/wallet/sendTransaction.js.map +1 -1
- package/_cjs/actions/wallet/waitForCallsStatus.js.map +1 -1
- package/_cjs/chains/definitions/battlechainTestnet.js +26 -0
- package/_cjs/chains/definitions/battlechainTestnet.js.map +1 -0
- package/_cjs/chains/definitions/eden.js +32 -0
- package/_cjs/chains/definitions/eden.js.map +1 -0
- package/_cjs/chains/definitions/gensyn.js +29 -0
- package/_cjs/chains/definitions/gensyn.js.map +1 -0
- package/_cjs/chains/definitions/igra.js +26 -0
- package/_cjs/chains/definitions/igra.js.map +1 -0
- package/_cjs/chains/definitions/katana.js +6 -0
- package/_cjs/chains/definitions/katana.js.map +1 -1
- package/_cjs/chains/definitions/megaeth.js +25 -3
- package/_cjs/chains/definitions/megaeth.js.map +1 -1
- package/_cjs/chains/definitions/mezo.js +23 -0
- package/_cjs/chains/definitions/mezo.js.map +1 -0
- package/_cjs/chains/definitions/mezoTestnet.js +30 -0
- package/_cjs/chains/definitions/mezoTestnet.js.map +1 -0
- package/_cjs/chains/definitions/radius.js +22 -0
- package/_cjs/chains/definitions/radius.js.map +1 -0
- package/_cjs/chains/definitions/radiusTestnet.js +22 -0
- package/_cjs/chains/definitions/radiusTestnet.js.map +1 -0
- package/_cjs/chains/definitions/tempoDevnet.js +1 -0
- package/_cjs/chains/definitions/tempoDevnet.js.map +1 -1
- package/_cjs/chains/definitions/tempoLocalnet.js +1 -0
- package/_cjs/chains/definitions/tempoLocalnet.js.map +1 -1
- package/_cjs/chains/definitions/tempoModerato.js +1 -1
- package/_cjs/chains/definitions/tempoModerato.js.map +1 -1
- package/_cjs/chains/index.js +32 -17
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/errors/version.js.map +1 -1
- package/_cjs/tempo/Abis.js +45 -0
- package/_cjs/tempo/Abis.js.map +1 -1
- package/_cjs/tempo/Account.js +1 -3
- package/_cjs/tempo/Account.js.map +1 -1
- package/_cjs/tempo/Hardfork.js +18 -0
- package/_cjs/tempo/Hardfork.js.map +1 -0
- package/_cjs/tempo/Transaction.js +1 -0
- package/_cjs/tempo/Transaction.js.map +1 -1
- package/_cjs/tempo/actions/accessKey.js +26 -2
- package/_cjs/tempo/actions/accessKey.js.map +1 -1
- package/_cjs/tempo/actions/token.js +2 -1
- package/_cjs/tempo/actions/token.js.map +1 -1
- package/_cjs/tempo/chainConfig.js +44 -8
- package/_cjs/tempo/chainConfig.js.map +1 -1
- package/_cjs/tempo/index.js +2 -1
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/utils/rpc/http.js +3 -0
- package/_cjs/utils/rpc/http.js.map +1 -1
- package/_esm/actions/public/verifyHash.js +17 -7
- package/_esm/actions/public/verifyHash.js.map +1 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js +14 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/actions/wallet/sendTransaction.js +2 -2
- package/_esm/actions/wallet/sendTransaction.js.map +1 -1
- package/_esm/actions/wallet/waitForCallsStatus.js.map +1 -1
- package/_esm/chains/definitions/battlechainTestnet.js +23 -0
- package/_esm/chains/definitions/battlechainTestnet.js.map +1 -0
- package/_esm/chains/definitions/eden.js +29 -0
- package/_esm/chains/definitions/eden.js.map +1 -0
- package/_esm/chains/definitions/gensyn.js +26 -0
- package/_esm/chains/definitions/gensyn.js.map +1 -0
- package/_esm/chains/definitions/igra.js +23 -0
- package/_esm/chains/definitions/igra.js.map +1 -0
- package/_esm/chains/definitions/katana.js +6 -0
- package/_esm/chains/definitions/katana.js.map +1 -1
- package/_esm/chains/definitions/megaeth.js +25 -3
- package/_esm/chains/definitions/megaeth.js.map +1 -1
- package/_esm/chains/definitions/mezo.js +20 -0
- package/_esm/chains/definitions/mezo.js.map +1 -0
- package/_esm/chains/definitions/mezoTestnet.js +27 -0
- package/_esm/chains/definitions/mezoTestnet.js.map +1 -0
- package/_esm/chains/definitions/radius.js +19 -0
- package/_esm/chains/definitions/radius.js.map +1 -0
- package/_esm/chains/definitions/radiusTestnet.js +19 -0
- package/_esm/chains/definitions/radiusTestnet.js.map +1 -0
- package/_esm/chains/definitions/tempoDevnet.js +1 -0
- package/_esm/chains/definitions/tempoDevnet.js.map +1 -1
- package/_esm/chains/definitions/tempoLocalnet.js +1 -0
- package/_esm/chains/definitions/tempoLocalnet.js.map +1 -1
- package/_esm/chains/definitions/tempoModerato.js +1 -1
- package/_esm/chains/definitions/tempoModerato.js.map +1 -1
- package/_esm/chains/index.js +10 -7
- package/_esm/chains/index.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/errors/version.js.map +1 -1
- package/_esm/tempo/Abis.js +45 -0
- package/_esm/tempo/Abis.js.map +1 -1
- package/_esm/tempo/Account.js +1 -5
- package/_esm/tempo/Account.js.map +1 -1
- package/_esm/tempo/Hardfork.js +15 -0
- package/_esm/tempo/Hardfork.js.map +1 -0
- package/_esm/tempo/Transaction.js +1 -0
- package/_esm/tempo/Transaction.js.map +1 -1
- package/_esm/tempo/actions/accessKey.js +34 -3
- package/_esm/tempo/actions/accessKey.js.map +1 -1
- package/_esm/tempo/actions/token.js +2 -1
- package/_esm/tempo/actions/token.js.map +1 -1
- package/_esm/tempo/chainConfig.js +52 -11
- package/_esm/tempo/chainConfig.js.map +1 -1
- package/_esm/tempo/index.js +1 -0
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/utils/rpc/http.js +5 -0
- package/_esm/utils/rpc/http.js.map +1 -1
- package/_types/actions/public/verifyHash.d.ts +2 -0
- package/_types/actions/public/verifyHash.d.ts.map +1 -1
- package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
- package/_types/chains/definitions/battlechainTestnet.d.ts +441 -0
- package/_types/chains/definitions/battlechainTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/eden.d.ts +46 -0
- package/_types/chains/definitions/eden.d.ts.map +1 -0
- package/_types/chains/definitions/gensyn.d.ts +45 -0
- package/_types/chains/definitions/gensyn.d.ts.map +1 -0
- package/_types/chains/definitions/igra.d.ts +48 -0
- package/_types/chains/definitions/igra.d.ts.map +1 -0
- package/_types/chains/definitions/katana.d.ts +6 -9
- package/_types/chains/definitions/katana.d.ts.map +1 -1
- package/_types/chains/definitions/megaeth.d.ts +274 -6
- package/_types/chains/definitions/megaeth.d.ts.map +1 -1
- package/_types/chains/definitions/mezo.d.ts +48 -0
- package/_types/chains/definitions/mezo.d.ts.map +1 -0
- package/_types/chains/definitions/mezoTestnet.d.ts +45 -0
- package/_types/chains/definitions/mezoTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/radius.d.ts +48 -0
- package/_types/chains/definitions/radius.d.ts.map +1 -0
- package/_types/chains/definitions/radiusTestnet.d.ts +48 -0
- package/_types/chains/definitions/radiusTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/tempo.d.ts +35 -32
- package/_types/chains/definitions/tempo.d.ts.map +1 -1
- package/_types/chains/definitions/tempoDevnet.d.ts +37 -32
- package/_types/chains/definitions/tempoDevnet.d.ts.map +1 -1
- package/_types/chains/definitions/tempoLocalnet.d.ts +37 -32
- package/_types/chains/definitions/tempoLocalnet.d.ts.map +1 -1
- package/_types/chains/definitions/tempoModerato.d.ts +37 -34
- package/_types/chains/definitions/tempoModerato.d.ts.map +1 -1
- package/_types/chains/index.d.ts +10 -7
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/errors/version.d.ts.map +1 -1
- package/_types/tempo/Abis.d.ts +75 -0
- package/_types/tempo/Abis.d.ts.map +1 -1
- package/_types/tempo/Account.d.ts.map +1 -1
- package/_types/tempo/Decorator.d.ts +2 -2
- package/_types/tempo/Hardfork.d.ts +5 -0
- package/_types/tempo/Hardfork.d.ts.map +1 -0
- package/_types/tempo/Transaction.d.ts +7 -6
- package/_types/tempo/Transaction.d.ts.map +1 -1
- package/_types/tempo/actions/accessKey.d.ts +106 -3
- package/_types/tempo/actions/accessKey.d.ts.map +1 -1
- package/_types/tempo/actions/reward.d.ts +108 -0
- package/_types/tempo/actions/reward.d.ts.map +1 -1
- package/_types/tempo/actions/token.d.ts +828 -18
- package/_types/tempo/actions/token.d.ts.map +1 -1
- package/_types/tempo/chainConfig.d.ts +18 -16
- package/_types/tempo/chainConfig.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +1 -0
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/utils/rpc/http.d.ts.map +1 -1
- package/actions/public/verifyHash.ts +23 -9
- package/actions/wallet/prepareTransactionRequest.ts +14 -1
- package/actions/wallet/sendTransaction.ts +2 -2
- package/actions/wallet/waitForCallsStatus.ts +1 -1
- package/chains/definitions/battlechainTestnet.ts +24 -0
- package/chains/definitions/eden.ts +29 -0
- package/chains/definitions/gensyn.ts +26 -0
- package/chains/definitions/igra.ts +23 -0
- package/chains/definitions/katana.ts +6 -0
- package/chains/definitions/megaeth.ts +26 -3
- package/chains/definitions/mezo.ts +20 -0
- package/chains/definitions/mezoTestnet.ts +27 -0
- package/chains/definitions/radius.ts +19 -0
- package/chains/definitions/radiusTestnet.ts +19 -0
- package/chains/definitions/tempoDevnet.ts +1 -0
- package/chains/definitions/tempoLocalnet.ts +1 -0
- package/chains/definitions/tempoModerato.ts +1 -1
- package/chains/index.ts +13 -8
- package/errors/version.ts +1 -1
- package/package.json +2 -2
- package/tempo/Abis.ts +45 -0
- package/tempo/Account.ts +1 -4
- package/tempo/Decorator.ts +2 -2
- package/tempo/Hardfork.ts +17 -0
- package/tempo/Transaction.ts +8 -7
- package/tempo/actions/accessKey.ts +40 -9
- package/tempo/actions/token.ts +2 -1
- package/tempo/chainConfig.ts +59 -15
- package/tempo/index.ts +1 -0
- package/tsconfig.json +1 -1
- package/utils/rpc/http.ts +8 -0
- package/_cjs/chains/definitions/tempoAndantino.js +0 -28
- package/_cjs/chains/definitions/tempoAndantino.js.map +0 -1
- package/_esm/chains/definitions/tempoAndantino.js +0 -25
- package/_esm/chains/definitions/tempoAndantino.js.map +0 -1
- package/_types/chains/definitions/tempoAndantino.d.ts +0 -918
- package/_types/chains/definitions/tempoAndantino.d.ts.map +0 -1
- package/chains/definitions/tempoAndantino.ts +0 -25
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const eden = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 714,
|
|
5
|
+
name: 'Eden',
|
|
6
|
+
nativeCurrency: {
|
|
7
|
+
name: 'TIA',
|
|
8
|
+
symbol: 'TIA',
|
|
9
|
+
decimals: 18,
|
|
10
|
+
},
|
|
11
|
+
rpcUrls: {
|
|
12
|
+
default: {
|
|
13
|
+
http: ['https://rpc.eden.gateway.fm'],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
contracts: {
|
|
17
|
+
multicall3: {
|
|
18
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
|
19
|
+
blockCreated: 0,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
blockExplorers: {
|
|
23
|
+
default: {
|
|
24
|
+
name: 'Blockscout',
|
|
25
|
+
url: 'https://eden.blockscout.com',
|
|
26
|
+
apiUrl: 'https://eden.blockscout.com/api',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
})
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const gensyn = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 685_689,
|
|
5
|
+
name: 'Gensyn Mainnet',
|
|
6
|
+
nativeCurrency: {
|
|
7
|
+
decimals: 18,
|
|
8
|
+
name: 'Ether',
|
|
9
|
+
symbol: 'ETH',
|
|
10
|
+
},
|
|
11
|
+
rpcUrls: {
|
|
12
|
+
default: { http: ['https://gensyn-mainnet.g.alchemy.com/public'] },
|
|
13
|
+
},
|
|
14
|
+
blockExplorers: {
|
|
15
|
+
default: {
|
|
16
|
+
name: 'Blockscout',
|
|
17
|
+
url: 'https://gensyn-mainnet.explorer.alchemy.com',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
contracts: {
|
|
21
|
+
multicall3: {
|
|
22
|
+
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
23
|
+
blockCreated: 0,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const igra = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 38833,
|
|
5
|
+
name: 'Igra Network',
|
|
6
|
+
nativeCurrency: {
|
|
7
|
+
decimals: 18,
|
|
8
|
+
name: 'iKAS',
|
|
9
|
+
symbol: 'iKAS',
|
|
10
|
+
},
|
|
11
|
+
rpcUrls: {
|
|
12
|
+
default: {
|
|
13
|
+
http: ['https://rpc.igralabs.com:8545'],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
blockExplorers: {
|
|
17
|
+
default: {
|
|
18
|
+
name: 'Igra Explorer',
|
|
19
|
+
url: 'https://explorer.igralabs.com',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
testnet: false,
|
|
23
|
+
})
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { chainConfig } from '../../op-stack/chainConfig.js'
|
|
1
2
|
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
3
|
|
|
4
|
+
const sourceId = 1 // mainnet
|
|
5
|
+
|
|
3
6
|
export const megaeth = /*#__PURE__*/ defineChain({
|
|
7
|
+
...chainConfig,
|
|
4
8
|
id: 4326,
|
|
5
9
|
blockTime: 1_000,
|
|
6
10
|
name: 'MegaETH',
|
|
@@ -22,15 +26,34 @@ export const megaeth = /*#__PURE__*/ defineChain({
|
|
|
22
26
|
apiUrl: 'https://api.etherscan.io/v2/api',
|
|
23
27
|
},
|
|
24
28
|
blockscout: {
|
|
25
|
-
name: '
|
|
26
|
-
url: 'https://
|
|
27
|
-
apiUrl: 'https://
|
|
29
|
+
name: 'Blockscout',
|
|
30
|
+
url: 'https://megaeth.blockscout.com',
|
|
31
|
+
apiUrl: 'https://megaeth.blockscout.com/api',
|
|
28
32
|
},
|
|
29
33
|
},
|
|
30
34
|
contracts: {
|
|
35
|
+
...chainConfig.contracts,
|
|
36
|
+
disputeGameFactory: {
|
|
37
|
+
[sourceId]: {
|
|
38
|
+
address: '0x8546840adF796875cD9AAcc5B3B048f6B2c9D563',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
31
41
|
multicall3: {
|
|
32
42
|
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
33
43
|
blockCreated: 0,
|
|
34
44
|
},
|
|
45
|
+
portal: {
|
|
46
|
+
[sourceId]: {
|
|
47
|
+
address: '0x7f82f57F0Dd546519324392e408b01fcC7D709e8',
|
|
48
|
+
blockCreated: 21644285,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
l1StandardBridge: {
|
|
52
|
+
[sourceId]: {
|
|
53
|
+
address: '0x0CA3A2FBC3D770b578223FBB6b062fa875a2eE75',
|
|
54
|
+
blockCreated: 21644285,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
35
57
|
},
|
|
58
|
+
sourceId,
|
|
36
59
|
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const mezo = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 31_612,
|
|
5
|
+
name: 'Mezo',
|
|
6
|
+
nativeCurrency: {
|
|
7
|
+
decimals: 18,
|
|
8
|
+
name: 'Bitcoin',
|
|
9
|
+
symbol: 'BTC',
|
|
10
|
+
},
|
|
11
|
+
rpcUrls: {
|
|
12
|
+
default: { http: ['https://rpc.mezo.org'] },
|
|
13
|
+
},
|
|
14
|
+
blockExplorers: {
|
|
15
|
+
default: {
|
|
16
|
+
name: 'Mezo Explorer',
|
|
17
|
+
url: 'https://explorer.mezo.org',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
})
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const mezoTestnet = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 31_611,
|
|
5
|
+
name: 'Mezo Testnet',
|
|
6
|
+
nativeCurrency: {
|
|
7
|
+
decimals: 18,
|
|
8
|
+
name: 'Bitcoin',
|
|
9
|
+
symbol: 'BTC',
|
|
10
|
+
},
|
|
11
|
+
rpcUrls: {
|
|
12
|
+
default: { http: ['https://rpc.test.mezo.org'] },
|
|
13
|
+
},
|
|
14
|
+
blockExplorers: {
|
|
15
|
+
default: {
|
|
16
|
+
name: 'Mezo Testnet Explorer',
|
|
17
|
+
url: 'https://explorer.test.mezo.org',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
contracts: {
|
|
21
|
+
multicall3: {
|
|
22
|
+
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
23
|
+
blockCreated: 3_328_573,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
testnet: true,
|
|
27
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const radius = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 723_487,
|
|
5
|
+
name: 'Radius Network',
|
|
6
|
+
nativeCurrency: { name: 'Radius USD', symbol: 'RUSD', decimals: 18 },
|
|
7
|
+
rpcUrls: {
|
|
8
|
+
default: {
|
|
9
|
+
http: ['https://rpc.radiustech.xyz'],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
blockExplorers: {
|
|
13
|
+
default: {
|
|
14
|
+
name: 'Radius Network Explorer',
|
|
15
|
+
url: 'https://network.radiustech.xyz',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
testnet: false,
|
|
19
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const radiusTestnet = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 72_344,
|
|
5
|
+
name: 'Radius Test Network',
|
|
6
|
+
nativeCurrency: { name: 'Radius USD', symbol: 'RUSD', decimals: 18 },
|
|
7
|
+
rpcUrls: {
|
|
8
|
+
default: {
|
|
9
|
+
http: ['https://rpc.testnet.radiustech.xyz'],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
blockExplorers: {
|
|
13
|
+
default: {
|
|
14
|
+
name: 'Radius Test Network Explorer',
|
|
15
|
+
url: 'https://testnet.radiustech.xyz',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
testnet: true,
|
|
19
|
+
})
|
package/chains/index.ts
CHANGED
|
@@ -62,6 +62,7 @@ export { base, basePreconf } from './definitions/base.js'
|
|
|
62
62
|
export { basecampTestnet } from './definitions/basecampTestnet.js'
|
|
63
63
|
export { baseGoerli } from './definitions/baseGoerli.js'
|
|
64
64
|
export { baseSepolia, baseSepoliaPreconf } from './definitions/baseSepolia.js'
|
|
65
|
+
export { battlechainTestnet } from './definitions/battlechainTestnet.js'
|
|
65
66
|
export { beam } from './definitions/beam.js'
|
|
66
67
|
export { beamTestnet } from './definitions/beamTestnet.js'
|
|
67
68
|
export { bearNetworkChainMainnet } from './definitions/bearNetworkChainMainnet.js'
|
|
@@ -164,6 +165,7 @@ export { dreyerxMainnet } from './definitions/dreyerxMainnet.js'
|
|
|
164
165
|
export { dreyerxTestnet } from './definitions/dreyerxTestnet.js'
|
|
165
166
|
export { dustboyIoT } from './definitions/dustboyIoT.js'
|
|
166
167
|
export { dymension } from './definitions/dymension.js'
|
|
168
|
+
export { eden } from './definitions/eden.js'
|
|
167
169
|
export { edexa } from './definitions/edexa.js'
|
|
168
170
|
export { edexaTestnet } from './definitions/edexaTestnet.js'
|
|
169
171
|
export { edgeless } from './definitions/edgeless.js'
|
|
@@ -234,6 +236,7 @@ export { garnet } from './definitions/garnet.js'
|
|
|
234
236
|
export { gatechain } from './definitions/gatechain.js'
|
|
235
237
|
export { geist } from './definitions/geist.js'
|
|
236
238
|
export { genesys } from './definitions/genesys.js'
|
|
239
|
+
export { gensyn } from './definitions/gensyn.js'
|
|
237
240
|
export { giwaSepolia, giwaSepoliaPreconf } from './definitions/giwaSepolia.js'
|
|
238
241
|
export { glideL1Protocol } from './definitions/glideL1Protocol.js'
|
|
239
242
|
export { glideL2Protocol } from './definitions/glideL2Protocol.js'
|
|
@@ -285,6 +288,7 @@ export { hyperEvm, hyperEvm as hyperliquid } from './definitions/hyperEvm.js'
|
|
|
285
288
|
export { hyperliquidEvmTestnet } from './definitions/hyperliquidEvmTestnet.js'
|
|
286
289
|
export { icbNetwork } from './definitions/icbNetwork.js'
|
|
287
290
|
export { idchain } from './definitions/idchain.js'
|
|
291
|
+
export { igra } from './definitions/igra.js'
|
|
288
292
|
export { immutableZkEvm } from './definitions/immutableZkEvm.js'
|
|
289
293
|
export { immutableZkEvmTestnet } from './definitions/immutableZkEvmTestnet.js'
|
|
290
294
|
export { inEVM } from './definitions/inEVM.js'
|
|
@@ -404,6 +408,8 @@ export { metisGoerli } from './definitions/metisGoerli.js'
|
|
|
404
408
|
export { metisSepolia } from './definitions/metisSepolia.js'
|
|
405
409
|
export { mev } from './definitions/mev.js'
|
|
406
410
|
export { mevTestnet } from './definitions/mevTestnet.js'
|
|
411
|
+
export { mezo } from './definitions/mezo.js'
|
|
412
|
+
export { mezoTestnet } from './definitions/mezoTestnet.js'
|
|
407
413
|
export { mint } from './definitions/mint.js'
|
|
408
414
|
export { mintSepoliaTestnet } from './definitions/mintSepoliaTestnet.js'
|
|
409
415
|
export { mitosisTestnet } from './definitions/mitosisTestnet.js'
|
|
@@ -495,6 +501,8 @@ export { qMainnet } from './definitions/qMainnet.js'
|
|
|
495
501
|
export { qTestnet } from './definitions/qTestnet.js'
|
|
496
502
|
export { quai } from './definitions/quai.js'
|
|
497
503
|
export { quaiTestnet } from './definitions/quaiTestnet.js'
|
|
504
|
+
export { radius } from './definitions/radius.js'
|
|
505
|
+
export { radiusTestnet } from './definitions/radiusTestnet.js'
|
|
498
506
|
export { reactiveTestnet } from './definitions/reactiveTestnet.js'
|
|
499
507
|
export { real } from './definitions/real.js'
|
|
500
508
|
export { redbellyMainnet } from './definitions/redbellyMainnet.js'
|
|
@@ -627,16 +635,13 @@ export { teaSepolia } from './definitions/teaSepolia.js'
|
|
|
627
635
|
export { telcoinTestnet } from './definitions/telcoinTestnet.js'
|
|
628
636
|
export { telos } from './definitions/telos.js'
|
|
629
637
|
export { telosTestnet } from './definitions/telosTestnet.js'
|
|
630
|
-
export { tempo } from './definitions/tempo.js'
|
|
631
|
-
export {
|
|
632
|
-
/** @deprecated Use `tempoModerato` instead. */
|
|
633
|
-
tempoAndantino,
|
|
634
|
-
/** @deprecated Use `tempoModerato` instead. */
|
|
635
|
-
tempoAndantino as tempoTestnet,
|
|
636
|
-
} from './definitions/tempoAndantino.js'
|
|
638
|
+
export { tempo, tempo as tempoMainnet } from './definitions/tempo.js'
|
|
637
639
|
export { tempoDevnet } from './definitions/tempoDevnet.js'
|
|
638
640
|
export { tempoLocalnet } from './definitions/tempoLocalnet.js'
|
|
639
|
-
export {
|
|
641
|
+
export {
|
|
642
|
+
tempoModerato,
|
|
643
|
+
tempoModerato as tempoTestnet,
|
|
644
|
+
} from './definitions/tempoModerato.js'
|
|
640
645
|
export { tenet } from './definitions/tenet.js'
|
|
641
646
|
export { ternoa } from './definitions/ternoa.js'
|
|
642
647
|
export { thaiChain } from './definitions/thaiChain.js'
|
package/errors/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.47.
|
|
1
|
+
export const version = '2.47.10'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "viem",
|
|
3
3
|
"description": "TypeScript Interface for Ethereum",
|
|
4
|
-
"version": "2.47.
|
|
4
|
+
"version": "2.47.10",
|
|
5
5
|
"main": "./_cjs/index.js",
|
|
6
6
|
"module": "./_esm/index.js",
|
|
7
7
|
"types": "./_types/index.d.ts",
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
"@scure/bip39": "1.6.0",
|
|
218
218
|
"abitype": "1.2.3",
|
|
219
219
|
"isows": "1.0.7",
|
|
220
|
-
"ox": "0.14.
|
|
220
|
+
"ox": "0.14.7",
|
|
221
221
|
"ws": "8.18.3"
|
|
222
222
|
},
|
|
223
223
|
"license": "MIT",
|
package/tempo/Abis.ts
CHANGED
|
@@ -260,6 +260,35 @@ export const tip20 = [
|
|
|
260
260
|
inputs: [],
|
|
261
261
|
outputs: [{ type: 'bytes32' }],
|
|
262
262
|
},
|
|
263
|
+
{
|
|
264
|
+
name: 'permit',
|
|
265
|
+
type: 'function',
|
|
266
|
+
stateMutability: 'nonpayable',
|
|
267
|
+
inputs: [
|
|
268
|
+
{ type: 'address', name: 'owner' },
|
|
269
|
+
{ type: 'address', name: 'spender' },
|
|
270
|
+
{ type: 'uint256', name: 'value' },
|
|
271
|
+
{ type: 'uint256', name: 'deadline' },
|
|
272
|
+
{ type: 'uint8', name: 'v' },
|
|
273
|
+
{ type: 'bytes32', name: 'r' },
|
|
274
|
+
{ type: 'bytes32', name: 's' },
|
|
275
|
+
],
|
|
276
|
+
outputs: [],
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: 'nonces',
|
|
280
|
+
type: 'function',
|
|
281
|
+
stateMutability: 'view',
|
|
282
|
+
inputs: [{ type: 'address', name: 'owner' }],
|
|
283
|
+
outputs: [{ type: 'uint256' }],
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
name: 'DOMAIN_SEPARATOR',
|
|
287
|
+
type: 'function',
|
|
288
|
+
stateMutability: 'view',
|
|
289
|
+
inputs: [],
|
|
290
|
+
outputs: [{ type: 'bytes32' }],
|
|
291
|
+
},
|
|
263
292
|
{
|
|
264
293
|
name: 'distributeReward',
|
|
265
294
|
type: 'function',
|
|
@@ -453,6 +482,8 @@ export const tip20 = [
|
|
|
453
482
|
{ name: 'InvalidToken', type: 'error', inputs: [] },
|
|
454
483
|
{ name: 'Uninitialized', type: 'error', inputs: [] },
|
|
455
484
|
{ name: 'InvalidTransferPolicyId', type: 'error', inputs: [] },
|
|
485
|
+
{ name: 'PermitExpired', type: 'error', inputs: [] },
|
|
486
|
+
{ name: 'InvalidSignature', type: 'error', inputs: [] },
|
|
456
487
|
{
|
|
457
488
|
name: 'hasRole',
|
|
458
489
|
type: 'function',
|
|
@@ -1172,6 +1203,20 @@ export const accountKeychain = [
|
|
|
1172
1203
|
],
|
|
1173
1204
|
outputs: [{ type: 'uint256' }],
|
|
1174
1205
|
},
|
|
1206
|
+
{
|
|
1207
|
+
name: 'getRemainingLimitWithPeriod',
|
|
1208
|
+
type: 'function',
|
|
1209
|
+
stateMutability: 'view',
|
|
1210
|
+
inputs: [
|
|
1211
|
+
{ type: 'address', name: 'account' },
|
|
1212
|
+
{ type: 'address', name: 'keyId' },
|
|
1213
|
+
{ type: 'address', name: 'token' },
|
|
1214
|
+
],
|
|
1215
|
+
outputs: [
|
|
1216
|
+
{ type: 'uint256', name: 'remaining' },
|
|
1217
|
+
{ type: 'uint64', name: 'periodEnd' },
|
|
1218
|
+
],
|
|
1219
|
+
},
|
|
1175
1220
|
{
|
|
1176
1221
|
name: 'getTransactionKey',
|
|
1177
1222
|
type: 'function',
|
package/tempo/Account.ts
CHANGED
|
@@ -444,10 +444,7 @@ function fromBase(parameters: fromBase.Parameters): Account_base {
|
|
|
444
444
|
version: internal_version,
|
|
445
445
|
}),
|
|
446
446
|
)
|
|
447
|
-
|
|
448
|
-
// backwards compatible with existing verification logic.
|
|
449
|
-
if (keyType === 'secp256k1') return signature
|
|
450
|
-
return Hex.concat(signature, SignatureEnvelope.magicBytes)
|
|
447
|
+
return signature
|
|
451
448
|
}
|
|
452
449
|
|
|
453
450
|
return {
|
package/tempo/Decorator.ts
CHANGED
|
@@ -124,7 +124,7 @@ export type Decorator<
|
|
|
124
124
|
* transport: http(),
|
|
125
125
|
* }).extend(tempoActions())
|
|
126
126
|
*
|
|
127
|
-
* const remaining = await client.accessKey.getRemainingLimit({
|
|
127
|
+
* const { remaining, periodEnd } = await client.accessKey.getRemainingLimit({
|
|
128
128
|
* account: '0x...',
|
|
129
129
|
* accessKey: '0x...',
|
|
130
130
|
* token: '0x...',
|
|
@@ -132,7 +132,7 @@ export type Decorator<
|
|
|
132
132
|
* ```
|
|
133
133
|
*
|
|
134
134
|
* @param parameters - Parameters.
|
|
135
|
-
* @returns The remaining spending amount.
|
|
135
|
+
* @returns The remaining spending amount and period end timestamp.
|
|
136
136
|
*/
|
|
137
137
|
getRemainingLimit: (
|
|
138
138
|
parameters: accessKeyActions.getRemainingLimit.Parameters<account>,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const hardforks = [
|
|
2
|
+
'genesis',
|
|
3
|
+
't0',
|
|
4
|
+
't1',
|
|
5
|
+
't1a',
|
|
6
|
+
't1b',
|
|
7
|
+
't1c',
|
|
8
|
+
't2',
|
|
9
|
+
't3',
|
|
10
|
+
] as const
|
|
11
|
+
|
|
12
|
+
export type Hardfork = (typeof hardforks)[number]
|
|
13
|
+
|
|
14
|
+
/** Returns `true` if `current` is before `target`. */
|
|
15
|
+
export function lt(current: string, target: Hardfork): boolean {
|
|
16
|
+
return hardforks.indexOf(current as Hardfork) < hardforks.indexOf(target)
|
|
17
|
+
}
|
package/tempo/Transaction.ts
CHANGED
|
@@ -73,7 +73,7 @@ export type TransactionTempo<
|
|
|
73
73
|
authorizationList?: AuthorizationTempo.ListSigned<quantity, index> | undefined
|
|
74
74
|
calls: readonly TxTempo.Call<quantity>[]
|
|
75
75
|
chainId: index
|
|
76
|
-
feeToken?:
|
|
76
|
+
feeToken?: Address | undefined
|
|
77
77
|
feePayerSignature?: viem_Signature | undefined
|
|
78
78
|
keyAuthorization?: KeyAuthorization.Signed<quantity, index> | null | undefined
|
|
79
79
|
nonceKey?: quantity | undefined
|
|
@@ -100,8 +100,8 @@ export type TransactionReceipt<
|
|
|
100
100
|
status = 'success' | 'reverted',
|
|
101
101
|
type = TransactionType,
|
|
102
102
|
> = viem_TransactionReceipt<quantity, index, status, type> & {
|
|
103
|
-
feePayer?:
|
|
104
|
-
feeToken?:
|
|
103
|
+
feePayer?: Address | undefined
|
|
104
|
+
feeToken?: Address | undefined
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
export type TransactionReceiptRpc = TransactionReceipt<
|
|
@@ -137,11 +137,11 @@ export type TransactionSerializableTempo<
|
|
|
137
137
|
> = TransactionSerializableBase<quantity, index> &
|
|
138
138
|
ExactPartial<FeeValuesEIP1559<quantity>> & {
|
|
139
139
|
accessList?: AccessList | undefined
|
|
140
|
-
calls: readonly TxTempo.Call<quantity
|
|
140
|
+
calls: readonly TxTempo.Call<quantity>[]
|
|
141
141
|
chainId: number
|
|
142
|
-
feeToken?:
|
|
142
|
+
feeToken?: Address | bigint | undefined
|
|
143
143
|
feePayerSignature?: viem_Signature | null | undefined
|
|
144
|
-
from?:
|
|
144
|
+
from?: Address | undefined
|
|
145
145
|
keyAuthorization?: KeyAuthorization.Signed<quantity, index> | undefined
|
|
146
146
|
nonceKey?: quantity | undefined
|
|
147
147
|
signature?: SignatureEnvelope.SignatureEnvelope<quantity, index> | undefined
|
|
@@ -163,10 +163,11 @@ export function getType(
|
|
|
163
163
|
transaction: Record<string, unknown>,
|
|
164
164
|
): Transaction['type'] {
|
|
165
165
|
const account = transaction.account as
|
|
166
|
-
| { keyType?: string | undefined }
|
|
166
|
+
| { keyType?: string | undefined; source?: string | undefined }
|
|
167
167
|
| undefined
|
|
168
168
|
if (
|
|
169
169
|
(account?.keyType && account.keyType !== 'secp256k1') ||
|
|
170
|
+
account?.source === 'accessKey' ||
|
|
170
171
|
typeof transaction.calls !== 'undefined' ||
|
|
171
172
|
typeof transaction.feePayer !== 'undefined' ||
|
|
172
173
|
typeof transaction.feeToken !== 'undefined' ||
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Address } from 'abitype'
|
|
2
2
|
import type { Account } from '../../accounts/types.js'
|
|
3
3
|
import { parseAccount } from '../../accounts/utils/parseAccount.js'
|
|
4
|
-
import type { ReadContractReturnType } from '../../actions/public/readContract.js'
|
|
5
4
|
import { readContract } from '../../actions/public/readContract.js'
|
|
6
5
|
import { sendTransaction } from '../../actions/wallet/sendTransaction.js'
|
|
7
6
|
import { sendTransactionSync } from '../../actions/wallet/sendTransactionSync.js'
|
|
@@ -20,6 +19,7 @@ import * as Abis from '../Abis.js'
|
|
|
20
19
|
import type { AccessKeyAccount } from '../Account.js'
|
|
21
20
|
import { signKeyAuthorization } from '../Account.js'
|
|
22
21
|
import * as Addresses from '../Addresses.js'
|
|
22
|
+
import * as Hardfork from '../Hardfork.js'
|
|
23
23
|
import type {
|
|
24
24
|
GetAccountParameter,
|
|
25
25
|
ReadParameters,
|
|
@@ -742,10 +742,26 @@ export async function getRemainingLimit<
|
|
|
742
742
|
} = parameters
|
|
743
743
|
if (!account_) throw new Error('account is required.')
|
|
744
744
|
const account = parseAccount(account_)
|
|
745
|
-
|
|
745
|
+
|
|
746
|
+
// TODO: remove pre-t3 branch once mainnet is on t3.
|
|
747
|
+
const hardfork = (client.chain as { hardfork?: string } | undefined)?.hardfork
|
|
748
|
+
if (hardfork && Hardfork.lt(hardfork, 't3')) {
|
|
749
|
+
const remaining = await readContract(client, {
|
|
750
|
+
...rest,
|
|
751
|
+
...getRemainingLimit.call({ account: account.address, accessKey, token }),
|
|
752
|
+
})
|
|
753
|
+
return { remaining, periodEnd: undefined }
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
const [remaining, periodEnd] = await readContract(client, {
|
|
746
757
|
...rest,
|
|
747
|
-
...getRemainingLimit.
|
|
758
|
+
...getRemainingLimit.callWithPeriod({
|
|
759
|
+
account: account.address,
|
|
760
|
+
accessKey,
|
|
761
|
+
token,
|
|
762
|
+
}),
|
|
748
763
|
})
|
|
764
|
+
return { remaining, periodEnd }
|
|
749
765
|
}
|
|
750
766
|
|
|
751
767
|
export namespace getRemainingLimit {
|
|
@@ -764,14 +780,13 @@ export namespace getRemainingLimit {
|
|
|
764
780
|
token: Address
|
|
765
781
|
}
|
|
766
782
|
|
|
767
|
-
export type ReturnValue =
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
>
|
|
783
|
+
export type ReturnValue = {
|
|
784
|
+
remaining: bigint
|
|
785
|
+
periodEnd: bigint | undefined
|
|
786
|
+
}
|
|
772
787
|
|
|
773
788
|
/**
|
|
774
|
-
* Defines a call to the `getRemainingLimit` function.
|
|
789
|
+
* Defines a call to the `getRemainingLimit` function (pre-T3).
|
|
775
790
|
*
|
|
776
791
|
* @param args - Arguments.
|
|
777
792
|
* @returns The call.
|
|
@@ -785,6 +800,22 @@ export namespace getRemainingLimit {
|
|
|
785
800
|
args: [account, resolveAccessKey(accessKey), token],
|
|
786
801
|
})
|
|
787
802
|
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Defines a call to the `getRemainingLimitWithPeriod` function (T3+).
|
|
806
|
+
*
|
|
807
|
+
* @param args - Arguments.
|
|
808
|
+
* @returns The call.
|
|
809
|
+
*/
|
|
810
|
+
export function callWithPeriod(args: Args) {
|
|
811
|
+
const { account, accessKey, token } = args
|
|
812
|
+
return defineCall({
|
|
813
|
+
address: Addresses.accountKeychain,
|
|
814
|
+
abi: Abis.accountKeychain,
|
|
815
|
+
functionName: 'getRemainingLimitWithPeriod',
|
|
816
|
+
args: [account, resolveAccessKey(accessKey), token],
|
|
817
|
+
})
|
|
818
|
+
}
|
|
788
819
|
}
|
|
789
820
|
|
|
790
821
|
/**
|
package/tempo/actions/token.ts
CHANGED
|
@@ -2510,8 +2510,9 @@ export namespace revokeRoles {
|
|
|
2510
2510
|
client: Client<Transport, chain, account>,
|
|
2511
2511
|
parameters: revokeRoles.Parameters<chain, account>,
|
|
2512
2512
|
): Promise<ReturnType<action>> {
|
|
2513
|
+
const { from: _, ...rest } = parameters
|
|
2513
2514
|
return (await action(client, {
|
|
2514
|
-
...
|
|
2515
|
+
...rest,
|
|
2515
2516
|
calls: parameters.roles.map((role) => {
|
|
2516
2517
|
const call = revokeRoles.call({ ...parameters, role })
|
|
2517
2518
|
return {
|