tempo.ts 0.0.6 → 0.1.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/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 +3250 -700
- package/dist/viem/Actions/token.d.ts.map +1 -0
- package/dist/viem/{actions → Actions}/token.js +419 -83
- 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 +403 -64
- package/src/viem/{actions → Actions}/token.ts +672 -133
- 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
package/src/viem/e2e.test.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { node } from '@elysiajs/node'
|
|
2
2
|
import { Elysia } from 'elysia'
|
|
3
3
|
import { RpcRequest, RpcResponse } from 'ox'
|
|
4
|
-
import
|
|
4
|
+
import { Transaction } from 'tempo.ts/viem'
|
|
5
5
|
import { createClient, http, publicActions, walletActions } from 'viem'
|
|
6
6
|
import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts'
|
|
7
7
|
import { afterAll, beforeAll, describe, expect, test } from 'vitest'
|
|
8
8
|
import { tempoTest } from '../../test/viem/config.js'
|
|
9
|
+
import * as actions from './Actions/index.js'
|
|
9
10
|
import { tempoActions } from './index.js'
|
|
10
|
-
import {
|
|
11
|
-
import { withFeePayer } from './transport.js'
|
|
11
|
+
import { withFeePayer } from './Transport.js'
|
|
12
12
|
|
|
13
13
|
describe('sendTransaction', () => {
|
|
14
14
|
test('default', async () => {
|
|
@@ -23,7 +23,8 @@ describe('sendTransaction', () => {
|
|
|
23
23
|
.extend(walletActions)
|
|
24
24
|
|
|
25
25
|
const hash = await client.sendTransaction({
|
|
26
|
-
|
|
26
|
+
data: '0xdeadbeef',
|
|
27
|
+
feeToken: '0x20c0000000000000000000000000000000000001',
|
|
27
28
|
to: '0x0000000000000000000000000000000000000000',
|
|
28
29
|
})
|
|
29
30
|
await client.waitForTransactionReceipt({ hash })
|
|
@@ -37,29 +38,44 @@ describe('sendTransaction', () => {
|
|
|
37
38
|
expect(transaction).toMatchInlineSnapshot(`
|
|
38
39
|
{
|
|
39
40
|
"accessList": [],
|
|
40
|
-
"authorizationList":
|
|
41
|
+
"authorizationList": undefined,
|
|
42
|
+
"calls": [
|
|
43
|
+
{
|
|
44
|
+
"data": "0xdeadbeef",
|
|
45
|
+
"to": "0x0000000000000000000000000000000000000000",
|
|
46
|
+
"value": 0n,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
41
49
|
"chainId": 1337,
|
|
42
|
-
"data":
|
|
50
|
+
"data": undefined,
|
|
43
51
|
"feePayerSignature": undefined,
|
|
44
|
-
"feeToken": "
|
|
52
|
+
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
45
53
|
"from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
|
|
46
|
-
"gas":
|
|
54
|
+
"gas": 53793n,
|
|
47
55
|
"gasPrice": 44n,
|
|
48
|
-
"hash": "
|
|
49
|
-
"input": "0x",
|
|
56
|
+
"hash": "0xab174e234e36ccb8bfa8c4917541b283c6bb71c0018b22aab44e2ac3d6472487",
|
|
50
57
|
"maxFeePerBlobGas": undefined,
|
|
51
58
|
"maxFeePerGas": 52n,
|
|
52
59
|
"maxPriorityFeePerGas": 0n,
|
|
53
60
|
"nonce": 0,
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
61
|
+
"nonceKey": 0n,
|
|
62
|
+
"signature": {
|
|
63
|
+
"signature": {
|
|
64
|
+
"r": 33687256364985057221987783909312106640857703993135866595362338429449340139426n,
|
|
65
|
+
"s": 20898247015832861772943764590866653791079823975780950675135942025860554494301n,
|
|
66
|
+
"yParity": 1,
|
|
67
|
+
},
|
|
68
|
+
"type": "secp256k1",
|
|
69
|
+
},
|
|
70
|
+
"to": null,
|
|
57
71
|
"transactionIndex": 0,
|
|
58
|
-
"type": "
|
|
59
|
-
"typeHex": "
|
|
60
|
-
"v":
|
|
72
|
+
"type": "aa",
|
|
73
|
+
"typeHex": "0x76",
|
|
74
|
+
"v": undefined,
|
|
75
|
+
"validAfter": null,
|
|
76
|
+
"validBefore": null,
|
|
61
77
|
"value": 0n,
|
|
62
|
-
"yParity":
|
|
78
|
+
"yParity": undefined,
|
|
63
79
|
}
|
|
64
80
|
`)
|
|
65
81
|
})
|
|
@@ -95,31 +111,46 @@ describe('sendTransaction', () => {
|
|
|
95
111
|
}).toMatchInlineSnapshot(`
|
|
96
112
|
{
|
|
97
113
|
"accessList": [],
|
|
98
|
-
"authorizationList":
|
|
114
|
+
"authorizationList": undefined,
|
|
99
115
|
"blockHash": undefined,
|
|
100
116
|
"blockNumber": undefined,
|
|
117
|
+
"calls": [
|
|
118
|
+
{
|
|
119
|
+
"data": "0xb395b9ac00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000020c0000000000000000000000000000000000000000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000000000000000000000000000000000000000000c5465737420546f6b656e203300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005544553543300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035553440000000000000000000000000000000000000000000000000000000000",
|
|
120
|
+
"to": "0x20fc000000000000000000000000000000000000",
|
|
121
|
+
"value": 0n,
|
|
122
|
+
},
|
|
123
|
+
],
|
|
101
124
|
"chainId": 1337,
|
|
102
|
-
"data":
|
|
125
|
+
"data": undefined,
|
|
103
126
|
"feePayerSignature": undefined,
|
|
104
127
|
"feeToken": null,
|
|
105
128
|
"from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
|
|
106
|
-
"gas":
|
|
129
|
+
"gas": 53793n,
|
|
107
130
|
"gasPrice": 44n,
|
|
108
|
-
"hash": "
|
|
109
|
-
"input": "0xe9ae5c5301000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000020fc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001447b155afa000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000000000000000000000000000000000000000000c5465737420546f6b656e20330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000554455354330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003555344000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
131
|
+
"hash": "0xaac409f81cf7a716479d4a1b516a3514edbe9d6def569725de8a36715e30f4c5",
|
|
110
132
|
"maxFeePerBlobGas": undefined,
|
|
111
133
|
"maxFeePerGas": 52n,
|
|
112
134
|
"maxPriorityFeePerGas": 0n,
|
|
113
135
|
"nonce": 0,
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
|
|
136
|
+
"nonceKey": 0n,
|
|
137
|
+
"signature": {
|
|
138
|
+
"signature": {
|
|
139
|
+
"r": 75472279831718666729809418999288579618977673042864019617021223809045246862945n,
|
|
140
|
+
"s": 33092981795205421900290930709795805463804729368014914886506847441614835773161n,
|
|
141
|
+
"yParity": 0,
|
|
142
|
+
},
|
|
143
|
+
"type": "secp256k1",
|
|
144
|
+
},
|
|
145
|
+
"to": null,
|
|
117
146
|
"transactionIndex": 0,
|
|
118
|
-
"type": "
|
|
119
|
-
"typeHex": "
|
|
120
|
-
"v":
|
|
147
|
+
"type": "aa",
|
|
148
|
+
"typeHex": "0x76",
|
|
149
|
+
"v": undefined,
|
|
150
|
+
"validAfter": null,
|
|
151
|
+
"validBefore": null,
|
|
121
152
|
"value": 0n,
|
|
122
|
-
"yParity":
|
|
153
|
+
"yParity": undefined,
|
|
123
154
|
}
|
|
124
155
|
`)
|
|
125
156
|
})
|
|
@@ -156,35 +187,50 @@ describe('sendTransaction', () => {
|
|
|
156
187
|
expect(transaction).toMatchInlineSnapshot(`
|
|
157
188
|
{
|
|
158
189
|
"accessList": [],
|
|
159
|
-
"authorizationList":
|
|
190
|
+
"authorizationList": undefined,
|
|
191
|
+
"calls": [
|
|
192
|
+
{
|
|
193
|
+
"data": "0x",
|
|
194
|
+
"to": "0x0000000000000000000000000000000000000000",
|
|
195
|
+
"value": 0n,
|
|
196
|
+
},
|
|
197
|
+
],
|
|
160
198
|
"chainId": 1337,
|
|
161
|
-
"data":
|
|
199
|
+
"data": undefined,
|
|
162
200
|
"feePayer": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
|
|
163
201
|
"feePayerSignature": {
|
|
164
|
-
"r": "
|
|
165
|
-
"s": "
|
|
202
|
+
"r": "0xc2406b257f0a6af102739a49ec871137037eb9ce0a26be112cda91b0b55f0866",
|
|
203
|
+
"s": "0x713f4df2408d1e38d8d54447213e41acd68829e19712243e6dfd188e2fe07ca0",
|
|
166
204
|
"v": 28n,
|
|
167
205
|
"yParity": 1,
|
|
168
206
|
},
|
|
169
207
|
"feeToken": null,
|
|
170
208
|
"from": "0x740474977e01d056f04a314b5537e4dd88f35952",
|
|
171
|
-
"gas":
|
|
209
|
+
"gas": 53793n,
|
|
172
210
|
"gasPrice": 44n,
|
|
173
|
-
"hash": "
|
|
174
|
-
"input": "0x",
|
|
211
|
+
"hash": "0x5b7ae2e6eb4d460522a62cf031ec37f9ce649f0fa1108071a7ba15c6d20f8f3b",
|
|
175
212
|
"maxFeePerBlobGas": undefined,
|
|
176
213
|
"maxFeePerGas": 52n,
|
|
177
214
|
"maxPriorityFeePerGas": 0n,
|
|
178
215
|
"nonce": 0,
|
|
179
|
-
"
|
|
180
|
-
"
|
|
181
|
-
|
|
216
|
+
"nonceKey": 0n,
|
|
217
|
+
"signature": {
|
|
218
|
+
"signature": {
|
|
219
|
+
"r": 78092362620450313170407859447796714674816655259251697170830907867162787398844n,
|
|
220
|
+
"s": 8477378266727504882091645495297339736341469566116127798403581541349939397793n,
|
|
221
|
+
"yParity": 0,
|
|
222
|
+
},
|
|
223
|
+
"type": "secp256k1",
|
|
224
|
+
},
|
|
225
|
+
"to": null,
|
|
182
226
|
"transactionIndex": 0,
|
|
183
|
-
"type": "
|
|
184
|
-
"typeHex": "
|
|
185
|
-
"v":
|
|
227
|
+
"type": "aa",
|
|
228
|
+
"typeHex": "0x76",
|
|
229
|
+
"v": undefined,
|
|
230
|
+
"validAfter": null,
|
|
231
|
+
"validBefore": null,
|
|
186
232
|
"value": 0n,
|
|
187
|
-
"yParity":
|
|
233
|
+
"yParity": undefined,
|
|
188
234
|
}
|
|
189
235
|
`)
|
|
190
236
|
})
|
|
@@ -212,12 +258,11 @@ describe('signTransaction', () => {
|
|
|
212
258
|
data: '0xdeadbeef',
|
|
213
259
|
feePayer: true,
|
|
214
260
|
to: '0xcafebabecafebabecafebabecafebabecafebabe',
|
|
215
|
-
type: 'feeToken',
|
|
216
261
|
})
|
|
217
262
|
let transaction = await client.signTransaction(request)
|
|
218
263
|
|
|
219
264
|
transaction = await client.signTransaction({
|
|
220
|
-
...
|
|
265
|
+
...Transaction.deserialize(transaction),
|
|
221
266
|
feePayer,
|
|
222
267
|
})
|
|
223
268
|
const hash = await client.sendRawTransaction({
|
|
@@ -235,35 +280,50 @@ describe('signTransaction', () => {
|
|
|
235
280
|
expect(transaction2).toMatchInlineSnapshot(`
|
|
236
281
|
{
|
|
237
282
|
"accessList": [],
|
|
238
|
-
"authorizationList":
|
|
283
|
+
"authorizationList": undefined,
|
|
284
|
+
"calls": [
|
|
285
|
+
{
|
|
286
|
+
"data": "0xdeadbeef",
|
|
287
|
+
"to": "0xcafebabecafebabecafebabecafebabecafebabe",
|
|
288
|
+
"value": 0n,
|
|
289
|
+
},
|
|
290
|
+
],
|
|
239
291
|
"chainId": 1337,
|
|
240
|
-
"data":
|
|
292
|
+
"data": undefined,
|
|
241
293
|
"feePayer": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
|
|
242
294
|
"feePayerSignature": {
|
|
243
|
-
"r": "
|
|
244
|
-
"s": "
|
|
245
|
-
"v":
|
|
246
|
-
"yParity":
|
|
295
|
+
"r": "0xd2174d7e41dec16cea89d13e8411e6e69cc9d7a1711861eba587bd02d1ba49f6",
|
|
296
|
+
"s": "0x30410097984493bdb80c6cb0cbc48055c9f570d161bdb8e9c23b8da71aa4769c",
|
|
297
|
+
"v": 27n,
|
|
298
|
+
"yParity": 0,
|
|
247
299
|
},
|
|
248
300
|
"feeToken": null,
|
|
249
301
|
"from": "0x740474977e01d056f04a314b5537e4dd88f35952",
|
|
250
|
-
"gas":
|
|
302
|
+
"gas": 53793n,
|
|
251
303
|
"gasPrice": 44n,
|
|
252
|
-
"hash": "
|
|
253
|
-
"input": "0xdeadbeef",
|
|
304
|
+
"hash": "0xc54c8ffa49ca69692cadbba5ac6e0f888c7fad53b59f6258f3fde027775832c9",
|
|
254
305
|
"maxFeePerBlobGas": undefined,
|
|
255
306
|
"maxFeePerGas": 52n,
|
|
256
307
|
"maxPriorityFeePerGas": 0n,
|
|
257
308
|
"nonce": 0,
|
|
258
|
-
"
|
|
259
|
-
"
|
|
260
|
-
|
|
309
|
+
"nonceKey": 0n,
|
|
310
|
+
"signature": {
|
|
311
|
+
"signature": {
|
|
312
|
+
"r": 44677545391995483967867222268488221760813651834887327154544748280403243454311n,
|
|
313
|
+
"s": 26359569188080842387556837532021842726007422277265560117459876153645612552527n,
|
|
314
|
+
"yParity": 1,
|
|
315
|
+
},
|
|
316
|
+
"type": "secp256k1",
|
|
317
|
+
},
|
|
318
|
+
"to": null,
|
|
261
319
|
"transactionIndex": 0,
|
|
262
|
-
"type": "
|
|
263
|
-
"typeHex": "
|
|
264
|
-
"v":
|
|
320
|
+
"type": "aa",
|
|
321
|
+
"typeHex": "0x76",
|
|
322
|
+
"v": undefined,
|
|
323
|
+
"validAfter": null,
|
|
324
|
+
"validBefore": null,
|
|
265
325
|
"value": 0n,
|
|
266
|
-
"yParity":
|
|
326
|
+
"yParity": undefined,
|
|
267
327
|
}
|
|
268
328
|
`)
|
|
269
329
|
})
|
|
@@ -301,8 +361,8 @@ describe('relay', () => {
|
|
|
301
361
|
),
|
|
302
362
|
)
|
|
303
363
|
|
|
304
|
-
const serialized = request.params?.[0] as `
|
|
305
|
-
if (!serialized.startsWith('
|
|
364
|
+
const serialized = request.params?.[0] as `0x76${string}`
|
|
365
|
+
if (!serialized.startsWith('0x76'))
|
|
306
366
|
return Response.json(
|
|
307
367
|
RpcResponse.from(
|
|
308
368
|
{
|
|
@@ -314,7 +374,7 @@ describe('relay', () => {
|
|
|
314
374
|
),
|
|
315
375
|
)
|
|
316
376
|
|
|
317
|
-
const transaction =
|
|
377
|
+
const transaction = Transaction.deserialize(serialized)
|
|
318
378
|
const serializedTransaction = await client.signTransaction({
|
|
319
379
|
...transaction,
|
|
320
380
|
feePayer: client.account,
|
|
@@ -375,35 +435,50 @@ describe('relay', () => {
|
|
|
375
435
|
expect(transaction).toMatchInlineSnapshot(`
|
|
376
436
|
{
|
|
377
437
|
"accessList": [],
|
|
378
|
-
"authorizationList":
|
|
438
|
+
"authorizationList": undefined,
|
|
439
|
+
"calls": [
|
|
440
|
+
{
|
|
441
|
+
"data": "0xe789744400000000000000000000000020c0000000000000000000000000000000000001",
|
|
442
|
+
"to": "0xfeec000000000000000000000000000000000000",
|
|
443
|
+
"value": 0n,
|
|
444
|
+
},
|
|
445
|
+
],
|
|
379
446
|
"chainId": 1337,
|
|
380
|
-
"data":
|
|
447
|
+
"data": undefined,
|
|
381
448
|
"feePayer": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
|
|
382
449
|
"feePayerSignature": {
|
|
383
|
-
"r": "
|
|
384
|
-
"s": "
|
|
450
|
+
"r": "0x6485c1333cb3bef00a8742d92fe5e8921f10d68506de7ab6bd54049d8ac9d345",
|
|
451
|
+
"s": "0x552550b209d538830a2863731a2c3382a671bc40cfa69a01d1d616d3df63f43c",
|
|
385
452
|
"v": 28n,
|
|
386
453
|
"yParity": 1,
|
|
387
454
|
},
|
|
388
455
|
"feeToken": null,
|
|
389
456
|
"from": "0x740474977e01d056f04a314b5537e4dd88f35952",
|
|
390
|
-
"gas":
|
|
457
|
+
"gas": 53793n,
|
|
391
458
|
"gasPrice": 44n,
|
|
392
|
-
"hash": "
|
|
393
|
-
"input": "0xe789744400000000000000000000000020c0000000000000000000000000000000000001",
|
|
459
|
+
"hash": "0xcb8f0e58ddb27f9fb3cbf200ec3023dffd43ced39c2e187c7907373082707420",
|
|
394
460
|
"maxFeePerBlobGas": undefined,
|
|
395
461
|
"maxFeePerGas": 52n,
|
|
396
462
|
"maxPriorityFeePerGas": 0n,
|
|
397
463
|
"nonce": 0,
|
|
398
|
-
"
|
|
399
|
-
"
|
|
400
|
-
|
|
464
|
+
"nonceKey": 0n,
|
|
465
|
+
"signature": {
|
|
466
|
+
"signature": {
|
|
467
|
+
"r": 58099370446734310330089633205075850139248168609383772256670067872736796317902n,
|
|
468
|
+
"s": 40363612152801210185555264529559625661542041105068748708016255256620242651218n,
|
|
469
|
+
"yParity": 1,
|
|
470
|
+
},
|
|
471
|
+
"type": "secp256k1",
|
|
472
|
+
},
|
|
473
|
+
"to": null,
|
|
401
474
|
"transactionIndex": 0,
|
|
402
|
-
"type": "
|
|
403
|
-
"typeHex": "
|
|
404
|
-
"v":
|
|
475
|
+
"type": "aa",
|
|
476
|
+
"typeHex": "0x76",
|
|
477
|
+
"v": undefined,
|
|
478
|
+
"validAfter": null,
|
|
479
|
+
"validBefore": null,
|
|
405
480
|
"value": 0n,
|
|
406
|
-
"yParity":
|
|
481
|
+
"yParity": undefined,
|
|
407
482
|
}
|
|
408
483
|
`)
|
|
409
484
|
})
|
package/src/viem/index.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * as
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export {
|
|
7
|
-
export
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
1
|
+
export * as Abis from './Abis.js'
|
|
2
|
+
export * as Actions from './Actions/index.js'
|
|
3
|
+
export * as Addresses from './Addresses.js'
|
|
4
|
+
export * as Chain from './Chain.js'
|
|
5
|
+
export * as Client from './Client.js'
|
|
6
|
+
export { createTempoClient } from './Client.js'
|
|
7
|
+
export { decorator as tempoActions } from './Decorator.js'
|
|
8
|
+
export * as Formatters from './Formatters.js'
|
|
9
|
+
export * as Tick from './Tick.js'
|
|
10
|
+
export * as TokenIds from './TokenIds.js'
|
|
11
|
+
export * as Transaction from './Transaction.js'
|
|
12
|
+
export * as Transport from './Transport.js'
|
|
13
|
+
export { withFeePayer } from './Transport.js'
|
|
@@ -9,8 +9,8 @@ import type {
|
|
|
9
9
|
IsUndefined,
|
|
10
10
|
MaybeRequired,
|
|
11
11
|
UnionPick,
|
|
12
|
-
} from '
|
|
13
|
-
import type {
|
|
12
|
+
} from '../../internal/types.js'
|
|
13
|
+
import type { TransactionRequestAA } from '../Transaction.js'
|
|
14
14
|
|
|
15
15
|
export type GetAccountParameter<
|
|
16
16
|
account extends Account | undefined = Account | undefined,
|
|
@@ -53,4 +53,4 @@ export type WriteParameters<
|
|
|
53
53
|
| 'nonce'
|
|
54
54
|
| 'throwOnReceiptRevert'
|
|
55
55
|
> &
|
|
56
|
-
UnionPick<
|
|
56
|
+
UnionPick<TransactionRequestAA, 'feePayer' | 'feeToken'>
|