viem 2.47.6 → 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 +48 -0
- package/_cjs/actions/wallet/prepareTransactionRequest.js +12 -0
- package/_cjs/actions/wallet/prepareTransactionRequest.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/_esm/actions/wallet/prepareTransactionRequest.js +12 -0
- package/_esm/actions/wallet/prepareTransactionRequest.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/_types/actions/public/verifyHash.d.ts +1 -1
- 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 +25 -22
- package/_types/chains/definitions/tempo.d.ts.map +1 -1
- package/_types/chains/definitions/tempoDevnet.d.ts +27 -22
- package/_types/chains/definitions/tempoDevnet.d.ts.map +1 -1
- package/_types/chains/definitions/tempoLocalnet.d.ts +27 -22
- package/_types/chains/definitions/tempoLocalnet.d.ts.map +1 -1
- package/_types/chains/definitions/tempoModerato.d.ts +27 -24
- 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.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 +13 -11
- 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/actions/public/verifyHash.ts +1 -1
- package/actions/wallet/prepareTransactionRequest.ts +12 -0
- 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 +1 -1
- 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 +2 -1
- 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/_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,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
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
|
@@ -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 {
|
package/tempo/chainConfig.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import * as Address from 'ox/Address'
|
|
2
|
+
import * as Hex from 'ox/Hex'
|
|
3
|
+
import * as PublicKey from 'ox/PublicKey'
|
|
1
4
|
import { SignatureEnvelope, type TokenId } from 'ox/tempo'
|
|
2
5
|
import { getCode } from '../actions/public/getCode.js'
|
|
3
6
|
import { verifyHash } from '../actions/public/verifyHash.js'
|
|
@@ -8,9 +11,12 @@ import { defineTransaction } from '../utils/formatters/transaction.js'
|
|
|
8
11
|
import { defineTransactionReceipt } from '../utils/formatters/transactionReceipt.js'
|
|
9
12
|
import { defineTransactionRequest } from '../utils/formatters/transactionRequest.js'
|
|
10
13
|
import { getAction } from '../utils/getAction.js'
|
|
14
|
+
import { keccak256 } from '../utils/hash/keccak256.js'
|
|
11
15
|
import type { SerializeTransactionFn } from '../utils/transaction/serializeTransaction.js'
|
|
12
16
|
import type { Account } from './Account.js'
|
|
17
|
+
import { getMetadata } from './actions/accessKey.js'
|
|
13
18
|
import * as Formatters from './Formatters.js'
|
|
19
|
+
import type { Hardfork } from './Hardfork.js'
|
|
14
20
|
import * as Concurrent from './internal/concurrent.js'
|
|
15
21
|
import * as Transaction from './Transaction.js'
|
|
16
22
|
|
|
@@ -20,6 +26,7 @@ export const chainConfig = {
|
|
|
20
26
|
blockTime: 1_000,
|
|
21
27
|
extendSchema: extendSchema<{
|
|
22
28
|
feeToken?: TokenId.TokenIdOrAddress | undefined
|
|
29
|
+
hardfork?: Hardfork | undefined
|
|
23
30
|
}>(),
|
|
24
31
|
formatters: {
|
|
25
32
|
transaction: defineTransaction({
|
|
@@ -42,13 +49,15 @@ export const chainConfig = {
|
|
|
42
49
|
| undefined
|
|
43
50
|
}
|
|
44
51
|
|
|
45
|
-
// FIXME: node
|
|
52
|
+
// FIXME: node estimates gas with secp256k1 dummy sig + null feePayerSignature.
|
|
53
|
+
// Actual tx has larger keychain/webAuthn sigs + real fee payer sig, costing more intrinsic gas.
|
|
46
54
|
if (phase === 'afterFillParameters') {
|
|
47
|
-
if (
|
|
48
|
-
request.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
if (request.feePayer) {
|
|
56
|
+
if (request.keyAuthorization?.signature.type === 'webAuthn')
|
|
57
|
+
request.gas = (request.gas ?? 0n) + 20_000n
|
|
58
|
+
else if (request.account?.source === 'accessKey')
|
|
59
|
+
request.gas = (request.gas ?? 0n) + 10_000n
|
|
60
|
+
}
|
|
52
61
|
return request as unknown as typeof r
|
|
53
62
|
}
|
|
54
63
|
|
|
@@ -89,18 +98,53 @@ export const chainConfig = {
|
|
|
89
98
|
Transaction.serialize(transaction, signature)) as SerializeTransactionFn,
|
|
90
99
|
},
|
|
91
100
|
async verifyHash(client, parameters) {
|
|
92
|
-
const { address, hash, signature } = parameters
|
|
101
|
+
const { address, hash, signature, mode } = parameters
|
|
102
|
+
|
|
103
|
+
const envelope = (() => {
|
|
104
|
+
if (typeof signature !== 'string') return
|
|
105
|
+
try {
|
|
106
|
+
return SignatureEnvelope.deserialize(signature)
|
|
107
|
+
} catch {
|
|
108
|
+
return undefined
|
|
109
|
+
}
|
|
110
|
+
})()
|
|
93
111
|
|
|
94
112
|
// `verifyHash` supports "signature envelopes" (a Tempo proposal) to natively verify arbitrary
|
|
95
113
|
// envelope-compatible (WebAuthn, P256, etc.) signatures.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
114
|
+
if (envelope) {
|
|
115
|
+
// Access key (keychain) signature verification: check the key is
|
|
116
|
+
// authorized, not expired, and not revoked on the AccountKeychain.
|
|
117
|
+
if (envelope?.type === 'keychain' && mode === 'allowAccessKey') {
|
|
118
|
+
const accessKeyAddress = Address.fromPublicKey(
|
|
119
|
+
PublicKey.from(envelope.inner.publicKey as PublicKey.PublicKey),
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
const keyInfo = await getMetadata(client, {
|
|
123
|
+
account: address,
|
|
124
|
+
accessKey: accessKeyAddress,
|
|
125
|
+
blockNumber: parameters.blockNumber,
|
|
126
|
+
blockTag: parameters.blockTag,
|
|
127
|
+
} as never)
|
|
128
|
+
|
|
129
|
+
if (keyInfo.isRevoked) return false
|
|
130
|
+
if (keyInfo.expiry <= BigInt(Math.floor(Date.now() / 1000)))
|
|
131
|
+
return false
|
|
132
|
+
|
|
133
|
+
// For v2 keychain envelopes, the inner signature signs
|
|
134
|
+
// keccak256(0x04 || hash || userAddress).
|
|
135
|
+
const innerPayload =
|
|
136
|
+
envelope.version === 'v2'
|
|
137
|
+
? keccak256(Hex.concat('0x04', hash, address))
|
|
138
|
+
: hash
|
|
139
|
+
return SignatureEnvelope.verify(envelope.inner, {
|
|
140
|
+
address: accessKeyAddress,
|
|
141
|
+
payload: innerPayload,
|
|
142
|
+
})
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Stateless, non-keychain signature envelopes (P256, WebAuthn) can be
|
|
146
|
+
// verified directly without a network request.
|
|
147
|
+
if (envelope.type === 'p256' || envelope.type === 'webAuthn') {
|
|
104
148
|
const code = await getCode(client, {
|
|
105
149
|
address,
|
|
106
150
|
blockNumber: parameters.blockNumber,
|
package/tempo/index.ts
CHANGED
|
@@ -21,6 +21,7 @@ export {
|
|
|
21
21
|
decorator as tempoActions,
|
|
22
22
|
} from './Decorator.js'
|
|
23
23
|
export * as Formatters from './Formatters.js'
|
|
24
|
+
export * as Hardfork from './Hardfork.js'
|
|
24
25
|
export * as P256 from './P256.js'
|
|
25
26
|
export * as Secp256k1 from './Secp256k1.js'
|
|
26
27
|
export * as TokenIds from './TokenIds.js'
|
package/tsconfig.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tempoAndantino = void 0;
|
|
4
|
-
const chainConfig_js_1 = require("../../tempo/chainConfig.js");
|
|
5
|
-
const defineChain_js_1 = require("../../utils/chain/defineChain.js");
|
|
6
|
-
exports.tempoAndantino = (0, defineChain_js_1.defineChain)({
|
|
7
|
-
...chainConfig_js_1.chainConfig,
|
|
8
|
-
id: 42429,
|
|
9
|
-
blockExplorers: {
|
|
10
|
-
default: {
|
|
11
|
-
name: 'Tempo Explorer',
|
|
12
|
-
url: 'https://explore.testnet.tempo.xyz',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
name: 'Tempo Testnet (Andantino)',
|
|
16
|
-
nativeCurrency: {
|
|
17
|
-
name: 'USD',
|
|
18
|
-
symbol: 'USD',
|
|
19
|
-
decimals: 6,
|
|
20
|
-
},
|
|
21
|
-
rpcUrls: {
|
|
22
|
-
default: {
|
|
23
|
-
http: ['https://rpc.testnet.tempo.xyz'],
|
|
24
|
-
webSocket: ['wss://rpc.testnet.tempo.xyz'],
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=tempoAndantino.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tempoAndantino.js","sourceRoot":"","sources":["../../../chains/definitions/tempoAndantino.ts"],"names":[],"mappings":";;;AAAA,+DAAwD;AACxD,qEAA8D;AAEjD,QAAA,cAAc,GAAiB,IAAA,4BAAW,EAAC;IACtD,GAAG,4BAAW;IACd,EAAE,EAAE,KAAK;IACT,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,gBAAgB;YACtB,GAAG,EAAE,mCAAmC;SACzC;KACF;IACD,IAAI,EAAE,2BAA2B;IACjC,cAAc,EAAE;QACd,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,CAAC;KACZ;IACD,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,+BAA+B,CAAC;YACvC,SAAS,EAAE,CAAC,6BAA6B,CAAC;SAC3C;KACF;CACF,CAAC,CAAA"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { chainConfig } from '../../tempo/chainConfig.js';
|
|
2
|
-
import { defineChain } from '../../utils/chain/defineChain.js';
|
|
3
|
-
export const tempoAndantino = /*#__PURE__*/ defineChain({
|
|
4
|
-
...chainConfig,
|
|
5
|
-
id: 42429,
|
|
6
|
-
blockExplorers: {
|
|
7
|
-
default: {
|
|
8
|
-
name: 'Tempo Explorer',
|
|
9
|
-
url: 'https://explore.testnet.tempo.xyz',
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
name: 'Tempo Testnet (Andantino)',
|
|
13
|
-
nativeCurrency: {
|
|
14
|
-
name: 'USD',
|
|
15
|
-
symbol: 'USD',
|
|
16
|
-
decimals: 6,
|
|
17
|
-
},
|
|
18
|
-
rpcUrls: {
|
|
19
|
-
default: {
|
|
20
|
-
http: ['https://rpc.testnet.tempo.xyz'],
|
|
21
|
-
webSocket: ['wss://rpc.testnet.tempo.xyz'],
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=tempoAndantino.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tempoAndantino.js","sourceRoot":"","sources":["../../../chains/definitions/tempoAndantino.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAE9D,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC,WAAW,CAAC;IACtD,GAAG,WAAW;IACd,EAAE,EAAE,KAAK;IACT,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,gBAAgB;YACtB,GAAG,EAAE,mCAAmC;SACzC;KACF;IACD,IAAI,EAAE,2BAA2B;IACjC,cAAc,EAAE;QACd,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,CAAC;KACZ;IACD,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,+BAA+B,CAAC;YACvC,SAAS,EAAE,CAAC,6BAA6B,CAAC;SAC3C;KACF;CACF,CAAC,CAAA"}
|