viem 2.48.3 → 2.48.6
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 +22 -0
- package/_cjs/errors/utils.js +13 -1
- package/_cjs/errors/utils.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/tempo/Addresses.js +2 -1
- package/_cjs/tempo/Addresses.js.map +1 -1
- package/_cjs/tempo/Decorator.js +7 -0
- package/_cjs/tempo/Decorator.js.map +1 -1
- package/_cjs/tempo/Formatters.js +4 -0
- package/_cjs/tempo/Formatters.js.map +1 -1
- package/_cjs/tempo/actions/accessKey.js.map +1 -1
- package/_cjs/tempo/actions/index.js +2 -1
- package/_cjs/tempo/actions/index.js.map +1 -1
- package/_cjs/tempo/actions/virtualAddress.js +95 -0
- package/_cjs/tempo/actions/virtualAddress.js.map +1 -0
- package/_cjs/tempo/index.js +3 -1
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/tempo/zones/zone.js +16 -2
- package/_cjs/tempo/zones/zone.js.map +1 -1
- package/_cjs/utils/formatters/transaction.js +3 -0
- package/_cjs/utils/formatters/transaction.js.map +1 -1
- package/_esm/errors/utils.js +18 -1
- package/_esm/errors/utils.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/tempo/Addresses.js +1 -0
- package/_esm/tempo/Addresses.js.map +1 -1
- package/_esm/tempo/Decorator.js +7 -0
- package/_esm/tempo/Decorator.js.map +1 -1
- package/_esm/tempo/Formatters.js +5 -0
- package/_esm/tempo/Formatters.js.map +1 -1
- package/_esm/tempo/actions/accessKey.js +14 -12
- package/_esm/tempo/actions/accessKey.js.map +1 -1
- package/_esm/tempo/actions/amm.js +14 -14
- package/_esm/tempo/actions/dex.js +34 -34
- package/_esm/tempo/actions/faucet.js +2 -2
- package/_esm/tempo/actions/fee.js +10 -10
- package/_esm/tempo/actions/index.js +1 -0
- package/_esm/tempo/actions/index.js.map +1 -1
- package/_esm/tempo/actions/nonce.js +2 -2
- package/_esm/tempo/actions/policy.js +18 -18
- package/_esm/tempo/actions/reward.js +14 -14
- package/_esm/tempo/actions/token.js +61 -61
- package/_esm/tempo/actions/validator.js +27 -27
- package/_esm/tempo/actions/virtualAddress.js +228 -0
- package/_esm/tempo/actions/virtualAddress.js.map +1 -0
- package/_esm/tempo/index.js +1 -1
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/tempo/zones/zone.js +16 -2
- package/_esm/tempo/zones/zone.js.map +1 -1
- package/_esm/utils/formatters/transaction.js +3 -0
- package/_esm/utils/formatters/transaction.js.map +1 -1
- package/_types/celo/chainConfig.d.ts +16 -0
- package/_types/celo/chainConfig.d.ts.map +1 -1
- package/_types/celo/formatters.d.ts +8 -0
- package/_types/celo/formatters.d.ts.map +1 -1
- package/_types/chains/definitions/abstract.d.ts +8 -1
- package/_types/chains/definitions/abstract.d.ts.map +1 -1
- package/_types/chains/definitions/abstractTestnet.d.ts +8 -1
- package/_types/chains/definitions/abstractTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/ancient8.d.ts +6 -0
- package/_types/chains/definitions/ancient8.d.ts.map +1 -1
- package/_types/chains/definitions/ancient8Sepolia.d.ts +6 -0
- package/_types/chains/definitions/ancient8Sepolia.d.ts.map +1 -1
- package/_types/chains/definitions/base.d.ts +12 -0
- package/_types/chains/definitions/base.d.ts.map +1 -1
- package/_types/chains/definitions/baseGoerli.d.ts +6 -0
- package/_types/chains/definitions/baseGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/baseSepolia.d.ts +12 -0
- package/_types/chains/definitions/baseSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/battlechainTestnet.d.ts +8 -1
- package/_types/chains/definitions/battlechainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/blast.d.ts +6 -0
- package/_types/chains/definitions/blast.d.ts.map +1 -1
- package/_types/chains/definitions/bob.d.ts +6 -0
- package/_types/chains/definitions/bob.d.ts.map +1 -1
- package/_types/chains/definitions/bobSepolia.d.ts +6 -0
- package/_types/chains/definitions/bobSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/celo.d.ts +16 -0
- package/_types/chains/definitions/celo.d.ts.map +1 -1
- package/_types/chains/definitions/celoAlfajores.d.ts +16 -0
- package/_types/chains/definitions/celoAlfajores.d.ts.map +1 -1
- package/_types/chains/definitions/celoSepolia.d.ts +16 -0
- package/_types/chains/definitions/celoSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/codex.d.ts +6 -0
- package/_types/chains/definitions/codex.d.ts.map +1 -1
- package/_types/chains/definitions/codexTestnet.d.ts +6 -0
- package/_types/chains/definitions/codexTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/dchain.d.ts +6 -0
- package/_types/chains/definitions/dchain.d.ts.map +1 -1
- package/_types/chains/definitions/dchainTestnet.d.ts +6 -0
- package/_types/chains/definitions/dchainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/elysiumTestnet.d.ts +6 -0
- package/_types/chains/definitions/elysiumTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/fraxtal.d.ts +6 -0
- package/_types/chains/definitions/fraxtal.d.ts.map +1 -1
- package/_types/chains/definitions/fraxtalTestnet.d.ts +6 -0
- package/_types/chains/definitions/fraxtalTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/funkiMainnet.d.ts +6 -0
- package/_types/chains/definitions/funkiMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/funkiSepolia.d.ts +6 -0
- package/_types/chains/definitions/funkiSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/garnet.d.ts +6 -0
- package/_types/chains/definitions/garnet.d.ts.map +1 -1
- package/_types/chains/definitions/giwaSepolia.d.ts +12 -0
- package/_types/chains/definitions/giwaSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/ink.d.ts +6 -0
- package/_types/chains/definitions/ink.d.ts.map +1 -1
- package/_types/chains/definitions/inkSepolia.d.ts +6 -0
- package/_types/chains/definitions/inkSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/lisk.d.ts +6 -0
- package/_types/chains/definitions/lisk.d.ts.map +1 -1
- package/_types/chains/definitions/liskSepolia.d.ts +6 -0
- package/_types/chains/definitions/liskSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/megaeth.d.ts +6 -0
- package/_types/chains/definitions/megaeth.d.ts.map +1 -1
- package/_types/chains/definitions/metalL2.d.ts +6 -0
- package/_types/chains/definitions/metalL2.d.ts.map +1 -1
- package/_types/chains/definitions/mode.d.ts +6 -0
- package/_types/chains/definitions/mode.d.ts.map +1 -1
- package/_types/chains/definitions/modeTestnet.d.ts +6 -0
- package/_types/chains/definitions/modeTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/optimism.d.ts +6 -0
- package/_types/chains/definitions/optimism.d.ts.map +1 -1
- package/_types/chains/definitions/optimismGoerli.d.ts +6 -0
- package/_types/chains/definitions/optimismGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/optimismSepolia.d.ts +6 -0
- package/_types/chains/definitions/optimismSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/pgn.d.ts +6 -0
- package/_types/chains/definitions/pgn.d.ts.map +1 -1
- package/_types/chains/definitions/pgnTestnet.d.ts +6 -0
- package/_types/chains/definitions/pgnTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/playfiAlbireo.d.ts +8 -1
- package/_types/chains/definitions/playfiAlbireo.d.ts.map +1 -1
- package/_types/chains/definitions/pyrope.d.ts +6 -0
- package/_types/chains/definitions/pyrope.d.ts.map +1 -1
- package/_types/chains/definitions/redstone.d.ts +6 -0
- package/_types/chains/definitions/redstone.d.ts.map +1 -1
- package/_types/chains/definitions/rss3.d.ts +6 -0
- package/_types/chains/definitions/rss3.d.ts.map +1 -1
- package/_types/chains/definitions/rss3Sepolia.d.ts +6 -0
- package/_types/chains/definitions/rss3Sepolia.d.ts.map +1 -1
- package/_types/chains/definitions/shape.d.ts +6 -0
- package/_types/chains/definitions/shape.d.ts.map +1 -1
- package/_types/chains/definitions/shapeSepolia.d.ts +6 -0
- package/_types/chains/definitions/shapeSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/snax.d.ts +6 -0
- package/_types/chains/definitions/snax.d.ts.map +1 -1
- package/_types/chains/definitions/snaxTestnet.d.ts +6 -0
- package/_types/chains/definitions/snaxTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/soneium.d.ts +6 -0
- package/_types/chains/definitions/soneium.d.ts.map +1 -1
- package/_types/chains/definitions/soneiumMinato.d.ts +6 -0
- package/_types/chains/definitions/soneiumMinato.d.ts.map +1 -1
- package/_types/chains/definitions/sophon.d.ts +8 -1
- package/_types/chains/definitions/sophon.d.ts.map +1 -1
- package/_types/chains/definitions/sophonTestnet.d.ts +8 -1
- package/_types/chains/definitions/sophonTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/superseed.d.ts +6 -0
- package/_types/chains/definitions/superseed.d.ts.map +1 -1
- package/_types/chains/definitions/superseedSepolia.d.ts +6 -0
- package/_types/chains/definitions/superseedSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/swellchain.d.ts +6 -0
- package/_types/chains/definitions/swellchain.d.ts.map +1 -1
- package/_types/chains/definitions/swellchainTestnet.d.ts +6 -0
- package/_types/chains/definitions/swellchainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/tempo.d.ts +12 -0
- package/_types/chains/definitions/tempo.d.ts.map +1 -1
- package/_types/chains/definitions/tempoDevnet.d.ts +12 -0
- package/_types/chains/definitions/tempoDevnet.d.ts.map +1 -1
- package/_types/chains/definitions/tempoLocalnet.d.ts +12 -0
- package/_types/chains/definitions/tempoLocalnet.d.ts.map +1 -1
- package/_types/chains/definitions/tempoModerato.d.ts +12 -0
- package/_types/chains/definitions/tempoModerato.d.ts.map +1 -1
- package/_types/chains/definitions/treasure.d.ts +8 -1
- package/_types/chains/definitions/treasure.d.ts.map +1 -1
- package/_types/chains/definitions/treasureTopaz.d.ts +8 -1
- package/_types/chains/definitions/treasureTopaz.d.ts.map +1 -1
- package/_types/chains/definitions/unichain.d.ts +6 -0
- package/_types/chains/definitions/unichain.d.ts.map +1 -1
- package/_types/chains/definitions/unichainSepolia.d.ts +6 -0
- package/_types/chains/definitions/unichainSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/worldchain.d.ts +6 -0
- package/_types/chains/definitions/worldchain.d.ts.map +1 -1
- package/_types/chains/definitions/worldchainSepolia.d.ts +6 -0
- package/_types/chains/definitions/worldchainSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/zircuit.d.ts +6 -0
- package/_types/chains/definitions/zircuit.d.ts.map +1 -1
- package/_types/chains/definitions/zircuitGarfieldTestnet.d.ts +6 -0
- package/_types/chains/definitions/zircuitGarfieldTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zksync.d.ts +8 -1
- package/_types/chains/definitions/zksync.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncInMemoryNode.d.ts +8 -1
- package/_types/chains/definitions/zksyncInMemoryNode.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts +8 -1
- package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalHyperchain.d.ts +8 -1
- package/_types/chains/definitions/zksyncLocalHyperchain.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalNode.d.ts +8 -1
- package/_types/chains/definitions/zksyncLocalNode.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts +8 -1
- package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zora.d.ts +6 -0
- package/_types/chains/definitions/zora.d.ts.map +1 -1
- package/_types/chains/definitions/zoraSepolia.d.ts +6 -0
- package/_types/chains/definitions/zoraSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/zoraTestnet.d.ts +6 -0
- package/_types/chains/definitions/zoraTestnet.d.ts.map +1 -1
- package/_types/errors/utils.d.ts +5 -0
- package/_types/errors/utils.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/op-stack/chainConfig.d.ts +6 -0
- package/_types/op-stack/chainConfig.d.ts.map +1 -1
- package/_types/op-stack/formatters.d.ts +6 -0
- package/_types/op-stack/formatters.d.ts.map +1 -1
- package/_types/tempo/Addresses.d.ts +1 -0
- package/_types/tempo/Addresses.d.ts.map +1 -1
- package/_types/tempo/Decorator.d.ts +101 -1
- package/_types/tempo/Decorator.d.ts.map +1 -1
- package/_types/tempo/Formatters.d.ts.map +1 -1
- package/_types/tempo/actions/accessKey.d.ts +14 -12
- package/_types/tempo/actions/accessKey.d.ts.map +1 -1
- package/_types/tempo/actions/amm.d.ts +14 -14
- package/_types/tempo/actions/dex.d.ts +34 -34
- package/_types/tempo/actions/faucet.d.ts +2 -2
- package/_types/tempo/actions/fee.d.ts +10 -10
- package/_types/tempo/actions/index.d.ts +1 -0
- package/_types/tempo/actions/index.d.ts.map +1 -1
- package/_types/tempo/actions/nonce.d.ts +2 -2
- package/_types/tempo/actions/policy.d.ts +18 -18
- package/_types/tempo/actions/reward.d.ts +14 -14
- package/_types/tempo/actions/token.d.ts +61 -61
- package/_types/tempo/actions/validator.d.ts +27 -27
- package/_types/tempo/actions/virtualAddress.d.ts +350 -0
- package/_types/tempo/actions/virtualAddress.d.ts.map +1 -0
- package/_types/tempo/chainConfig.d.ts +6 -0
- package/_types/tempo/chainConfig.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +1 -1
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/tempo/zones/zone.d.ts +48 -12
- package/_types/tempo/zones/zone.d.ts.map +1 -1
- package/_types/types/transaction.d.ts +3 -1
- package/_types/types/transaction.d.ts.map +1 -1
- package/_types/utils/formatters/transaction.d.ts +1 -1
- package/_types/utils/formatters/transaction.d.ts.map +1 -1
- package/_types/zksync/chainConfig.d.ts +8 -1
- package/_types/zksync/chainConfig.d.ts.map +1 -1
- package/_types/zksync/formatters.d.ts +8 -1
- package/_types/zksync/formatters.d.ts.map +1 -1
- package/errors/utils.ts +17 -1
- package/errors/version.ts +1 -1
- package/package.json +2 -2
- package/tempo/Addresses.ts +1 -0
- package/tempo/Decorator.ts +125 -1
- package/tempo/Formatters.ts +6 -0
- package/tempo/actions/accessKey.ts +14 -12
- package/tempo/actions/amm.ts +14 -14
- package/tempo/actions/dex.ts +34 -34
- package/tempo/actions/faucet.ts +2 -2
- package/tempo/actions/fee.ts +10 -10
- package/tempo/actions/index.ts +1 -0
- package/tempo/actions/nonce.ts +2 -2
- package/tempo/actions/policy.ts +18 -18
- package/tempo/actions/reward.ts +14 -14
- package/tempo/actions/token.ts +61 -61
- package/tempo/actions/validator.ts +27 -27
- package/tempo/actions/virtualAddress.ts +337 -0
- package/tempo/index.ts +8 -1
- package/tempo/zones/zone.ts +23 -2
- package/types/transaction.ts +3 -1
- package/utils/formatters/transaction.ts +3 -0
package/errors/utils.ts
CHANGED
|
@@ -3,4 +3,20 @@ import type { Address } from 'abitype'
|
|
|
3
3
|
export type ErrorType<name extends string = 'Error'> = Error & { name: name }
|
|
4
4
|
|
|
5
5
|
export const getContractAddress = (address: Address) => address
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Returns the URL with any embedded basic-auth credentials stripped, so
|
|
9
|
+
* error messages and logs don't leak secrets when an RPC URL like
|
|
10
|
+
* `https://user:pass@host` is used.
|
|
11
|
+
*/
|
|
12
|
+
export const getUrl = (url: string) => {
|
|
13
|
+
try {
|
|
14
|
+
const parsed = new URL(url)
|
|
15
|
+
if (!parsed.username && !parsed.password) return url
|
|
16
|
+
parsed.username = ''
|
|
17
|
+
parsed.password = ''
|
|
18
|
+
return parsed.toString()
|
|
19
|
+
} catch {
|
|
20
|
+
return url
|
|
21
|
+
}
|
|
22
|
+
}
|
package/errors/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.48.
|
|
1
|
+
export const version = '2.48.6'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "viem",
|
|
3
3
|
"description": "TypeScript Interface for Ethereum",
|
|
4
|
-
"version": "2.48.
|
|
4
|
+
"version": "2.48.6",
|
|
5
5
|
"main": "./_cjs/index.js",
|
|
6
6
|
"module": "./_esm/index.js",
|
|
7
7
|
"types": "./_types/index.d.ts",
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
"@scure/bip39": "1.6.0",
|
|
223
223
|
"abitype": "1.2.3",
|
|
224
224
|
"isows": "1.0.7",
|
|
225
|
-
"ox": "0.14.
|
|
225
|
+
"ox": "0.14.20",
|
|
226
226
|
"ws": "8.18.3"
|
|
227
227
|
},
|
|
228
228
|
"license": "MIT",
|
package/tempo/Addresses.ts
CHANGED
|
@@ -2,6 +2,7 @@ export const accountImplementation =
|
|
|
2
2
|
'0x7702c00000000000000000000000000000000000'
|
|
3
3
|
export const accountKeychain = '0xaAAAaaAA00000000000000000000000000000000'
|
|
4
4
|
export const accountRegistrar = '0x7702ac0000000000000000000000000000000000'
|
|
5
|
+
export const addressRegistry = '0xfdc0000000000000000000000000000000000000'
|
|
5
6
|
export const feeManager = '0xfeec000000000000000000000000000000000000'
|
|
6
7
|
export const nonceManager = '0x4e4F4E4345000000000000000000000000000000'
|
|
7
8
|
export const pathUsd = '0x20c0000000000000000000000000000000000000'
|
package/tempo/Decorator.ts
CHANGED
|
@@ -14,6 +14,7 @@ import * as rewardActions from './actions/reward.js'
|
|
|
14
14
|
import * as simulateActions from './actions/simulate.js'
|
|
15
15
|
import * as tokenActions from './actions/token.js'
|
|
16
16
|
import * as validatorActions from './actions/validator.js'
|
|
17
|
+
import * as virtualAddressActions from './actions/virtualAddress.js'
|
|
17
18
|
import * as zoneActions from './actions/zone.js'
|
|
18
19
|
|
|
19
20
|
export type Decorator<
|
|
@@ -264,7 +265,7 @@ export type Decorator<
|
|
|
264
265
|
* import { tempoActions } from 'viem/tempo'
|
|
265
266
|
*
|
|
266
267
|
* const client = createClient({
|
|
267
|
-
* chain: tempo({ feeToken: '0x20c...001' }),
|
|
268
|
+
* chain: tempo.extend({ feeToken: '0x20c...001' }),
|
|
268
269
|
* transport: http(),
|
|
269
270
|
* }).extend(tempoActions())
|
|
270
271
|
*
|
|
@@ -3805,6 +3806,119 @@ export type Decorator<
|
|
|
3805
3806
|
parameters: validatorActions.updateSync.Parameters<chain, account>,
|
|
3806
3807
|
) => Promise<validatorActions.updateSync.ReturnValue>
|
|
3807
3808
|
}
|
|
3809
|
+
virtualAddress: {
|
|
3810
|
+
/**
|
|
3811
|
+
* Gets the registered master address for a given master ID.
|
|
3812
|
+
*
|
|
3813
|
+
* @example
|
|
3814
|
+
* ```ts
|
|
3815
|
+
* import { createClient, http } from 'viem'
|
|
3816
|
+
* import { tempo } from 'viem/chains'
|
|
3817
|
+
* import { tempoActions } from 'viem/tempo'
|
|
3818
|
+
*
|
|
3819
|
+
* const client = createClient({
|
|
3820
|
+
* chain: tempo,
|
|
3821
|
+
* transport: http(),
|
|
3822
|
+
* }).extend(tempoActions())
|
|
3823
|
+
*
|
|
3824
|
+
* const master = await client.virtualAddress.getMasterAddress({
|
|
3825
|
+
* masterId: '0x58e21090',
|
|
3826
|
+
* })
|
|
3827
|
+
* ```
|
|
3828
|
+
*
|
|
3829
|
+
* @param parameters - Parameters.
|
|
3830
|
+
* @returns The master address, or null if unregistered.
|
|
3831
|
+
*/
|
|
3832
|
+
getMasterAddress: (
|
|
3833
|
+
parameters: virtualAddressActions.getMasterAddress.Parameters,
|
|
3834
|
+
) => Promise<virtualAddressActions.getMasterAddress.ReturnValue>
|
|
3835
|
+
/**
|
|
3836
|
+
* Registers the caller as a virtual address master.
|
|
3837
|
+
*
|
|
3838
|
+
* @example
|
|
3839
|
+
* ```ts
|
|
3840
|
+
* import { createClient, http } from 'viem'
|
|
3841
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
3842
|
+
* import { tempo } from 'viem/chains'
|
|
3843
|
+
* import { tempoActions } from 'viem/tempo'
|
|
3844
|
+
*
|
|
3845
|
+
* const client = createClient({
|
|
3846
|
+
* account: privateKeyToAccount('0x...'),
|
|
3847
|
+
* chain: tempo,
|
|
3848
|
+
* transport: http(),
|
|
3849
|
+
* }).extend(tempoActions())
|
|
3850
|
+
*
|
|
3851
|
+
* const hash = await client.virtualAddress.registerMaster({
|
|
3852
|
+
* salt: '0x...',
|
|
3853
|
+
* })
|
|
3854
|
+
* ```
|
|
3855
|
+
*
|
|
3856
|
+
* @param parameters - Parameters.
|
|
3857
|
+
* @returns The transaction hash.
|
|
3858
|
+
*/
|
|
3859
|
+
registerMaster: (
|
|
3860
|
+
parameters: virtualAddressActions.registerMaster.Parameters<
|
|
3861
|
+
chain,
|
|
3862
|
+
account
|
|
3863
|
+
>,
|
|
3864
|
+
) => Promise<virtualAddressActions.registerMaster.ReturnValue>
|
|
3865
|
+
/**
|
|
3866
|
+
* Registers the caller as a virtual address master and waits for confirmation.
|
|
3867
|
+
*
|
|
3868
|
+
* @example
|
|
3869
|
+
* ```ts
|
|
3870
|
+
* import { createClient, http } from 'viem'
|
|
3871
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
3872
|
+
* import { tempo } from 'viem/chains'
|
|
3873
|
+
* import { tempoActions } from 'viem/tempo'
|
|
3874
|
+
*
|
|
3875
|
+
* const client = createClient({
|
|
3876
|
+
* account: privateKeyToAccount('0x...'),
|
|
3877
|
+
* chain: tempo,
|
|
3878
|
+
* transport: http(),
|
|
3879
|
+
* }).extend(tempoActions())
|
|
3880
|
+
*
|
|
3881
|
+
* const { receipt, masterId, masterAddress } =
|
|
3882
|
+
* await client.virtualAddress.registerMasterSync({
|
|
3883
|
+
* salt: '0x...',
|
|
3884
|
+
* })
|
|
3885
|
+
* ```
|
|
3886
|
+
*
|
|
3887
|
+
* @param parameters - Parameters.
|
|
3888
|
+
* @returns The transaction receipt and event data.
|
|
3889
|
+
*/
|
|
3890
|
+
registerMasterSync: (
|
|
3891
|
+
parameters: virtualAddressActions.registerMasterSync.Parameters<
|
|
3892
|
+
chain,
|
|
3893
|
+
account
|
|
3894
|
+
>,
|
|
3895
|
+
) => Promise<virtualAddressActions.registerMasterSync.ReturnValue>
|
|
3896
|
+
/**
|
|
3897
|
+
* Resolves an address to its effective recipient.
|
|
3898
|
+
*
|
|
3899
|
+
* @example
|
|
3900
|
+
* ```ts
|
|
3901
|
+
* import { createClient, http } from 'viem'
|
|
3902
|
+
* import { tempo } from 'viem/chains'
|
|
3903
|
+
* import { tempoActions } from 'viem/tempo'
|
|
3904
|
+
*
|
|
3905
|
+
* const client = createClient({
|
|
3906
|
+
* chain: tempo,
|
|
3907
|
+
* transport: http(),
|
|
3908
|
+
* }).extend(tempoActions())
|
|
3909
|
+
*
|
|
3910
|
+
* const recipient = await client.virtualAddress.resolve({
|
|
3911
|
+
* address: '0x58e21090fdfdfdfdfdfdfdfdfdfd010203040506',
|
|
3912
|
+
* })
|
|
3913
|
+
* ```
|
|
3914
|
+
*
|
|
3915
|
+
* @param parameters - Parameters.
|
|
3916
|
+
* @returns The resolved address, or null if virtual and unregistered.
|
|
3917
|
+
*/
|
|
3918
|
+
resolve: (
|
|
3919
|
+
parameters: virtualAddressActions.resolve.Parameters,
|
|
3920
|
+
) => Promise<virtualAddressActions.resolve.ReturnValue>
|
|
3921
|
+
}
|
|
3808
3922
|
zone: {
|
|
3809
3923
|
/**
|
|
3810
3924
|
* Deposits tokens into a zone.
|
|
@@ -4361,6 +4475,16 @@ export function decorator() {
|
|
|
4361
4475
|
updateSync: (parameters) =>
|
|
4362
4476
|
validatorActions.updateSync(client, parameters),
|
|
4363
4477
|
},
|
|
4478
|
+
virtualAddress: {
|
|
4479
|
+
getMasterAddress: (parameters) =>
|
|
4480
|
+
virtualAddressActions.getMasterAddress(client, parameters),
|
|
4481
|
+
registerMaster: (parameters) =>
|
|
4482
|
+
virtualAddressActions.registerMaster(client, parameters),
|
|
4483
|
+
registerMasterSync: (parameters) =>
|
|
4484
|
+
virtualAddressActions.registerMasterSync(client, parameters),
|
|
4485
|
+
resolve: (parameters) =>
|
|
4486
|
+
virtualAddressActions.resolve(client, parameters),
|
|
4487
|
+
},
|
|
4364
4488
|
zone: {
|
|
4365
4489
|
deposit: (parameters) => zoneActions.deposit(client, parameters),
|
|
4366
4490
|
depositSync: (parameters) =>
|
package/tempo/Formatters.ts
CHANGED
|
@@ -27,6 +27,11 @@ export function formatTransaction(
|
|
|
27
27
|
): Transaction<bigint, number, boolean> {
|
|
28
28
|
if (!isTempo(transaction)) return viem_formatTransaction(transaction as never)
|
|
29
29
|
|
|
30
|
+
// TODO: upstream `blockTimestamp` formatting into `ox`.
|
|
31
|
+
const blockTimestamp =
|
|
32
|
+
transaction.blockTimestamp == null
|
|
33
|
+
? undefined
|
|
34
|
+
: BigInt(transaction.blockTimestamp)
|
|
30
35
|
const {
|
|
31
36
|
feePayerSignature,
|
|
32
37
|
gasPrice: _,
|
|
@@ -37,6 +42,7 @@ export function formatTransaction(
|
|
|
37
42
|
return {
|
|
38
43
|
...tx,
|
|
39
44
|
accessList: tx.accessList!,
|
|
45
|
+
...(typeof blockTimestamp !== 'undefined' && { blockTimestamp }),
|
|
40
46
|
feePayerSignature: feePayerSignature
|
|
41
47
|
? {
|
|
42
48
|
r: Hex.fromNumber(feePayerSignature.r, { size: 32 }),
|
|
@@ -55,7 +55,7 @@ const spendPolicies = {
|
|
|
55
55
|
* const account = Account.from({ privateKey: '0x...' })
|
|
56
56
|
* const client = createClient({
|
|
57
57
|
* account,
|
|
58
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
58
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
59
59
|
* transport: http(),
|
|
60
60
|
* })
|
|
61
61
|
*
|
|
@@ -169,7 +169,7 @@ export namespace authorize {
|
|
|
169
169
|
* const account = Account.from({ privateKey: '0x...' })
|
|
170
170
|
* const client = createClient({
|
|
171
171
|
* account,
|
|
172
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
172
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
173
173
|
* transport: http(),
|
|
174
174
|
* })
|
|
175
175
|
*
|
|
@@ -240,7 +240,7 @@ export namespace authorizeSync {
|
|
|
240
240
|
*
|
|
241
241
|
* const client = createClient({
|
|
242
242
|
* account: privateKeyToAccount('0x...'),
|
|
243
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
243
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
244
244
|
* transport: http(),
|
|
245
245
|
* })
|
|
246
246
|
*
|
|
@@ -312,7 +312,7 @@ export namespace revoke {
|
|
|
312
312
|
* import { Actions } from 'viem/tempo'
|
|
313
313
|
*
|
|
314
314
|
* const client = createClient({
|
|
315
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
315
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
316
316
|
* transport: http(),
|
|
317
317
|
* }).extend(walletActions)
|
|
318
318
|
*
|
|
@@ -360,7 +360,7 @@ export namespace revoke {
|
|
|
360
360
|
*
|
|
361
361
|
* const client = createClient({
|
|
362
362
|
* account: privateKeyToAccount('0x...'),
|
|
363
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
363
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
364
364
|
* transport: http(),
|
|
365
365
|
* })
|
|
366
366
|
*
|
|
@@ -426,7 +426,7 @@ export namespace revokeSync {
|
|
|
426
426
|
*
|
|
427
427
|
* const client = createClient({
|
|
428
428
|
* account: privateKeyToAccount('0x...'),
|
|
429
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
429
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
430
430
|
* transport: http(),
|
|
431
431
|
* })
|
|
432
432
|
*
|
|
@@ -504,7 +504,7 @@ export namespace updateLimit {
|
|
|
504
504
|
* import { Actions } from 'viem/tempo'
|
|
505
505
|
*
|
|
506
506
|
* const client = createClient({
|
|
507
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
507
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
508
508
|
* transport: http(),
|
|
509
509
|
* }).extend(walletActions)
|
|
510
510
|
*
|
|
@@ -556,7 +556,7 @@ export namespace updateLimit {
|
|
|
556
556
|
*
|
|
557
557
|
* const client = createClient({
|
|
558
558
|
* account: privateKeyToAccount('0x...'),
|
|
559
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
559
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
560
560
|
* transport: http(),
|
|
561
561
|
* })
|
|
562
562
|
*
|
|
@@ -628,7 +628,7 @@ export namespace updateLimitSync {
|
|
|
628
628
|
* import { Actions } from 'viem/tempo'
|
|
629
629
|
*
|
|
630
630
|
* const client = createClient({
|
|
631
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
631
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
632
632
|
* transport: http(),
|
|
633
633
|
* })
|
|
634
634
|
*
|
|
@@ -719,20 +719,22 @@ export namespace getMetadata {
|
|
|
719
719
|
* import { Actions } from 'viem/tempo'
|
|
720
720
|
*
|
|
721
721
|
* const client = createClient({
|
|
722
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
722
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
723
723
|
* transport: http(),
|
|
724
724
|
* })
|
|
725
725
|
*
|
|
726
|
-
* const remaining = await Actions.accessKey.getRemainingLimit(client, {
|
|
726
|
+
* const { remaining, periodEnd } = await Actions.accessKey.getRemainingLimit(client, {
|
|
727
727
|
* account: '0x...',
|
|
728
728
|
* accessKey: '0x...',
|
|
729
729
|
* token: '0x...',
|
|
730
730
|
* })
|
|
731
|
+
*
|
|
732
|
+
* console.log(remaining, periodEnd)
|
|
731
733
|
* ```
|
|
732
734
|
*
|
|
733
735
|
* @param client - Client.
|
|
734
736
|
* @param parameters - Parameters.
|
|
735
|
-
* @returns The remaining spending amount.
|
|
737
|
+
* @returns The remaining spending amount and period end timestamp.
|
|
736
738
|
*/
|
|
737
739
|
export async function getRemainingLimit<
|
|
738
740
|
chain extends Chain | undefined,
|
package/tempo/actions/amm.ts
CHANGED
|
@@ -34,7 +34,7 @@ import { defineCall } from '../internal/utils.js'
|
|
|
34
34
|
* import { Actions } from 'viem/tempo'
|
|
35
35
|
*
|
|
36
36
|
* const client = createClient({
|
|
37
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
37
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
38
38
|
* transport: http(),
|
|
39
39
|
* })
|
|
40
40
|
*
|
|
@@ -124,7 +124,7 @@ export namespace getPool {
|
|
|
124
124
|
* import { Actions } from 'viem/tempo'
|
|
125
125
|
*
|
|
126
126
|
* const client = createClient({
|
|
127
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
127
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
128
128
|
* transport: http(),
|
|
129
129
|
* })
|
|
130
130
|
*
|
|
@@ -224,7 +224,7 @@ export namespace getLiquidityBalance {
|
|
|
224
224
|
*
|
|
225
225
|
* const client = createClient({
|
|
226
226
|
* account: privateKeyToAccount('0x...'),
|
|
227
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
227
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
228
228
|
* transport: http(),
|
|
229
229
|
* })
|
|
230
230
|
*
|
|
@@ -307,7 +307,7 @@ export namespace rebalanceSwap {
|
|
|
307
307
|
* import { Actions } from 'viem/tempo'
|
|
308
308
|
*
|
|
309
309
|
* const client = createClient({
|
|
310
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
310
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
311
311
|
* transport: http(),
|
|
312
312
|
* }).extend(walletActions)
|
|
313
313
|
*
|
|
@@ -377,7 +377,7 @@ export namespace rebalanceSwap {
|
|
|
377
377
|
*
|
|
378
378
|
* const client = createClient({
|
|
379
379
|
* account: privateKeyToAccount('0x...'),
|
|
380
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
380
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
381
381
|
* transport: http(),
|
|
382
382
|
* })
|
|
383
383
|
*
|
|
@@ -444,7 +444,7 @@ export namespace rebalanceSwapSync {
|
|
|
444
444
|
*
|
|
445
445
|
* const client = createClient({
|
|
446
446
|
* account: privateKeyToAccount('0x...'),
|
|
447
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
447
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
448
448
|
* transport: http(),
|
|
449
449
|
* })
|
|
450
450
|
*
|
|
@@ -533,7 +533,7 @@ export namespace mint {
|
|
|
533
533
|
* import { Actions } from 'viem/tempo'
|
|
534
534
|
*
|
|
535
535
|
* const client = createClient({
|
|
536
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
536
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
537
537
|
* transport: http(),
|
|
538
538
|
* }).extend(walletActions)
|
|
539
539
|
*
|
|
@@ -608,7 +608,7 @@ export namespace mint {
|
|
|
608
608
|
*
|
|
609
609
|
* const client = createClient({
|
|
610
610
|
* account: privateKeyToAccount('0x...'),
|
|
611
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
611
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
612
612
|
* transport: http(),
|
|
613
613
|
* })
|
|
614
614
|
*
|
|
@@ -675,7 +675,7 @@ export namespace mintSync {
|
|
|
675
675
|
*
|
|
676
676
|
* const client = createClient({
|
|
677
677
|
* account: privateKeyToAccount('0x...'),
|
|
678
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
678
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
679
679
|
* transport: http(),
|
|
680
680
|
* })
|
|
681
681
|
*
|
|
@@ -753,7 +753,7 @@ export namespace burn {
|
|
|
753
753
|
* import { Actions } from 'viem/tempo'
|
|
754
754
|
*
|
|
755
755
|
* const client = createClient({
|
|
756
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
756
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
757
757
|
* transport: http(),
|
|
758
758
|
* }).extend(walletActions)
|
|
759
759
|
*
|
|
@@ -823,7 +823,7 @@ export namespace burn {
|
|
|
823
823
|
*
|
|
824
824
|
* const client = createClient({
|
|
825
825
|
* account: privateKeyToAccount('0x...'),
|
|
826
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
826
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
827
827
|
* transport: http(),
|
|
828
828
|
* })
|
|
829
829
|
*
|
|
@@ -888,7 +888,7 @@ export namespace burnSync {
|
|
|
888
888
|
* import { Actions } from 'viem/tempo'
|
|
889
889
|
*
|
|
890
890
|
* const client = createClient({
|
|
891
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
891
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
892
892
|
* transport: http(),
|
|
893
893
|
* })
|
|
894
894
|
*
|
|
@@ -968,7 +968,7 @@ export declare namespace watchRebalanceSwap {
|
|
|
968
968
|
* import { Actions } from 'viem/tempo'
|
|
969
969
|
*
|
|
970
970
|
* const client = createClient({
|
|
971
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
971
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
972
972
|
* transport: http(),
|
|
973
973
|
* })
|
|
974
974
|
*
|
|
@@ -1051,7 +1051,7 @@ export declare namespace watchMint {
|
|
|
1051
1051
|
* import { Actions } from 'viem/tempo'
|
|
1052
1052
|
*
|
|
1053
1053
|
* const client = createClient({
|
|
1054
|
-
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1054
|
+
* chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1055
1055
|
* transport: http(),
|
|
1056
1056
|
* })
|
|
1057
1057
|
*
|