viem 3.0.0-next.13 → 3.0.0-next.14
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/dist/chains/definitions/arcTestnet.d.ts +5 -5
- package/dist/chains/definitions/arcTestnet.d.ts.map +1 -1
- package/dist/chains/definitions/arcTestnet.js +11 -8
- package/dist/chains/definitions/arcTestnet.js.map +1 -1
- package/dist/chains/definitions/qmsTestnet.d.ts +27 -0
- package/dist/chains/definitions/qmsTestnet.d.ts.map +1 -0
- package/dist/chains/definitions/qmsTestnet.js +23 -0
- package/dist/chains/definitions/qmsTestnet.js.map +1 -0
- package/dist/chains/definitions/tempo.d.ts +1 -1
- package/dist/chains/definitions/tempo.js +1 -1
- package/dist/chains/definitions/tempoModerato.d.ts +2 -2
- package/dist/chains/definitions/tempoModerato.js +2 -2
- package/dist/chains/index.d.ts +1 -0
- package/dist/chains/index.d.ts.map +1 -1
- package/dist/chains/index.js +1 -0
- package/dist/chains/index.js.map +1 -1
- package/dist/core/actions/transaction/waitForReceipt.d.ts +1 -1
- package/dist/core/actions/transaction/waitForReceipt.d.ts.map +1 -1
- package/dist/core/actions/transaction/waitForReceipt.js +5 -2
- package/dist/core/actions/transaction/waitForReceipt.js.map +1 -1
- package/dist/core/actions/wallet/waitForCallsStatus.d.ts.map +1 -1
- package/dist/core/actions/wallet/waitForCallsStatus.js +24 -1
- package/dist/core/actions/wallet/waitForCallsStatus.js.map +1 -1
- package/dist/internal/inference.d.ts +3 -3
- package/dist/internal/inference.d.ts.map +1 -1
- package/dist/tempo/Abis.d.ts +1935 -899
- package/dist/tempo/Abis.d.ts.map +1 -1
- package/dist/tempo/Abis.js +215 -0
- package/dist/tempo/Abis.js.map +1 -1
- package/dist/tempo/Account.d.ts +30 -30
- package/dist/tempo/Account.d.ts.map +1 -1
- package/dist/tempo/Account.js +43 -43
- package/dist/tempo/Account.js.map +1 -1
- package/dist/tempo/Addresses.d.ts +2 -0
- package/dist/tempo/Addresses.d.ts.map +1 -1
- package/dist/tempo/Addresses.js +2 -0
- package/dist/tempo/Addresses.js.map +1 -1
- package/dist/tempo/Decorator.d.ts +33 -10
- package/dist/tempo/Decorator.d.ts.map +1 -1
- package/dist/tempo/Decorator.js +9 -8
- package/dist/tempo/Decorator.js.map +1 -1
- package/dist/tempo/ExecutionError.js +1 -1
- package/dist/tempo/ExecutionError.js.map +1 -1
- package/dist/tempo/KeyAuthorizationManager.d.ts +24 -13
- package/dist/tempo/KeyAuthorizationManager.d.ts.map +1 -1
- package/dist/tempo/KeyAuthorizationManager.js +44 -25
- package/dist/tempo/KeyAuthorizationManager.js.map +1 -1
- package/dist/tempo/Relay.d.ts +61 -12
- package/dist/tempo/Relay.d.ts.map +1 -1
- package/dist/tempo/Relay.js +48 -8
- package/dist/tempo/Relay.js.map +1 -1
- package/dist/tempo/Selectors.d.ts +12 -0
- package/dist/tempo/Selectors.d.ts.map +1 -1
- package/dist/tempo/Selectors.js +12 -0
- package/dist/tempo/Selectors.js.map +1 -1
- package/dist/tempo/Transport.d.ts +19 -6
- package/dist/tempo/Transport.d.ts.map +1 -1
- package/dist/tempo/Transport.js +18 -12
- package/dist/tempo/Transport.js.map +1 -1
- package/dist/tempo/{multisig → accounts}/Config.d.ts +8 -8
- package/dist/tempo/accounts/Config.d.ts.map +1 -0
- package/dist/tempo/{multisig → accounts}/Config.js +14 -14
- package/dist/tempo/{multisig → accounts}/Config.js.map +1 -1
- package/dist/tempo/{multisig → accounts}/Operation.d.ts +8 -8
- package/dist/tempo/{multisig → accounts}/Operation.d.ts.map +1 -1
- package/dist/tempo/{multisig → accounts}/Operation.js +17 -17
- package/dist/tempo/{multisig → accounts}/Operation.js.map +1 -1
- package/dist/tempo/{multisig → accounts}/Signature.d.ts +1 -1
- package/dist/tempo/accounts/Signature.d.ts.map +1 -0
- package/dist/tempo/accounts/Signature.js +9 -0
- package/dist/tempo/accounts/Signature.js.map +1 -0
- package/dist/tempo/actions/accessKey/index.d.ts +1 -0
- package/dist/tempo/actions/accessKey/index.d.ts.map +1 -1
- package/dist/tempo/actions/accessKey/index.js +1 -0
- package/dist/tempo/actions/accessKey/index.js.map +1 -1
- package/dist/tempo/actions/accessKey/prepareAuthorization.d.ts +4 -4
- package/dist/tempo/actions/accessKey/prepareAuthorization.d.ts.map +1 -1
- package/dist/tempo/actions/accessKey/prepareAuthorization.js +10 -10
- package/dist/tempo/actions/accessKey/prepareAuthorization.js.map +1 -1
- package/dist/tempo/actions/accessKey/saveAuthorization.d.ts +40 -0
- package/dist/tempo/actions/accessKey/saveAuthorization.d.ts.map +1 -0
- package/dist/tempo/actions/accessKey/saveAuthorization.js +32 -0
- package/dist/tempo/actions/accessKey/saveAuthorization.js.map +1 -0
- package/dist/tempo/actions/accessKey/signAuthorization.d.ts +17 -13
- package/dist/tempo/actions/accessKey/signAuthorization.d.ts.map +1 -1
- package/dist/tempo/actions/accessKey/signAuthorization.js +43 -30
- package/dist/tempo/actions/accessKey/signAuthorization.js.map +1 -1
- package/dist/tempo/actions/{multisig → accounts}/getConfig.d.ts +5 -5
- package/dist/tempo/actions/accounts/getConfig.d.ts.map +1 -0
- package/dist/tempo/actions/{multisig → accounts}/getConfig.js +5 -5
- package/dist/tempo/actions/accounts/getConfig.js.map +1 -0
- package/dist/tempo/actions/{multisig → accounts}/getConfigCommitment.d.ts +3 -3
- package/dist/tempo/actions/{multisig → accounts}/getConfigCommitment.d.ts.map +1 -1
- package/dist/tempo/actions/{multisig → accounts}/getConfigCommitment.js +2 -2
- package/dist/tempo/actions/{multisig → accounts}/getConfigCommitment.js.map +1 -1
- package/dist/tempo/actions/{multisig → accounts}/getOperation.d.ts +4 -4
- package/dist/tempo/actions/{multisig → accounts}/getOperation.d.ts.map +1 -1
- package/dist/tempo/actions/{multisig → accounts}/getOperation.js +4 -4
- package/dist/tempo/actions/accounts/getOperation.js.map +1 -0
- package/dist/tempo/actions/{multisig → accounts}/index.d.ts.map +1 -1
- package/dist/tempo/actions/{multisig → accounts}/index.js.map +1 -1
- package/dist/tempo/actions/{multisig → accounts}/updateConfig.d.ts +12 -12
- package/dist/tempo/actions/{multisig → accounts}/updateConfig.d.ts.map +1 -1
- package/dist/tempo/actions/{multisig → accounts}/updateConfig.js +16 -21
- package/dist/tempo/actions/{multisig → accounts}/updateConfig.js.map +1 -1
- package/dist/tempo/actions/{multisig → accounts}/updateConfigSync.d.ts +6 -6
- package/dist/tempo/actions/{multisig → accounts}/updateConfigSync.d.ts.map +1 -1
- package/dist/tempo/actions/{multisig → accounts}/updateConfigSync.js +6 -6
- package/dist/tempo/actions/{multisig → accounts}/updateConfigSync.js.map +1 -1
- package/dist/tempo/actions/index.d.ts +2 -2
- package/dist/tempo/actions/index.d.ts.map +1 -1
- package/dist/tempo/actions/index.js +2 -2
- package/dist/tempo/actions/index.js.map +1 -1
- package/dist/tempo/chainConfig.d.ts +16 -16
- package/dist/tempo/chainConfig.d.ts.map +1 -1
- package/dist/tempo/chainConfig.js +52 -52
- package/dist/tempo/chainConfig.js.map +1 -1
- package/dist/tempo/index.d.ts +2 -2
- package/dist/tempo/index.d.ts.map +1 -1
- package/dist/tempo/index.js +2 -2
- package/dist/tempo/index.js.map +1 -1
- package/dist/tempo/internal/relay/accounts.d.ts +15 -0
- package/dist/tempo/internal/relay/accounts.d.ts.map +1 -0
- package/dist/tempo/internal/relay/{multisig.js → accounts.js} +96 -101
- package/dist/tempo/internal/relay/accounts.js.map +1 -0
- package/dist/tempo/internal/relay/feePayer.js +5 -5
- package/dist/tempo/internal/relay/feePayer.js.map +1 -1
- package/dist/tempo/internal/relay/keyAuthorization.d.ts +25 -0
- package/dist/tempo/internal/relay/keyAuthorization.d.ts.map +1 -0
- package/dist/tempo/internal/relay/keyAuthorization.js +339 -0
- package/dist/tempo/internal/relay/keyAuthorization.js.map +1 -0
- package/dist/tempo/internal/relay/plugin.d.ts +6 -3
- package/dist/tempo/internal/relay/plugin.d.ts.map +1 -1
- package/dist/tempo/internal/relay/plugin.js +15 -6
- package/dist/tempo/internal/relay/plugin.js.map +1 -1
- package/dist/tempo/internal/relay/utils.d.ts +8 -0
- package/dist/tempo/internal/relay/utils.d.ts.map +1 -1
- package/dist/utils/RpcClient.d.ts.map +1 -1
- package/dist/utils/RpcClient.js +36 -19
- package/dist/utils/RpcClient.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/src/chains/definitions/arcTestnet.ts +11 -8
- package/src/chains/definitions/qmsTestnet.ts +23 -0
- package/src/chains/definitions/tempo.ts +1 -1
- package/src/chains/definitions/tempoModerato.ts +2 -2
- package/src/chains/index.ts +1 -0
- package/src/core/actions/transaction/waitForReceipt.ts +5 -3
- package/src/core/actions/wallet/waitForCallsStatus.ts +25 -1
- package/src/internal/inference.ts +3 -3
- package/src/tempo/Abis.ts +216 -0
- package/src/tempo/Account.ts +97 -87
- package/src/tempo/Addresses.ts +2 -0
- package/src/tempo/Decorator.ts +55 -28
- package/src/tempo/ExecutionError.ts +1 -1
- package/src/tempo/KeyAuthorizationManager.ts +53 -31
- package/src/tempo/Relay.ts +69 -14
- package/src/tempo/Selectors.ts +13 -0
- package/src/tempo/Transport.ts +46 -20
- package/src/tempo/{multisig → accounts}/Config.ts +21 -21
- package/src/tempo/{multisig → accounts}/Operation.ts +26 -26
- package/src/tempo/{multisig → accounts}/Signature.ts +5 -3
- package/src/tempo/actions/accessKey/index.ts +1 -0
- package/src/tempo/actions/accessKey/prepareAuthorization.ts +16 -15
- package/src/tempo/actions/accessKey/saveAuthorization.ts +51 -0
- package/src/tempo/actions/accessKey/signAuthorization.ts +73 -51
- package/src/tempo/actions/{multisig → accounts}/getConfig.ts +7 -7
- package/src/tempo/actions/{multisig → accounts}/getConfigCommitment.ts +3 -3
- package/src/tempo/actions/{multisig → accounts}/getOperation.ts +6 -6
- package/src/tempo/actions/{multisig → accounts}/updateConfig.ts +21 -26
- package/src/tempo/actions/{multisig → accounts}/updateConfigSync.ts +7 -7
- package/src/tempo/actions/index.ts +2 -3
- package/src/tempo/chainConfig.ts +87 -85
- package/src/tempo/index.ts +4 -4
- package/src/tempo/internal/relay/{multisig.ts → accounts.ts} +121 -121
- package/src/tempo/internal/relay/feePayer.ts +5 -5
- package/src/tempo/internal/relay/keyAuthorization.ts +419 -0
- package/src/tempo/internal/relay/plugin.ts +20 -7
- package/src/utils/RpcClient.ts +38 -21
- package/src/version.ts +1 -1
- package/dist/tempo/actions/multisig/getConfig.d.ts.map +0 -1
- package/dist/tempo/actions/multisig/getConfig.js.map +0 -1
- package/dist/tempo/actions/multisig/getOperation.js.map +0 -1
- package/dist/tempo/internal/relay/multisig.d.ts +0 -4
- package/dist/tempo/internal/relay/multisig.d.ts.map +0 -1
- package/dist/tempo/internal/relay/multisig.js.map +0 -1
- package/dist/tempo/multisig/Config.d.ts.map +0 -1
- package/dist/tempo/multisig/Signature.d.ts.map +0 -1
- package/dist/tempo/multisig/Signature.js +0 -9
- package/dist/tempo/multisig/Signature.js.map +0 -1
- /package/dist/tempo/actions/{multisig → accounts}/index.d.ts +0 -0
- /package/dist/tempo/actions/{multisig → accounts}/index.js +0 -0
- /package/src/tempo/actions/{multisig → accounts}/index.ts +0 -0
package/src/tempo/Abis.ts
CHANGED
|
@@ -8762,6 +8762,221 @@ export const zoneMessenger = [
|
|
|
8762
8762
|
},
|
|
8763
8763
|
] as const
|
|
8764
8764
|
|
|
8765
|
+
export const zoneInbox = [
|
|
8766
|
+
{
|
|
8767
|
+
name: 'processedDepositQueueHash',
|
|
8768
|
+
type: 'function',
|
|
8769
|
+
stateMutability: 'view',
|
|
8770
|
+
inputs: [],
|
|
8771
|
+
outputs: [{ type: 'bytes32' }],
|
|
8772
|
+
},
|
|
8773
|
+
{
|
|
8774
|
+
name: 'processedDepositNumber',
|
|
8775
|
+
type: 'function',
|
|
8776
|
+
stateMutability: 'view',
|
|
8777
|
+
inputs: [],
|
|
8778
|
+
outputs: [{ type: 'uint64' }],
|
|
8779
|
+
},
|
|
8780
|
+
{
|
|
8781
|
+
name: 'processedTokenEnablementHash',
|
|
8782
|
+
type: 'function',
|
|
8783
|
+
stateMutability: 'view',
|
|
8784
|
+
inputs: [],
|
|
8785
|
+
outputs: [{ type: 'bytes32' }],
|
|
8786
|
+
},
|
|
8787
|
+
{
|
|
8788
|
+
name: 'processedEnabledTokenCount',
|
|
8789
|
+
type: 'function',
|
|
8790
|
+
stateMutability: 'view',
|
|
8791
|
+
inputs: [],
|
|
8792
|
+
outputs: [{ type: 'uint64' }],
|
|
8793
|
+
},
|
|
8794
|
+
{
|
|
8795
|
+
name: 'tempoPortal',
|
|
8796
|
+
type: 'function',
|
|
8797
|
+
stateMutability: 'view',
|
|
8798
|
+
inputs: [],
|
|
8799
|
+
outputs: [{ type: 'address' }],
|
|
8800
|
+
},
|
|
8801
|
+
{
|
|
8802
|
+
name: 'tempoState',
|
|
8803
|
+
type: 'function',
|
|
8804
|
+
stateMutability: 'view',
|
|
8805
|
+
inputs: [],
|
|
8806
|
+
outputs: [{ type: 'address' }],
|
|
8807
|
+
},
|
|
8808
|
+
{
|
|
8809
|
+
name: 'refunds',
|
|
8810
|
+
type: 'function',
|
|
8811
|
+
stateMutability: 'view',
|
|
8812
|
+
inputs: [
|
|
8813
|
+
{ type: 'address', name: 'token' },
|
|
8814
|
+
{ type: 'address', name: 'owner' },
|
|
8815
|
+
],
|
|
8816
|
+
outputs: [{ type: 'uint128' }],
|
|
8817
|
+
},
|
|
8818
|
+
{
|
|
8819
|
+
name: 'claimRefund',
|
|
8820
|
+
type: 'function',
|
|
8821
|
+
stateMutability: 'nonpayable',
|
|
8822
|
+
inputs: [{ type: 'address', name: 'token' }],
|
|
8823
|
+
outputs: [{ type: 'uint128', name: 'amount' }],
|
|
8824
|
+
},
|
|
8825
|
+
{
|
|
8826
|
+
name: 'advanceTempo',
|
|
8827
|
+
type: 'function',
|
|
8828
|
+
stateMutability: 'nonpayable',
|
|
8829
|
+
inputs: [
|
|
8830
|
+
{ type: 'bytes', name: 'header' },
|
|
8831
|
+
{
|
|
8832
|
+
type: 'tuple[]',
|
|
8833
|
+
name: 'deposits',
|
|
8834
|
+
components: [
|
|
8835
|
+
{ type: 'uint8', name: 'depositType' },
|
|
8836
|
+
{ type: 'bytes', name: 'depositData' },
|
|
8837
|
+
{ type: 'bool', name: 'rejected' },
|
|
8838
|
+
],
|
|
8839
|
+
},
|
|
8840
|
+
{
|
|
8841
|
+
type: 'tuple[]',
|
|
8842
|
+
name: 'decryptions',
|
|
8843
|
+
components: [
|
|
8844
|
+
{ type: 'bytes32', name: 'sharedSecret' },
|
|
8845
|
+
{ type: 'uint8', name: 'sharedSecretYParity' },
|
|
8846
|
+
{
|
|
8847
|
+
type: 'tuple',
|
|
8848
|
+
name: 'cpProof',
|
|
8849
|
+
components: [
|
|
8850
|
+
{ type: 'bytes32', name: 's' },
|
|
8851
|
+
{ type: 'bytes32', name: 'c' },
|
|
8852
|
+
],
|
|
8853
|
+
},
|
|
8854
|
+
],
|
|
8855
|
+
},
|
|
8856
|
+
{
|
|
8857
|
+
type: 'tuple[]',
|
|
8858
|
+
name: 'enabledTokens',
|
|
8859
|
+
components: [
|
|
8860
|
+
{ type: 'address', name: 'token' },
|
|
8861
|
+
{ type: 'string', name: 'name' },
|
|
8862
|
+
{ type: 'string', name: 'symbol' },
|
|
8863
|
+
{ type: 'string', name: 'currency' },
|
|
8864
|
+
],
|
|
8865
|
+
},
|
|
8866
|
+
],
|
|
8867
|
+
outputs: [],
|
|
8868
|
+
},
|
|
8869
|
+
{
|
|
8870
|
+
name: 'advanceTempoHeaders',
|
|
8871
|
+
type: 'function',
|
|
8872
|
+
stateMutability: 'nonpayable',
|
|
8873
|
+
inputs: [{ type: 'bytes[]', name: 'headers' }],
|
|
8874
|
+
outputs: [],
|
|
8875
|
+
},
|
|
8876
|
+
{
|
|
8877
|
+
name: 'TempoAdvanced',
|
|
8878
|
+
type: 'event',
|
|
8879
|
+
inputs: [
|
|
8880
|
+
{ type: 'bytes32', name: 'tempoBlockHash', indexed: true },
|
|
8881
|
+
{ type: 'uint64', name: 'tempoBlockNumber', indexed: true },
|
|
8882
|
+
{ type: 'uint256', name: 'depositsProcessed' },
|
|
8883
|
+
{ type: 'bytes32', name: 'newProcessedDepositQueueHash' },
|
|
8884
|
+
{ type: 'uint64', name: 'lastProcessedDepositNumber' },
|
|
8885
|
+
],
|
|
8886
|
+
},
|
|
8887
|
+
{
|
|
8888
|
+
name: 'TempoAdvanced',
|
|
8889
|
+
type: 'event',
|
|
8890
|
+
inputs: [
|
|
8891
|
+
{ type: 'bytes32', name: 'tempoBlockHash', indexed: true },
|
|
8892
|
+
{ type: 'uint64', name: 'tempoBlockNumber', indexed: true },
|
|
8893
|
+
{ type: 'uint256', name: 'depositsProcessed' },
|
|
8894
|
+
{ type: 'bytes32', name: 'newProcessedDepositQueueHash' },
|
|
8895
|
+
{ type: 'uint64', name: 'lastProcessedDepositNumber' },
|
|
8896
|
+
{ type: 'uint64', name: 'lastProcessedEnabledTokenCount' },
|
|
8897
|
+
],
|
|
8898
|
+
},
|
|
8899
|
+
{
|
|
8900
|
+
name: 'DepositProcessed',
|
|
8901
|
+
type: 'event',
|
|
8902
|
+
inputs: [
|
|
8903
|
+
{ type: 'bytes32', name: 'depositHash', indexed: true },
|
|
8904
|
+
{ type: 'address', name: 'sender', indexed: true },
|
|
8905
|
+
{ type: 'address', name: 'to', indexed: true },
|
|
8906
|
+
{ type: 'address', name: 'token' },
|
|
8907
|
+
{ type: 'uint128', name: 'amount' },
|
|
8908
|
+
{ type: 'bytes32', name: 'memo' },
|
|
8909
|
+
],
|
|
8910
|
+
},
|
|
8911
|
+
{
|
|
8912
|
+
name: 'DepositFailed',
|
|
8913
|
+
type: 'event',
|
|
8914
|
+
inputs: [
|
|
8915
|
+
{ type: 'bytes32', name: 'depositHash', indexed: true },
|
|
8916
|
+
{ type: 'address', name: 'sender', indexed: true },
|
|
8917
|
+
{ type: 'address', name: 'token' },
|
|
8918
|
+
{ type: 'uint128', name: 'amount' },
|
|
8919
|
+
],
|
|
8920
|
+
},
|
|
8921
|
+
{
|
|
8922
|
+
name: 'DepositRejected',
|
|
8923
|
+
type: 'event',
|
|
8924
|
+
inputs: [
|
|
8925
|
+
{ type: 'bytes32', name: 'depositHash', indexed: true },
|
|
8926
|
+
{ type: 'address', name: 'sender', indexed: true },
|
|
8927
|
+
{ type: 'uint8', name: 'depositType' },
|
|
8928
|
+
{ type: 'address', name: 'token' },
|
|
8929
|
+
{ type: 'uint128', name: 'amount' },
|
|
8930
|
+
{ type: 'address', name: 'tempoRefundRecipient' },
|
|
8931
|
+
],
|
|
8932
|
+
},
|
|
8933
|
+
{
|
|
8934
|
+
name: 'WithdrawalBounceBackProcessed',
|
|
8935
|
+
type: 'event',
|
|
8936
|
+
inputs: [
|
|
8937
|
+
{ type: 'address', name: 'zoneFallbackRecipient', indexed: true },
|
|
8938
|
+
{ type: 'address', name: 'token' },
|
|
8939
|
+
{ type: 'uint128', name: 'amount' },
|
|
8940
|
+
],
|
|
8941
|
+
},
|
|
8942
|
+
{
|
|
8943
|
+
name: 'WithdrawalBounceBackPending',
|
|
8944
|
+
type: 'event',
|
|
8945
|
+
inputs: [
|
|
8946
|
+
{ type: 'address', name: 'zoneFallbackRecipient', indexed: true },
|
|
8947
|
+
{ type: 'address', name: 'token' },
|
|
8948
|
+
{ type: 'uint128', name: 'amount' },
|
|
8949
|
+
],
|
|
8950
|
+
},
|
|
8951
|
+
{
|
|
8952
|
+
name: 'RefundClaimed',
|
|
8953
|
+
type: 'event',
|
|
8954
|
+
inputs: [
|
|
8955
|
+
{ type: 'address', name: 'recipient', indexed: true },
|
|
8956
|
+
{ type: 'address', name: 'token', indexed: true },
|
|
8957
|
+
{ type: 'uint128', name: 'amount' },
|
|
8958
|
+
],
|
|
8959
|
+
},
|
|
8960
|
+
{
|
|
8961
|
+
name: 'TokenEnabled',
|
|
8962
|
+
type: 'event',
|
|
8963
|
+
inputs: [
|
|
8964
|
+
{ type: 'address', name: 'token', indexed: true },
|
|
8965
|
+
{ type: 'string', name: 'name' },
|
|
8966
|
+
{ type: 'string', name: 'symbol' },
|
|
8967
|
+
{ type: 'string', name: 'currency' },
|
|
8968
|
+
],
|
|
8969
|
+
},
|
|
8970
|
+
{ name: 'OnlySequencer', type: 'error', inputs: [] },
|
|
8971
|
+
{ name: 'InvalidDepositQueueHash', type: 'error', inputs: [] },
|
|
8972
|
+
{ name: 'InvalidWithdrawalBounceBack', type: 'error', inputs: [] },
|
|
8973
|
+
{ name: 'InvalidTokenEnablementHash', type: 'error', inputs: [] },
|
|
8974
|
+
{ name: 'MissingDecryptionData', type: 'error', inputs: [] },
|
|
8975
|
+
{ name: 'ExtraDecryptionData', type: 'error', inputs: [] },
|
|
8976
|
+
{ name: 'InvalidSharedSecretProof', type: 'error', inputs: [] },
|
|
8977
|
+
{ name: 'Unauthorized', type: 'error', inputs: [] },
|
|
8978
|
+
] as const
|
|
8979
|
+
|
|
8765
8980
|
// Source: tempoxyz/propAMM@bff7c1fa50cf72e2896a078abae4e164c36caa93
|
|
8766
8981
|
|
|
8767
8982
|
export const directPropAmm = [
|
|
@@ -9709,6 +9924,7 @@ export const earn = [
|
|
|
9709
9924
|
] as const
|
|
9710
9925
|
|
|
9711
9926
|
export const zone = [
|
|
9927
|
+
...zoneInbox,
|
|
9712
9928
|
...zoneMessenger,
|
|
9713
9929
|
...zoneOutbox,
|
|
9714
9930
|
...zonePortalPreT13Retired,
|
package/src/tempo/Account.ts
CHANGED
|
@@ -15,15 +15,15 @@ import {
|
|
|
15
15
|
WebCryptoP256,
|
|
16
16
|
} from 'ox'
|
|
17
17
|
import {
|
|
18
|
+
AccountConfig,
|
|
18
19
|
Channel,
|
|
19
20
|
KeyAuthorization,
|
|
20
|
-
MultisigConfig,
|
|
21
21
|
SignatureEnvelope,
|
|
22
22
|
TxEnvelopeTempo,
|
|
23
23
|
} from 'ox/tempo'
|
|
24
24
|
|
|
25
25
|
import { nativeMultisigFactory } from './Addresses.js'
|
|
26
|
-
import { parseApproval } from './
|
|
26
|
+
import { parseApproval } from './accounts/Signature.js'
|
|
27
27
|
|
|
28
28
|
import * as viem_Account from '../core/Account.js'
|
|
29
29
|
import type { OneOf, RequiredBy } from '../core/internal/types.js'
|
|
@@ -80,7 +80,9 @@ export type AccessKeyAccount = Base<'accessKey'> & {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/** A Tempo account. */
|
|
83
|
-
export type Account = OneOf<
|
|
83
|
+
export type Account = OneOf<
|
|
84
|
+
RootAccount | AccessKeyAccount | ConfigurableAccount
|
|
85
|
+
>
|
|
84
86
|
|
|
85
87
|
/**
|
|
86
88
|
* Instantiates an Account from a sign function and public key.
|
|
@@ -274,7 +276,7 @@ export declare namespace fromSecp256k1 {
|
|
|
274
276
|
}
|
|
275
277
|
|
|
276
278
|
/**
|
|
277
|
-
* Instantiates an Account for a
|
|
279
|
+
* Instantiates an Account for a configurable account (TIP-1107) config.
|
|
278
280
|
*
|
|
279
281
|
* The returned account does not hold a key itself. Omit `address` or set it to
|
|
280
282
|
* `infer` to derive an account address from its initial config. For a current
|
|
@@ -287,39 +289,39 @@ export declare namespace fromSecp256k1 {
|
|
|
287
289
|
* Configs containing only owner addresses require external approvals through
|
|
288
290
|
* `signatures`.
|
|
289
291
|
*
|
|
290
|
-
* Normalizes supplied config fields with `
|
|
292
|
+
* Normalizes supplied config fields with `AccountConfig.from`, so callers do
|
|
291
293
|
* not need to normalize owner ordering themselves.
|
|
292
294
|
*
|
|
293
295
|
* @example
|
|
294
296
|
* ```ts
|
|
295
297
|
* import { Account } from 'viem/tempo'
|
|
296
298
|
*
|
|
297
|
-
* const account = Account.
|
|
299
|
+
* const account = Account.fromConfig({
|
|
298
300
|
* address: 'infer',
|
|
299
301
|
* owners: [owner_1, owner_2],
|
|
300
302
|
* threshold: 2,
|
|
301
303
|
* })
|
|
302
304
|
*
|
|
303
|
-
* // The
|
|
305
|
+
* // The account config is inferred from the account.
|
|
304
306
|
* const { request } = await client.transaction.prepare({ account, ...rest })
|
|
305
307
|
*
|
|
306
308
|
* const transaction = await client.transaction.sign(request)
|
|
307
309
|
* ```
|
|
308
310
|
*
|
|
309
|
-
* @param value Initial config, current config, or
|
|
310
|
-
* @returns
|
|
311
|
+
* @param value Initial config, current config, or account address.
|
|
312
|
+
* @returns Configurable account.
|
|
311
313
|
*/
|
|
312
|
-
export function
|
|
313
|
-
value:
|
|
314
|
-
):
|
|
315
|
-
export function
|
|
316
|
-
value:
|
|
317
|
-
):
|
|
318
|
-
export function
|
|
314
|
+
export function fromConfig(
|
|
315
|
+
value: fromConfig.InitialConfig,
|
|
316
|
+
): ConfigurableAccount<AccountConfig.Config>
|
|
317
|
+
export function fromConfig(
|
|
318
|
+
value: fromConfig.CurrentConfig,
|
|
319
|
+
): ConfigurableAccount<AccountConfig.Config>
|
|
320
|
+
export function fromConfig(
|
|
319
321
|
address: Address.Address,
|
|
320
|
-
):
|
|
321
|
-
export function
|
|
322
|
-
export function
|
|
322
|
+
): ConfigurableAccount<undefined>
|
|
323
|
+
export function fromConfig(value: fromConfig.Parameters): ConfigurableAccount
|
|
324
|
+
export function fromConfig(value: fromConfig.Parameters): ConfigurableAccount {
|
|
323
325
|
const configInput = (() => {
|
|
324
326
|
if (typeof value === 'string') return undefined
|
|
325
327
|
const { address: _, ...config } = value
|
|
@@ -332,7 +334,7 @@ export function fromMultisig(value: fromMultisig.Parameters): MultisigAccount {
|
|
|
332
334
|
? { owner: value, weight: 1 }
|
|
333
335
|
: value,
|
|
334
336
|
)
|
|
335
|
-
return
|
|
337
|
+
return AccountConfig.from({
|
|
336
338
|
...configInput,
|
|
337
339
|
owners: ownerEntries.map(({ owner, weight }) => ({
|
|
338
340
|
owner: typeof owner === 'string' ? owner : owner.address,
|
|
@@ -346,19 +348,19 @@ export function fromMultisig(value: fromMultisig.Parameters): MultisigAccount {
|
|
|
346
348
|
(value.address === undefined || value.address === 'infer') &&
|
|
347
349
|
config!.version !== 0n
|
|
348
350
|
)
|
|
349
|
-
throw new Error('An initial
|
|
351
|
+
throw new Error('An initial account config must have version zero.')
|
|
350
352
|
if (
|
|
351
353
|
value.address !== undefined &&
|
|
352
354
|
value.address !== 'infer' &&
|
|
353
355
|
config!.version === 0n
|
|
354
356
|
)
|
|
355
|
-
throw new Error('A current
|
|
357
|
+
throw new Error('A current account config must have a version.')
|
|
356
358
|
}
|
|
357
359
|
const address = Address.checksum(
|
|
358
360
|
(() => {
|
|
359
361
|
if (typeof value === 'string') return value
|
|
360
362
|
if (value.address === undefined || value.address === 'infer')
|
|
361
|
-
return
|
|
363
|
+
return AccountConfig.getAddress(config!, {
|
|
362
364
|
factory: nativeMultisigFactory,
|
|
363
365
|
})
|
|
364
366
|
return value.address
|
|
@@ -374,10 +376,12 @@ export function fromMultisig(value: fromMultisig.Parameters): MultisigAccount {
|
|
|
374
376
|
})()
|
|
375
377
|
if (
|
|
376
378
|
ownerAccounts.some(
|
|
377
|
-
(owner) =>
|
|
379
|
+
(owner) => isConfigurableAccount(owner) || isAccessKeyAccount(owner),
|
|
378
380
|
)
|
|
379
381
|
)
|
|
380
|
-
throw new Error(
|
|
382
|
+
throw new Error(
|
|
383
|
+
'Configurable account owners must use primitive signatures.',
|
|
384
|
+
)
|
|
381
385
|
const owners =
|
|
382
386
|
config?.owners.flatMap(({ owner }) => {
|
|
383
387
|
const account = ownerAccounts.find((account) =>
|
|
@@ -386,21 +390,23 @@ export function fromMultisig(value: fromMultisig.Parameters): MultisigAccount {
|
|
|
386
390
|
return account ? [account] : []
|
|
387
391
|
}) ?? []
|
|
388
392
|
|
|
389
|
-
const account:
|
|
393
|
+
const account: ConfigurableAccount = {
|
|
390
394
|
address,
|
|
391
395
|
config,
|
|
392
396
|
owners,
|
|
393
397
|
publicKey: '0x',
|
|
394
|
-
source: '
|
|
395
|
-
keyType: '
|
|
398
|
+
source: 'configurable',
|
|
399
|
+
keyType: 'configurable',
|
|
396
400
|
type: 'local',
|
|
397
401
|
async sign({ hash }) {
|
|
398
402
|
return SignatureEnvelope.serialize(
|
|
399
|
-
await
|
|
403
|
+
await signConfigurable(account, { payload: hash }),
|
|
400
404
|
)
|
|
401
405
|
},
|
|
402
406
|
async signMessage() {
|
|
403
|
-
throw new Error(
|
|
407
|
+
throw new Error(
|
|
408
|
+
'`signMessage` is not supported for configurable accounts.',
|
|
409
|
+
)
|
|
404
410
|
},
|
|
405
411
|
async signTransaction(envelope_, options) {
|
|
406
412
|
const request = envelope_ as unknown as Envelope
|
|
@@ -432,11 +438,11 @@ export function fromMultisig(value: fromMultisig.Parameters): MultisigAccount {
|
|
|
432
438
|
const owner = request.owner
|
|
433
439
|
if (owner.type !== 'local')
|
|
434
440
|
throw new Error(
|
|
435
|
-
'A local owner account is required to approve a
|
|
441
|
+
'A local owner account is required to approve a configurable account transaction.',
|
|
436
442
|
)
|
|
437
443
|
if (owner.source !== 'root')
|
|
438
444
|
throw new Error(
|
|
439
|
-
'A Tempo owner account is required to approve a
|
|
445
|
+
'A Tempo owner account is required to approve a configurable account transaction.',
|
|
440
446
|
)
|
|
441
447
|
const { owner: _, ...ownerRequest } = request
|
|
442
448
|
const approval = await owner.signTransaction(
|
|
@@ -453,13 +459,13 @@ export function fromMultisig(value: fromMultisig.Parameters): MultisigAccount {
|
|
|
453
459
|
}
|
|
454
460
|
if (owners.length === 0) return serializeTransaction(request)
|
|
455
461
|
const payload = TxEnvelopeTempo.getSignPayload(request)
|
|
456
|
-
const simulation = request.
|
|
462
|
+
const simulation = request.accountSimulation
|
|
457
463
|
if (request.from && !Address.isEqual(request.from, address))
|
|
458
464
|
throw new Error(
|
|
459
|
-
'
|
|
465
|
+
'Configurable account does not match the transaction sender.',
|
|
460
466
|
)
|
|
461
467
|
|
|
462
|
-
const signature = await
|
|
468
|
+
const signature = await signConfigurable(account, {
|
|
463
469
|
config: simulation?.config,
|
|
464
470
|
payload,
|
|
465
471
|
signatures: request.signatures?.map((signature) =>
|
|
@@ -469,90 +475,92 @@ export function fromMultisig(value: fromMultisig.Parameters): MultisigAccount {
|
|
|
469
475
|
return serializeTransaction(request, { signature })
|
|
470
476
|
},
|
|
471
477
|
async signTypedData() {
|
|
472
|
-
throw new Error(
|
|
478
|
+
throw new Error(
|
|
479
|
+
'`signTypedData` is not supported for configurable accounts.',
|
|
480
|
+
)
|
|
473
481
|
},
|
|
474
482
|
}
|
|
475
483
|
return account
|
|
476
484
|
}
|
|
477
485
|
|
|
478
|
-
export declare namespace
|
|
479
|
-
/** Initial version-zero
|
|
486
|
+
export declare namespace fromConfig {
|
|
487
|
+
/** Initial version-zero account config. */
|
|
480
488
|
export type Config = InitialConfig
|
|
481
489
|
|
|
482
|
-
/** Stable
|
|
490
|
+
/** Stable configurable account address and its current config. */
|
|
483
491
|
export type CurrentConfig = {
|
|
484
|
-
/** Stable
|
|
492
|
+
/** Stable configurable account address. */
|
|
485
493
|
address: Address.Address
|
|
486
494
|
/** Weighted owners. */
|
|
487
495
|
owners: readonly Owner[]
|
|
488
496
|
/** Caller-chosen 32-byte salt. */
|
|
489
|
-
salt:
|
|
497
|
+
salt: AccountConfig.Config['salt']
|
|
490
498
|
/** Minimum total owner weight required for authorization. */
|
|
491
|
-
threshold:
|
|
499
|
+
threshold: AccountConfig.Config['threshold']
|
|
492
500
|
/** Current configuration version. */
|
|
493
|
-
version:
|
|
501
|
+
version: AccountConfig.Config<bigint | number>['version']
|
|
494
502
|
}
|
|
495
503
|
|
|
496
|
-
/** Initial version-zero
|
|
504
|
+
/** Initial version-zero account config. */
|
|
497
505
|
export type InitialConfig = {
|
|
498
506
|
/** Derives the stable account address from this initial config. */
|
|
499
507
|
address?: 'infer' | undefined
|
|
500
508
|
/** Weighted owners. */
|
|
501
509
|
owners: readonly Owner[]
|
|
502
510
|
/** Caller-chosen 32-byte salt. */
|
|
503
|
-
salt?:
|
|
511
|
+
salt?: AccountConfig.Input['salt'] | undefined
|
|
504
512
|
/** Minimum owner weight required for authorization. */
|
|
505
513
|
threshold?: number | undefined
|
|
506
514
|
/** Initial configuration version. */
|
|
507
515
|
version?: 0 | 0n | undefined
|
|
508
516
|
}
|
|
509
517
|
|
|
510
|
-
/**
|
|
518
|
+
/** Configurable account owner account or address, optionally with an explicit weight. */
|
|
511
519
|
export type Owner =
|
|
512
520
|
| Address.Address
|
|
513
521
|
| (viem_Account.Local & { accessKeyAddress?: never; owners?: never })
|
|
514
|
-
| (Omit<
|
|
522
|
+
| (Omit<AccountConfig.Owner, 'owner'> & {
|
|
515
523
|
owner:
|
|
516
524
|
| Address.Address
|
|
517
525
|
| (viem_Account.Local & { accessKeyAddress?: never; owners?: never })
|
|
518
526
|
})
|
|
519
527
|
|
|
520
|
-
/** Parameters for {@link
|
|
528
|
+
/** Parameters for {@link fromConfig}. */
|
|
521
529
|
export type Parameters = Address.Address | CurrentConfig | InitialConfig
|
|
522
530
|
}
|
|
523
531
|
|
|
524
|
-
export type
|
|
525
|
-
config extends
|
|
526
|
-
|
|
|
532
|
+
export type ConfigurableAccount<
|
|
533
|
+
config extends AccountConfig.Config | undefined =
|
|
534
|
+
| AccountConfig.Config
|
|
527
535
|
| undefined,
|
|
528
|
-
> = viem_Account.Local<'
|
|
536
|
+
> = viem_Account.Local<'configurable'> & {
|
|
529
537
|
/** Account source. */
|
|
530
|
-
source: '
|
|
538
|
+
source: 'configurable'
|
|
531
539
|
/** Normalized config, or `undefined` for an address-only account. */
|
|
532
540
|
config: config
|
|
533
541
|
/** @internal Local owner accounts available for signing. */
|
|
534
542
|
owners: readonly (viem_Account.Local & { source?: string | undefined })[]
|
|
535
543
|
}
|
|
536
544
|
|
|
537
|
-
function
|
|
545
|
+
function isConfigurableAccount(
|
|
538
546
|
account: viem_Account.Local,
|
|
539
|
-
): account is
|
|
540
|
-
return 'source' in account && account.source === '
|
|
547
|
+
): account is ConfigurableAccount {
|
|
548
|
+
return 'source' in account && account.source === 'configurable'
|
|
541
549
|
}
|
|
542
550
|
|
|
543
|
-
async function
|
|
544
|
-
account:
|
|
551
|
+
async function signConfigurable(
|
|
552
|
+
account: ConfigurableAccount,
|
|
545
553
|
parameters: {
|
|
546
|
-
config?:
|
|
554
|
+
config?: AccountConfig.Config | undefined
|
|
547
555
|
payload: Hex.Hex
|
|
548
556
|
signatures?: readonly SignatureEnvelope.Primitive[] | undefined
|
|
549
557
|
},
|
|
550
|
-
): Promise<SignatureEnvelope.
|
|
558
|
+
): Promise<SignatureEnvelope.Configurable> {
|
|
551
559
|
const { config, payload, signatures: providedSignatures = [] } = parameters
|
|
552
560
|
const currentConfig = config ?? account.config
|
|
553
561
|
if (!currentConfig)
|
|
554
|
-
throw new Error('A current
|
|
555
|
-
const digest =
|
|
562
|
+
throw new Error('A current account config is required for local signing.')
|
|
563
|
+
const digest = AccountConfig.getSignPayload({
|
|
556
564
|
account: account.address,
|
|
557
565
|
config: currentConfig,
|
|
558
566
|
payload,
|
|
@@ -589,7 +597,7 @@ async function signMultisig(
|
|
|
589
597
|
if (!ownerAccount) continue
|
|
590
598
|
|
|
591
599
|
if (!ownerAccount.sign)
|
|
592
|
-
throw new Error('
|
|
600
|
+
throw new Error('Configurable account owner account cannot sign.')
|
|
593
601
|
signatures.push(parseApproval(await ownerAccount.sign({ hash: digest })))
|
|
594
602
|
|
|
595
603
|
signedOwners.add(address)
|
|
@@ -598,18 +606,18 @@ async function signMultisig(
|
|
|
598
606
|
}
|
|
599
607
|
|
|
600
608
|
if (weight < Number(currentConfig.threshold))
|
|
601
|
-
throw new Error('Local
|
|
609
|
+
throw new Error('Local owners do not meet the threshold.')
|
|
602
610
|
|
|
603
611
|
return SignatureEnvelope.from({
|
|
604
612
|
account: account.address,
|
|
605
613
|
config: currentConfig,
|
|
606
|
-
signatures: SignatureEnvelope.
|
|
614
|
+
signatures: SignatureEnvelope.sortApprovals({
|
|
607
615
|
account: account.address,
|
|
608
616
|
config: currentConfig,
|
|
609
617
|
payload,
|
|
610
618
|
signatures,
|
|
611
619
|
}),
|
|
612
|
-
}) as SignatureEnvelope.
|
|
620
|
+
}) as SignatureEnvelope.Configurable
|
|
613
621
|
}
|
|
614
622
|
|
|
615
623
|
/**
|
|
@@ -819,7 +827,7 @@ export function getKeyAuthorizationSignPayload(
|
|
|
819
827
|
const { admin, chainId, expiry, key, limits, scopes, witness } = parameters
|
|
820
828
|
const { accessKeyAddress, keyType: type } = resolveAccessKey(key)
|
|
821
829
|
const boundFields =
|
|
822
|
-
isAccessKeyAccount(account) ||
|
|
830
|
+
isAccessKeyAccount(account) || isConfigurableAccount(account)
|
|
823
831
|
? { account: account.address }
|
|
824
832
|
: {}
|
|
825
833
|
const restrictions = admin ? {} : { expiry, limits, scopes }
|
|
@@ -844,7 +852,7 @@ export async function signKeyAuthorization(
|
|
|
844
852
|
expiry,
|
|
845
853
|
key,
|
|
846
854
|
limits,
|
|
847
|
-
|
|
855
|
+
configurable: configurableState,
|
|
848
856
|
scopes,
|
|
849
857
|
signatures,
|
|
850
858
|
witness,
|
|
@@ -856,9 +864,9 @@ export async function signKeyAuthorization(
|
|
|
856
864
|
// on behalf of, so the signed payload cannot be replayed against another
|
|
857
865
|
// account. [TIP-1049]
|
|
858
866
|
const isAccessKey = isAccessKeyAccount(account)
|
|
859
|
-
const
|
|
867
|
+
const isConfigurable = isConfigurableAccount(account)
|
|
860
868
|
const boundFields =
|
|
861
|
-
isAccessKey ||
|
|
869
|
+
isAccessKey || isConfigurable ? { account: account.address } : {}
|
|
862
870
|
|
|
863
871
|
// Admin key authorizations are unrestricted and must not carry expiry,
|
|
864
872
|
// limits, or call scopes (the protocol rejects them). [TIP-1049]
|
|
@@ -867,14 +875,14 @@ export async function signKeyAuthorization(
|
|
|
867
875
|
const hash = getKeyAuthorizationSignPayload(account, parameters)
|
|
868
876
|
const signature = await (async () => {
|
|
869
877
|
if (isAccessKey) return account.sign({ hash, raw: true })
|
|
870
|
-
if (
|
|
871
|
-
if (!
|
|
878
|
+
if (isConfigurable) {
|
|
879
|
+
if (!configurableState)
|
|
872
880
|
throw new Error(
|
|
873
|
-
'
|
|
881
|
+
'Configurable account state is required to sign a key authorization.',
|
|
874
882
|
)
|
|
875
883
|
return SignatureEnvelope.serialize(
|
|
876
|
-
await
|
|
877
|
-
config:
|
|
884
|
+
await signConfigurable(account, {
|
|
885
|
+
config: configurableState.config,
|
|
878
886
|
payload: hash,
|
|
879
887
|
signatures: signatures?.map((signature) => parseApproval(signature)),
|
|
880
888
|
}),
|
|
@@ -909,13 +917,13 @@ export declare namespace signKeyAuthorization {
|
|
|
909
917
|
chainId: number | bigint
|
|
910
918
|
admin?: boolean | undefined
|
|
911
919
|
key: resolveAccessKey.Parameters
|
|
912
|
-
/** @internal Current state used when a
|
|
913
|
-
|
|
920
|
+
/** @internal Current state used when a configurable account signs the authorization. */
|
|
921
|
+
configurable?:
|
|
914
922
|
| {
|
|
915
|
-
config:
|
|
923
|
+
config: AccountConfig.Config
|
|
916
924
|
}
|
|
917
925
|
| undefined
|
|
918
|
-
/** Serialized approvals from external
|
|
926
|
+
/** Serialized approvals from external owners. */
|
|
919
927
|
signatures?: readonly SignatureEnvelope.Serialized[] | undefined
|
|
920
928
|
}
|
|
921
929
|
|
|
@@ -1025,12 +1033,12 @@ function fromBase(parameters: fromBase.Parameters): Base {
|
|
|
1025
1033
|
async signTransaction(envelope_, options) {
|
|
1026
1034
|
const chain = options?.chain
|
|
1027
1035
|
// The envelope originates from the tempo chain's `toEnvelope` (or is a
|
|
1028
|
-
// Tempo envelope directly); `feePayer` and `
|
|
1036
|
+
// Tempo envelope directly); `feePayer` and `accountSimulation` ride it as
|
|
1029
1037
|
// request metadata.
|
|
1030
1038
|
const envelope =
|
|
1031
1039
|
envelope_ as unknown as TxEnvelopeTempo.TxEnvelopeTempo & {
|
|
1032
1040
|
feePayer?: Envelope['feePayer'] | undefined
|
|
1033
|
-
|
|
1041
|
+
accountSimulation?: Envelope['accountSimulation'] | undefined
|
|
1034
1042
|
}
|
|
1035
1043
|
|
|
1036
1044
|
// Non-tempo envelopes take the generic path (secp256k1 signatures
|
|
@@ -1060,17 +1068,19 @@ function fromBase(parameters: fromBase.Parameters): Base {
|
|
|
1060
1068
|
const payload =
|
|
1061
1069
|
getSignPayload?.(envelope) ?? TxEnvelopeTempo.getSignPayload(envelope)
|
|
1062
1070
|
|
|
1063
|
-
//
|
|
1064
|
-
// primitive signature over the
|
|
1071
|
+
// Configurable account (TIP-1107): return this owner's approval — a
|
|
1072
|
+
// primitive signature over the owner approval digest — instead
|
|
1065
1073
|
// of a full serialized transaction. Approvals are combined later via
|
|
1066
1074
|
// `signatures`.
|
|
1067
|
-
if (envelope.
|
|
1075
|
+
if (envelope.accountSimulation) {
|
|
1068
1076
|
if (!envelope.from)
|
|
1069
|
-
throw new Error(
|
|
1070
|
-
|
|
1077
|
+
throw new Error(
|
|
1078
|
+
'A configurable account sender is required for signing.',
|
|
1079
|
+
)
|
|
1080
|
+
const digest = AccountConfig.getSignPayload({
|
|
1071
1081
|
payload,
|
|
1072
1082
|
account: envelope.from,
|
|
1073
|
-
config:
|
|
1083
|
+
config: AccountConfig.from(envelope.accountSimulation.config),
|
|
1074
1084
|
})
|
|
1075
1085
|
return await sign({ hash: digest, raw: true })
|
|
1076
1086
|
}
|