viem 2.57.8 → 2.57.11
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 +68 -0
- package/_cjs/actions/public/getTransactionConfirmations.js +6 -1
- package/_cjs/actions/public/getTransactionConfirmations.js.map +1 -1
- package/_cjs/actions/public/waitForTransactionReceipt.js +4 -1
- package/_cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_cjs/actions/public/watchEvent.js +2 -0
- package/_cjs/actions/public/watchEvent.js.map +1 -1
- package/_cjs/chains/definitions/hyperEvm.js +3 -0
- package/_cjs/chains/definitions/hyperEvm.js.map +1 -1
- package/_cjs/chains/definitions/hyperliquidEvmTestnet.js +3 -0
- package/_cjs/chains/definitions/hyperliquidEvmTestnet.js.map +1 -1
- package/_cjs/chains/definitions/monad.js +1 -1
- package/_cjs/chains/definitions/monadTestnet.js +1 -1
- package/_cjs/chains/definitions/zksyncEraTestnet.js +32 -0
- package/_cjs/chains/definitions/zksyncEraTestnet.js.map +1 -0
- package/_cjs/chains/index.js +3 -1
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/clients/createClient.js +50 -5
- package/_cjs/clients/createClient.js.map +1 -1
- package/_cjs/clients/transports/fallback.js +2 -2
- package/_cjs/clients/transports/fallback.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/errors/version.js.map +1 -1
- package/_cjs/experimental/erc7821/actions/supportsExecutionMode.js +1 -1
- package/_cjs/experimental/erc7821/actions/supportsExecutionMode.js.map +1 -1
- package/_cjs/op-stack/actions/getPortalVersion.js +4 -1
- package/_cjs/op-stack/actions/getPortalVersion.js.map +1 -1
- package/_cjs/tempo/Abis.js +84 -15
- package/_cjs/tempo/Abis.js.map +1 -1
- package/_cjs/tempo/Account.js +13 -11
- package/_cjs/tempo/Account.js.map +1 -1
- package/_cjs/tempo/Addresses.js +3 -3
- package/_cjs/tempo/Addresses.js.map +1 -1
- package/_cjs/tempo/Decorator.js +4 -0
- package/_cjs/tempo/Decorator.js.map +1 -1
- package/_cjs/tempo/ExecutionError.js +25 -2
- package/_cjs/tempo/ExecutionError.js.map +1 -1
- package/_cjs/tempo/Hardfork.js +12 -1
- package/_cjs/tempo/Hardfork.js.map +1 -1
- package/_cjs/tempo/Selectors.js +4 -2
- package/_cjs/tempo/Selectors.js.map +1 -1
- package/_cjs/tempo/Transport.js.map +1 -1
- package/_cjs/tempo/accounts/Config.js +4 -2
- package/_cjs/tempo/accounts/Config.js.map +1 -1
- package/_cjs/tempo/accounts/Operation.js +2 -2
- package/_cjs/tempo/accounts/Operation.js.map +1 -1
- package/_cjs/tempo/actions/accessKey.js +1 -0
- package/_cjs/tempo/actions/accessKey.js.map +1 -1
- package/_cjs/tempo/actions/accounts.js +122 -7
- package/_cjs/tempo/actions/accounts.js.map +1 -1
- package/_cjs/tempo/chainConfig.js +31 -3
- package/_cjs/tempo/chainConfig.js.map +1 -1
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/tempo/internal/relay/accounts.js +46 -5
- package/_cjs/tempo/internal/relay/accounts.js.map +1 -1
- package/_cjs/tempo/internal/relay/feePayer.js +4 -4
- package/_cjs/tempo/internal/relay/feePayer.js.map +1 -1
- package/_cjs/utils/ens/avatar/parseAvatarRecord.js +4 -1
- package/_cjs/utils/ens/avatar/parseAvatarRecord.js.map +1 -1
- package/_cjs/utils/ens/avatar/utils.js +2 -1
- package/_cjs/utils/ens/avatar/utils.js.map +1 -1
- package/_cjs/utils/nonceManager.js +2 -2
- package/_cjs/utils/nonceManager.js.map +1 -1
- package/_cjs/utils/promise/withRetry.js +5 -1
- package/_cjs/utils/promise/withRetry.js.map +1 -1
- package/_esm/actions/public/getTransactionConfirmations.js +11 -1
- package/_esm/actions/public/getTransactionConfirmations.js.map +1 -1
- package/_esm/actions/public/waitForTransactionReceipt.js +10 -1
- package/_esm/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_esm/actions/public/watchEvent.js +2 -0
- package/_esm/actions/public/watchEvent.js.map +1 -1
- package/_esm/chains/definitions/hyperEvm.js +3 -0
- package/_esm/chains/definitions/hyperEvm.js.map +1 -1
- package/_esm/chains/definitions/hyperliquidEvmTestnet.js +3 -0
- package/_esm/chains/definitions/hyperliquidEvmTestnet.js.map +1 -1
- package/_esm/chains/definitions/monad.js +1 -1
- package/_esm/chains/definitions/monadTestnet.js +1 -1
- package/_esm/chains/definitions/zksyncEraTestnet.js +29 -0
- package/_esm/chains/definitions/zksyncEraTestnet.js.map +1 -0
- package/_esm/chains/index.js +1 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/clients/createClient.js +58 -5
- package/_esm/clients/createClient.js.map +1 -1
- package/_esm/clients/transports/fallback.js +2 -2
- package/_esm/clients/transports/fallback.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/errors/version.js.map +1 -1
- package/_esm/experimental/erc7821/actions/supportsExecutionMode.js +2 -1
- package/_esm/experimental/erc7821/actions/supportsExecutionMode.js.map +1 -1
- package/_esm/op-stack/actions/getPortalVersion.js +4 -1
- package/_esm/op-stack/actions/getPortalVersion.js.map +1 -1
- package/_esm/tempo/Abis.js +84 -15
- package/_esm/tempo/Abis.js.map +1 -1
- package/_esm/tempo/Account.js +18 -12
- package/_esm/tempo/Account.js.map +1 -1
- package/_esm/tempo/Addresses.js +3 -3
- package/_esm/tempo/Addresses.js.map +1 -1
- package/_esm/tempo/Decorator.js +4 -0
- package/_esm/tempo/Decorator.js.map +1 -1
- package/_esm/tempo/ExecutionError.js +25 -2
- package/_esm/tempo/ExecutionError.js.map +1 -1
- package/_esm/tempo/Hardfork.js +17 -2
- package/_esm/tempo/Hardfork.js.map +1 -1
- package/_esm/tempo/Selectors.js +3 -1
- package/_esm/tempo/Selectors.js.map +1 -1
- package/_esm/tempo/Transport.js.map +1 -1
- package/_esm/tempo/accounts/Config.js +5 -3
- package/_esm/tempo/accounts/Config.js.map +1 -1
- package/_esm/tempo/accounts/Operation.js +2 -2
- package/_esm/tempo/accounts/Operation.js.map +1 -1
- package/_esm/tempo/actions/accessKey.js +1 -0
- package/_esm/tempo/actions/accessKey.js.map +1 -1
- package/_esm/tempo/actions/accounts.js +279 -8
- package/_esm/tempo/actions/accounts.js.map +1 -1
- package/_esm/tempo/chainConfig.js +36 -4
- package/_esm/tempo/chainConfig.js.map +1 -1
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/tempo/internal/relay/accounts.js +50 -5
- package/_esm/tempo/internal/relay/accounts.js.map +1 -1
- package/_esm/tempo/internal/relay/feePayer.js +4 -4
- package/_esm/tempo/internal/relay/feePayer.js.map +1 -1
- package/_esm/utils/ens/avatar/parseAvatarRecord.js +4 -1
- package/_esm/utils/ens/avatar/parseAvatarRecord.js.map +1 -1
- package/_esm/utils/ens/avatar/utils.js +2 -1
- package/_esm/utils/ens/avatar/utils.js.map +1 -1
- package/_esm/utils/nonceManager.js +2 -2
- package/_esm/utils/nonceManager.js.map +1 -1
- package/_esm/utils/promise/withRetry.js +6 -1
- package/_esm/utils/promise/withRetry.js.map +1 -1
- package/_types/actions/public/getTransactionConfirmations.d.ts.map +1 -1
- package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
- package/_types/actions/public/watchEvent.d.ts.map +1 -1
- package/_types/chains/definitions/hyperEvm.d.ts +3 -1
- package/_types/chains/definitions/hyperEvm.d.ts.map +1 -1
- package/_types/chains/definitions/hyperliquidEvmTestnet.d.ts +3 -1
- package/_types/chains/definitions/hyperliquidEvmTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/monad.d.ts +1 -1
- package/_types/chains/definitions/monadTestnet.d.ts +1 -1
- package/_types/chains/definitions/zksyncEraTestnet.d.ts +82 -0
- package/_types/chains/definitions/zksyncEraTestnet.d.ts.map +1 -0
- package/_types/chains/index.d.ts +1 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/createClient.d.ts +33 -3
- package/_types/clients/createClient.d.ts.map +1 -1
- package/_types/clients/transports/fallback.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/errors/version.d.ts.map +1 -1
- package/_types/experimental/erc7821/actions/supportsExecutionMode.d.ts.map +1 -1
- package/_types/op-stack/actions/getPortalVersion.d.ts.map +1 -1
- package/_types/tempo/Abis.d.ts +621 -307
- package/_types/tempo/Abis.d.ts.map +1 -1
- package/_types/tempo/Account.d.ts +24 -4
- package/_types/tempo/Account.d.ts.map +1 -1
- package/_types/tempo/Addresses.d.ts +3 -3
- package/_types/tempo/Addresses.d.ts.map +1 -1
- package/_types/tempo/Decorator.d.ts +104 -0
- package/_types/tempo/Decorator.d.ts.map +1 -1
- package/_types/tempo/ExecutionError.d.ts.map +1 -1
- package/_types/tempo/Hardfork.d.ts +6 -2
- package/_types/tempo/Hardfork.d.ts.map +1 -1
- package/_types/tempo/Selectors.d.ts +3 -1
- package/_types/tempo/Selectors.d.ts.map +1 -1
- package/_types/tempo/Transaction.d.ts +2 -2
- package/_types/tempo/Transaction.d.ts.map +1 -1
- package/_types/tempo/Transport.d.ts +2 -0
- package/_types/tempo/Transport.d.ts.map +1 -1
- package/_types/tempo/actions/accessKey.d.ts +3 -2
- package/_types/tempo/actions/accessKey.d.ts.map +1 -1
- package/_types/tempo/actions/accounts.d.ts +594 -7
- package/_types/tempo/actions/accounts.d.ts.map +1 -1
- package/_types/tempo/actions/channel.d.ts +42 -0
- package/_types/tempo/actions/channel.d.ts.map +1 -1
- package/_types/tempo/actions/reward.d.ts +14 -0
- package/_types/tempo/actions/reward.d.ts.map +1 -1
- package/_types/tempo/actions/token.d.ts +105 -0
- package/_types/tempo/actions/token.d.ts.map +1 -1
- package/_types/tempo/chainConfig.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +5 -1
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/tempo/internal/relay/accounts.d.ts.map +1 -1
- package/_types/utils/ens/avatar/parseAvatarRecord.d.ts.map +1 -1
- package/_types/utils/ens/avatar/utils.d.ts.map +1 -1
- package/_types/utils/promise/withRetry.d.ts.map +1 -1
- package/actions/public/getTransactionConfirmations.ts +15 -1
- package/actions/public/waitForTransactionReceipt.ts +10 -1
- package/actions/public/watchEvent.ts +2 -0
- package/chains/definitions/hyperEvm.ts +3 -0
- package/chains/definitions/hyperliquidEvmTestnet.ts +3 -0
- package/chains/definitions/monad.ts +1 -1
- package/chains/definitions/monadTestnet.ts +1 -1
- package/chains/definitions/zksyncEraTestnet.ts +29 -0
- package/chains/index.ts +1 -0
- package/clients/createClient.ts +108 -9
- package/clients/transports/fallback.ts +8 -5
- package/errors/version.ts +1 -1
- package/experimental/erc7821/actions/supportsExecutionMode.ts +2 -1
- package/op-stack/actions/getPortalVersion.ts +4 -1
- package/package.json +2 -2
- package/tempo/Abis.ts +84 -15
- package/tempo/Account.ts +52 -16
- package/tempo/Addresses.ts +4 -4
- package/tempo/Decorator.ts +116 -0
- package/tempo/ExecutionError.ts +28 -2
- package/tempo/Hardfork.ts +16 -2
- package/tempo/Selectors.ts +4 -2
- package/tempo/Transaction.ts +2 -2
- package/tempo/Transport.ts +2 -0
- package/tempo/accounts/Config.ts +5 -3
- package/tempo/accounts/Operation.ts +2 -2
- package/tempo/actions/accessKey.ts +3 -2
- package/tempo/actions/accounts.ts +394 -10
- package/tempo/chainConfig.ts +46 -4
- package/tempo/index.ts +4 -0
- package/tempo/internal/relay/accounts.ts +62 -5
- package/tempo/internal/relay/feePayer.ts +4 -4
- package/utils/ens/avatar/parseAvatarRecord.ts +7 -1
- package/utils/ens/avatar/utils.ts +2 -1
- package/utils/nonceManager.ts +2 -2
- package/utils/promise/withRetry.ts +7 -1
package/tempo/Decorator.ts
CHANGED
|
@@ -503,6 +503,34 @@ type DecoratorBase<
|
|
|
503
503
|
) => ReturnType<typeof accessKeyActions.watchWitnessBurned>
|
|
504
504
|
}
|
|
505
505
|
accounts: {
|
|
506
|
+
/**
|
|
507
|
+
* Derives a configurable account address from an initial config with the
|
|
508
|
+
* configurable account precompile.
|
|
509
|
+
*
|
|
510
|
+
* @example
|
|
511
|
+
* ```ts
|
|
512
|
+
* import { createClient, http } from 'viem'
|
|
513
|
+
* import { tempo } from 'viem/chains'
|
|
514
|
+
* import { Account, tempoActions } from 'viem/tempo'
|
|
515
|
+
*
|
|
516
|
+
* const client = createClient({
|
|
517
|
+
* account: Account.fromSecp256k1('0x...'),
|
|
518
|
+
* chain: tempo,
|
|
519
|
+
* transport: http(),
|
|
520
|
+
* }).extend(tempoActions())
|
|
521
|
+
*
|
|
522
|
+
* const address = await client.accounts.deriveAccount({
|
|
523
|
+
* owners: [{ owner: '0x...', weight: 1 }],
|
|
524
|
+
* threshold: 1,
|
|
525
|
+
* })
|
|
526
|
+
* ```
|
|
527
|
+
*
|
|
528
|
+
* @param parameters - Owners, threshold, and optional salt.
|
|
529
|
+
* @returns The configurable account address.
|
|
530
|
+
*/
|
|
531
|
+
deriveAccount: (
|
|
532
|
+
parameters: accountsActions.deriveAccount.Parameters,
|
|
533
|
+
) => Promise<accountsActions.deriveAccount.ReturnValue>
|
|
506
534
|
/**
|
|
507
535
|
* Gets the current cached config for a configurable account.
|
|
508
536
|
*
|
|
@@ -543,6 +571,90 @@ type DecoratorBase<
|
|
|
543
571
|
updateConfigSync: (
|
|
544
572
|
parameters: accountsActions.updateConfigSync.Parameters<chain, account>,
|
|
545
573
|
) => Promise<accountsActions.updateConfigSync.ReturnValue>
|
|
574
|
+
/**
|
|
575
|
+
* Upgrades an existing account to a configurable account in place.
|
|
576
|
+
*
|
|
577
|
+
* @example
|
|
578
|
+
* ```ts
|
|
579
|
+
* import { createClient, http } from 'viem'
|
|
580
|
+
* import { tempo } from 'viem/chains'
|
|
581
|
+
* import { Account, tempoActions } from 'viem/tempo'
|
|
582
|
+
*
|
|
583
|
+
* const client = createClient({
|
|
584
|
+
* account: Account.fromSecp256k1('0x...'),
|
|
585
|
+
* chain: tempo,
|
|
586
|
+
* transport: http(),
|
|
587
|
+
* }).extend(tempoActions())
|
|
588
|
+
*
|
|
589
|
+
* const hash = await client.accounts.upgrade({
|
|
590
|
+
* owners: [{ owner: '0x...', weight: 1 }],
|
|
591
|
+
* threshold: 1,
|
|
592
|
+
* })
|
|
593
|
+
* ```
|
|
594
|
+
*
|
|
595
|
+
* @param parameters - Owners, threshold, and transaction parameters.
|
|
596
|
+
* @returns The transaction hash.
|
|
597
|
+
*/
|
|
598
|
+
upgrade: (
|
|
599
|
+
parameters: accountsActions.upgrade.Parameters<chain, account>,
|
|
600
|
+
) => Promise<accountsActions.upgrade.ReturnValue>
|
|
601
|
+
/**
|
|
602
|
+
* Upgrades an existing account to a configurable account in place and
|
|
603
|
+
* waits for confirmation.
|
|
604
|
+
*
|
|
605
|
+
* @example
|
|
606
|
+
* ```ts
|
|
607
|
+
* import { createClient, http } from 'viem'
|
|
608
|
+
* import { tempo } from 'viem/chains'
|
|
609
|
+
* import { Account, tempoActions } from 'viem/tempo'
|
|
610
|
+
*
|
|
611
|
+
* const client = createClient({
|
|
612
|
+
* account: Account.fromSecp256k1('0x...'),
|
|
613
|
+
* chain: tempo,
|
|
614
|
+
* transport: http(),
|
|
615
|
+
* }).extend(tempoActions())
|
|
616
|
+
*
|
|
617
|
+
* const { config } = await client.accounts.upgradeSync({
|
|
618
|
+
* owners: [{ owner: '0x...', weight: 1 }],
|
|
619
|
+
* threshold: 1,
|
|
620
|
+
* })
|
|
621
|
+
* ```
|
|
622
|
+
*
|
|
623
|
+
* @param parameters - Owners, threshold, and transaction parameters.
|
|
624
|
+
* @returns The installed configuration, its commitment, and the transaction receipt.
|
|
625
|
+
*/
|
|
626
|
+
upgradeSync: (
|
|
627
|
+
parameters: accountsActions.upgradeSync.Parameters<chain, account>,
|
|
628
|
+
) => Promise<accountsActions.upgradeSync.ReturnValue>
|
|
629
|
+
/**
|
|
630
|
+
* Verifies a configurable account signature against the account's
|
|
631
|
+
* current configuration.
|
|
632
|
+
*
|
|
633
|
+
* @example
|
|
634
|
+
* ```ts
|
|
635
|
+
* import { createClient, http } from 'viem'
|
|
636
|
+
* import { tempo } from 'viem/chains'
|
|
637
|
+
* import { Account, tempoActions } from 'viem/tempo'
|
|
638
|
+
*
|
|
639
|
+
* const client = createClient({
|
|
640
|
+
* account: Account.fromSecp256k1('0x...'),
|
|
641
|
+
* chain: tempo,
|
|
642
|
+
* transport: http(),
|
|
643
|
+
* }).extend(tempoActions())
|
|
644
|
+
*
|
|
645
|
+
* const valid = await client.accounts.verifyHash({
|
|
646
|
+
* account: '0x...',
|
|
647
|
+
* hash: '0x...',
|
|
648
|
+
* signature: '0x...',
|
|
649
|
+
* })
|
|
650
|
+
* ```
|
|
651
|
+
*
|
|
652
|
+
* @param parameters - Account, hash, and signature.
|
|
653
|
+
* @returns Whether the signature is valid for the account.
|
|
654
|
+
*/
|
|
655
|
+
verifyHash: (
|
|
656
|
+
parameters: accountsActions.verifyHash.Parameters,
|
|
657
|
+
) => Promise<accountsActions.verifyHash.ReturnValue>
|
|
546
658
|
}
|
|
547
659
|
amm: {
|
|
548
660
|
/**
|
|
@@ -6206,11 +6318,15 @@ export function decorator() {
|
|
|
6206
6318
|
'watchWitnessBurned',
|
|
6207
6319
|
]),
|
|
6208
6320
|
accounts: bindActions(client, accountsActions, [
|
|
6321
|
+
'deriveAccount',
|
|
6209
6322
|
'getConfig',
|
|
6210
6323
|
'getConfigCommitment',
|
|
6211
6324
|
'getOperation',
|
|
6212
6325
|
'updateConfig',
|
|
6213
6326
|
'updateConfigSync',
|
|
6327
|
+
'upgrade',
|
|
6328
|
+
'upgradeSync',
|
|
6329
|
+
'verifyHash',
|
|
6214
6330
|
]),
|
|
6215
6331
|
amm: bindActions(client, ammActions, [
|
|
6216
6332
|
'getPool',
|
package/tempo/ExecutionError.ts
CHANGED
|
@@ -34,6 +34,9 @@ export type Rpc =
|
|
|
34
34
|
export const messages: Record<`${AbiErrorName}(${string})`, string> = {
|
|
35
35
|
'AbdicationAlreadyScheduled(uint8)':
|
|
36
36
|
'Abdication is already scheduled for capability {0}.',
|
|
37
|
+
'AccountAlreadyConfigurable()':
|
|
38
|
+
'The account is already a configurable account.',
|
|
39
|
+
'AccountHasCode()': 'Accounts with code cannot be upgraded.',
|
|
37
40
|
'AccountNotAllowed(address)': 'Account {0} is not allowed.',
|
|
38
41
|
'ActiveLeaderRemoved()': 'The active leader cannot be removed.',
|
|
39
42
|
'AddressAlreadyHasValidator()': 'This address already has a validator.',
|
|
@@ -100,6 +103,7 @@ export const messages: Record<`${AbiErrorName}(${string})`, string> = {
|
|
|
100
103
|
'InvalidClaimAddress()': 'Invalid claim address.',
|
|
101
104
|
'InvalidClosedLoopConfig()': 'Invalid closed-loop configuration.',
|
|
102
105
|
'InvalidConfig()': 'Invalid configuration.',
|
|
106
|
+
'InvalidConfigurableAccountOwner()': 'Invalid owner.',
|
|
103
107
|
'InvalidCurrency()': 'Invalid currency.',
|
|
104
108
|
'InvalidDepositTransition()': 'Invalid deposit transition.',
|
|
105
109
|
'InvalidEncryptionKeyIndex(uint256)': 'Invalid encryption key index ({0}).',
|
|
@@ -114,7 +118,6 @@ export const messages: Record<`${AbiErrorName}(${string})`, string> = {
|
|
|
114
118
|
'InvalidMasterAddress()': 'Invalid master address.',
|
|
115
119
|
'InvalidMigrationIndex()': 'Invalid migration index.',
|
|
116
120
|
'InvalidMode()': 'Invalid mode.',
|
|
117
|
-
'InvalidMultisigOwner()': 'Invalid owner.',
|
|
118
121
|
'InvalidNonceKey()': 'Invalid nonce key.',
|
|
119
122
|
'InvalidOwner()': 'Invalid owner.',
|
|
120
123
|
'InvalidOwnerOrder()': 'Invalid owner order.',
|
|
@@ -191,11 +194,13 @@ export const messages: Record<`${AbiErrorName}(${string})`, string> = {
|
|
|
191
194
|
'PolicyNotFound()': 'Policy not found.',
|
|
192
195
|
'PolicyNotSimple()': 'Policy is not a simple policy.',
|
|
193
196
|
'PortalIsPaused()': 'The portal is paused.',
|
|
197
|
+
'PrimitiveRootRequired()': 'The root key must sign the upgrade transaction.',
|
|
194
198
|
'ProofOfWorkFailed()': 'Proof of work failed.',
|
|
195
199
|
'ProtectedAddress()': 'Address is protected.',
|
|
196
200
|
'ProtocolNonceNotSupported()': 'Protocol nonce is not supported.',
|
|
197
201
|
'PublicKeyAlreadyExists()': 'Public key already exists.',
|
|
198
202
|
'ReentrantWithdrawal()': 'Reentrant withdrawals are not allowed.',
|
|
203
|
+
'RootKeyRetired(address)': 'The root key of {0} is retired.',
|
|
199
204
|
'SequencerConfigurationUnchanged()':
|
|
200
205
|
'The sequencer configuration is unchanged.',
|
|
201
206
|
'SignatureTypeMismatch(uint8,uint8)':
|
|
@@ -219,8 +224,11 @@ export const messages: Record<`${AbiErrorName}(${string})`, string> = {
|
|
|
219
224
|
'Unauthorized()': 'Unauthorized.',
|
|
220
225
|
'UnauthorizedCaller()': 'Unauthorized caller.',
|
|
221
226
|
'UnauthorizedClaimer()': 'Unauthorized claimer.',
|
|
222
|
-
'
|
|
227
|
+
'UnauthorizedConfigurableAccountCaller()':
|
|
228
|
+
'Unauthorized configurable account caller.',
|
|
223
229
|
'Uninitialized()': 'Uninitialized.',
|
|
230
|
+
'UpgradeMustBeOnlyCall()':
|
|
231
|
+
'The upgrade must be the only call in the transaction.',
|
|
224
232
|
'ValidatorAlreadyDeactivated()': 'Validator is already deactivated.',
|
|
225
233
|
'ValidatorAlreadyExists()': 'Validator already exists.',
|
|
226
234
|
'ValidatorNotFound()': 'Validator not found.',
|
|
@@ -310,6 +318,24 @@ export const hints: Partial<Record<keyof typeof messages, readonly string[]>> =
|
|
|
310
318
|
'SupplyCapExceeded()': ['Mint a smaller amount, or raise the supply cap.'],
|
|
311
319
|
'TickOutOfBounds(int16)': ['Use a tick within the allowed range.'],
|
|
312
320
|
'Unauthorized()': ['The account lacks the permission this call requires.'],
|
|
321
|
+
'AccountAlreadyConfigurable()': [
|
|
322
|
+
'The account is already configurable. Rotate its owners with `updateConfig` instead.',
|
|
323
|
+
],
|
|
324
|
+
'AccountHasCode()': [
|
|
325
|
+
'Only accounts without code or delegation can be upgraded in place.',
|
|
326
|
+
],
|
|
327
|
+
'PrimitiveRootRequired()': [
|
|
328
|
+
"Send the upgrade from the account's root key, not an access key or another account.",
|
|
329
|
+
],
|
|
330
|
+
'RootKeyRetired(address)': [
|
|
331
|
+
'The account was upgraded to a configurable account. Sign with its owners instead of the retired root key.',
|
|
332
|
+
],
|
|
333
|
+
'UnauthorizedConfigurableAccountCaller()': [
|
|
334
|
+
'Only the configurable account can update its own configuration.',
|
|
335
|
+
],
|
|
336
|
+
'UpgradeMustBeOnlyCall()': [
|
|
337
|
+
'Send `upgradeAccount` as the only call, without a key authorization or authorization list.',
|
|
338
|
+
],
|
|
313
339
|
}
|
|
314
340
|
|
|
315
341
|
/** Interpolate `{0}`, `{1}`, … placeholders with args. */
|
package/tempo/Hardfork.ts
CHANGED
|
@@ -10,11 +10,25 @@ export const hardforks = [
|
|
|
10
10
|
't4',
|
|
11
11
|
't5',
|
|
12
12
|
't6',
|
|
13
|
+
't7',
|
|
14
|
+
't8',
|
|
15
|
+
't9',
|
|
16
|
+
't10',
|
|
17
|
+
't11',
|
|
18
|
+
't12',
|
|
19
|
+
't13',
|
|
20
|
+
't14',
|
|
13
21
|
] as const
|
|
14
22
|
|
|
15
23
|
export type Hardfork = (typeof hardforks)[number]
|
|
16
24
|
|
|
17
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Returns `true` if `current` is before `target`.
|
|
27
|
+
*
|
|
28
|
+
* Unknown `current` hardforks are treated as newer than every known hardfork.
|
|
29
|
+
*/
|
|
18
30
|
export function lt(current: string, target: Hardfork): boolean {
|
|
19
|
-
|
|
31
|
+
const index = hardforks.indexOf(current as Hardfork)
|
|
32
|
+
if (index === -1) return false
|
|
33
|
+
return index < hardforks.indexOf(target)
|
|
20
34
|
}
|
package/tempo/Selectors.ts
CHANGED
|
@@ -49,11 +49,12 @@ export const addressRegistry = {
|
|
|
49
49
|
resolveVirtualAddress: '0xe2fc56ef',
|
|
50
50
|
} as const satisfies FunctionSelectors<typeof Abis.addressRegistry>
|
|
51
51
|
|
|
52
|
-
export const
|
|
52
|
+
export const configurableAccount = {
|
|
53
53
|
deriveAccount: '0xce8e071c',
|
|
54
54
|
getConfigCommitment: '0x5bd93359',
|
|
55
55
|
updateConfig: '0x64203645',
|
|
56
|
-
|
|
56
|
+
upgradeAccount: '0x5f5fdc31',
|
|
57
|
+
} as const satisfies FunctionSelectors<typeof Abis.configurableAccount>
|
|
57
58
|
|
|
58
59
|
export const currentCommittee = {
|
|
59
60
|
getCommitteeMembers: '0xb2a275f9',
|
|
@@ -73,6 +74,7 @@ export const receivePolicyGuard = {
|
|
|
73
74
|
export const signatureVerifier = {
|
|
74
75
|
recover: '0x19045a25',
|
|
75
76
|
verify: '0x1a86b550',
|
|
77
|
+
verifyConfigurableAccount: '0x8a4c1645',
|
|
76
78
|
verifyKeychain: '0x6c0c731e',
|
|
77
79
|
verifyKeychainAdmin: '0x5f6fc5b7',
|
|
78
80
|
} as const satisfies FunctionSelectors<typeof Abis.signatureVerifier>
|
package/tempo/Transaction.ts
CHANGED
|
@@ -103,8 +103,8 @@ export type TransactionRequestRpc = OneOf<
|
|
|
103
103
|
TransactionRequestTempo<Hex.Hex, Hex.Hex, '0x76'>,
|
|
104
104
|
'accountSimulation'
|
|
105
105
|
> & {
|
|
106
|
-
/** Account simulation spec, named `
|
|
107
|
-
|
|
106
|
+
/** Account simulation spec, named `configurableAccountSimulation` by the node. */
|
|
107
|
+
configurableAccountSimulation?: AccountSimulation.Rpc | undefined
|
|
108
108
|
})
|
|
109
109
|
>
|
|
110
110
|
|
package/tempo/Transport.ts
CHANGED
|
@@ -85,7 +85,9 @@ type RelayProxyParameters = {
|
|
|
85
85
|
policy?: 'sign-only' | 'sign-and-broadcast' | undefined
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/** Transport that {@link withFeePayer} returns. */
|
|
88
89
|
export type FeePayer = Transport<typeof withFeePayer.type>
|
|
90
|
+
/** Transport that {@link withRelay} returns for a remote relay. */
|
|
89
91
|
export type Relay = Transport<typeof withRelay.type, { accounts: true }>
|
|
90
92
|
|
|
91
93
|
/**
|
package/tempo/accounts/Config.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type * as Hex from 'ox/Hex'
|
|
|
4
4
|
import * as Json from 'ox/Json'
|
|
5
5
|
import { AccountConfig } from 'ox/tempo'
|
|
6
6
|
import { BaseError } from '../../errors/base.js'
|
|
7
|
-
import {
|
|
7
|
+
import { configurableAccountRecoveryFactory } from '../Addresses.js'
|
|
8
8
|
import type * as Store from '../Store.js'
|
|
9
9
|
|
|
10
10
|
/** A valid 48-owner config is much smaller; 64 KiB bounds hostile store parsing work. */
|
|
@@ -78,7 +78,9 @@ function assertKey(options: {
|
|
|
78
78
|
if (config.version === 0n) {
|
|
79
79
|
if (
|
|
80
80
|
!Address.isEqual(
|
|
81
|
-
AccountConfig.getAddress(config, {
|
|
81
|
+
AccountConfig.getAddress(config, {
|
|
82
|
+
factory: configurableAccountRecoveryFactory,
|
|
83
|
+
}),
|
|
82
84
|
address,
|
|
83
85
|
)
|
|
84
86
|
)
|
|
@@ -106,7 +108,7 @@ function deserialize(value: string): AccountConfig.Config {
|
|
|
106
108
|
/** Returns the store key for an account and config commitment. */
|
|
107
109
|
function key(options: { address: Address.Address; commitment: Hex.Hex }) {
|
|
108
110
|
const { address, commitment } = options
|
|
109
|
-
return `
|
|
111
|
+
return `configurableAccount:config:${address.toLowerCase()}:${commitment.toLowerCase()}`
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
/** Serializes an account config for storage. */
|
|
@@ -173,12 +173,12 @@ function assertHash(operation: AccountOperation.Operation) {
|
|
|
173
173
|
|
|
174
174
|
/** Returns the store key for an operation hash. */
|
|
175
175
|
function operationKey(hash: Hex.Hex) {
|
|
176
|
-
return `
|
|
176
|
+
return `configurableAccount:operation:${hash.toLowerCase()}`
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
/** Returns the store key for a submission attempt. */
|
|
180
180
|
function submissionKey(hash: Hex.Hex, submissionId: Hex.Hex) {
|
|
181
|
-
return `
|
|
181
|
+
return `configurableAccount:submission:${hash.toLowerCase()}:${submissionId.toLowerCase()}`
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
/** Thrown when a stored account operation is malformed or unsupported. */
|
|
@@ -72,6 +72,7 @@ const signatureTypes = {
|
|
|
72
72
|
0: 'secp256k1',
|
|
73
73
|
1: 'p256',
|
|
74
74
|
2: 'webAuthn',
|
|
75
|
+
3: 'configurable',
|
|
75
76
|
} as const satisfies Record<number, string>
|
|
76
77
|
|
|
77
78
|
/** @internal */
|
|
@@ -558,8 +559,8 @@ export namespace getMetadata {
|
|
|
558
559
|
export type ReturnValue = {
|
|
559
560
|
/** The access key address. */
|
|
560
561
|
address: Address
|
|
561
|
-
/** The key type. */
|
|
562
|
-
keyType: 'secp256k1' | 'p256' | 'webAuthn'
|
|
562
|
+
/** The key type. `configurable` for a configurable account access key. */
|
|
563
|
+
keyType: 'secp256k1' | 'p256' | 'webAuthn' | 'configurable'
|
|
563
564
|
/** The expiry timestamp. */
|
|
564
565
|
expiry: bigint
|
|
565
566
|
/** The spending policy. */
|