ox 0.14.54 → 0.14.56
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 +35 -0
- package/_cjs/tempo/{MultisigConfig.js → AccountConfig.js} +16 -4
- package/_cjs/tempo/AccountConfig.js.map +1 -0
- package/_cjs/tempo/{MultisigOperation.js → AccountOperation.js} +29 -29
- package/_cjs/tempo/AccountOperation.js.map +1 -0
- package/_cjs/tempo/{MultisigSimulation.js → AccountSimulation.js} +9 -9
- package/_cjs/tempo/AccountSimulation.js.map +1 -0
- package/_cjs/tempo/KeyAuthorization.js +12 -11
- package/_cjs/tempo/KeyAuthorization.js.map +1 -1
- package/_cjs/tempo/SignatureEnvelope.js +64 -64
- package/_cjs/tempo/SignatureEnvelope.js.map +1 -1
- package/_cjs/tempo/Transaction.js +2 -0
- package/_cjs/tempo/Transaction.js.map +1 -1
- package/_cjs/tempo/TransactionRequest.js +12 -9
- package/_cjs/tempo/TransactionRequest.js.map +1 -1
- package/_cjs/tempo/index.js +4 -4
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/tempo/{MultisigConfig.js → AccountConfig.js} +103 -55
- package/_esm/tempo/AccountConfig.js.map +1 -0
- package/_esm/tempo/{MultisigOperation.js → AccountOperation.js} +64 -64
- package/_esm/tempo/AccountOperation.js.map +1 -0
- package/_esm/tempo/{MultisigSimulation.js → AccountSimulation.js} +20 -20
- package/_esm/tempo/AccountSimulation.js.map +1 -0
- package/_esm/tempo/KeyAuthorization.js +13 -12
- package/_esm/tempo/KeyAuthorization.js.map +1 -1
- package/_esm/tempo/SignatureEnvelope.js +71 -71
- package/_esm/tempo/SignatureEnvelope.js.map +1 -1
- package/_esm/tempo/Transaction.js +2 -0
- package/_esm/tempo/Transaction.js.map +1 -1
- package/_esm/tempo/TransactionRequest.js +12 -9
- package/_esm/tempo/TransactionRequest.js.map +1 -1
- package/_esm/tempo/index.js +50 -48
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/tempo/{MultisigConfig.d.ts → AccountConfig.d.ts} +110 -63
- package/_types/tempo/AccountConfig.d.ts.map +1 -0
- package/_types/tempo/{MultisigOperation.d.ts → AccountOperation.d.ts} +62 -62
- package/_types/tempo/AccountOperation.d.ts.map +1 -0
- package/_types/tempo/{MultisigSimulation.d.ts → AccountSimulation.d.ts} +21 -21
- package/_types/tempo/AccountSimulation.d.ts.map +1 -0
- package/_types/tempo/KeyAuthorization.d.ts +14 -14
- package/_types/tempo/KeyAuthorization.d.ts.map +1 -1
- package/_types/tempo/RpcSchemaTempo.d.ts +13 -13
- package/_types/tempo/RpcSchemaTempo.d.ts.map +1 -1
- package/_types/tempo/SignatureEnvelope.d.ts +36 -33
- package/_types/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/_types/tempo/Transaction.d.ts.map +1 -1
- package/_types/tempo/TransactionRequest.d.ts +11 -9
- package/_types/tempo/TransactionRequest.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +50 -48
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/package.json +31 -31
- package/tempo/AccountConfig/package.json +6 -0
- package/tempo/AccountConfig.test-d/package.json +6 -0
- package/tempo/{MultisigConfig.test-d.ts → AccountConfig.test-d.ts} +22 -12
- package/tempo/{MultisigConfig.test.ts → AccountConfig.test.ts} +155 -37
- package/tempo/{MultisigConfig.ts → AccountConfig.ts} +132 -66
- package/tempo/AccountOperation/package.json +6 -0
- package/tempo/AccountOperation.test-d/package.json +6 -0
- package/tempo/AccountOperation.test-d.ts +71 -0
- package/tempo/{MultisigOperation.test.ts → AccountOperation.test.ts} +97 -97
- package/tempo/{MultisigOperation.ts → AccountOperation.ts} +95 -97
- package/tempo/AccountSimulation/package.json +6 -0
- package/tempo/AccountSimulation.test-d/package.json +6 -0
- package/tempo/{MultisigSimulation.test-d.ts → AccountSimulation.test-d.ts} +7 -9
- package/tempo/{MultisigSimulation.test.ts → AccountSimulation.test.ts} +29 -29
- package/tempo/{MultisigSimulation.ts → AccountSimulation.ts} +28 -30
- package/tempo/KeyAuthorization.test-d.ts +14 -14
- package/tempo/KeyAuthorization.test.ts +70 -49
- package/tempo/KeyAuthorization.ts +29 -27
- package/tempo/RpcSchemaTempo.test-d.ts +19 -19
- package/tempo/RpcSchemaTempo.ts +13 -13
- package/tempo/SignatureEnvelope.test-d.ts +7 -7
- package/tempo/SignatureEnvelope.test.ts +34 -34
- package/tempo/SignatureEnvelope.ts +107 -103
- package/tempo/Transaction.test.ts +40 -4
- package/tempo/Transaction.ts +2 -0
- package/tempo/TransactionRequest.test-d.ts +16 -7
- package/tempo/TransactionRequest.test.ts +25 -17
- package/tempo/TransactionRequest.ts +25 -18
- package/tempo/{multisig.e2e.test.ts → configurableAccounts.e2e.test.ts} +16 -16
- package/tempo/index.ts +50 -48
- package/version.ts +1 -1
- package/_cjs/tempo/MultisigConfig.js.map +0 -1
- package/_cjs/tempo/MultisigOperation.js.map +0 -1
- package/_cjs/tempo/MultisigSimulation.js.map +0 -1
- package/_esm/tempo/MultisigConfig.js.map +0 -1
- package/_esm/tempo/MultisigOperation.js.map +0 -1
- package/_esm/tempo/MultisigSimulation.js.map +0 -1
- package/_types/tempo/MultisigConfig.d.ts.map +0 -1
- package/_types/tempo/MultisigOperation.d.ts.map +0 -1
- package/_types/tempo/MultisigSimulation.d.ts.map +0 -1
- package/tempo/MultisigConfig/package.json +0 -6
- package/tempo/MultisigConfig.test-d/package.json +0 -6
- package/tempo/MultisigOperation/package.json +0 -6
- package/tempo/MultisigOperation.test-d/package.json +0 -6
- package/tempo/MultisigOperation.test-d.ts +0 -71
- package/tempo/MultisigSimulation/package.json +0 -6
- package/tempo/MultisigSimulation.test-d/package.json +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionRequest.js","sourceRoot":"","sources":["../../tempo/TransactionRequest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,G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C,OAAO,CAAC,QAAQ,CAAC,CAAA;QACzC,OAAO,SAAS,CAAA;IAClB,CAAC,CAAC,EAAE,CAAA;IACJ,IAAI,QAAQ;QAAE,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAE7C,IACE,OAAO,OAAO,CAAC,iBAAiB,KAAK,WAAW;QAChD,OAAO,OAAO,CAAC,KAAK,KAAK,WAAW;QACpC,OAAO,OAAO,CAAC,QAAQ,KAAK,WAAW;QACvC,OAAO,OAAO,CAAC,QAAQ,KAAK,WAAW;QACvC,OAAO,OAAO,CAAC,gBAAgB,KAAK,WAAW;QAC/C,OAAO,OAAO,CAAC,QAAQ,KAAK,WAAW;QACvC,OAAO,OAAO,CAAC,WAAW,KAAK,WAAW;QAC1C,OAAO,OAAO,CAAC,UAAU,KAAK,WAAW;QACzC,OAAO,CAAC,IAAI,KAAK,OAAO,EACxB,CAAC;QACD,WAAW,CAAC,IAAI,GAAG,WAAW,CAAC,SAAS,CAAC,KAAK,CAAA;QAC9C,OAAO,WAAW,CAAC,IAAI,CAAA;QACvB,OAAO,WAAW,CAAC,KAAK,CAAA;QACxB,OAAO,WAAW,CAAC,EAAE,CAAA;QACrB,OAAO,WAAW,CAAC,KAAK,CAAA;IAC1B,CAAC;IAED,OAAO,WAAW,CAAA;AACpB,CAAC"}
|
package/_esm/tempo/index.js
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configurable account configuration utilities (TIP-1107).
|
|
3
|
+
*
|
|
4
|
+
* Configurable accounts have weighted owners and an approval threshold that
|
|
5
|
+
* can change without changing the account address. Derives the stable account
|
|
6
|
+
* address from the initial configuration, computes configuration commitments,
|
|
7
|
+
* and computes the owner approval digest that owners sign.
|
|
8
|
+
*
|
|
9
|
+
* [TIP-1107](https://tips.sh/1107) · [TIP-1114](https://tips.sh/1114)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts twoslash
|
|
13
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
14
|
+
*
|
|
15
|
+
* const initialConfig = AccountConfig.from({
|
|
16
|
+
* threshold: 2,
|
|
17
|
+
* owners: [
|
|
18
|
+
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
19
|
+
* { owner: '0x2222222222222222222222222222222222222222', weight: 1 },
|
|
20
|
+
* ],
|
|
21
|
+
* })
|
|
22
|
+
*
|
|
23
|
+
* const account = AccountConfig.getAddress(initialConfig, {
|
|
24
|
+
* factory: '0x7171717171717171717171717171717171717171'
|
|
25
|
+
* })
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @category Reference
|
|
29
|
+
*/
|
|
30
|
+
export * as AccountConfig from './AccountConfig.js';
|
|
31
|
+
/**
|
|
32
|
+
* Offchain configurable account transaction and key authorization operation utilities.
|
|
33
|
+
*
|
|
34
|
+
* Derives operation hashes, selects owner approvals, serializes transactions,
|
|
35
|
+
* validates operation state, and converts JSON-RPC representations.
|
|
36
|
+
*
|
|
37
|
+
* @category Reference
|
|
38
|
+
*/
|
|
39
|
+
export * as AccountOperation from './AccountOperation.js';
|
|
40
|
+
/**
|
|
41
|
+
* Configurable account RPC simulation utilities.
|
|
42
|
+
*
|
|
43
|
+
* Converts the owner approvals and configuration modeled during gas estimation
|
|
44
|
+
* between their domain and Tempo JSON-RPC representations.
|
|
45
|
+
*
|
|
46
|
+
* @category Reference
|
|
47
|
+
*/
|
|
48
|
+
export * as AccountSimulation from './AccountSimulation.js';
|
|
1
49
|
/**
|
|
2
50
|
* Utilities for Tempo-flavoured EIP-7702 authorizations.
|
|
3
51
|
*
|
|
@@ -120,52 +168,6 @@ export * as EarnShares from './EarnShares.js';
|
|
|
120
168
|
* @category Reference
|
|
121
169
|
*/
|
|
122
170
|
export * as KeyAuthorization from './KeyAuthorization.js';
|
|
123
|
-
/**
|
|
124
|
-
* Native multisig account utilities (TIP-1061).
|
|
125
|
-
*
|
|
126
|
-
* Derives stable multisig account addresses from a weighted owner
|
|
127
|
-
* configuration, and computes the owner approval digest that owners sign.
|
|
128
|
-
*
|
|
129
|
-
* [TIP-1061](https://tips.sh/1061)
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
* ```ts twoslash
|
|
133
|
-
* import { MultisigConfig } from 'ox/tempo'
|
|
134
|
-
*
|
|
135
|
-
* const initialConfig = MultisigConfig.from({
|
|
136
|
-
* threshold: 2,
|
|
137
|
-
* owners: [
|
|
138
|
-
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
139
|
-
* { owner: '0x2222222222222222222222222222222222222222', weight: 1 },
|
|
140
|
-
* ],
|
|
141
|
-
* })
|
|
142
|
-
*
|
|
143
|
-
* const account = MultisigConfig.getAddress(initialConfig, {
|
|
144
|
-
* factory: '0x7171717171717171717171717171717171717171'
|
|
145
|
-
* })
|
|
146
|
-
* ```
|
|
147
|
-
*
|
|
148
|
-
* @category Reference
|
|
149
|
-
*/
|
|
150
|
-
export * as MultisigConfig from './MultisigConfig.js';
|
|
151
|
-
/**
|
|
152
|
-
* Offchain multisig transaction and key authorization operation utilities.
|
|
153
|
-
*
|
|
154
|
-
* Derives operation hashes, selects owner approvals, serializes transactions,
|
|
155
|
-
* validates operation state, and converts JSON-RPC representations.
|
|
156
|
-
*
|
|
157
|
-
* @category Reference
|
|
158
|
-
*/
|
|
159
|
-
export * as MultisigOperation from './MultisigOperation.js';
|
|
160
|
-
/**
|
|
161
|
-
* Native multisig RPC simulation utilities.
|
|
162
|
-
*
|
|
163
|
-
* Converts complete root and nested owner specs between their domain and Tempo
|
|
164
|
-
* JSON-RPC representations.
|
|
165
|
-
*
|
|
166
|
-
* @category Reference
|
|
167
|
-
*/
|
|
168
|
-
export * as MultisigSimulation from './MultisigSimulation.js';
|
|
169
171
|
/**
|
|
170
172
|
* Utilities for constructing period durations (in seconds) for recurring spending limits.
|
|
171
173
|
*
|
|
@@ -239,7 +241,7 @@ export * as PoolId from './PoolId.js';
|
|
|
239
241
|
*/
|
|
240
242
|
export * as ReceivePolicyReceipt from './ReceivePolicyReceipt.js';
|
|
241
243
|
/**
|
|
242
|
-
* JSON-RPC schemas for the `tempo_` and `
|
|
244
|
+
* JSON-RPC schemas for the `tempo_` and `account_` namespaces.
|
|
243
245
|
*
|
|
244
246
|
* @example
|
|
245
247
|
* ```ts twoslash
|
|
@@ -249,7 +251,7 @@ export * as ReceivePolicyReceipt from './ReceivePolicyReceipt.js';
|
|
|
249
251
|
*
|
|
250
252
|
* const schema = RpcSchema.from<
|
|
251
253
|
* | RpcSchema.Default
|
|
252
|
-
* | RpcSchemaTempo.
|
|
254
|
+
* | RpcSchemaTempo.Account
|
|
253
255
|
* | RpcSchemaTempo.Tempo
|
|
254
256
|
* >()
|
|
255
257
|
*
|
package/_esm/tempo/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tempo/index.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tempo/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AACnD;;;;;;;GAOG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AACzD;;;;;;;GAOG;AACH,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAA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,MAAM,oBAAoB,CAAA;AAEnD;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAA"}
|
package/_esm/version.js
CHANGED
|
@@ -7,20 +7,25 @@ import * as Hex from '../core/Hex.js';
|
|
|
7
7
|
import type { Compute } from '../core/internal/types.js';
|
|
8
8
|
/** Maximum encoded byte length for one primitive owner approval. */
|
|
9
9
|
export declare const maxOwnerSignatureBytes = 2049;
|
|
10
|
-
/** Maximum number of owners allowed in
|
|
10
|
+
/** Maximum number of owners allowed in an account config. */
|
|
11
11
|
export declare const maxOwners = 48;
|
|
12
|
-
/** Maximum number of owner approvals in a
|
|
12
|
+
/** Maximum number of owner approvals in a configurable account signature. */
|
|
13
13
|
export declare const maxSignatures = 8;
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Maximum threshold accepted by an account config.
|
|
16
|
+
*
|
|
17
|
+
* The threshold must also be reachable by at most {@link ox#AccountConfig.maxSignatures}
|
|
18
|
+
* owner approvals.
|
|
19
|
+
*/
|
|
20
|
+
export declare const maxThreshold = 255;
|
|
21
|
+
/** Maximum version accepted by an account config. */
|
|
17
22
|
export declare const maxVersion: bigint;
|
|
18
|
-
/** Tempo signature type byte for
|
|
23
|
+
/** Tempo signature type byte for configurable account signatures. */
|
|
19
24
|
export declare const signatureTypeByte: "0x05";
|
|
20
25
|
/** Zero 32-byte salt (the default when no salt is provided). */
|
|
21
26
|
export declare const zeroSalt: `0x${string}`;
|
|
22
27
|
/**
|
|
23
|
-
* Complete
|
|
28
|
+
* Complete account configuration witness.
|
|
24
29
|
*/
|
|
25
30
|
export type Config<bigintType = bigint, numberType = number> = Compute<{
|
|
26
31
|
/** Weighted owner list, strictly ascending by owner address. */
|
|
@@ -32,13 +37,13 @@ export type Config<bigintType = bigint, numberType = number> = Compute<{
|
|
|
32
37
|
/** Configuration version. Zero identifies the initial configuration. */
|
|
33
38
|
version: bigintType;
|
|
34
39
|
}>;
|
|
35
|
-
/** Input accepted when constructing
|
|
40
|
+
/** Input accepted when constructing an account configuration. */
|
|
36
41
|
export type Input<versionType extends bigint | number = bigint | number, numberType = number> = Compute<{
|
|
37
42
|
/** Weighted owner list (strictly ascending by `owner` address). */
|
|
38
43
|
owners: readonly Owner<numberType>[];
|
|
39
44
|
/**
|
|
40
45
|
* Caller-chosen 32-byte salt mixed into the derived account address.
|
|
41
|
-
* Defaults to the zero salt (`
|
|
46
|
+
* Defaults to the zero salt (`AccountConfig.zeroSalt`) when omitted.
|
|
42
47
|
*/
|
|
43
48
|
salt?: Hex.Hex | undefined;
|
|
44
49
|
/** Minimum total owner weight required to authorize a transaction. */
|
|
@@ -46,16 +51,16 @@ export type Input<versionType extends bigint | number = bigint | number, numberT
|
|
|
46
51
|
/** Configuration version as a safe integer or bigint. Defaults to `0n`. */
|
|
47
52
|
version?: versionType | undefined;
|
|
48
53
|
}>;
|
|
49
|
-
/**
|
|
54
|
+
/** Account config owner entry. */
|
|
50
55
|
export type Owner<numberType = number> = {
|
|
51
56
|
/** Owner address (recovered from the owner's approval). */
|
|
52
57
|
owner: Address.Address;
|
|
53
58
|
/** Nonzero owner weight. */
|
|
54
59
|
weight: numberType;
|
|
55
60
|
};
|
|
56
|
-
/** JSON-RPC representation of
|
|
61
|
+
/** JSON-RPC representation of an account configuration. */
|
|
57
62
|
export type Rpc = Config<Hex.Hex, number>;
|
|
58
|
-
/** RLP tuple representation of a {@link ox#
|
|
63
|
+
/** RLP tuple representation of a {@link ox#AccountConfig.Config}. */
|
|
59
64
|
export type Tuple = readonly [
|
|
60
65
|
salt: Hex.Hex,
|
|
61
66
|
version: Hex.Hex,
|
|
@@ -63,7 +68,7 @@ export type Tuple = readonly [
|
|
|
63
68
|
owners: readonly Hex.Hex[][]
|
|
64
69
|
];
|
|
65
70
|
/**
|
|
66
|
-
* Asserts that
|
|
71
|
+
* Asserts that an {@link ox#AccountConfig.Config} is valid.
|
|
67
72
|
*
|
|
68
73
|
* Mirrors the Tempo configuration rules: owners non-empty and
|
|
69
74
|
* `<= maxOwners`, strictly ascending unique nonzero owner addresses, nonzero
|
|
@@ -73,9 +78,9 @@ export type Tuple = readonly [
|
|
|
73
78
|
*
|
|
74
79
|
* @example
|
|
75
80
|
* ```ts twoslash
|
|
76
|
-
* import {
|
|
81
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
77
82
|
*
|
|
78
|
-
*
|
|
83
|
+
* AccountConfig.assert({
|
|
79
84
|
* threshold: 1,
|
|
80
85
|
* owners: [
|
|
81
86
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
@@ -83,23 +88,23 @@ export type Tuple = readonly [
|
|
|
83
88
|
* })
|
|
84
89
|
* ```
|
|
85
90
|
*
|
|
86
|
-
* @param config - The
|
|
91
|
+
* @param config - The account config.
|
|
87
92
|
*/
|
|
88
93
|
export declare function assert<versionType extends bigint | number = bigint | number, numberType = number>(config: Input<versionType, numberType>): void;
|
|
89
94
|
export declare namespace assert {
|
|
90
95
|
type ErrorType = InvalidConfigError | Errors.GlobalErrorType;
|
|
91
96
|
}
|
|
92
97
|
/**
|
|
93
|
-
* Normalizes
|
|
98
|
+
* Normalizes an {@link ox#AccountConfig.Config}.
|
|
94
99
|
*
|
|
95
100
|
* Sorts owners into strictly ascending `owner` address order (the canonical
|
|
96
101
|
* form required for account derivation) and asserts the config is valid.
|
|
97
102
|
*
|
|
98
103
|
* @example
|
|
99
104
|
* ```ts twoslash
|
|
100
|
-
* import {
|
|
105
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
101
106
|
*
|
|
102
|
-
* const config =
|
|
107
|
+
* const config = AccountConfig.from({
|
|
103
108
|
* owners: [
|
|
104
109
|
* { owner: '0x2222222222222222222222222222222222222222', weight: 1 },
|
|
105
110
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
@@ -109,8 +114,8 @@ export declare namespace assert {
|
|
|
109
114
|
* // owners are now sorted ascending by address
|
|
110
115
|
* ```
|
|
111
116
|
*
|
|
112
|
-
* @param config - The
|
|
113
|
-
* @returns The normalized
|
|
117
|
+
* @param config - The account config.
|
|
118
|
+
* @returns The normalized account config.
|
|
114
119
|
*/
|
|
115
120
|
export declare function from<numberType = number>(config: Input<0 | 0n, numberType> & {
|
|
116
121
|
version?: 0 | 0n | undefined;
|
|
@@ -123,13 +128,13 @@ export declare function from<numberType = number>(config: Input<number, numberTy
|
|
|
123
128
|
}): Config<bigint, numberType>;
|
|
124
129
|
export declare function from<numberType = number>(config: Input<bigint | number, numberType>): Config<bigint, numberType>;
|
|
125
130
|
/**
|
|
126
|
-
* Converts a JSON-RPC
|
|
131
|
+
* Converts a JSON-RPC account configuration to its domain representation.
|
|
127
132
|
*
|
|
128
133
|
* @example
|
|
129
134
|
* ```ts twoslash
|
|
130
|
-
* import {
|
|
135
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
131
136
|
*
|
|
132
|
-
* const config =
|
|
137
|
+
* const config = AccountConfig.fromRpc({
|
|
133
138
|
* owners: [
|
|
134
139
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
135
140
|
* ],
|
|
@@ -139,22 +144,22 @@ export declare function from<numberType = number>(config: Input<bigint | number,
|
|
|
139
144
|
* })
|
|
140
145
|
* ```
|
|
141
146
|
*
|
|
142
|
-
* @param config - The JSON-RPC
|
|
143
|
-
* @returns The normalized
|
|
147
|
+
* @param config - The JSON-RPC account configuration.
|
|
148
|
+
* @returns The normalized account configuration.
|
|
144
149
|
*/
|
|
145
150
|
export declare function fromRpc(config: Rpc): Config;
|
|
146
151
|
export declare namespace fromRpc {
|
|
147
152
|
type ErrorType = assert.ErrorType | Hex.toBigInt.ErrorType | Errors.GlobalErrorType;
|
|
148
153
|
}
|
|
149
154
|
/**
|
|
150
|
-
* Converts an RLP {@link ox#
|
|
151
|
-
* {@link ox#
|
|
155
|
+
* Converts an RLP {@link ox#AccountConfig.Tuple} back to a
|
|
156
|
+
* {@link ox#AccountConfig.Config}.
|
|
152
157
|
*
|
|
153
158
|
* @example
|
|
154
159
|
* ```ts twoslash
|
|
155
|
-
* import {
|
|
160
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
156
161
|
*
|
|
157
|
-
* const config =
|
|
162
|
+
* const config = AccountConfig.fromTuple([
|
|
158
163
|
* `0x${'00'.repeat(32)}`,
|
|
159
164
|
* '0x',
|
|
160
165
|
* '0x01',
|
|
@@ -163,11 +168,11 @@ export declare namespace fromRpc {
|
|
|
163
168
|
* ```
|
|
164
169
|
*
|
|
165
170
|
* @param tuple - The RLP tuple.
|
|
166
|
-
* @returns The
|
|
171
|
+
* @returns The account config.
|
|
167
172
|
*/
|
|
168
173
|
export declare function fromTuple(tuple: Tuple): Config;
|
|
169
174
|
/**
|
|
170
|
-
* Derives the stable
|
|
175
|
+
* Derives the stable configurable account address.
|
|
171
176
|
*
|
|
172
177
|
* The initial config is hashed into a CREATE2 salt using fixed-width
|
|
173
178
|
* big-endian fields, not RLP. The account uses the chain-configured recovery
|
|
@@ -178,23 +183,23 @@ export declare function fromTuple(tuple: Tuple): Config;
|
|
|
178
183
|
*
|
|
179
184
|
* @example
|
|
180
185
|
* ```ts twoslash
|
|
181
|
-
* import {
|
|
186
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
182
187
|
*
|
|
183
|
-
* const initialConfig =
|
|
188
|
+
* const initialConfig = AccountConfig.from({
|
|
184
189
|
* owners: [
|
|
185
190
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
186
191
|
* ],
|
|
187
192
|
* threshold: 1,
|
|
188
193
|
* })
|
|
189
194
|
*
|
|
190
|
-
* const address =
|
|
195
|
+
* const address = AccountConfig.getAddress(initialConfig, {
|
|
191
196
|
* factory: '0x7171717171717171717171717171717171717171'
|
|
192
197
|
* })
|
|
193
198
|
* ```
|
|
194
199
|
*
|
|
195
|
-
* @param config - The initial
|
|
200
|
+
* @param config - The initial account config.
|
|
196
201
|
* @param options - The recovery factory configured by the chain.
|
|
197
|
-
* @returns The
|
|
202
|
+
* @returns The configurable account address.
|
|
198
203
|
*/
|
|
199
204
|
export declare function getAddress(config: Input, options: getAddress.Options): Address.Address;
|
|
200
205
|
export declare namespace getAddress {
|
|
@@ -205,16 +210,16 @@ export declare namespace getAddress {
|
|
|
205
210
|
type ErrorType = assert.ErrorType | ContractAddress.fromCreate2.ErrorType | Hash.keccak256.ErrorType | Hex.concat.ErrorType | Hex.fromNumber.ErrorType | Hex.fromString.ErrorType | Errors.GlobalErrorType;
|
|
206
211
|
}
|
|
207
212
|
/**
|
|
208
|
-
* Computes the commitment for
|
|
213
|
+
* Computes the commitment for an account configuration.
|
|
209
214
|
*
|
|
210
215
|
* The commitment uses raw fixed-width fields, not RLP or ABI encoding:
|
|
211
216
|
* `keccak256("tempo:multisig:config" || salt || uint64be(version) || uint8(threshold) || uint8(owners.length) || owners)`.
|
|
212
217
|
*
|
|
213
218
|
* @example
|
|
214
219
|
* ```ts twoslash
|
|
215
|
-
* import {
|
|
220
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
216
221
|
*
|
|
217
|
-
* const commitment =
|
|
222
|
+
* const commitment = AccountConfig.getCommitment({
|
|
218
223
|
* owners: [
|
|
219
224
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
220
225
|
* ],
|
|
@@ -223,7 +228,7 @@ export declare namespace getAddress {
|
|
|
223
228
|
* })
|
|
224
229
|
* ```
|
|
225
230
|
*
|
|
226
|
-
* @param config - The complete
|
|
231
|
+
* @param config - The complete account configuration.
|
|
227
232
|
* @returns The configuration commitment.
|
|
228
233
|
*/
|
|
229
234
|
export declare function getCommitment(config: Input): Hex.Hex;
|
|
@@ -231,7 +236,7 @@ export declare namespace getCommitment {
|
|
|
231
236
|
type ErrorType = assert.ErrorType | Hash.keccak256.ErrorType | Hex.concat.ErrorType | Hex.fromNumber.ErrorType | Hex.fromString.ErrorType | Errors.GlobalErrorType;
|
|
232
237
|
}
|
|
233
238
|
/**
|
|
234
|
-
* Computes the digest a
|
|
239
|
+
* Computes the digest a configurable account owner approves (signs).
|
|
235
240
|
*
|
|
236
241
|
* `keccak256("tempo:multisig:signature" || inner_digest || account || uint64be(version))`,
|
|
237
242
|
* where `inner_digest` is the transaction sign payload
|
|
@@ -243,9 +248,9 @@ export declare namespace getCommitment {
|
|
|
243
248
|
*
|
|
244
249
|
* @example
|
|
245
250
|
* ```ts twoslash
|
|
246
|
-
* import {
|
|
251
|
+
* import { AccountConfig, TxEnvelopeTempo } from 'ox/tempo'
|
|
247
252
|
*
|
|
248
|
-
* const config =
|
|
253
|
+
* const config = AccountConfig.from({
|
|
249
254
|
* owners: [
|
|
250
255
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
251
256
|
* ],
|
|
@@ -257,8 +262,8 @@ export declare namespace getCommitment {
|
|
|
257
262
|
* calls: [],
|
|
258
263
|
* })
|
|
259
264
|
*
|
|
260
|
-
* const digest =
|
|
261
|
-
* account:
|
|
265
|
+
* const digest = AccountConfig.getSignPayload({
|
|
266
|
+
* account: AccountConfig.getAddress(config, {
|
|
262
267
|
* factory: '0x7171717171717171717171717171717171717171'
|
|
263
268
|
* }),
|
|
264
269
|
* config,
|
|
@@ -272,7 +277,7 @@ export declare namespace getCommitment {
|
|
|
272
277
|
export declare function getSignPayload(value: getSignPayload.Value): Hex.Hex;
|
|
273
278
|
export declare namespace getSignPayload {
|
|
274
279
|
type Value = {
|
|
275
|
-
/** The
|
|
280
|
+
/** The configurable account address. */
|
|
276
281
|
account: Address.Address;
|
|
277
282
|
/** Configuration whose version applies to the approval. */
|
|
278
283
|
config: Pick<Config<bigint | number>, 'version'>;
|
|
@@ -282,13 +287,13 @@ export declare namespace getSignPayload {
|
|
|
282
287
|
type ErrorType = assert.ErrorType | Hash.keccak256.ErrorType | Hex.concat.ErrorType | Hex.from.ErrorType | Hex.fromNumber.ErrorType | Errors.GlobalErrorType;
|
|
283
288
|
}
|
|
284
289
|
/**
|
|
285
|
-
* Converts
|
|
290
|
+
* Converts an account configuration to its JSON-RPC representation.
|
|
286
291
|
*
|
|
287
292
|
* @example
|
|
288
293
|
* ```ts twoslash
|
|
289
|
-
* import {
|
|
294
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
290
295
|
*
|
|
291
|
-
* const config =
|
|
296
|
+
* const config = AccountConfig.toRpc({
|
|
292
297
|
* owners: [
|
|
293
298
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
294
299
|
* ],
|
|
@@ -296,15 +301,15 @@ export declare namespace getSignPayload {
|
|
|
296
301
|
* })
|
|
297
302
|
* ```
|
|
298
303
|
*
|
|
299
|
-
* @param config - The
|
|
300
|
-
* @returns The JSON-RPC
|
|
304
|
+
* @param config - The account configuration.
|
|
305
|
+
* @returns The JSON-RPC account configuration.
|
|
301
306
|
*/
|
|
302
307
|
export declare function toRpc(config: Input): Rpc;
|
|
303
308
|
export declare namespace toRpc {
|
|
304
309
|
type ErrorType = assert.ErrorType | Hex.fromNumber.ErrorType | Errors.GlobalErrorType;
|
|
305
310
|
}
|
|
306
311
|
/**
|
|
307
|
-
* Converts a {@link ox#
|
|
312
|
+
* Converts a {@link ox#AccountConfig.Config} to its RLP tuple form.
|
|
308
313
|
*
|
|
309
314
|
* Tuple shape: `[salt, version, threshold, [[owner, weight], ...]]`. The
|
|
310
315
|
* 32-byte `salt` encodes as a full fixed-width string; other integers use
|
|
@@ -312,9 +317,9 @@ export declare namespace toRpc {
|
|
|
312
317
|
*
|
|
313
318
|
* @example
|
|
314
319
|
* ```ts twoslash
|
|
315
|
-
* import {
|
|
320
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
316
321
|
*
|
|
317
|
-
* const tuple =
|
|
322
|
+
* const tuple = AccountConfig.toTuple({
|
|
318
323
|
* owners: [
|
|
319
324
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
320
325
|
* ],
|
|
@@ -322,19 +327,61 @@ export declare namespace toRpc {
|
|
|
322
327
|
* })
|
|
323
328
|
* ```
|
|
324
329
|
*
|
|
325
|
-
* @param config - The
|
|
330
|
+
* @param config - The account config.
|
|
326
331
|
* @returns The RLP tuple.
|
|
327
332
|
*/
|
|
328
333
|
export declare function toTuple(config: Input): Tuple;
|
|
329
334
|
/**
|
|
330
|
-
*
|
|
335
|
+
* Derives the configuration that replaces the current one in an owner update.
|
|
336
|
+
*
|
|
337
|
+
* Mirrors the `updateConfig` precompile ([TIP-1109](https://tips.sh/1109)):
|
|
338
|
+
* keeps the current salt, increments the version by one, and replaces the
|
|
339
|
+
* owners and threshold. Owners are sorted into canonical order and the next
|
|
340
|
+
* configuration is validated. The account address does not change.
|
|
341
|
+
*
|
|
342
|
+
* @example
|
|
343
|
+
* ```ts twoslash
|
|
344
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
345
|
+
*
|
|
346
|
+
* const initialConfig = AccountConfig.from({
|
|
347
|
+
* owners: [
|
|
348
|
+
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
349
|
+
* ],
|
|
350
|
+
* threshold: 1,
|
|
351
|
+
* })
|
|
352
|
+
*
|
|
353
|
+
* const config = AccountConfig.update(initialConfig, {
|
|
354
|
+
* owners: [
|
|
355
|
+
* { owner: '0x2222222222222222222222222222222222222222', weight: 1 },
|
|
356
|
+
* ],
|
|
357
|
+
* threshold: 1,
|
|
358
|
+
* })
|
|
359
|
+
* // config.version === 1n, with the initial salt
|
|
360
|
+
* ```
|
|
361
|
+
*
|
|
362
|
+
* @param config - The current account config.
|
|
363
|
+
* @param options - The replacement owners and threshold.
|
|
364
|
+
* @returns The next account config.
|
|
365
|
+
*/
|
|
366
|
+
export declare function update<numberType = number>(config: Input<bigint | number, numberType>, options: update.Options<numberType>): Config<bigint, numberType>;
|
|
367
|
+
export declare namespace update {
|
|
368
|
+
type Options<numberType = number> = {
|
|
369
|
+
/** Replacement weighted owners. Sorted into canonical order. */
|
|
370
|
+
owners: readonly Owner<numberType>[];
|
|
371
|
+
/** Replacement minimum total owner weight required for authorization. */
|
|
372
|
+
threshold: numberType;
|
|
373
|
+
};
|
|
374
|
+
type ErrorType = assert.ErrorType | InvalidConfigError | Errors.GlobalErrorType;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Validates an {@link ox#AccountConfig.Config}. Returns `true`
|
|
331
378
|
* if valid, `false` otherwise.
|
|
332
379
|
*
|
|
333
380
|
* @example
|
|
334
381
|
* ```ts twoslash
|
|
335
|
-
* import {
|
|
382
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
336
383
|
*
|
|
337
|
-
* const valid =
|
|
384
|
+
* const valid = AccountConfig.validate({
|
|
338
385
|
* owners: [
|
|
339
386
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
340
387
|
* ],
|
|
@@ -343,15 +390,15 @@ export declare function toTuple(config: Input): Tuple;
|
|
|
343
390
|
* // @log: true
|
|
344
391
|
* ```
|
|
345
392
|
*
|
|
346
|
-
* @param config - The
|
|
393
|
+
* @param config - The account config.
|
|
347
394
|
* @returns Whether the config is valid.
|
|
348
395
|
*/
|
|
349
396
|
export declare function validate(config: Input): boolean;
|
|
350
|
-
/** Thrown when
|
|
397
|
+
/** Thrown when an account config is invalid. */
|
|
351
398
|
export declare class InvalidConfigError extends Errors.BaseError {
|
|
352
|
-
readonly name = "
|
|
399
|
+
readonly name = "AccountConfig.InvalidConfigError";
|
|
353
400
|
constructor({ reason }: {
|
|
354
401
|
reason: string;
|
|
355
402
|
});
|
|
356
403
|
}
|
|
357
|
-
//# sourceMappingURL=
|
|
404
|
+
//# sourceMappingURL=AccountConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountConfig.d.ts","sourceRoot":"","sources":["../../tempo/AccountConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,oBAA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