ox 0.14.35 → 0.14.37
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 +12 -0
- package/_cjs/core/Hash.js +1 -1
- package/_cjs/core/Hash.js.map +1 -1
- package/_cjs/core/P256.js +2 -2
- package/_cjs/core/P256.js.map +1 -1
- package/_cjs/core/Secp256k1.js +2 -2
- package/_cjs/core/Secp256k1.js.map +1 -1
- package/_cjs/core/internal/mnemonic.js +18 -0
- package/_cjs/core/internal/mnemonic.js.map +1 -0
- package/_cjs/tempo/MultisigOperation.js +400 -0
- package/_cjs/tempo/MultisigOperation.js.map +1 -0
- package/_cjs/tempo/index.js +2 -1
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/core/Hash.js +1 -1
- package/_esm/core/Hash.js.map +1 -1
- package/_esm/core/P256.js +2 -2
- package/_esm/core/P256.js.map +1 -1
- package/_esm/core/Secp256k1.js +2 -2
- package/_esm/core/Secp256k1.js.map +1 -1
- package/_esm/core/internal/mnemonic.js +16 -0
- package/_esm/core/internal/mnemonic.js.map +1 -0
- package/_esm/tempo/MultisigOperation.js +502 -0
- package/_esm/tempo/MultisigOperation.js.map +1 -0
- package/_esm/tempo/index.js +11 -1
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/core/Secp256k1.d.ts +1 -1
- package/_types/core/Secp256k1.d.ts.map +1 -1
- package/_types/core/internal/mnemonic.d.ts +13 -0
- package/_types/core/internal/mnemonic.d.ts.map +1 -0
- package/_types/tempo/MultisigOperation.d.ts +153 -0
- package/_types/tempo/MultisigOperation.d.ts.map +1 -0
- package/_types/tempo/RpcSchemaTempo.d.ts +35 -0
- package/_types/tempo/RpcSchemaTempo.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +11 -1
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/core/Hash.ts +1 -1
- package/core/P256.ts +2 -2
- package/core/Secp256k1.ts +3 -2
- package/core/internal/mnemonic.ts +31 -0
- package/package.json +16 -1
- package/tempo/MultisigOperation/package.json +6 -0
- package/tempo/MultisigOperation.test-d/package.json +6 -0
- package/tempo/MultisigOperation.test-d.ts +52 -0
- package/tempo/MultisigOperation.test.ts +1052 -0
- package/tempo/MultisigOperation.ts +720 -0
- package/tempo/RpcSchemaTempo.test-d/package.json +6 -0
- package/tempo/RpcSchemaTempo.test-d.ts +56 -0
- package/tempo/RpcSchemaTempo.ts +37 -0
- package/tempo/index.ts +11 -1
- package/version.ts +1 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Provider } from 'ox'
|
|
2
|
+
import type {
|
|
3
|
+
KeyAuthorization,
|
|
4
|
+
MultisigOperation,
|
|
5
|
+
RpcSchemaTempo,
|
|
6
|
+
} from 'ox/tempo'
|
|
7
|
+
import { expectTypeOf, test } from 'vitest'
|
|
8
|
+
import type * as Hex from '../core/Hex.js'
|
|
9
|
+
|
|
10
|
+
declare const provider: Provider.Provider<{ schema: RpcSchemaTempo.Multisig }>
|
|
11
|
+
declare const hash: Hex.Hex
|
|
12
|
+
declare const keyAuthorization: KeyAuthorization.Rpc
|
|
13
|
+
declare const serializedTransaction: Hex.Hex
|
|
14
|
+
declare const signature: Hex.Hex
|
|
15
|
+
|
|
16
|
+
test('multisig provider methods', () => {
|
|
17
|
+
expectTypeOf(
|
|
18
|
+
provider.request({
|
|
19
|
+
method: 'multisig_approveRawTransaction',
|
|
20
|
+
params: [serializedTransaction],
|
|
21
|
+
}),
|
|
22
|
+
).resolves.toEqualTypeOf<Hex.Hex>()
|
|
23
|
+
|
|
24
|
+
expectTypeOf(
|
|
25
|
+
provider.request({
|
|
26
|
+
method: 'multisig_approveRawTransactionSync',
|
|
27
|
+
params: [serializedTransaction],
|
|
28
|
+
}),
|
|
29
|
+
).resolves.toEqualTypeOf<MultisigOperation.TransactionRpc>()
|
|
30
|
+
|
|
31
|
+
provider.request({
|
|
32
|
+
method: 'multisig_approveRawTransactionSync',
|
|
33
|
+
params: [serializedTransaction, 30_000],
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
expectTypeOf(
|
|
37
|
+
provider.request({
|
|
38
|
+
method: 'multisig_approveKeyAuthorization',
|
|
39
|
+
params: [{ keyAuthorization }],
|
|
40
|
+
}),
|
|
41
|
+
).resolves.toEqualTypeOf<MultisigOperation.KeyAuthorizationRpc>()
|
|
42
|
+
|
|
43
|
+
expectTypeOf(
|
|
44
|
+
provider.request({
|
|
45
|
+
method: 'multisig_approveKeyAuthorization',
|
|
46
|
+
params: [{ hash, signature }],
|
|
47
|
+
}),
|
|
48
|
+
).resolves.toEqualTypeOf<MultisigOperation.KeyAuthorizationRpc>()
|
|
49
|
+
|
|
50
|
+
expectTypeOf(
|
|
51
|
+
provider.request({
|
|
52
|
+
method: 'multisig_getOperation',
|
|
53
|
+
params: [hash],
|
|
54
|
+
}),
|
|
55
|
+
).resolves.toEqualTypeOf<MultisigOperation.Rpc | null>()
|
|
56
|
+
})
|
package/tempo/RpcSchemaTempo.ts
CHANGED
|
@@ -4,6 +4,8 @@ import type * as Hex from '../core/Hex.js'
|
|
|
4
4
|
import type * as Log from '../core/Log.js'
|
|
5
5
|
import type * as RpcSchema from '../core/RpcSchema.js'
|
|
6
6
|
import type * as StateOverrides from '../core/StateOverrides.js'
|
|
7
|
+
import type * as KeyAuthorization from './KeyAuthorization.js'
|
|
8
|
+
import type * as MultisigOperation from './MultisigOperation.js'
|
|
7
9
|
import type * as TransactionRequest from './TransactionRequest.js'
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -53,3 +55,38 @@ export type Tempo = RpcSchema.From<{
|
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
}>
|
|
58
|
+
|
|
59
|
+
/** Union of all JSON-RPC methods for the `multisig_` namespace. */
|
|
60
|
+
export type Multisig = RpcSchema.From<
|
|
61
|
+
| {
|
|
62
|
+
Request: {
|
|
63
|
+
method: 'multisig_approveRawTransaction'
|
|
64
|
+
params: [serializedTransaction: Hex.Hex]
|
|
65
|
+
}
|
|
66
|
+
ReturnType: Hex.Hex
|
|
67
|
+
}
|
|
68
|
+
| {
|
|
69
|
+
Request: {
|
|
70
|
+
method: 'multisig_approveRawTransactionSync'
|
|
71
|
+
params: [serializedTransaction: Hex.Hex, timeout?: number]
|
|
72
|
+
}
|
|
73
|
+
ReturnType: MultisigOperation.TransactionRpc
|
|
74
|
+
}
|
|
75
|
+
| {
|
|
76
|
+
Request: {
|
|
77
|
+
method: 'multisig_approveKeyAuthorization'
|
|
78
|
+
params: [
|
|
79
|
+
| { keyAuthorization: KeyAuthorization.Rpc }
|
|
80
|
+
| { hash: Hex.Hex; signature: Hex.Hex },
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
ReturnType: MultisigOperation.KeyAuthorizationRpc
|
|
84
|
+
}
|
|
85
|
+
| {
|
|
86
|
+
Request: {
|
|
87
|
+
method: 'multisig_getOperation'
|
|
88
|
+
params: [hash: Hex.Hex]
|
|
89
|
+
}
|
|
90
|
+
ReturnType: MultisigOperation.Rpc | null
|
|
91
|
+
}
|
|
92
|
+
>
|
package/tempo/index.ts
CHANGED
|
@@ -150,6 +150,15 @@ export * as KeyAuthorization from './KeyAuthorization.js'
|
|
|
150
150
|
* @category Reference
|
|
151
151
|
*/
|
|
152
152
|
export * as MultisigConfig from './MultisigConfig.js'
|
|
153
|
+
/**
|
|
154
|
+
* Offchain multisig transaction and key authorization operation utilities.
|
|
155
|
+
*
|
|
156
|
+
* Validates operation state, serialized payloads, and deterministic operation
|
|
157
|
+
* hashes, and converts between domain and JSON-RPC representations.
|
|
158
|
+
*
|
|
159
|
+
* @category Reference
|
|
160
|
+
*/
|
|
161
|
+
export * as MultisigOperation from './MultisigOperation.js'
|
|
153
162
|
/**
|
|
154
163
|
* Utilities for constructing period durations (in seconds) for recurring spending limits.
|
|
155
164
|
*
|
|
@@ -224,7 +233,7 @@ export * as PoolId from './PoolId.js'
|
|
|
224
233
|
*/
|
|
225
234
|
export * as ReceivePolicyReceipt from './ReceivePolicyReceipt.js'
|
|
226
235
|
/**
|
|
227
|
-
*
|
|
236
|
+
* JSON-RPC schemas for the `tempo_` and `multisig_` namespaces.
|
|
228
237
|
*
|
|
229
238
|
* @example
|
|
230
239
|
* ```ts twoslash
|
|
@@ -234,6 +243,7 @@ export * as ReceivePolicyReceipt from './ReceivePolicyReceipt.js'
|
|
|
234
243
|
*
|
|
235
244
|
* const schema = RpcSchema.from<
|
|
236
245
|
* | RpcSchema.Default
|
|
246
|
+
* | RpcSchemaTempo.Multisig
|
|
237
247
|
* | RpcSchemaTempo.Tempo
|
|
238
248
|
* >()
|
|
239
249
|
*
|
package/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @internal */
|
|
2
|
-
export const version = '0.14.
|
|
2
|
+
export const version = '0.14.37'
|