ox 1.7.2 → 1.7.5
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 +43 -0
- package/dist/core/AbiEvent.d.ts.map +1 -1
- package/dist/core/AbiEvent.js +10 -9
- package/dist/core/AbiEvent.js.map +1 -1
- package/dist/core/Blobs.d.ts.map +1 -1
- package/dist/core/Blobs.js +6 -2
- package/dist/core/Blobs.js.map +1 -1
- package/dist/core/Signature.d.ts +6 -5
- package/dist/core/Signature.d.ts.map +1 -1
- package/dist/core/Signature.js +17 -7
- package/dist/core/Signature.js.map +1 -1
- package/dist/core/Siwe.d.ts.map +1 -1
- package/dist/core/Siwe.js +21 -1
- package/dist/core/Siwe.js.map +1 -1
- package/dist/tempo/KeyAuthorization.d.ts +43 -39
- package/dist/tempo/KeyAuthorization.d.ts.map +1 -1
- package/dist/tempo/KeyAuthorization.js +24 -4
- package/dist/tempo/KeyAuthorization.js.map +1 -1
- package/dist/tempo/MultisigConfig.d.ts +18 -15
- package/dist/tempo/MultisigConfig.d.ts.map +1 -1
- package/dist/tempo/MultisigConfig.js +49 -20
- package/dist/tempo/MultisigConfig.js.map +1 -1
- package/dist/tempo/MultisigOperation.d.ts +45 -28
- package/dist/tempo/MultisigOperation.d.ts.map +1 -1
- package/dist/tempo/MultisigOperation.js +81 -131
- package/dist/tempo/MultisigOperation.js.map +1 -1
- package/dist/tempo/MultisigSimulation.d.ts +85 -0
- package/dist/tempo/MultisigSimulation.d.ts.map +1 -0
- package/dist/tempo/MultisigSimulation.js +112 -0
- package/dist/tempo/MultisigSimulation.js.map +1 -0
- package/dist/tempo/RpcSchemaTempo.d.ts +20 -10
- package/dist/tempo/RpcSchemaTempo.d.ts.map +1 -1
- package/dist/tempo/SignatureEnvelope.d.ts +74 -153
- package/dist/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/dist/tempo/SignatureEnvelope.js +130 -187
- package/dist/tempo/SignatureEnvelope.js.map +1 -1
- package/dist/tempo/TransactionRequest.d.ts +9 -7
- package/dist/tempo/TransactionRequest.d.ts.map +1 -1
- package/dist/tempo/TransactionRequest.js +12 -7
- package/dist/tempo/TransactionRequest.js.map +1 -1
- package/dist/tempo/index.d.ts +7 -5
- package/dist/tempo/index.d.ts.map +1 -1
- package/dist/tempo/index.js +7 -5
- package/dist/tempo/index.js.map +1 -1
- package/dist/zod/tempo/AuthorizationTempo.d.ts +360 -140
- package/dist/zod/tempo/AuthorizationTempo.d.ts.map +1 -1
- package/dist/zod/tempo/KeyAuthorization.d.ts +247 -487
- package/dist/zod/tempo/KeyAuthorization.d.ts.map +1 -1
- package/dist/zod/tempo/KeyAuthorization.js +29 -31
- package/dist/zod/tempo/KeyAuthorization.js.map +1 -1
- package/dist/zod/tempo/MultisigOperation.d.ts +0 -10
- package/dist/zod/tempo/MultisigOperation.d.ts.map +1 -1
- package/dist/zod/tempo/MultisigOperation.js +0 -3
- package/dist/zod/tempo/MultisigOperation.js.map +1 -1
- package/dist/zod/tempo/MultisigSimulation.d.ts +52 -0
- package/dist/zod/tempo/MultisigSimulation.d.ts.map +1 -0
- package/dist/zod/tempo/MultisigSimulation.js +44 -0
- package/dist/zod/tempo/MultisigSimulation.js.map +1 -0
- package/dist/zod/tempo/RpcSchemaTempo.d.ts +357 -422
- package/dist/zod/tempo/RpcSchemaTempo.d.ts.map +1 -1
- package/dist/zod/tempo/RpcSchemaTempo.js +19 -10
- package/dist/zod/tempo/RpcSchemaTempo.js.map +1 -1
- package/dist/zod/tempo/SignatureEnvelope.d.ts +108 -42
- package/dist/zod/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/dist/zod/tempo/SignatureEnvelope.js +21 -19
- package/dist/zod/tempo/SignatureEnvelope.js.map +1 -1
- package/dist/zod/tempo/Transaction.d.ts +678 -666
- package/dist/zod/tempo/Transaction.d.ts.map +1 -1
- package/dist/zod/tempo/TransactionRequest.d.ts +580 -619
- package/dist/zod/tempo/TransactionRequest.d.ts.map +1 -1
- package/dist/zod/tempo/TransactionRequest.js +18 -10
- package/dist/zod/tempo/TransactionRequest.js.map +1 -1
- package/dist/zod/tempo/TxEnvelopeTempo.d.ts +327 -213
- package/dist/zod/tempo/TxEnvelopeTempo.d.ts.map +1 -1
- package/dist/zod/tempo/ZoneRpcAuthentication.d.ts +105 -3
- package/dist/zod/tempo/ZoneRpcAuthentication.d.ts.map +1 -1
- package/dist/zod/tempo/z.d.ts +1 -1
- package/dist/zod/tempo/z.d.ts.map +1 -1
- package/dist/zod/tempo/z.js +1 -1
- package/dist/zod/tempo/z.js.map +1 -1
- package/package.json +9 -9
- package/src/core/AbiEvent.ts +11 -9
- package/src/core/Blobs.ts +6 -2
- package/src/core/Signature.ts +41 -11
- package/src/core/Siwe.ts +20 -1
- package/src/core/_test/AbiEvent.test.ts +45 -0
- package/src/core/_test/Blobs.test.ts +22 -0
- package/src/core/_test/Signature.test.ts +166 -0
- package/src/core/_test/Siwe.test.ts +100 -1
- package/src/tempo/AuthorizationTempo.test.ts +8 -0
- package/src/tempo/KeyAuthorization.test-d.ts +16 -74
- package/src/tempo/KeyAuthorization.test.ts +113 -14
- package/src/tempo/KeyAuthorization.ts +110 -66
- package/src/tempo/MultisigConfig.test.ts +44 -20
- package/src/tempo/MultisigConfig.ts +65 -23
- package/src/tempo/MultisigOperation.test-d.ts +8 -6
- package/src/tempo/MultisigOperation.test.ts +187 -591
- package/src/tempo/MultisigOperation.ts +129 -205
- package/src/tempo/MultisigSimulation.test-d.ts +33 -0
- package/src/tempo/MultisigSimulation.test.ts +194 -0
- package/src/tempo/MultisigSimulation.ts +192 -0
- package/src/tempo/RpcSchemaTempo.test-d.ts +45 -10
- package/src/tempo/RpcSchemaTempo.ts +15 -6
- package/src/tempo/SignatureEnvelope.test-d.ts +27 -101
- package/src/tempo/SignatureEnvelope.test.ts +330 -533
- package/src/tempo/SignatureEnvelope.ts +198 -310
- package/src/tempo/Transaction.test.ts +61 -0
- package/src/tempo/TransactionRequest.test-d.ts +7 -7
- package/src/tempo/TransactionRequest.test.ts +81 -223
- package/src/tempo/TransactionRequest.ts +34 -13
- package/src/tempo/index.ts +7 -5
- package/src/tempo/multisig.e2e.test.ts +329 -818
- package/src/version.ts +1 -1
- package/src/zod/tempo/KeyAuthorization.ts +50 -39
- package/src/zod/tempo/MultisigOperation.ts +0 -3
- package/src/zod/tempo/MultisigSimulation.ts +53 -0
- package/src/zod/tempo/RpcSchemaTempo.ts +20 -10
- package/src/zod/tempo/SignatureEnvelope.ts +46 -59
- package/src/zod/tempo/TransactionRequest.ts +28 -14
- package/src/zod/tempo/_test/KeyAuthorization.test.ts +66 -30
- package/src/zod/tempo/_test/MultisigOperation.test.ts +0 -2
- package/src/zod/tempo/_test/MultisigSimulation.test-d.ts +13 -0
- package/src/zod/tempo/_test/MultisigSimulation.test.ts +53 -0
- package/src/zod/tempo/_test/RpcSchemaTempo.test-d.ts +19 -2
- package/src/zod/tempo/_test/RpcSchemaTempo.test.ts +46 -4
- package/src/zod/tempo/_test/SignatureEnvelope.test.ts +108 -129
- package/src/zod/tempo/_test/TransactionRequest.test.ts +17 -168
- package/src/zod/tempo/z.ts +1 -1
- package/dist/tempo/MultisigWitness.d.ts +0 -106
- package/dist/tempo/MultisigWitness.d.ts.map +0 -1
- package/dist/tempo/MultisigWitness.js +0 -118
- package/dist/tempo/MultisigWitness.js.map +0 -1
- package/dist/zod/tempo/MultisigWitness.d.ts +0 -152
- package/dist/zod/tempo/MultisigWitness.d.ts.map +0 -1
- package/dist/zod/tempo/MultisigWitness.js +0 -76
- package/dist/zod/tempo/MultisigWitness.js.map +0 -1
- package/src/tempo/MultisigWitness.test-d.ts +0 -42
- package/src/tempo/MultisigWitness.test.ts +0 -288
- package/src/tempo/MultisigWitness.ts +0 -210
- package/src/zod/tempo/MultisigWitness.ts +0 -101
- package/src/zod/tempo/_test/MultisigWitness.test-d.ts +0 -13
- package/src/zod/tempo/_test/MultisigWitness.test.ts +0 -149
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxEnvelopeTempo.d.ts","sourceRoot":"","sources":["../../../src/zod/tempo/TxEnvelopeTempo.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAY7B,8CAA8C;AAC9C,eAAO,MAAM,IAAI,2BAAqB,CAAA;AAEtC,qCAAqC;AACrC,eAAO,MAAM,IAAI;;;;iBAIf,CAAA;AAqBF,yCAAyC;AACzC,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"TxEnvelopeTempo.d.ts","sourceRoot":"","sources":["../../../src/zod/tempo/TxEnvelopeTempo.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAY7B,8CAA8C;AAC9C,eAAO,MAAM,IAAI,2BAAqB,CAAA;AAEtC,qCAAqC;AACrC,eAAO,MAAM,IAAI;;;;iBAIf,CAAA;AAqBF,yCAAyC;AACzC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG1B,CAAA;AAEF,gDAAgD;AAChD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGjB,CAAA;AAEF,yFAAyF;AACzF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBASrB,CAAA"}
|
|
@@ -70,7 +70,41 @@ export declare const Signed: z.ZodMiniObject<{
|
|
|
70
70
|
threshold: z.ZodMiniNumber<number>;
|
|
71
71
|
version: z.ZodMiniBigInt<bigint>;
|
|
72
72
|
}, z.core.$strip>;
|
|
73
|
-
signatures: z.
|
|
73
|
+
signatures: z.ZodMiniReadonly<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
74
|
+
signature: z.ZodMiniObject<{
|
|
75
|
+
r: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
76
|
+
s: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
77
|
+
yParity: z.ZodMiniNumber<number>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
type: z.ZodMiniLiteral<"secp256k1">;
|
|
80
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
81
|
+
prehash: z.ZodMiniBoolean<boolean>;
|
|
82
|
+
publicKey: z.ZodMiniObject<{
|
|
83
|
+
prefix: z.ZodMiniNumber<number>;
|
|
84
|
+
x: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
85
|
+
y: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
signature: z.ZodMiniObject<{
|
|
88
|
+
r: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
89
|
+
s: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
type: z.ZodMiniLiteral<"p256">;
|
|
92
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
93
|
+
metadata: z.ZodMiniObject<{
|
|
94
|
+
authenticatorData: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
95
|
+
clientDataJSON: z.ZodMiniString<string>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
publicKey: z.ZodMiniObject<{
|
|
98
|
+
prefix: z.ZodMiniNumber<number>;
|
|
99
|
+
x: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
100
|
+
y: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
signature: z.ZodMiniObject<{
|
|
103
|
+
r: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
104
|
+
s: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
type: z.ZodMiniLiteral<"webAuthn">;
|
|
107
|
+
}, z.core.$strip>]>>>;
|
|
74
108
|
type: z.ZodMiniLiteral<"multisig">;
|
|
75
109
|
}, z.core.$strip>]>;
|
|
76
110
|
version: z.ZodMiniLiteral<0>;
|
|
@@ -132,7 +166,41 @@ export declare const ZoneRpcAuthentication: z.ZodMiniUnion<readonly [z.ZodMiniOb
|
|
|
132
166
|
threshold: z.ZodMiniNumber<number>;
|
|
133
167
|
version: z.ZodMiniBigInt<bigint>;
|
|
134
168
|
}, z.core.$strip>;
|
|
135
|
-
signatures: z.
|
|
169
|
+
signatures: z.ZodMiniReadonly<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
170
|
+
signature: z.ZodMiniObject<{
|
|
171
|
+
r: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
172
|
+
s: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
173
|
+
yParity: z.ZodMiniNumber<number>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
type: z.ZodMiniLiteral<"secp256k1">;
|
|
176
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
177
|
+
prehash: z.ZodMiniBoolean<boolean>;
|
|
178
|
+
publicKey: z.ZodMiniObject<{
|
|
179
|
+
prefix: z.ZodMiniNumber<number>;
|
|
180
|
+
x: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
181
|
+
y: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
182
|
+
}, z.core.$strip>;
|
|
183
|
+
signature: z.ZodMiniObject<{
|
|
184
|
+
r: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
185
|
+
s: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
186
|
+
}, z.core.$strip>;
|
|
187
|
+
type: z.ZodMiniLiteral<"p256">;
|
|
188
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
189
|
+
metadata: z.ZodMiniObject<{
|
|
190
|
+
authenticatorData: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
191
|
+
clientDataJSON: z.ZodMiniString<string>;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
publicKey: z.ZodMiniObject<{
|
|
194
|
+
prefix: z.ZodMiniNumber<number>;
|
|
195
|
+
x: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
196
|
+
y: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
signature: z.ZodMiniObject<{
|
|
199
|
+
r: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
200
|
+
s: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
type: z.ZodMiniLiteral<"webAuthn">;
|
|
203
|
+
}, z.core.$strip>]>>>;
|
|
136
204
|
type: z.ZodMiniLiteral<"multisig">;
|
|
137
205
|
}, z.core.$strip>]>;
|
|
138
206
|
version: z.ZodMiniLiteral<0>;
|
|
@@ -201,7 +269,41 @@ export declare const serialized: z.ZodMiniCodec<z.ZodMiniTemplateLiteral<`0x${st
|
|
|
201
269
|
threshold: z.ZodMiniNumber<number>;
|
|
202
270
|
version: z.ZodMiniBigInt<bigint>;
|
|
203
271
|
}, z.core.$strip>;
|
|
204
|
-
signatures: z.
|
|
272
|
+
signatures: z.ZodMiniReadonly<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
273
|
+
signature: z.ZodMiniObject<{
|
|
274
|
+
r: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
275
|
+
s: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
276
|
+
yParity: z.ZodMiniNumber<number>;
|
|
277
|
+
}, z.core.$strip>;
|
|
278
|
+
type: z.ZodMiniLiteral<"secp256k1">;
|
|
279
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
280
|
+
prehash: z.ZodMiniBoolean<boolean>;
|
|
281
|
+
publicKey: z.ZodMiniObject<{
|
|
282
|
+
prefix: z.ZodMiniNumber<number>;
|
|
283
|
+
x: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
284
|
+
y: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
285
|
+
}, z.core.$strip>;
|
|
286
|
+
signature: z.ZodMiniObject<{
|
|
287
|
+
r: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
288
|
+
s: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
289
|
+
}, z.core.$strip>;
|
|
290
|
+
type: z.ZodMiniLiteral<"p256">;
|
|
291
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
292
|
+
metadata: z.ZodMiniObject<{
|
|
293
|
+
authenticatorData: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
294
|
+
clientDataJSON: z.ZodMiniString<string>;
|
|
295
|
+
}, z.core.$strip>;
|
|
296
|
+
publicKey: z.ZodMiniObject<{
|
|
297
|
+
prefix: z.ZodMiniNumber<number>;
|
|
298
|
+
x: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
299
|
+
y: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
300
|
+
}, z.core.$strip>;
|
|
301
|
+
signature: z.ZodMiniObject<{
|
|
302
|
+
r: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
303
|
+
s: z.ZodMiniTemplateLiteral<`0x${string}`>;
|
|
304
|
+
}, z.core.$strip>;
|
|
305
|
+
type: z.ZodMiniLiteral<"webAuthn">;
|
|
306
|
+
}, z.core.$strip>]>>>;
|
|
205
307
|
type: z.ZodMiniLiteral<"multisig">;
|
|
206
308
|
}, z.core.$strip>]>;
|
|
207
309
|
version: z.ZodMiniLiteral<0>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneRpcAuthentication.d.ts","sourceRoot":"","sources":["../../../src/zod/tempo/ZoneRpcAuthentication.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAG7B,8CAA8C;AAC9C,eAAO,MAAM,OAAO,qBAAe,CAAA;AAEnC,iEAAiE;AACjE,eAAO,MAAM,MAAM,yCAAwD,CAAA;AAE3E,mEAAmE;AACnE,eAAO,MAAM,UAAU,yCAAY,CAAA;AAEnC,qDAAqD;AACrD,eAAO,MAAM,QAAQ;;;;;;;iBAOnB,CAAA;AAEF,mDAAmD;AACnD,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"ZoneRpcAuthentication.d.ts","sourceRoot":"","sources":["../../../src/zod/tempo/ZoneRpcAuthentication.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAG7B,8CAA8C;AAC9C,eAAO,MAAM,OAAO,qBAAe,CAAA;AAEnC,iEAAiE;AACjE,eAAO,MAAM,MAAM,yCAAwD,CAAA;AAE3E,mEAAmE;AACnE,eAAO,MAAM,UAAU,yCAAY,CAAA;AAEnC,qDAAqD;AACrD,eAAO,MAAM,QAAQ;;;;;;;iBAOnB,CAAA;AAEF,mDAAmD;AACnD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOjB,CAAA;AAEF,4CAA4C;AAC5C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAA8B,CAAA;AAEhE,qFAAqF;AACrF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMrB,CAAA"}
|
package/dist/zod/tempo/z.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * as AuthorizationTempo from './AuthorizationTempo.js';
|
|
|
2
2
|
export * as KeyAuthorization from './KeyAuthorization.js';
|
|
3
3
|
export * as MultisigConfig from './MultisigConfig.js';
|
|
4
4
|
export * as MultisigOperation from './MultisigOperation.js';
|
|
5
|
-
export * as
|
|
5
|
+
export * as MultisigSimulation from './MultisigSimulation.js';
|
|
6
6
|
export * as PoolId from './PoolId.js';
|
|
7
7
|
export * as RpcSchemaTempo from './RpcSchemaTempo.js';
|
|
8
8
|
export * as SignatureEnvelope from './SignatureEnvelope.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"z.d.ts","sourceRoot":"","sources":["../../../src/zod/tempo/z.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"z.d.ts","sourceRoot":"","sources":["../../../src/zod/tempo/z.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AACvD,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAA"}
|
package/dist/zod/tempo/z.js
CHANGED
|
@@ -3,7 +3,7 @@ export * as AuthorizationTempo from './AuthorizationTempo.js';
|
|
|
3
3
|
export * as KeyAuthorization from './KeyAuthorization.js';
|
|
4
4
|
export * as MultisigConfig from './MultisigConfig.js';
|
|
5
5
|
export * as MultisigOperation from './MultisigOperation.js';
|
|
6
|
-
export * as
|
|
6
|
+
export * as MultisigSimulation from './MultisigSimulation.js';
|
|
7
7
|
export * as PoolId from './PoolId.js';
|
|
8
8
|
export * as RpcSchemaTempo from './RpcSchemaTempo.js';
|
|
9
9
|
export * as SignatureEnvelope from './SignatureEnvelope.js';
|
package/dist/zod/tempo/z.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"z.js","sourceRoot":"","sources":["../../../src/zod/tempo/z.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"z.js","sourceRoot":"","sources":["../../../src/zod/tempo/z.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AACvD,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAA"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "ox",
|
|
3
3
|
"description": "Ethereum Standard Library",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.7.
|
|
5
|
+
"version": "1.7.5",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"license": "MIT",
|
|
@@ -604,10 +604,10 @@
|
|
|
604
604
|
"types": "./dist/tempo/MultisigOperation.d.ts",
|
|
605
605
|
"default": "./dist/tempo/MultisigOperation.js"
|
|
606
606
|
},
|
|
607
|
-
"./tempo/
|
|
608
|
-
"src": "./src/tempo/
|
|
609
|
-
"types": "./dist/tempo/
|
|
610
|
-
"default": "./dist/tempo/
|
|
607
|
+
"./tempo/MultisigSimulation": {
|
|
608
|
+
"src": "./src/tempo/MultisigSimulation.ts",
|
|
609
|
+
"types": "./dist/tempo/MultisigSimulation.d.ts",
|
|
610
|
+
"default": "./dist/tempo/MultisigSimulation.js"
|
|
611
611
|
},
|
|
612
612
|
"./tempo/Period": {
|
|
613
613
|
"src": "./src/tempo/Period.ts",
|
|
@@ -1029,10 +1029,10 @@
|
|
|
1029
1029
|
"types": "./dist/zod/tempo/MultisigOperation.d.ts",
|
|
1030
1030
|
"default": "./dist/zod/tempo/MultisigOperation.js"
|
|
1031
1031
|
},
|
|
1032
|
-
"./zod/tempo/
|
|
1033
|
-
"src": "./src/zod/tempo/
|
|
1034
|
-
"types": "./dist/zod/tempo/
|
|
1035
|
-
"default": "./dist/zod/tempo/
|
|
1032
|
+
"./zod/tempo/MultisigSimulation": {
|
|
1033
|
+
"src": "./src/zod/tempo/MultisigSimulation.ts",
|
|
1034
|
+
"types": "./dist/zod/tempo/MultisigSimulation.d.ts",
|
|
1035
|
+
"default": "./dist/zod/tempo/MultisigSimulation.js"
|
|
1036
1036
|
},
|
|
1037
1037
|
"./zod/tempo/PoolId": {
|
|
1038
1038
|
"src": "./src/zod/tempo/PoolId.ts",
|
package/src/core/AbiEvent.ts
CHANGED
|
@@ -496,12 +496,15 @@ export function decode(
|
|
|
496
496
|
// don't have to call `inputs.indexOf(...)` per non-indexed entry below
|
|
497
497
|
// (which is O(n^2) on event width).
|
|
498
498
|
const indexedInputs: abitype.AbiEventParameter[] = []
|
|
499
|
+
const indexedOriginalIndex: number[] = []
|
|
499
500
|
const nonIndexedInputs: abitype.AbiEventParameter[] = []
|
|
500
501
|
const nonIndexedOriginalIndex: number[] = []
|
|
501
502
|
for (let i = 0; i < inputs.length; i++) {
|
|
502
503
|
const input = inputs[i]!
|
|
503
|
-
if ('indexed' in input && input.indexed)
|
|
504
|
-
|
|
504
|
+
if ('indexed' in input && input.indexed) {
|
|
505
|
+
indexedInputs.push(input)
|
|
506
|
+
indexedOriginalIndex.push(i)
|
|
507
|
+
} else {
|
|
505
508
|
nonIndexedInputs.push(input)
|
|
506
509
|
nonIndexedOriginalIndex.push(i)
|
|
507
510
|
}
|
|
@@ -510,13 +513,14 @@ export function decode(
|
|
|
510
513
|
// Decode topics (indexed args).
|
|
511
514
|
for (let i = 0; i < indexedInputs.length; i++) {
|
|
512
515
|
const param = indexedInputs[i]!
|
|
516
|
+
const index = indexedOriginalIndex[i]!
|
|
513
517
|
const topic = argTopics[i]
|
|
514
518
|
if (!topic)
|
|
515
519
|
throw new TopicsMismatchError({
|
|
516
520
|
abiEvent,
|
|
517
521
|
param: param as abitype.AbiParameter & { indexed: boolean },
|
|
518
522
|
})
|
|
519
|
-
args[isUnnamed ?
|
|
523
|
+
args[isUnnamed ? index : param.name || index] = (() => {
|
|
520
524
|
const t = param.type
|
|
521
525
|
if (
|
|
522
526
|
t === 'string' ||
|
|
@@ -545,12 +549,10 @@ export function decode(
|
|
|
545
549
|
options,
|
|
546
550
|
)
|
|
547
551
|
if (decodedData) {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
args[nonIndexedInputs[i]!.name! || index] = decodedData[i]
|
|
553
|
-
}
|
|
552
|
+
for (let i = 0; i < nonIndexedInputs.length; i++) {
|
|
553
|
+
const index = nonIndexedOriginalIndex[i]!
|
|
554
|
+
args[isUnnamed ? index : nonIndexedInputs[i]!.name || index] =
|
|
555
|
+
decodedData[i]
|
|
554
556
|
}
|
|
555
557
|
}
|
|
556
558
|
} catch (err) {
|
package/src/core/Blobs.ts
CHANGED
|
@@ -398,8 +398,10 @@ export function to<
|
|
|
398
398
|
const data = Cursor.create(new Uint8Array(length))
|
|
399
399
|
let active = true
|
|
400
400
|
|
|
401
|
-
for (const blob of blobs_) {
|
|
401
|
+
for (const [index, blob] of blobs_.entries()) {
|
|
402
402
|
const cursor = Cursor.create(blob)
|
|
403
|
+
// Only the final blob contains a terminator; preceding blobs contain only data.
|
|
404
|
+
const isLastBlob = index === blobs_.length - 1
|
|
403
405
|
while (active && cursor.position < blob.length) {
|
|
404
406
|
// First byte will be a zero 0x00 byte – we can skip.
|
|
405
407
|
cursor.incrementPosition(1)
|
|
@@ -411,7 +413,9 @@ export function to<
|
|
|
411
413
|
for (let i = 0; i < consume; i++) {
|
|
412
414
|
const byte = cursor.readByte()
|
|
413
415
|
const isTerminator =
|
|
414
|
-
|
|
416
|
+
isLastBlob &&
|
|
417
|
+
byte === 0x80 &&
|
|
418
|
+
!cursor.inspectBytes(cursor.remaining).includes(0x80)
|
|
415
419
|
if (isTerminator) {
|
|
416
420
|
active = false
|
|
417
421
|
break
|
package/src/core/Signature.ts
CHANGED
|
@@ -564,13 +564,16 @@ export declare namespace toBytes {
|
|
|
564
564
|
*/
|
|
565
565
|
export function toCompactBytes(signature: Signature<boolean>): Bytes.Bytes {
|
|
566
566
|
const bytes = new Uint8Array(64)
|
|
567
|
-
bytes.set(Bytes.fromHex(signature.r,
|
|
568
|
-
bytes.set(Bytes.fromHex(signature.s,
|
|
567
|
+
bytes.set(Bytes.fromHex(Hex.padLeft(signature.r, 32)), 0)
|
|
568
|
+
bytes.set(Bytes.fromHex(Hex.padLeft(signature.s, 32)), 32)
|
|
569
569
|
return bytes
|
|
570
570
|
}
|
|
571
571
|
|
|
572
572
|
export declare namespace toCompactBytes {
|
|
573
|
-
type ErrorType =
|
|
573
|
+
type ErrorType =
|
|
574
|
+
| Hex.padLeft.ErrorType
|
|
575
|
+
| Bytes.fromHex.ErrorType
|
|
576
|
+
| Errors.GlobalErrorType
|
|
574
577
|
}
|
|
575
578
|
|
|
576
579
|
/**
|
|
@@ -591,6 +594,8 @@ export declare namespace toCompactBytes {
|
|
|
591
594
|
* @returns The decoded {@link ox#Signature.Signature}.
|
|
592
595
|
*/
|
|
593
596
|
export function fromCompactBytes(bytes: Bytes.Bytes): Signature<false> {
|
|
597
|
+
if (bytes.length !== 64)
|
|
598
|
+
throw new InvalidSerializedSizeError({ expectedSize: 64, signature: bytes })
|
|
594
599
|
return {
|
|
595
600
|
r: Hex.fromBytes(bytes.subarray(0, 32)),
|
|
596
601
|
s: Hex.fromBytes(bytes.subarray(32, 64)),
|
|
@@ -598,7 +603,10 @@ export function fromCompactBytes(bytes: Bytes.Bytes): Signature<false> {
|
|
|
598
603
|
}
|
|
599
604
|
|
|
600
605
|
export declare namespace fromCompactBytes {
|
|
601
|
-
type ErrorType =
|
|
606
|
+
type ErrorType =
|
|
607
|
+
| Hex.fromBytes.ErrorType
|
|
608
|
+
| InvalidSerializedSizeError
|
|
609
|
+
| Errors.GlobalErrorType
|
|
602
610
|
}
|
|
603
611
|
|
|
604
612
|
/**
|
|
@@ -621,15 +629,20 @@ export declare namespace fromCompactBytes {
|
|
|
621
629
|
* @returns The 65-byte recovered representation.
|
|
622
630
|
*/
|
|
623
631
|
export function toRecoveredBytes(signature: Signature): Bytes.Bytes {
|
|
632
|
+
assert(signature, { recovered: true })
|
|
624
633
|
const bytes = new Uint8Array(65)
|
|
625
634
|
bytes[0] = signature.yParity
|
|
626
|
-
bytes.set(Bytes.fromHex(signature.r,
|
|
627
|
-
bytes.set(Bytes.fromHex(signature.s,
|
|
635
|
+
bytes.set(Bytes.fromHex(Hex.padLeft(signature.r, 32)), 1)
|
|
636
|
+
bytes.set(Bytes.fromHex(Hex.padLeft(signature.s, 32)), 33)
|
|
628
637
|
return bytes
|
|
629
638
|
}
|
|
630
639
|
|
|
631
640
|
export declare namespace toRecoveredBytes {
|
|
632
|
-
type ErrorType =
|
|
641
|
+
type ErrorType =
|
|
642
|
+
| assert.ErrorType
|
|
643
|
+
| Hex.padLeft.ErrorType
|
|
644
|
+
| Bytes.fromHex.ErrorType
|
|
645
|
+
| Errors.GlobalErrorType
|
|
633
646
|
}
|
|
634
647
|
|
|
635
648
|
/**
|
|
@@ -650,15 +663,24 @@ export declare namespace toRecoveredBytes {
|
|
|
650
663
|
* @returns The decoded {@link ox#Signature.Signature}.
|
|
651
664
|
*/
|
|
652
665
|
export function fromRecoveredBytes(bytes: Bytes.Bytes): Signature {
|
|
666
|
+
if (bytes.length !== 65)
|
|
667
|
+
throw new InvalidSerializedSizeError({ expectedSize: 65, signature: bytes })
|
|
668
|
+
const yParity = bytes[0]!
|
|
669
|
+
if (yParity !== 0 && yParity !== 1)
|
|
670
|
+
throw new InvalidYParityError({ value: yParity })
|
|
653
671
|
return {
|
|
654
672
|
r: Hex.fromBytes(bytes.subarray(1, 33)),
|
|
655
673
|
s: Hex.fromBytes(bytes.subarray(33, 65)),
|
|
656
|
-
yParity
|
|
674
|
+
yParity,
|
|
657
675
|
}
|
|
658
676
|
}
|
|
659
677
|
|
|
660
678
|
export declare namespace fromRecoveredBytes {
|
|
661
|
-
type ErrorType =
|
|
679
|
+
type ErrorType =
|
|
680
|
+
| Hex.fromBytes.ErrorType
|
|
681
|
+
| InvalidSerializedSizeError
|
|
682
|
+
| InvalidYParityError
|
|
683
|
+
| Errors.GlobalErrorType
|
|
662
684
|
}
|
|
663
685
|
|
|
664
686
|
/**
|
|
@@ -945,10 +967,18 @@ export declare namespace yParityToV {
|
|
|
945
967
|
export class InvalidSerializedSizeError extends Errors.BaseError {
|
|
946
968
|
override readonly name = 'Signature.InvalidSerializedSizeError'
|
|
947
969
|
|
|
948
|
-
constructor({
|
|
970
|
+
constructor({
|
|
971
|
+
expectedSize,
|
|
972
|
+
signature,
|
|
973
|
+
}: {
|
|
974
|
+
expectedSize?: number | undefined
|
|
975
|
+
signature: Hex.Hex | Bytes.Bytes
|
|
976
|
+
}) {
|
|
949
977
|
super(`Value \`${signature}\` is an invalid signature size.`, {
|
|
950
978
|
metaMessages: [
|
|
951
|
-
|
|
979
|
+
typeof expectedSize === 'number'
|
|
980
|
+
? `Expected: ${expectedSize} bytes.`
|
|
981
|
+
: 'Expected: 64 bytes or 65 bytes.',
|
|
952
982
|
`Received ${Hex.size(Hex.from(signature))} bytes.`,
|
|
953
983
|
],
|
|
954
984
|
})
|
package/src/core/Siwe.ts
CHANGED
|
@@ -330,11 +330,12 @@ export function isUri(value: string): false | string {
|
|
|
330
330
|
const fragment = splitted[5]
|
|
331
331
|
|
|
332
332
|
// scheme and path are required, though the path can be empty
|
|
333
|
-
if (!(scheme?.length && path
|
|
333
|
+
if (!(scheme?.length && path !== undefined)) return false
|
|
334
334
|
|
|
335
335
|
// if authority is present, the path must be empty or begin with a /
|
|
336
336
|
if (authority?.length) {
|
|
337
337
|
if (!(path.length === 0 || path.startsWith('/'))) return false
|
|
338
|
+
if (path.length === 0 && !isAuthority(authority)) return false
|
|
338
339
|
} else {
|
|
339
340
|
// if authority is not present, the path must not start with //
|
|
340
341
|
if (path.startsWith('//')) return false
|
|
@@ -356,6 +357,24 @@ export function isUri(value: string): false | string {
|
|
|
356
357
|
return out
|
|
357
358
|
}
|
|
358
359
|
|
|
360
|
+
function isAuthority(value: string) {
|
|
361
|
+
const host = value.match(/^(?:[a-z0-9._~!$&'()*+,;=:%-]*@)?(.*)$/i)?.[1]
|
|
362
|
+
if (host === undefined) return false
|
|
363
|
+
|
|
364
|
+
const ipLiteral = host.match(/^\[([^\]]+)\](?::\d*)?$/)?.[1]
|
|
365
|
+
if (ipLiteral) {
|
|
366
|
+
if (/^v[0-9a-f]+\.[a-z0-9._~!$&'()*+,;=:-]+$/i.test(ipLiteral)) return true
|
|
367
|
+
try {
|
|
368
|
+
new URL(`http://[${ipLiteral}]`)
|
|
369
|
+
return true
|
|
370
|
+
} catch {
|
|
371
|
+
return false
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return /^(?:[a-z0-9._~!$&'()*+,;=%-]*)(?::\d*)?$/i.test(host)
|
|
376
|
+
}
|
|
377
|
+
|
|
359
378
|
function splitUri(value: string) {
|
|
360
379
|
return value.match(
|
|
361
380
|
/(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/,
|
|
@@ -330,6 +330,51 @@ describe('decode', () => {
|
|
|
330
330
|
`)
|
|
331
331
|
})
|
|
332
332
|
|
|
333
|
+
test('behavior: unnamed, non-indexed input before indexed input (array mode)', () => {
|
|
334
|
+
// Declaration order (uint256, bool indexed) differs from indexed-subset
|
|
335
|
+
// order (bool is the only indexed input). Args must still come back in
|
|
336
|
+
// declaration order, not indexed-subset order.
|
|
337
|
+
const foo = AbiEvent.from('event Foo(uint256, bool indexed)')
|
|
338
|
+
const decoded = AbiEvent.decode(foo, {
|
|
339
|
+
data: '0x0000000000000000000000000000000000000000000000000000000000000111',
|
|
340
|
+
topics: [
|
|
341
|
+
'0x79c52e97493a8f32348c3cf1ebfe4a8dfaeb083ca12cddd87b5d9f7c00d3ccaa',
|
|
342
|
+
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
343
|
+
],
|
|
344
|
+
})
|
|
345
|
+
expect(decoded).toMatchInlineSnapshot(`
|
|
346
|
+
[
|
|
347
|
+
273n,
|
|
348
|
+
true,
|
|
349
|
+
]
|
|
350
|
+
`)
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
test('behavior: named + unnamed, indexed input interleaved with non-indexed (mixed mode)', () => {
|
|
354
|
+
// `a` (indexed) and the trailing unnamed `address` (indexed) are not a
|
|
355
|
+
// contiguous prefix of declaration order — a non-indexed `bool` sits
|
|
356
|
+
// between them. All three values must be present and at the correct
|
|
357
|
+
// declaration-order keys; none may be silently dropped or overwritten.
|
|
358
|
+
const foo = AbiEvent.from(
|
|
359
|
+
'event Foo(uint256 indexed a, bool, address indexed)',
|
|
360
|
+
)
|
|
361
|
+
const decoded = AbiEvent.decode(foo, {
|
|
362
|
+
data: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
363
|
+
topics: [
|
|
364
|
+
'0xbf5963a29fe665781e91d832989689110056ee09e32656ea57265dbb1084006e',
|
|
365
|
+
'0x0000000000000000000000000000000000000000000000000000000000000aaa',
|
|
366
|
+
'0x00000000000000000000000000cccccccccccccccccccccccccccccccccccccc',
|
|
367
|
+
],
|
|
368
|
+
})
|
|
369
|
+
expect(decoded).toMatchInlineSnapshot(`
|
|
370
|
+
{
|
|
371
|
+
"1": true,
|
|
372
|
+
"2": "0x00CCCCCCccCcCccCCcccCCcccCcCcCccCcCcCCcc",
|
|
373
|
+
"a": 2730n,
|
|
374
|
+
}
|
|
375
|
+
`)
|
|
376
|
+
})
|
|
377
|
+
|
|
333
378
|
test('error: topics mismatch, named', () => {
|
|
334
379
|
const transfer = AbiEvent.from(
|
|
335
380
|
'event Transfer(address indexed from, address to, uint256 indexed value)',
|
|
@@ -415,6 +415,28 @@ describe('to', () => {
|
|
|
415
415
|
const blobs = Blobs.from(data)
|
|
416
416
|
expect(Blobs.to(blobs, 'Bytes')).toEqual(data)
|
|
417
417
|
})
|
|
418
|
+
|
|
419
|
+
test('0x80 byte in a non-final blob is not mistaken for the terminator', () => {
|
|
420
|
+
// This payload spans multiple blobs and places terminator-shaped data in the first blob.
|
|
421
|
+
const size = 200_000
|
|
422
|
+
const data = new Uint8Array(size).fill(0x41)
|
|
423
|
+
data[1_000] = 0x80
|
|
424
|
+
data[100_000] = 0x80
|
|
425
|
+
|
|
426
|
+
const blobs = Blobs.from(data)
|
|
427
|
+
expect(blobs.length).toBeGreaterThan(1)
|
|
428
|
+
expect(Blobs.to(blobs, 'Bytes')).toEqual(data)
|
|
429
|
+
})
|
|
430
|
+
|
|
431
|
+
test('all-0x80 data exactly filling the first blob leaves a terminator-only final blob', () => {
|
|
432
|
+
// Exact first-blob capacity forces `Blobs.from` to place the terminator in a second blob.
|
|
433
|
+
const size = 31 * Blobs.fieldElementsPerBlob
|
|
434
|
+
const data = new Uint8Array(size).fill(0x80)
|
|
435
|
+
|
|
436
|
+
const blobs = Blobs.from(data)
|
|
437
|
+
expect(blobs.length).toBe(2)
|
|
438
|
+
expect(Blobs.to(blobs, 'Bytes')).toEqual(data)
|
|
439
|
+
})
|
|
418
440
|
})
|
|
419
441
|
|
|
420
442
|
describe('toCommitments', () => {
|