tempo.ts 0.0.6 → 0.1.1
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/dist/chains.d.ts +244 -541
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +10 -23
- package/dist/chains.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/ox/SignatureEnvelope.d.ts +245 -0
- package/dist/ox/SignatureEnvelope.d.ts.map +1 -0
- package/dist/ox/SignatureEnvelope.js +437 -0
- package/dist/ox/SignatureEnvelope.js.map +1 -0
- package/dist/ox/Transaction.d.ts +61 -24
- package/dist/ox/Transaction.d.ts.map +1 -1
- package/dist/ox/Transaction.js +63 -18
- package/dist/ox/Transaction.js.map +1 -1
- package/dist/ox/TransactionEnvelopeAA.d.ts +461 -0
- package/dist/ox/TransactionEnvelopeAA.d.ts.map +1 -0
- package/dist/ox/TransactionEnvelopeAA.js +528 -0
- package/dist/ox/TransactionEnvelopeAA.js.map +1 -0
- package/dist/ox/TransactionRequest.d.ts +7 -5
- package/dist/ox/TransactionRequest.d.ts.map +1 -1
- package/dist/ox/TransactionRequest.js +21 -12
- package/dist/ox/TransactionRequest.js.map +1 -1
- package/dist/ox/index.d.ts +5 -4
- package/dist/ox/index.d.ts.map +1 -1
- package/dist/ox/index.js +5 -4
- package/dist/ox/index.js.map +1 -1
- package/dist/prool/Instance.d.ts +0 -4
- package/dist/prool/Instance.d.ts.map +1 -1
- package/dist/prool/Instance.js +7 -7
- package/dist/prool/Instance.js.map +1 -1
- package/dist/prool/index.d.ts +1 -1
- package/dist/prool/index.d.ts.map +1 -1
- package/dist/prool/index.js +1 -1
- package/dist/prool/index.js.map +1 -1
- package/dist/viem/{abis.d.ts → Abis.d.ts} +523 -9
- package/dist/viem/Abis.d.ts.map +1 -0
- package/dist/viem/{abis.js → Abis.js} +321 -9
- package/dist/viem/Abis.js.map +1 -0
- package/dist/viem/{actions → Actions}/amm.d.ts +21 -21
- package/dist/viem/Actions/amm.d.ts.map +1 -0
- package/dist/viem/{actions → Actions}/amm.js +55 -43
- package/dist/viem/Actions/amm.js.map +1 -0
- package/dist/viem/Actions/dex.d.ts +3263 -0
- package/dist/viem/Actions/dex.d.ts.map +1 -0
- package/dist/viem/Actions/dex.js +1357 -0
- package/dist/viem/Actions/dex.js.map +1 -0
- package/dist/viem/{actions → Actions}/fee.d.ts +8 -8
- package/dist/viem/Actions/fee.d.ts.map +1 -0
- package/dist/viem/{actions → Actions}/fee.js +14 -13
- package/dist/viem/Actions/fee.js.map +1 -0
- package/dist/viem/Actions/index.d.ts +6 -0
- package/dist/viem/Actions/index.d.ts.map +1 -0
- package/dist/viem/Actions/index.js +6 -0
- package/dist/viem/Actions/index.js.map +1 -0
- package/dist/viem/{actions → Actions}/policy.d.ts +19 -19
- package/dist/viem/Actions/policy.d.ts.map +1 -0
- package/dist/viem/{actions → Actions}/policy.js +59 -46
- package/dist/viem/Actions/policy.js.map +1 -0
- package/dist/viem/{actions → Actions}/token.d.ts +3275 -698
- package/dist/viem/Actions/token.d.ts.map +1 -0
- package/dist/viem/{actions → Actions}/token.js +458 -84
- package/dist/viem/Actions/token.js.map +1 -0
- package/dist/viem/Addresses.d.ts +9 -0
- package/dist/viem/Addresses.d.ts.map +1 -0
- package/dist/viem/Addresses.js +9 -0
- package/dist/viem/Addresses.js.map +1 -0
- package/dist/viem/{chain.d.ts → Chain.d.ts} +81 -57
- package/dist/viem/Chain.d.ts.map +1 -0
- package/dist/viem/{chain.js → Chain.js} +7 -7
- package/dist/viem/Chain.js.map +1 -0
- package/dist/viem/{client.d.ts → Client.d.ts} +4 -4
- package/dist/viem/Client.d.ts.map +1 -0
- package/dist/viem/{client.js → Client.js} +3 -3
- package/dist/viem/Client.js.map +1 -0
- package/dist/viem/{decorator.d.ts → Decorator.d.ts} +507 -5
- package/dist/viem/Decorator.d.ts.map +1 -0
- package/dist/viem/{decorator.js → Decorator.js} +31 -5
- package/dist/viem/Decorator.js.map +1 -0
- package/dist/viem/{formatters.d.ts → Formatters.d.ts} +2 -2
- package/dist/viem/Formatters.d.ts.map +1 -0
- package/dist/viem/{formatters.js → Formatters.js} +24 -17
- package/dist/viem/Formatters.js.map +1 -0
- package/dist/viem/Tick.d.ts +111 -0
- package/dist/viem/Tick.d.ts.map +1 -0
- package/dist/viem/Tick.js +127 -0
- package/dist/viem/Tick.js.map +1 -0
- package/dist/viem/TokenIds.d.ts +3 -0
- package/dist/viem/TokenIds.d.ts.map +1 -0
- package/dist/viem/TokenIds.js +3 -0
- package/dist/viem/TokenIds.js.map +1 -0
- package/dist/viem/Transaction.d.ts +57 -0
- package/dist/viem/Transaction.d.ts.map +1 -0
- package/dist/viem/Transaction.js +137 -0
- package/dist/viem/Transaction.js.map +1 -0
- package/dist/viem/{transport.d.ts → Transport.d.ts} +3 -3
- package/dist/viem/Transport.d.ts.map +1 -0
- package/dist/viem/{transport.js → Transport.js} +3 -3
- package/dist/viem/Transport.js.map +1 -0
- package/dist/viem/index.d.ts +13 -9
- package/dist/viem/index.d.ts.map +1 -1
- package/dist/viem/index.js +13 -9
- package/dist/viem/index.js.map +1 -1
- package/dist/viem/{types.d.ts → internal/types.d.ts} +3 -3
- package/dist/viem/internal/types.d.ts.map +1 -0
- package/dist/viem/{types.js.map → internal/types.js.map} +1 -1
- package/dist/viem/internal/utils.d.ts.map +1 -0
- package/dist/viem/internal/utils.js.map +1 -0
- package/package.json +87 -101
- package/src/chains.ts +10 -24
- package/src/ox/SignatureEnvelope.test.ts +1252 -0
- package/src/ox/SignatureEnvelope.ts +709 -0
- package/src/ox/Transaction.test.ts +144 -89
- package/src/ox/Transaction.ts +104 -29
- package/src/ox/TransactionEnvelopeAA.test.ts +1533 -0
- package/src/ox/TransactionEnvelopeAA.ts +858 -0
- package/src/ox/TransactionRequest.ts +25 -17
- package/src/ox/index.ts +2 -1
- package/src/prool/Instance.ts +6 -14
- package/src/prool/internal/chain.json +101 -27
- package/src/viem/{abis.ts → Abis.ts} +322 -8
- package/src/viem/{actions → Actions}/amm.test.ts +65 -68
- package/src/viem/{actions → Actions}/amm.ts +72 -60
- package/src/viem/Actions/dex.test.ts +1608 -0
- package/src/viem/Actions/dex.ts +2026 -0
- package/src/viem/{actions → Actions}/fee.test.ts +34 -36
- package/src/viem/{actions → Actions}/fee.ts +18 -17
- package/src/viem/{actions → Actions}/index.ts +1 -0
- package/src/viem/{actions → Actions}/policy.test.ts +2 -2
- package/src/viem/{actions → Actions}/policy.ts +77 -64
- package/src/viem/{actions → Actions}/token.test.ts +419 -64
- package/src/viem/{actions → Actions}/token.ts +751 -145
- package/src/viem/Addresses.ts +9 -0
- package/src/viem/{chain.ts → Chain.ts} +6 -6
- package/src/viem/{client.bench-d.ts → Client.bench-d.ts} +2 -2
- package/src/viem/{client.test.ts → Client.test.ts} +31 -6
- package/src/viem/{client.ts → Client.ts} +1 -1
- package/src/viem/{decorator.bench-d.ts → Decorator.bench-d.ts} +2 -2
- package/src/viem/{decorator.test.ts → Decorator.test.ts} +1 -0
- package/src/viem/{decorator.ts → Decorator.ts} +586 -4
- package/src/viem/{formatters.ts → Formatters.ts} +31 -20
- package/src/viem/Tick.test.ts +281 -0
- package/src/viem/Tick.ts +176 -0
- package/src/viem/TokenIds.ts +2 -0
- package/src/viem/Transaction.ts +303 -0
- package/src/viem/{transport.ts → Transport.ts} +5 -5
- package/src/viem/e2e.test.ts +153 -78
- package/src/viem/index.ts +13 -9
- package/src/viem/{types.ts → internal/types.ts} +3 -3
- package/dist/ox/TransactionEnvelopeFeeToken.d.ts +0 -393
- package/dist/ox/TransactionEnvelopeFeeToken.d.ts.map +0 -1
- package/dist/ox/TransactionEnvelopeFeeToken.js +0 -452
- package/dist/ox/TransactionEnvelopeFeeToken.js.map +0 -1
- package/dist/viem/abis.d.ts.map +0 -1
- package/dist/viem/abis.js.map +0 -1
- package/dist/viem/actions/amm.d.ts.map +0 -1
- package/dist/viem/actions/amm.js.map +0 -1
- package/dist/viem/actions/fee.d.ts.map +0 -1
- package/dist/viem/actions/fee.js.map +0 -1
- package/dist/viem/actions/index.d.ts +0 -5
- package/dist/viem/actions/index.d.ts.map +0 -1
- package/dist/viem/actions/index.js +0 -5
- package/dist/viem/actions/index.js.map +0 -1
- package/dist/viem/actions/policy.d.ts.map +0 -1
- package/dist/viem/actions/policy.js.map +0 -1
- package/dist/viem/actions/token.d.ts.map +0 -1
- package/dist/viem/actions/token.js.map +0 -1
- package/dist/viem/addresses.d.ts +0 -8
- package/dist/viem/addresses.d.ts.map +0 -1
- package/dist/viem/addresses.js +0 -8
- package/dist/viem/addresses.js.map +0 -1
- package/dist/viem/chain.d.ts.map +0 -1
- package/dist/viem/chain.js.map +0 -1
- package/dist/viem/client.d.ts.map +0 -1
- package/dist/viem/client.js.map +0 -1
- package/dist/viem/decorator.d.ts.map +0 -1
- package/dist/viem/decorator.js.map +0 -1
- package/dist/viem/formatters.d.ts.map +0 -1
- package/dist/viem/formatters.js.map +0 -1
- package/dist/viem/transaction.d.ts +0 -54
- package/dist/viem/transaction.d.ts.map +0 -1
- package/dist/viem/transaction.js +0 -108
- package/dist/viem/transaction.js.map +0 -1
- package/dist/viem/transport.d.ts.map +0 -1
- package/dist/viem/transport.js.map +0 -1
- package/dist/viem/types.d.ts.map +0 -1
- package/dist/viem/utils.d.ts.map +0 -1
- package/dist/viem/utils.js.map +0 -1
- package/src/ox/TransactionEnvelopeFeeToken.test.ts +0 -1119
- package/src/ox/TransactionEnvelopeFeeToken.ts +0 -717
- package/src/prool/internal/consensus.toml +0 -32
- package/src/viem/addresses.ts +0 -10
- package/src/viem/transaction.ts +0 -253
- /package/dist/viem/{types.js → internal/types.js} +0 -0
- /package/dist/viem/{utils.d.ts → internal/utils.d.ts} +0 -0
- /package/dist/viem/{utils.js → internal/utils.js} +0 -0
- /package/src/viem/{utils.ts → internal/utils.ts} +0 -0
|
@@ -5,7 +5,13 @@ describe('fromRpc', () => {
|
|
|
5
5
|
test('default', () => {
|
|
6
6
|
const transaction = Transaction.fromRpc({
|
|
7
7
|
accessList: [],
|
|
8
|
-
|
|
8
|
+
calls: [
|
|
9
|
+
{
|
|
10
|
+
input: '0xdeadbeef',
|
|
11
|
+
to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
|
|
12
|
+
value: '0x9b6e64a8ec60000',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
9
15
|
maxFeePerGas: '0x2',
|
|
10
16
|
maxPriorityFeePerGas: '0x1',
|
|
11
17
|
hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',
|
|
@@ -16,44 +22,51 @@ describe('fromRpc', () => {
|
|
|
16
22
|
transactionIndex: '0x2',
|
|
17
23
|
feeToken: '0x20c0000000000000000000000000000000000000',
|
|
18
24
|
from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',
|
|
19
|
-
to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
|
|
20
|
-
value: '0x9b6e64a8ec60000',
|
|
21
25
|
gas: '0x43f5d',
|
|
22
26
|
gasPrice: '0x2ca6ae494',
|
|
23
|
-
|
|
24
|
-
'
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
signature: {
|
|
28
|
+
r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',
|
|
29
|
+
s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',
|
|
30
|
+
v: '0x0',
|
|
31
|
+
type: 'secp256k1',
|
|
32
|
+
yParity: '0x0',
|
|
33
|
+
},
|
|
29
34
|
chainId: '0x1',
|
|
30
|
-
type: '
|
|
35
|
+
type: '0x76',
|
|
31
36
|
})
|
|
32
37
|
expect(transaction).toMatchInlineSnapshot(`
|
|
33
38
|
{
|
|
34
39
|
"accessList": [],
|
|
35
|
-
"authorizationList": [],
|
|
36
40
|
"blockHash": "0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b",
|
|
37
41
|
"blockNumber": 19868015n,
|
|
42
|
+
"calls": [
|
|
43
|
+
{
|
|
44
|
+
"data": "0xdeadbeef",
|
|
45
|
+
"to": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
|
|
46
|
+
"value": 700000000000000000n,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
38
49
|
"chainId": 1,
|
|
39
|
-
"data":
|
|
50
|
+
"data": undefined,
|
|
40
51
|
"feeToken": "0x20c0000000000000000000000000000000000000",
|
|
41
52
|
"from": "0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6",
|
|
42
53
|
"gas": 278365n,
|
|
43
54
|
"gasPrice": 11985937556n,
|
|
44
55
|
"hash": "0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0",
|
|
45
|
-
"input": "0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b",
|
|
46
56
|
"maxFeePerGas": 2n,
|
|
47
57
|
"maxPriorityFeePerGas": 1n,
|
|
48
58
|
"nonce": 855n,
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
"signature": {
|
|
60
|
+
"signature": {
|
|
61
|
+
"r": 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
|
|
62
|
+
"s": 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
|
|
63
|
+
"yParity": 0,
|
|
64
|
+
},
|
|
65
|
+
"type": "secp256k1",
|
|
66
|
+
},
|
|
52
67
|
"transactionIndex": 2,
|
|
53
|
-
"type": "
|
|
54
|
-
"
|
|
55
|
-
"value": 700000000000000000n,
|
|
56
|
-
"yParity": 0,
|
|
68
|
+
"type": "aa",
|
|
69
|
+
"value": 0n,
|
|
57
70
|
}
|
|
58
71
|
`)
|
|
59
72
|
})
|
|
@@ -61,7 +74,19 @@ describe('fromRpc', () => {
|
|
|
61
74
|
test('with feePayerSignature', () => {
|
|
62
75
|
const transaction = Transaction.fromRpc({
|
|
63
76
|
accessList: [],
|
|
64
|
-
|
|
77
|
+
calls: [
|
|
78
|
+
{
|
|
79
|
+
input: '0xdeadbeef',
|
|
80
|
+
to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
|
|
81
|
+
value: '0x9b6e64a8ec60000',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
feePayerSignature: {
|
|
85
|
+
r: '0x12f4d9e9924f62b19de816252efc125006298f43e62d394151e62600e2c2f91e',
|
|
86
|
+
s: '0x31daa78bb3e95dd22f6370e59617c60d109bf28e55c92b25994ddbed420e2a80',
|
|
87
|
+
v: '0x0',
|
|
88
|
+
yParity: '0x0',
|
|
89
|
+
},
|
|
65
90
|
maxFeePerGas: '0x2',
|
|
66
91
|
maxPriorityFeePerGas: '0x1',
|
|
67
92
|
hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',
|
|
@@ -71,35 +96,35 @@ describe('fromRpc', () => {
|
|
|
71
96
|
blockNumber: '0x12f296f',
|
|
72
97
|
transactionIndex: '0x2',
|
|
73
98
|
feeToken: '0x20c0000000000000000000000000000000000000',
|
|
74
|
-
feePayerSignature: {
|
|
75
|
-
r: '0x12f4d9e9924f62b19de816252efc125006298f43e62d394151e62600e2c2f91e',
|
|
76
|
-
s: '0x31daa78bb3e95dd22f6370e59617c60d109bf28e55c92b25994ddbed420e2a80',
|
|
77
|
-
v: '0x0',
|
|
78
|
-
yParity: '0x0',
|
|
79
|
-
},
|
|
80
99
|
from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',
|
|
81
|
-
to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
|
|
82
|
-
value: '0x9b6e64a8ec60000',
|
|
83
100
|
gas: '0x43f5d',
|
|
84
101
|
gasPrice: '0x2ca6ae494',
|
|
85
|
-
|
|
86
|
-
'
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
102
|
+
signature: {
|
|
103
|
+
r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',
|
|
104
|
+
s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',
|
|
105
|
+
v: '0x0',
|
|
106
|
+
type: 'secp256k1',
|
|
107
|
+
yParity: '0x0',
|
|
108
|
+
},
|
|
91
109
|
chainId: '0x1',
|
|
92
|
-
type: '
|
|
110
|
+
type: '0x76',
|
|
93
111
|
})
|
|
112
|
+
|
|
94
113
|
expect(transaction).toMatchInlineSnapshot(`
|
|
95
114
|
{
|
|
96
115
|
"accessList": [],
|
|
97
|
-
"authorizationList": [],
|
|
98
116
|
"blockHash": "0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b",
|
|
99
117
|
"blockNumber": 19868015n,
|
|
118
|
+
"calls": [
|
|
119
|
+
{
|
|
120
|
+
"data": "0xdeadbeef",
|
|
121
|
+
"to": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
|
|
122
|
+
"value": 700000000000000000n,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
100
125
|
"chainId": 1,
|
|
101
|
-
"data":
|
|
102
|
-
"feePayer": "
|
|
126
|
+
"data": undefined,
|
|
127
|
+
"feePayer": "0xa5dd355188d0cd90324e13fc82ce7f3a2f3e44bc",
|
|
103
128
|
"feePayerSignature": {
|
|
104
129
|
"r": 8574245934337799659042750864278046211314109527666697413298781631396794530078n,
|
|
105
130
|
"s": 22549658598721143185960614158212618570884225122794367192341714237232002247296n,
|
|
@@ -111,18 +136,20 @@ describe('fromRpc', () => {
|
|
|
111
136
|
"gas": 278365n,
|
|
112
137
|
"gasPrice": 11985937556n,
|
|
113
138
|
"hash": "0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0",
|
|
114
|
-
"input": "0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b",
|
|
115
139
|
"maxFeePerGas": 2n,
|
|
116
140
|
"maxPriorityFeePerGas": 1n,
|
|
117
141
|
"nonce": 855n,
|
|
118
|
-
"
|
|
119
|
-
|
|
120
|
-
|
|
142
|
+
"signature": {
|
|
143
|
+
"signature": {
|
|
144
|
+
"r": 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
|
|
145
|
+
"s": 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
|
|
146
|
+
"yParity": 0,
|
|
147
|
+
},
|
|
148
|
+
"type": "secp256k1",
|
|
149
|
+
},
|
|
121
150
|
"transactionIndex": 2,
|
|
122
|
-
"type": "
|
|
123
|
-
"
|
|
124
|
-
"value": 700000000000000000n,
|
|
125
|
-
"yParity": 0,
|
|
151
|
+
"type": "aa",
|
|
152
|
+
"value": 0n,
|
|
126
153
|
}
|
|
127
154
|
`)
|
|
128
155
|
})
|
|
@@ -132,55 +159,69 @@ describe('toRpc', () => {
|
|
|
132
159
|
test('default', () => {
|
|
133
160
|
const transaction = Transaction.toRpc({
|
|
134
161
|
accessList: [],
|
|
135
|
-
authorizationList: [],
|
|
136
162
|
blockHash:
|
|
137
163
|
'0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',
|
|
138
164
|
blockNumber: 19868015n,
|
|
165
|
+
calls: [
|
|
166
|
+
{
|
|
167
|
+
data: '0xdeadbeef',
|
|
168
|
+
to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
|
|
169
|
+
value: 700000000000000000n,
|
|
170
|
+
},
|
|
171
|
+
],
|
|
139
172
|
chainId: 1,
|
|
140
|
-
data:
|
|
173
|
+
data: undefined,
|
|
141
174
|
feeToken: '0x20c0000000000000000000000000000000000000',
|
|
142
175
|
from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',
|
|
143
176
|
gas: 278365n,
|
|
144
177
|
gasPrice: 11985937556n,
|
|
145
178
|
hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',
|
|
146
|
-
input:
|
|
147
|
-
'0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b',
|
|
148
179
|
maxFeePerGas: 2n,
|
|
149
180
|
maxPriorityFeePerGas: 1n,
|
|
150
181
|
nonce: 855n,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
182
|
+
signature: {
|
|
183
|
+
signature: {
|
|
184
|
+
r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
|
|
185
|
+
s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
|
|
186
|
+
yParity: 0,
|
|
187
|
+
},
|
|
188
|
+
type: 'secp256k1',
|
|
189
|
+
},
|
|
154
190
|
transactionIndex: 2,
|
|
155
|
-
type: '
|
|
156
|
-
v: 27,
|
|
157
|
-
value: 700000000000000000n,
|
|
158
|
-
yParity: 0,
|
|
191
|
+
type: 'aa',
|
|
159
192
|
})
|
|
160
193
|
expect(transaction).toMatchInlineSnapshot(`
|
|
161
194
|
{
|
|
162
195
|
"accessList": [],
|
|
163
|
-
"authorizationList": [],
|
|
164
196
|
"blockHash": "0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b",
|
|
165
197
|
"blockNumber": "0x12f296f",
|
|
198
|
+
"calls": [
|
|
199
|
+
{
|
|
200
|
+
"data": "0xdeadbeef",
|
|
201
|
+
"to": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
|
|
202
|
+
"value": "0x9b6e64a8ec60000",
|
|
203
|
+
},
|
|
204
|
+
],
|
|
166
205
|
"chainId": "0x1",
|
|
167
206
|
"feeToken": "0x20c0000000000000000000000000000000000000",
|
|
168
207
|
"from": "0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6",
|
|
169
208
|
"gas": "0x43f5d",
|
|
170
209
|
"gasPrice": "0x2ca6ae494",
|
|
171
210
|
"hash": "0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0",
|
|
172
|
-
"input":
|
|
211
|
+
"input": undefined,
|
|
173
212
|
"maxFeePerGas": "0x2",
|
|
174
213
|
"maxPriorityFeePerGas": "0x1",
|
|
175
214
|
"nonce": "0x357",
|
|
176
|
-
"
|
|
177
|
-
|
|
178
|
-
|
|
215
|
+
"signature": {
|
|
216
|
+
"r": "0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d",
|
|
217
|
+
"s": "0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540",
|
|
218
|
+
"type": "secp256k1",
|
|
219
|
+
"yParity": "0x0",
|
|
220
|
+
},
|
|
221
|
+
"to": undefined,
|
|
179
222
|
"transactionIndex": "0x2",
|
|
180
|
-
"type": "
|
|
181
|
-
"
|
|
182
|
-
"value": "0x9b6e64a8ec60000",
|
|
183
|
-
"yParity": "0x0",
|
|
223
|
+
"type": "0x76",
|
|
224
|
+
"value": "0x0",
|
|
184
225
|
}
|
|
185
226
|
`)
|
|
186
227
|
})
|
|
@@ -188,13 +229,19 @@ describe('toRpc', () => {
|
|
|
188
229
|
test('default', () => {
|
|
189
230
|
const transaction = Transaction.toRpc({
|
|
190
231
|
accessList: [],
|
|
191
|
-
authorizationList: [],
|
|
192
232
|
blockHash:
|
|
193
233
|
'0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',
|
|
194
234
|
blockNumber: 19868015n,
|
|
235
|
+
calls: [
|
|
236
|
+
{
|
|
237
|
+
data: '0xdeadbeef',
|
|
238
|
+
to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
|
|
239
|
+
value: 700000000000000000n,
|
|
240
|
+
},
|
|
241
|
+
],
|
|
195
242
|
chainId: 1,
|
|
196
|
-
data:
|
|
197
|
-
feePayer: '
|
|
243
|
+
data: undefined,
|
|
244
|
+
feePayer: '0x84378105024c0386fb24d4d441674fa645138a83',
|
|
198
245
|
feePayerSignature: {
|
|
199
246
|
r: 8574245934337799659042750864278046211314109527666697413298781631396794530078n,
|
|
200
247
|
s: 22549658598721143185960614158212618570884225122794367192341714237232002247296n,
|
|
@@ -206,28 +253,34 @@ describe('toRpc', () => {
|
|
|
206
253
|
gas: 278365n,
|
|
207
254
|
gasPrice: 11985937556n,
|
|
208
255
|
hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',
|
|
209
|
-
input:
|
|
210
|
-
'0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b',
|
|
211
256
|
maxFeePerGas: 2n,
|
|
212
257
|
maxPriorityFeePerGas: 1n,
|
|
213
258
|
nonce: 855n,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
259
|
+
signature: {
|
|
260
|
+
signature: {
|
|
261
|
+
r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
|
|
262
|
+
s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
|
|
263
|
+
yParity: 0,
|
|
264
|
+
},
|
|
265
|
+
type: 'secp256k1',
|
|
266
|
+
},
|
|
217
267
|
transactionIndex: 2,
|
|
218
|
-
type: '
|
|
219
|
-
v: 27,
|
|
220
|
-
value: 700000000000000000n,
|
|
221
|
-
yParity: 0,
|
|
268
|
+
type: 'aa',
|
|
222
269
|
})
|
|
223
270
|
expect(transaction).toMatchInlineSnapshot(`
|
|
224
271
|
{
|
|
225
272
|
"accessList": [],
|
|
226
|
-
"authorizationList": [],
|
|
227
273
|
"blockHash": "0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b",
|
|
228
274
|
"blockNumber": "0x12f296f",
|
|
275
|
+
"calls": [
|
|
276
|
+
{
|
|
277
|
+
"data": "0xdeadbeef",
|
|
278
|
+
"to": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
|
|
279
|
+
"value": "0x9b6e64a8ec60000",
|
|
280
|
+
},
|
|
281
|
+
],
|
|
229
282
|
"chainId": "0x1",
|
|
230
|
-
"feePayer": "
|
|
283
|
+
"feePayer": "0x84378105024c0386fb24d4d441674fa645138a83",
|
|
231
284
|
"feePayerSignature": {
|
|
232
285
|
"r": "0x12f4d9e9924f62b19de816252efc125006298f43e62d394151e62600e2c2f91e",
|
|
233
286
|
"s": "0x31daa78bb3e95dd22f6370e59617c60d109bf28e55c92b25994ddbed420e2a80",
|
|
@@ -239,18 +292,20 @@ describe('toRpc', () => {
|
|
|
239
292
|
"gas": "0x43f5d",
|
|
240
293
|
"gasPrice": "0x2ca6ae494",
|
|
241
294
|
"hash": "0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0",
|
|
242
|
-
"input":
|
|
295
|
+
"input": undefined,
|
|
243
296
|
"maxFeePerGas": "0x2",
|
|
244
297
|
"maxPriorityFeePerGas": "0x1",
|
|
245
298
|
"nonce": "0x357",
|
|
246
|
-
"
|
|
247
|
-
|
|
248
|
-
|
|
299
|
+
"signature": {
|
|
300
|
+
"r": "0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d",
|
|
301
|
+
"s": "0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540",
|
|
302
|
+
"type": "secp256k1",
|
|
303
|
+
"yParity": "0x0",
|
|
304
|
+
},
|
|
305
|
+
"to": undefined,
|
|
249
306
|
"transactionIndex": "0x2",
|
|
250
|
-
"type": "
|
|
251
|
-
"
|
|
252
|
-
"value": "0x9b6e64a8ec60000",
|
|
253
|
-
"yParity": "0x0",
|
|
307
|
+
"type": "0x76",
|
|
308
|
+
"value": "0x0",
|
|
254
309
|
}
|
|
255
310
|
`)
|
|
256
311
|
})
|