ox 0.10.6 → 0.11.0
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 +6 -0
- package/_cjs/tempo/SignatureEnvelope.js +2 -2
- package/_cjs/version.js +1 -1
- package/_esm/tempo/SignatureEnvelope.js +2 -2
- package/_esm/version.js +1 -1
- package/_types/tempo/SignatureEnvelope.d.ts +1 -1
- package/_types/version.d.ts +1 -1
- package/package.json +1 -1
- package/tempo/AuthorizationTempo.test.ts +4 -4
- package/tempo/KeyAuthorization.test.ts +2 -2
- package/tempo/SignatureEnvelope.test.ts +4 -4
- package/tempo/SignatureEnvelope.ts +3 -3
- package/tempo/e2e.test.ts +14 -7
- package/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# ox
|
|
2
2
|
|
|
3
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`4c55afa`](https://github.com/wevm/ox/commit/4c55afa2c942eb86789b1315e5b4ccc4611aafca) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Renamed `prehash` to `preHash` on `KeyAuthorization#P256Rpc`
|
|
8
|
+
|
|
3
9
|
## 0.10.6
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -199,7 +199,7 @@ function fromRpc(envelope) {
|
|
|
199
199
|
};
|
|
200
200
|
if (envelope.type === 'p256') {
|
|
201
201
|
return {
|
|
202
|
-
prehash: envelope.
|
|
202
|
+
prehash: envelope.preHash,
|
|
203
203
|
publicKey: {
|
|
204
204
|
prefix: 4,
|
|
205
205
|
x: Hex.toBigInt(envelope.pubKeyX),
|
|
@@ -323,7 +323,7 @@ function toRpc(envelope) {
|
|
|
323
323
|
if (type === 'p256') {
|
|
324
324
|
const p256 = envelope;
|
|
325
325
|
return {
|
|
326
|
-
|
|
326
|
+
preHash: p256.prehash,
|
|
327
327
|
pubKeyX: Hex.fromNumber(p256.publicKey.x, { size: 32 }),
|
|
328
328
|
pubKeyY: Hex.fromNumber(p256.publicKey.y, { size: 32 }),
|
|
329
329
|
r: Hex.fromNumber(p256.signature.r, { size: 32 }),
|
package/_cjs/version.js
CHANGED
|
@@ -374,7 +374,7 @@ export function fromRpc(envelope) {
|
|
|
374
374
|
};
|
|
375
375
|
if (envelope.type === 'p256') {
|
|
376
376
|
return {
|
|
377
|
-
prehash: envelope.
|
|
377
|
+
prehash: envelope.preHash,
|
|
378
378
|
publicKey: {
|
|
379
379
|
prefix: 4,
|
|
380
380
|
x: Hex.toBigInt(envelope.pubKeyX),
|
|
@@ -566,7 +566,7 @@ export function toRpc(envelope) {
|
|
|
566
566
|
if (type === 'p256') {
|
|
567
567
|
const p256 = envelope;
|
|
568
568
|
return {
|
|
569
|
-
|
|
569
|
+
preHash: p256.prehash,
|
|
570
570
|
pubKeyX: Hex.fromNumber(p256.publicKey.x, { size: 32 }),
|
|
571
571
|
pubKeyY: Hex.fromNumber(p256.publicKey.y, { size: 32 }),
|
|
572
572
|
r: Hex.fromNumber(p256.signature.r, { size: 32 }),
|
package/_esm/version.js
CHANGED
package/_types/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -303,7 +303,7 @@ describe('fromRpc', () => {
|
|
|
303
303
|
chainId: '0x1',
|
|
304
304
|
nonce: '0x1',
|
|
305
305
|
signature: {
|
|
306
|
-
|
|
306
|
+
preHash: true,
|
|
307
307
|
pubKeyX:
|
|
308
308
|
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
309
309
|
pubKeyY:
|
|
@@ -408,7 +408,7 @@ describe('fromRpcList', () => {
|
|
|
408
408
|
chainId: '0x1',
|
|
409
409
|
nonce: '0x1',
|
|
410
410
|
signature: {
|
|
411
|
-
|
|
411
|
+
preHash: true,
|
|
412
412
|
pubKeyX:
|
|
413
413
|
'0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
414
414
|
pubKeyY:
|
|
@@ -423,7 +423,7 @@ describe('fromRpcList', () => {
|
|
|
423
423
|
chainId: '0x2',
|
|
424
424
|
nonce: '0x2',
|
|
425
425
|
signature: {
|
|
426
|
-
|
|
426
|
+
preHash: false,
|
|
427
427
|
pubKeyX:
|
|
428
428
|
'0x0000000000000000000000000000000000000000000000000000000000000003',
|
|
429
429
|
pubKeyY:
|
|
@@ -579,7 +579,7 @@ describe('fromRpcList', () => {
|
|
|
579
579
|
chainId: '0x2',
|
|
580
580
|
nonce: '0x2',
|
|
581
581
|
signature: {
|
|
582
|
-
|
|
582
|
+
preHash: true,
|
|
583
583
|
pubKeyX:
|
|
584
584
|
'0x0000000000000000000000000000000000000000000000000000000000000003',
|
|
585
585
|
pubKeyY:
|
|
@@ -439,7 +439,7 @@ describe('fromRpc', () => {
|
|
|
439
439
|
limits: [{ token, limit: '0x989680' }],
|
|
440
440
|
signature: {
|
|
441
441
|
type: 'p256',
|
|
442
|
-
|
|
442
|
+
preHash: true,
|
|
443
443
|
pubKeyX: Hex.fromNumber(publicKey_p256.x),
|
|
444
444
|
pubKeyY: Hex.fromNumber(publicKey_p256.y),
|
|
445
445
|
r: Hex.fromNumber(signature_p256_raw.r),
|
|
@@ -1013,7 +1013,7 @@ describe('toRpc', () => {
|
|
|
1013
1013
|
},
|
|
1014
1014
|
],
|
|
1015
1015
|
"signature": {
|
|
1016
|
-
"
|
|
1016
|
+
"preHash": true,
|
|
1017
1017
|
"pubKeyX": "0xad8ac16e167d6992c3e120d7f17d2376bc1cbcf30c46ba6dd00ce07303e742f5",
|
|
1018
1018
|
"pubKeyY": "0x11edf6ce1c32de66846f56afa7be1cbd729bc35750b6d0cdcf3ec9d75461aba0",
|
|
1019
1019
|
"r": "0xccbb3485d4726235f13cb15ef394fb7158179fb7b1925eccec0147671090c52e",
|
|
@@ -1907,7 +1907,7 @@ describe('fromRpc', () => {
|
|
|
1907
1907
|
describe('p256', () => {
|
|
1908
1908
|
test('behavior: converts RPC P256 signature', () => {
|
|
1909
1909
|
const rpc: SignatureEnvelope.P256Rpc = {
|
|
1910
|
-
|
|
1910
|
+
preHash: true,
|
|
1911
1911
|
pubKeyX: Hex.fromNumber(publicKey.x, { size: 32 }),
|
|
1912
1912
|
pubKeyY: Hex.fromNumber(publicKey.y, { size: 32 }),
|
|
1913
1913
|
r: Hex.fromNumber(p256Signature.r, { size: 32 }),
|
|
@@ -2005,7 +2005,7 @@ describe('fromRpc', () => {
|
|
|
2005
2005
|
type: 'keychain',
|
|
2006
2006
|
userAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
|
|
2007
2007
|
signature: {
|
|
2008
|
-
|
|
2008
|
+
preHash: true,
|
|
2009
2009
|
pubKeyX: Hex.fromNumber(publicKey.x, { size: 32 }),
|
|
2010
2010
|
pubKeyY: Hex.fromNumber(publicKey.y, { size: 32 }),
|
|
2011
2011
|
r: Hex.fromNumber(p256Signature.r, { size: 32 }),
|
|
@@ -2108,7 +2108,7 @@ describe('toRpc', () => {
|
|
|
2108
2108
|
const rpc = SignatureEnvelope.toRpc(signature_p256)
|
|
2109
2109
|
|
|
2110
2110
|
expect(rpc.type).toBe('p256')
|
|
2111
|
-
expect(rpc.
|
|
2111
|
+
expect(rpc.preHash).toBe(true)
|
|
2112
2112
|
expect(typeof rpc.pubKeyX).toBe('string')
|
|
2113
2113
|
expect(typeof rpc.pubKeyY).toBe('string')
|
|
2114
2114
|
expect(typeof rpc.r).toBe('string')
|
|
@@ -2119,7 +2119,7 @@ describe('toRpc', () => {
|
|
|
2119
2119
|
const withPrehashFalse = { ...signature_p256, prehash: false }
|
|
2120
2120
|
const rpc = SignatureEnvelope.toRpc(withPrehashFalse)
|
|
2121
2121
|
|
|
2122
|
-
expect(rpc.
|
|
2122
|
+
expect(rpc.preHash).toBe(false)
|
|
2123
2123
|
})
|
|
2124
2124
|
})
|
|
2125
2125
|
|
|
@@ -128,7 +128,7 @@ export type P256<bigintType = bigint, numberType = number> = {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
export type P256Rpc = {
|
|
131
|
-
|
|
131
|
+
preHash: boolean
|
|
132
132
|
pubKeyX: Hex.Hex
|
|
133
133
|
pubKeyY: Hex.Hex
|
|
134
134
|
r: Hex.Hex
|
|
@@ -597,7 +597,7 @@ export function fromRpc(envelope: SignatureEnvelopeRpc): SignatureEnvelope {
|
|
|
597
597
|
|
|
598
598
|
if (envelope.type === 'p256') {
|
|
599
599
|
return {
|
|
600
|
-
prehash: envelope.
|
|
600
|
+
prehash: envelope.preHash,
|
|
601
601
|
publicKey: {
|
|
602
602
|
prefix: 4,
|
|
603
603
|
x: Hex.toBigInt(envelope.pubKeyX),
|
|
@@ -874,7 +874,7 @@ export function toRpc(envelope: SignatureEnvelope): SignatureEnvelopeRpc {
|
|
|
874
874
|
if (type === 'p256') {
|
|
875
875
|
const p256 = envelope as P256
|
|
876
876
|
return {
|
|
877
|
-
|
|
877
|
+
preHash: p256.prehash,
|
|
878
878
|
pubKeyX: Hex.fromNumber(p256.publicKey.x, { size: 32 }),
|
|
879
879
|
pubKeyY: Hex.fromNumber(p256.publicKey.y, { size: 32 }),
|
|
880
880
|
r: Hex.fromNumber(p256.signature.r, { size: 32 }),
|
package/tempo/e2e.test.ts
CHANGED
|
@@ -131,6 +131,7 @@ test('behavior: default (secp256k1)', async () => {
|
|
|
131
131
|
feePayer,
|
|
132
132
|
feeToken: _,
|
|
133
133
|
from,
|
|
134
|
+
gasUsed,
|
|
134
135
|
logs,
|
|
135
136
|
logsBloom,
|
|
136
137
|
transactionHash,
|
|
@@ -143,6 +144,7 @@ test('behavior: default (secp256k1)', async () => {
|
|
|
143
144
|
expect(cumulativeGasUsed).toBeDefined()
|
|
144
145
|
expect(feePayer).toBeDefined()
|
|
145
146
|
expect(from).toBe(address)
|
|
147
|
+
expect(gasUsed).toBeDefined()
|
|
146
148
|
expect(logs).toBeDefined()
|
|
147
149
|
expect(logsBloom).toBeDefined()
|
|
148
150
|
expect(transactionHash).toBe(receipt.transactionHash)
|
|
@@ -153,7 +155,6 @@ test('behavior: default (secp256k1)', async () => {
|
|
|
153
155
|
"blobGasUsed": undefined,
|
|
154
156
|
"contractAddress": null,
|
|
155
157
|
"effectiveGasPrice": 20000000000n,
|
|
156
|
-
"gasUsed": 23600n,
|
|
157
158
|
"status": "success",
|
|
158
159
|
"to": "0x0000000000000000000000000000000000000000",
|
|
159
160
|
"type": "0x76",
|
|
@@ -339,6 +340,7 @@ test('behavior: default (p256)', async () => {
|
|
|
339
340
|
feePayer,
|
|
340
341
|
feeToken: _,
|
|
341
342
|
from,
|
|
343
|
+
gasUsed,
|
|
342
344
|
logs,
|
|
343
345
|
logsBloom,
|
|
344
346
|
transactionHash,
|
|
@@ -351,6 +353,7 @@ test('behavior: default (p256)', async () => {
|
|
|
351
353
|
expect(cumulativeGasUsed).toBeDefined()
|
|
352
354
|
expect(feePayer).toBeDefined()
|
|
353
355
|
expect(from).toBe(address)
|
|
356
|
+
expect(gasUsed).toBeDefined()
|
|
354
357
|
expect(logs).toBeDefined()
|
|
355
358
|
expect(logsBloom).toBeDefined()
|
|
356
359
|
expect(transactionHash).toBe(receipt.transactionHash)
|
|
@@ -361,7 +364,6 @@ test('behavior: default (p256)', async () => {
|
|
|
361
364
|
"blobGasUsed": undefined,
|
|
362
365
|
"contractAddress": null,
|
|
363
366
|
"effectiveGasPrice": 20000000000n,
|
|
364
|
-
"gasUsed": 28600n,
|
|
365
367
|
"status": "success",
|
|
366
368
|
"to": "0x0000000000000000000000000000000000000000",
|
|
367
369
|
"type": "0x76",
|
|
@@ -479,6 +481,7 @@ test('behavior: default (p256 - webcrypto)', async () => {
|
|
|
479
481
|
feePayer,
|
|
480
482
|
feeToken: _,
|
|
481
483
|
from,
|
|
484
|
+
gasUsed,
|
|
482
485
|
logs,
|
|
483
486
|
logsBloom,
|
|
484
487
|
transactionHash,
|
|
@@ -491,6 +494,7 @@ test('behavior: default (p256 - webcrypto)', async () => {
|
|
|
491
494
|
expect(cumulativeGasUsed).toBeDefined()
|
|
492
495
|
expect(feePayer).toBeDefined()
|
|
493
496
|
expect(from).toBeDefined()
|
|
497
|
+
expect(gasUsed).toBeDefined()
|
|
494
498
|
expect(logs).toBeDefined()
|
|
495
499
|
expect(logsBloom).toBeDefined()
|
|
496
500
|
expect(transactionHash).toBe(receipt.transactionHash)
|
|
@@ -501,7 +505,6 @@ test('behavior: default (p256 - webcrypto)', async () => {
|
|
|
501
505
|
"blobGasUsed": undefined,
|
|
502
506
|
"contractAddress": null,
|
|
503
507
|
"effectiveGasPrice": 20000000000n,
|
|
504
|
-
"gasUsed": 28600n,
|
|
505
508
|
"status": "success",
|
|
506
509
|
"to": "0x0000000000000000000000000000000000000000",
|
|
507
510
|
"type": "0x76",
|
|
@@ -626,6 +629,7 @@ test('behavior: default (webauthn)', async () => {
|
|
|
626
629
|
feePayer,
|
|
627
630
|
feeToken: _,
|
|
628
631
|
from,
|
|
632
|
+
gasUsed,
|
|
629
633
|
logs,
|
|
630
634
|
logsBloom,
|
|
631
635
|
transactionHash,
|
|
@@ -638,6 +642,7 @@ test('behavior: default (webauthn)', async () => {
|
|
|
638
642
|
expect(cumulativeGasUsed).toBeDefined()
|
|
639
643
|
expect(feePayer).toBeDefined()
|
|
640
644
|
expect(from).toBe(address)
|
|
645
|
+
expect(gasUsed).toBeDefined()
|
|
641
646
|
expect(logs).toBeDefined()
|
|
642
647
|
expect(logsBloom).toBeDefined()
|
|
643
648
|
expect(transactionHash).toBe(receipt.transactionHash)
|
|
@@ -648,7 +653,6 @@ test('behavior: default (webauthn)', async () => {
|
|
|
648
653
|
"blobGasUsed": undefined,
|
|
649
654
|
"contractAddress": null,
|
|
650
655
|
"effectiveGasPrice": 20000000000n,
|
|
651
|
-
"gasUsed": 31208n,
|
|
652
656
|
"status": "success",
|
|
653
657
|
"to": "0x0000000000000000000000000000000000000000",
|
|
654
658
|
"type": "0x76",
|
|
@@ -733,6 +737,7 @@ test('behavior: feePayerSignature (user → feePayer)', async () => {
|
|
|
733
737
|
feePayer,
|
|
734
738
|
feeToken: _,
|
|
735
739
|
from,
|
|
740
|
+
gasUsed,
|
|
736
741
|
logs,
|
|
737
742
|
logsBloom,
|
|
738
743
|
transactionHash,
|
|
@@ -745,6 +750,7 @@ test('behavior: feePayerSignature (user → feePayer)', async () => {
|
|
|
745
750
|
expect(cumulativeGasUsed).toBeDefined()
|
|
746
751
|
expect(feePayer).toBe(feePayerAddress)
|
|
747
752
|
expect(from).toBe(senderAddress)
|
|
753
|
+
expect(gasUsed).toBeDefined()
|
|
748
754
|
expect(logs).toBeDefined()
|
|
749
755
|
expect(logsBloom).toBeDefined()
|
|
750
756
|
expect(transactionHash).toBe(receipt.transactionHash)
|
|
@@ -755,7 +761,6 @@ test('behavior: feePayerSignature (user → feePayer)', async () => {
|
|
|
755
761
|
"blobGasUsed": undefined,
|
|
756
762
|
"contractAddress": null,
|
|
757
763
|
"effectiveGasPrice": 20000000000n,
|
|
758
|
-
"gasUsed": 23600n,
|
|
759
764
|
"status": "success",
|
|
760
765
|
"to": "0x0000000000000000000000000000000000000000",
|
|
761
766
|
"type": "0x76",
|
|
@@ -920,6 +925,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
920
925
|
feePayer,
|
|
921
926
|
feeToken,
|
|
922
927
|
from,
|
|
928
|
+
gasUsed,
|
|
923
929
|
logs,
|
|
924
930
|
logsBloom,
|
|
925
931
|
transactionHash,
|
|
@@ -932,6 +938,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
932
938
|
expect(cumulativeGasUsed).toBeDefined()
|
|
933
939
|
expect(feeToken).toBeDefined()
|
|
934
940
|
expect(feePayer).toBeDefined()
|
|
941
|
+
expect(gasUsed).toBeDefined()
|
|
935
942
|
expect(from).toBeDefined()
|
|
936
943
|
expect(logs).toBeDefined()
|
|
937
944
|
expect(logsBloom).toBeDefined()
|
|
@@ -943,7 +950,6 @@ describe('behavior: keyAuthorization', () => {
|
|
|
943
950
|
"blobGasUsed": undefined,
|
|
944
951
|
"contractAddress": null,
|
|
945
952
|
"effectiveGasPrice": 20000000000n,
|
|
946
|
-
"gasUsed": 23600n,
|
|
947
953
|
"status": "success",
|
|
948
954
|
"to": "0x0000000000000000000000000000000000000000",
|
|
949
955
|
"type": "0x76",
|
|
@@ -1131,6 +1137,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1131
1137
|
feePayer,
|
|
1132
1138
|
feeToken,
|
|
1133
1139
|
from,
|
|
1140
|
+
gasUsed,
|
|
1134
1141
|
logs,
|
|
1135
1142
|
logsBloom,
|
|
1136
1143
|
transactionHash,
|
|
@@ -1144,6 +1151,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1144
1151
|
expect(feePayer).toBeDefined()
|
|
1145
1152
|
expect(feeToken).toBeDefined()
|
|
1146
1153
|
expect(from).toBeDefined()
|
|
1154
|
+
expect(gasUsed).toBeDefined()
|
|
1147
1155
|
expect(logs).toBeDefined()
|
|
1148
1156
|
expect(logsBloom).toBeDefined()
|
|
1149
1157
|
expect(transactionHash).toBe(receipt.transactionHash)
|
|
@@ -1154,7 +1162,6 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1154
1162
|
"blobGasUsed": undefined,
|
|
1155
1163
|
"contractAddress": null,
|
|
1156
1164
|
"effectiveGasPrice": 20000000000n,
|
|
1157
|
-
"gasUsed": 28600n,
|
|
1158
1165
|
"status": "success",
|
|
1159
1166
|
"to": "0x0000000000000000000000000000000000000000",
|
|
1160
1167
|
"type": "0x76",
|
package/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @internal */
|
|
2
|
-
export const version = '0.
|
|
2
|
+
export const version = '0.11.0'
|