ox 1.8.1 → 1.8.3
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/dist/core/Frame.d.ts +23 -20
- package/dist/core/Frame.d.ts.map +1 -1
- package/dist/core/Frame.js +28 -23
- package/dist/core/Frame.js.map +1 -1
- package/dist/core/FrameReceipt.d.ts +23 -14
- package/dist/core/FrameReceipt.d.ts.map +1 -1
- package/dist/core/FrameReceipt.js +15 -11
- package/dist/core/FrameReceipt.js.map +1 -1
- package/dist/core/FrameRequest.d.ts +50 -0
- package/dist/core/FrameRequest.d.ts.map +1 -0
- package/dist/core/FrameRequest.js +59 -0
- package/dist/core/FrameRequest.js.map +1 -0
- package/dist/core/FrameSignature.d.ts +17 -16
- package/dist/core/FrameSignature.d.ts.map +1 -1
- package/dist/core/FrameSignature.js +38 -21
- package/dist/core/FrameSignature.js.map +1 -1
- package/dist/core/Siwe.d.ts.map +1 -1
- package/dist/core/Siwe.js +3 -3
- package/dist/core/Siwe.js.map +1 -1
- package/dist/core/Transaction.d.ts +2 -2
- package/dist/core/Transaction.d.ts.map +1 -1
- package/dist/core/Transaction.js.map +1 -1
- package/dist/core/TransactionRequest.d.ts +5 -5
- package/dist/core/TransactionRequest.d.ts.map +1 -1
- package/dist/core/TransactionRequest.js +3 -3
- package/dist/core/TransactionRequest.js.map +1 -1
- package/dist/core/TxEnvelope.d.ts +3 -1
- package/dist/core/TxEnvelope.d.ts.map +1 -1
- package/dist/core/TxEnvelope.js +9 -1
- package/dist/core/TxEnvelope.js.map +1 -1
- package/dist/core/TxEnvelopeEip8141.d.ts +4 -4
- package/dist/core/TxEnvelopeEip8141.js +8 -8
- package/dist/core/TxEnvelopeEip8141.js.map +1 -1
- package/dist/core/internal/rpcSchemas/eth.d.ts +16 -4
- package/dist/core/internal/rpcSchemas/eth.d.ts.map +1 -1
- package/dist/index.d.ts +21 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -5
- package/dist/index.js.map +1 -1
- package/dist/zod/Block.d.ts +49 -37
- package/dist/zod/Block.d.ts.map +1 -1
- package/dist/zod/Frame.d.ts +14 -14
- package/dist/zod/Frame.js +5 -5
- package/dist/zod/Frame.js.map +1 -1
- package/dist/zod/FrameReceipt.d.ts +42 -2
- package/dist/zod/FrameReceipt.d.ts.map +1 -1
- package/dist/zod/FrameReceipt.js +11 -1
- package/dist/zod/FrameReceipt.js.map +1 -1
- package/dist/zod/FrameRequest.d.ts +40 -0
- package/dist/zod/FrameRequest.d.ts.map +1 -0
- package/dist/zod/FrameRequest.js +37 -0
- package/dist/zod/FrameRequest.js.map +1 -0
- package/dist/zod/FrameSignature.d.ts +21 -13
- package/dist/zod/FrameSignature.d.ts.map +1 -1
- package/dist/zod/FrameSignature.js +10 -7
- package/dist/zod/FrameSignature.js.map +1 -1
- package/dist/zod/RpcSchema.d.ts +447 -265
- package/dist/zod/RpcSchema.d.ts.map +1 -1
- package/dist/zod/Transaction.d.ts +98 -74
- package/dist/zod/Transaction.d.ts.map +1 -1
- package/dist/zod/Transaction.js +4 -4
- package/dist/zod/Transaction.js.map +1 -1
- package/dist/zod/TransactionEnvelope.d.ts +50 -34
- package/dist/zod/TransactionEnvelope.d.ts.map +1 -1
- package/dist/zod/TransactionReceipt.d.ts +42 -2
- package/dist/zod/TransactionReceipt.d.ts.map +1 -1
- package/dist/zod/TransactionRequest.d.ts +29 -21
- package/dist/zod/TransactionRequest.d.ts.map +1 -1
- package/dist/zod/TransactionRequest.js +3 -3
- package/dist/zod/TransactionRequest.js.map +1 -1
- package/dist/zod/TxEnvelopeEip8141.d.ts +37 -25
- package/dist/zod/TxEnvelopeEip8141.d.ts.map +1 -1
- package/dist/zod/internal/rpcSchemas/Eth.d.ts +449 -267
- package/dist/zod/internal/rpcSchemas/Eth.d.ts.map +1 -1
- package/dist/zod/internal/rpcSchemas/Eth.js +9 -0
- package/dist/zod/internal/rpcSchemas/Eth.js.map +1 -1
- package/dist/zod/internal/rpcSchemas/Wallet.d.ts +49 -21
- package/dist/zod/internal/rpcSchemas/Wallet.d.ts.map +1 -1
- package/dist/zod/tempo/RpcSchemaTempo.d.ts +64 -48
- package/dist/zod/tempo/RpcSchemaTempo.d.ts.map +1 -1
- package/dist/zod/tempo/Transaction.d.ts +49 -37
- package/dist/zod/tempo/Transaction.d.ts.map +1 -1
- package/dist/zod/z.d.ts +1 -0
- package/dist/zod/z.d.ts.map +1 -1
- package/dist/zod/z.js +1 -0
- package/dist/zod/z.js.map +1 -1
- package/package.json +11 -1
- package/src/core/Frame.ts +41 -33
- package/src/core/FrameReceipt.ts +30 -16
- package/src/core/FrameRequest.ts +78 -0
- package/src/core/FrameSignature.ts +64 -34
- package/src/core/Siwe.ts +21 -13
- package/src/core/Transaction.ts +35 -24
- package/src/core/TransactionRequest.ts +9 -7
- package/src/core/TxEnvelope.ts +9 -1
- package/src/core/TxEnvelopeEip8141.ts +8 -8
- package/src/core/_test/AbiConstructor.test.ts +2 -0
- package/src/core/_test/Frame.test-d.ts +16 -7
- package/src/core/_test/Frame.test.ts +52 -24
- package/src/core/_test/FrameReceipt.test.ts +15 -9
- package/src/core/_test/FrameRequest.test-d.ts +16 -0
- package/src/core/_test/FrameRequest.test.ts +41 -0
- package/src/core/_test/FrameRpc.test.ts +131 -0
- package/src/core/_test/FrameSignature.test-d.ts +20 -0
- package/src/core/_test/FrameSignature.test.ts +132 -11
- package/src/core/_test/RpcSchema.test-d.ts +45 -0
- package/src/core/_test/Siwe.test.ts +147 -0
- package/src/core/_test/TransactionEnvelope.test.ts +1 -1
- package/src/core/_test/TransactionReceipt.test.ts +32 -6
- package/src/core/_test/TransactionRequest.test-d.ts +10 -1
- package/src/core/_test/TransactionRequest.test.ts +3 -2
- package/src/core/_test/TxEnvelopeEip8141.test-d.ts +2 -2
- package/src/core/_test/TxEnvelopeEip8141.test.ts +92 -53
- package/src/core/_test/index.test.ts +1 -0
- package/src/core/internal/rpcSchemas/eth.ts +13 -4
- package/src/index.ts +22 -5
- package/src/version.ts +1 -1
- package/src/zod/Frame.ts +5 -5
- package/src/zod/FrameReceipt.ts +11 -1
- package/src/zod/FrameRequest.ts +46 -0
- package/src/zod/FrameSignature.ts +10 -7
- package/src/zod/Transaction.ts +4 -4
- package/src/zod/TransactionRequest.ts +3 -3
- package/src/zod/_test/Frame.test.ts +13 -11
- package/src/zod/_test/FrameReceipt.test.ts +11 -4
- package/src/zod/_test/FrameRequest.test-d.ts +15 -0
- package/src/zod/_test/FrameRequest.test.ts +44 -0
- package/src/zod/_test/FrameSignature.test.ts +73 -9
- package/src/zod/_test/RpcSchema.test.ts +106 -0
- package/src/zod/_test/TransactionRequest.test.ts +61 -0
- package/src/zod/_test/TxEnvelopeEip8141.test.ts +3 -3
- package/src/zod/internal/rpcSchemas/Eth.ts +20 -0
- package/src/zod/z.ts +1 -0
|
@@ -214,3 +214,48 @@ test('eth_call accepts a 4-tuple with state + block overrides', () => {
|
|
|
214
214
|
]
|
|
215
215
|
>().toExtend<Params>()
|
|
216
216
|
})
|
|
217
|
+
|
|
218
|
+
test('frame fill responses do not require raw bytes or lookup metadata', () => {
|
|
219
|
+
type Filled = Extract<
|
|
220
|
+
RpcSchema.Eth,
|
|
221
|
+
{ Request: { method: 'eth_fillTransaction' } }
|
|
222
|
+
>['ReturnType']
|
|
223
|
+
const filled = {
|
|
224
|
+
tx: {
|
|
225
|
+
type: '0x6',
|
|
226
|
+
chainId: '0x1',
|
|
227
|
+
nonce: '0x0',
|
|
228
|
+
from: '0x1111111111111111111111111111111111111111',
|
|
229
|
+
frames: [
|
|
230
|
+
{
|
|
231
|
+
mode: '0x2',
|
|
232
|
+
flags: '0x0',
|
|
233
|
+
executionGas: '0x10000',
|
|
234
|
+
stateGas: '0x0',
|
|
235
|
+
value: '0x0',
|
|
236
|
+
data: '0x',
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
signatures: [{ scheme: '0x1' }],
|
|
240
|
+
maxFeePerGas: '0x2',
|
|
241
|
+
maxPriorityFeePerGas: '0x1',
|
|
242
|
+
maxFeePerBlobGas: '0x0',
|
|
243
|
+
blobVersionedHashes: [],
|
|
244
|
+
},
|
|
245
|
+
} as const satisfies Filled
|
|
246
|
+
expectTypeOf(filled).toExtend<Filled>()
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
test('frame simulation results expose payer and frame results', () => {
|
|
250
|
+
type Result = Extract<
|
|
251
|
+
RpcSchema.Eth,
|
|
252
|
+
{ Request: { method: 'eth_simulateV1' } }
|
|
253
|
+
>['ReturnType'][number]
|
|
254
|
+
type Call = NonNullable<Result['calls']>[number]
|
|
255
|
+
expectTypeOf<Call['payer']>().toEqualTypeOf<`0x${string}` | undefined>()
|
|
256
|
+
type Frame = NonNullable<Call['frameResults']>[number]
|
|
257
|
+
expectTypeOf<Frame['status']>().toEqualTypeOf<'0x0' | '0x1' | '0x2'>()
|
|
258
|
+
expectTypeOf<Frame['executionGasUsed']>().toEqualTypeOf<`0x${string}`>()
|
|
259
|
+
expectTypeOf<Frame['stateGasUsed']>().toEqualTypeOf<`0x${string}`>()
|
|
260
|
+
expectTypeOf<Frame['returnData']>().toEqualTypeOf<`0x${string}`>()
|
|
261
|
+
})
|
|
@@ -773,6 +773,153 @@ Resources:
|
|
|
773
773
|
`)
|
|
774
774
|
})
|
|
775
775
|
|
|
776
|
+
test('behavior: "Resources:" in statement', () => {
|
|
777
|
+
const message = `example.com wants you to sign in with your Ethereum account:
|
|
778
|
+
0xA0Cf798816D4b9b9866b5330EEa46a18382f251e
|
|
779
|
+
|
|
780
|
+
See the Resources: list below.
|
|
781
|
+
|
|
782
|
+
URI: https://example.com/path
|
|
783
|
+
Version: 1
|
|
784
|
+
Chain ID: 1
|
|
785
|
+
Nonce: foobarbaz
|
|
786
|
+
Issued At: 2023-02-01T00:00:00.000Z
|
|
787
|
+
Resources:
|
|
788
|
+
- https://example.com/foo
|
|
789
|
+
- https://example.com/bar`
|
|
790
|
+
const parsed = Siwe.parseMessage(message)
|
|
791
|
+
expect(parsed).toMatchInlineSnapshot(`
|
|
792
|
+
{
|
|
793
|
+
"address": "0xA0Cf798816D4b9b9866b5330EEa46a18382f251e",
|
|
794
|
+
"chainId": 1,
|
|
795
|
+
"domain": "example.com",
|
|
796
|
+
"issuedAt": 2023-02-01T00:00:00.000Z,
|
|
797
|
+
"nonce": "foobarbaz",
|
|
798
|
+
"resources": [
|
|
799
|
+
"https://example.com/foo",
|
|
800
|
+
"https://example.com/bar",
|
|
801
|
+
],
|
|
802
|
+
"statement": "See the Resources: list below.",
|
|
803
|
+
"uri": "https://example.com/path",
|
|
804
|
+
"version": "1",
|
|
805
|
+
}
|
|
806
|
+
`)
|
|
807
|
+
})
|
|
808
|
+
|
|
809
|
+
test('behavior: "Resources:" in statement without resources', () => {
|
|
810
|
+
const message = `example.com wants you to sign in with your Ethereum account:
|
|
811
|
+
0xA0Cf798816D4b9b9866b5330EEa46a18382f251e
|
|
812
|
+
|
|
813
|
+
See the Resources: page.
|
|
814
|
+
|
|
815
|
+
URI: https://example.com/path
|
|
816
|
+
Version: 1
|
|
817
|
+
Chain ID: 1
|
|
818
|
+
Nonce: foobarbaz
|
|
819
|
+
Issued At: 2023-02-01T00:00:00.000Z`
|
|
820
|
+
const parsed = Siwe.parseMessage(message)
|
|
821
|
+
expect(parsed.resources).toBeUndefined()
|
|
822
|
+
})
|
|
823
|
+
|
|
824
|
+
test('behavior: "Resources:" in uri', () => {
|
|
825
|
+
const message = `example.com wants you to sign in with your Ethereum account:
|
|
826
|
+
0xA0Cf798816D4b9b9866b5330EEa46a18382f251e
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
URI: https://example.com/Resources:path
|
|
830
|
+
Version: 1
|
|
831
|
+
Chain ID: 1
|
|
832
|
+
Nonce: foobarbaz
|
|
833
|
+
Issued At: 2023-02-01T00:00:00.000Z
|
|
834
|
+
Resources:
|
|
835
|
+
- https://example.com/foo`
|
|
836
|
+
const parsed = Siwe.parseMessage(message)
|
|
837
|
+
expect(parsed.resources).toMatchInlineSnapshot(`
|
|
838
|
+
[
|
|
839
|
+
"https://example.com/foo",
|
|
840
|
+
]
|
|
841
|
+
`)
|
|
842
|
+
})
|
|
843
|
+
|
|
844
|
+
test('behavior: "Resources:" in requestId', () => {
|
|
845
|
+
const message = `example.com wants you to sign in with your Ethereum account:
|
|
846
|
+
0xA0Cf798816D4b9b9866b5330EEa46a18382f251e
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
URI: https://example.com/path
|
|
850
|
+
Version: 1
|
|
851
|
+
Chain ID: 1
|
|
852
|
+
Nonce: foobarbaz
|
|
853
|
+
Issued At: 2023-02-01T00:00:00.000Z
|
|
854
|
+
Request ID: Resources:123
|
|
855
|
+
Resources:
|
|
856
|
+
- https://example.com/foo`
|
|
857
|
+
const parsed = Siwe.parseMessage(message)
|
|
858
|
+
expect(parsed.resources).toMatchInlineSnapshot(`
|
|
859
|
+
[
|
|
860
|
+
"https://example.com/foo",
|
|
861
|
+
]
|
|
862
|
+
`)
|
|
863
|
+
})
|
|
864
|
+
|
|
865
|
+
test('behavior: "Resources:" in a resource', () => {
|
|
866
|
+
const message = `example.com wants you to sign in with your Ethereum account:
|
|
867
|
+
0xA0Cf798816D4b9b9866b5330EEa46a18382f251e
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
URI: https://example.com/path
|
|
871
|
+
Version: 1
|
|
872
|
+
Chain ID: 1
|
|
873
|
+
Nonce: foobarbaz
|
|
874
|
+
Issued At: 2023-02-01T00:00:00.000Z
|
|
875
|
+
Resources:
|
|
876
|
+
- https://example.com/Resources:foo
|
|
877
|
+
- https://example.com/bar`
|
|
878
|
+
const parsed = Siwe.parseMessage(message)
|
|
879
|
+
expect(parsed.resources).toMatchInlineSnapshot(`
|
|
880
|
+
[
|
|
881
|
+
"https://example.com/Resources:foo",
|
|
882
|
+
"https://example.com/bar",
|
|
883
|
+
]
|
|
884
|
+
`)
|
|
885
|
+
})
|
|
886
|
+
|
|
887
|
+
test('behavior: empty requestId with resources', () => {
|
|
888
|
+
// EIP-4361 allows an empty Request ID (`request-id = *pchar`).
|
|
889
|
+
const message = `example.com wants you to sign in with your Ethereum account:
|
|
890
|
+
0xA0Cf798816D4b9b9866b5330EEa46a18382f251e
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
URI: https://example.com/path
|
|
894
|
+
Version: 1
|
|
895
|
+
Chain ID: 1
|
|
896
|
+
Nonce: foobarbaz
|
|
897
|
+
Issued At: 2023-02-01T00:00:00.000Z
|
|
898
|
+
Request ID: \nResources:
|
|
899
|
+
- https://example.com/foo`
|
|
900
|
+
const parsed = Siwe.parseMessage(message)
|
|
901
|
+
expect(parsed.resources).toMatchInlineSnapshot(`
|
|
902
|
+
[
|
|
903
|
+
"https://example.com/foo",
|
|
904
|
+
]
|
|
905
|
+
`)
|
|
906
|
+
})
|
|
907
|
+
|
|
908
|
+
test('behavior: empty resources', () => {
|
|
909
|
+
const message = Siwe.createMessage({
|
|
910
|
+
address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
|
911
|
+
chainId: 1,
|
|
912
|
+
domain: 'example.com',
|
|
913
|
+
issuedAt: new Date('2023-02-01T00:00:00.000Z'),
|
|
914
|
+
nonce: 'foobarbaz',
|
|
915
|
+
resources: [],
|
|
916
|
+
statement: 'Resources:',
|
|
917
|
+
uri: 'https://example.com/path',
|
|
918
|
+
version: '1',
|
|
919
|
+
})
|
|
920
|
+
expect(Siwe.parseMessage(message).resources).toMatchInlineSnapshot('[]')
|
|
921
|
+
})
|
|
922
|
+
|
|
776
923
|
test('behavior: no suffix', () => {
|
|
777
924
|
const message = `https://example.com wants you to sign in with your Ethereum account:
|
|
778
925
|
0xA0Cf798816D4b9b9866b5330EEa46a18382f251e
|
|
@@ -434,7 +434,7 @@ describe('toTransactionRequest', () => {
|
|
|
434
434
|
test('maps frame sender to request from', () => {
|
|
435
435
|
expect(TransactionEnvelope.toTransactionRequest(eip8141)).toEqual({
|
|
436
436
|
chainId: 1,
|
|
437
|
-
frames: [{}],
|
|
437
|
+
frames: [{ executionGas: 0n, stateGas: 0n }],
|
|
438
438
|
from: '0x1111111111111111111111111111111111111111',
|
|
439
439
|
type: 'eip8141',
|
|
440
440
|
})
|
|
@@ -469,6 +469,7 @@ describe('frame receipts', () => {
|
|
|
469
469
|
frameReceipts: [
|
|
470
470
|
{
|
|
471
471
|
executionGasUsed: '0x20000000000001',
|
|
472
|
+
gasUsed: '0x20000000000003',
|
|
472
473
|
logs: [
|
|
473
474
|
{
|
|
474
475
|
address: '0x1111111111111111111111111111111111111111',
|
|
@@ -477,10 +478,22 @@ describe('frame receipts', () => {
|
|
|
477
478
|
},
|
|
478
479
|
],
|
|
479
480
|
stateGasUsed: '0x2',
|
|
480
|
-
status:
|
|
481
|
+
status: '0x1',
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
executionGasUsed: '0x3',
|
|
485
|
+
gasUsed: '0x3',
|
|
486
|
+
logs: [],
|
|
487
|
+
stateGasUsed: '0x0',
|
|
488
|
+
status: '0x0',
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
executionGasUsed: '0x0',
|
|
492
|
+
gasUsed: '0x0',
|
|
493
|
+
logs: [],
|
|
494
|
+
stateGasUsed: '0x0',
|
|
495
|
+
status: '0x2',
|
|
481
496
|
},
|
|
482
|
-
{ executionGasUsed: '0x3', logs: [], stateGasUsed: '0x0', status: 0 },
|
|
483
|
-
{ executionGasUsed: '0x0', logs: [], stateGasUsed: '0x0', status: 2 },
|
|
484
497
|
],
|
|
485
498
|
from: '0x1111111111111111111111111111111111111111',
|
|
486
499
|
gasUsed: '0x20000000000001',
|
|
@@ -498,13 +511,26 @@ describe('frame receipts', () => {
|
|
|
498
511
|
expect(receipt.payer).toBe(rpc.payer)
|
|
499
512
|
expect(receipt.frameReceipts).toEqual([
|
|
500
513
|
{
|
|
501
|
-
|
|
514
|
+
executionGasUsed: 9007199254740993n,
|
|
515
|
+
gasUsed: 9007199254740995n,
|
|
502
516
|
logs: rpc.frameReceipts[0]!.logs,
|
|
503
517
|
stateGasUsed: 2n,
|
|
504
518
|
status: 'success',
|
|
505
519
|
},
|
|
506
|
-
{
|
|
507
|
-
|
|
520
|
+
{
|
|
521
|
+
executionGasUsed: 3n,
|
|
522
|
+
gasUsed: 3n,
|
|
523
|
+
logs: [],
|
|
524
|
+
stateGasUsed: 0n,
|
|
525
|
+
status: 'reverted',
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
executionGasUsed: 0n,
|
|
529
|
+
gasUsed: 0n,
|
|
530
|
+
logs: [],
|
|
531
|
+
stateGasUsed: 0n,
|
|
532
|
+
status: 'skipped',
|
|
533
|
+
},
|
|
508
534
|
])
|
|
509
535
|
expect(TransactionReceipt.toRpc(receipt)).toMatchObject(rpc)
|
|
510
536
|
expect(
|
|
@@ -139,7 +139,16 @@ describe('frame generics', () => {
|
|
|
139
139
|
|
|
140
140
|
test('RPC types', () => {
|
|
141
141
|
expectTypeOf<TransactionRequest.Rpc['frames']>().toEqualTypeOf<
|
|
142
|
-
readonly
|
|
142
|
+
| readonly {
|
|
143
|
+
mode: `0x${string}`
|
|
144
|
+
flags?: `0x${string}` | undefined
|
|
145
|
+
data?: `0x${string}` | undefined
|
|
146
|
+
executionGas?: `0x${string}` | undefined
|
|
147
|
+
stateGas?: `0x${string}` | undefined
|
|
148
|
+
target?: `0x${string}` | null | undefined
|
|
149
|
+
value?: `0x${string}` | undefined
|
|
150
|
+
}[]
|
|
151
|
+
| undefined
|
|
143
152
|
>()
|
|
144
153
|
expectTypeOf<TransactionRequest.Rpc['signatures']>().toEqualTypeOf<
|
|
145
154
|
readonly FrameSignature.Rpc[] | undefined
|
|
@@ -466,7 +466,7 @@ describe('frame transactions', () => {
|
|
|
466
466
|
test('round-trips frame requests and envelopes', () => {
|
|
467
467
|
const envelope = TxEnvelopeEip8141.from({
|
|
468
468
|
chainId: 8141,
|
|
469
|
-
frames: [Frame.from({
|
|
469
|
+
frames: [Frame.from({ executionGas: 50_000n, mode: 'verify' })],
|
|
470
470
|
sender: '0x1111111111111111111111111111111111111111',
|
|
471
471
|
signatures: [FrameSignature.from('0xaabb')],
|
|
472
472
|
})
|
|
@@ -474,8 +474,9 @@ describe('frame transactions', () => {
|
|
|
474
474
|
const rpc = TransactionRequest.toRpc(request)
|
|
475
475
|
expect(rpc.chainId).toBe('0x1fcd')
|
|
476
476
|
expect(rpc.type).toBe('0x6')
|
|
477
|
+
expect(rpc.frames?.[0]?.executionGas).toBe('0xc350')
|
|
477
478
|
expect(rpc.signatures).toEqual([
|
|
478
|
-
{ msg: '0x', scheme:
|
|
479
|
+
{ msg: '0x', scheme: '0x0', signature: '0xaabb' },
|
|
479
480
|
])
|
|
480
481
|
const decoded = TransactionRequest.fromRpc(rpc)
|
|
481
482
|
expect(decoded.chainId).toBe(8141)
|
|
@@ -4,12 +4,12 @@ import { expectTypeOf, test } from 'vp/test'
|
|
|
4
4
|
test('default', () => {
|
|
5
5
|
const envelope = TxEnvelopeEip8141.from({
|
|
6
6
|
chainId: 1,
|
|
7
|
-
frames: [{
|
|
7
|
+
frames: [{ executionGas: 50000n }],
|
|
8
8
|
sender: '0x1111111111111111111111111111111111111111',
|
|
9
9
|
})
|
|
10
10
|
expectTypeOf(envelope).toEqualTypeOf<{
|
|
11
11
|
readonly chainId: 1
|
|
12
|
-
readonly frames: readonly [{ readonly
|
|
12
|
+
readonly frames: readonly [{ readonly executionGas: 50000n }]
|
|
13
13
|
readonly sender: '0x1111111111111111111111111111111111111111'
|
|
14
14
|
readonly type: 'eip8141'
|
|
15
15
|
}>()
|