tempo.ts 0.10.5 → 0.11.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.
Files changed (203) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +0 -41
  3. package/dist/viem/Account.d.ts +8 -3
  4. package/dist/viem/Account.d.ts.map +1 -1
  5. package/dist/viem/Account.js +9 -2
  6. package/dist/viem/Account.js.map +1 -1
  7. package/dist/viem/Actions/account.d.ts.map +1 -1
  8. package/dist/viem/Actions/account.js +1 -1
  9. package/dist/viem/Actions/account.js.map +1 -1
  10. package/dist/viem/Actions/amm.d.ts +1 -1
  11. package/dist/viem/Actions/amm.d.ts.map +1 -1
  12. package/dist/viem/Actions/amm.js +1 -2
  13. package/dist/viem/Actions/amm.js.map +1 -1
  14. package/dist/viem/Actions/dex.d.ts +0 -35
  15. package/dist/viem/Actions/dex.d.ts.map +1 -1
  16. package/dist/viem/Actions/dex.js +0 -43
  17. package/dist/viem/Actions/dex.js.map +1 -1
  18. package/dist/viem/Actions/fee.d.ts +1 -1
  19. package/dist/viem/Actions/fee.d.ts.map +1 -1
  20. package/dist/viem/Actions/fee.js +1 -1
  21. package/dist/viem/Actions/fee.js.map +1 -1
  22. package/dist/viem/Actions/nonce.d.ts.map +1 -1
  23. package/dist/viem/Actions/nonce.js +6 -4
  24. package/dist/viem/Actions/nonce.js.map +1 -1
  25. package/dist/viem/Actions/token.d.ts +1 -2
  26. package/dist/viem/Actions/token.d.ts.map +1 -1
  27. package/dist/viem/Actions/token.js +1 -2
  28. package/dist/viem/Actions/token.js.map +1 -1
  29. package/dist/viem/Chain.d.ts +34 -34
  30. package/dist/viem/Chain.d.ts.map +1 -1
  31. package/dist/viem/Chain.js +2 -0
  32. package/dist/viem/Chain.js.map +1 -1
  33. package/dist/viem/Decorator.d.ts +0 -27
  34. package/dist/viem/Decorator.d.ts.map +1 -1
  35. package/dist/viem/Decorator.js +0 -1
  36. package/dist/viem/Decorator.js.map +1 -1
  37. package/dist/viem/Formatters.d.ts.map +1 -1
  38. package/dist/viem/Formatters.js +5 -3
  39. package/dist/viem/Formatters.js.map +1 -1
  40. package/dist/viem/Transaction.d.ts +8 -5
  41. package/dist/viem/Transaction.d.ts.map +1 -1
  42. package/dist/viem/Transaction.js +13 -3
  43. package/dist/viem/Transaction.js.map +1 -1
  44. package/dist/viem/index.d.ts +10 -1
  45. package/dist/viem/index.d.ts.map +1 -1
  46. package/dist/viem/index.js +1 -1
  47. package/dist/viem/index.js.map +1 -1
  48. package/dist/viem/internal/types.d.ts +1 -1
  49. package/dist/viem/internal/types.d.ts.map +1 -1
  50. package/dist/wagmi/Actions/dex.d.ts +1 -45
  51. package/dist/wagmi/Actions/dex.d.ts.map +1 -1
  52. package/dist/wagmi/Actions/dex.js +0 -55
  53. package/dist/wagmi/Actions/dex.js.map +1 -1
  54. package/dist/wagmi/Connector.d.ts +1 -1
  55. package/dist/wagmi/Connector.d.ts.map +1 -1
  56. package/dist/wagmi/Connector.js +1 -2
  57. package/dist/wagmi/Connector.js.map +1 -1
  58. package/dist/wagmi/Hooks/dex.d.ts +3 -46
  59. package/dist/wagmi/Hooks/dex.d.ts.map +1 -1
  60. package/dist/wagmi/Hooks/dex.js +2 -54
  61. package/dist/wagmi/Hooks/dex.js.map +1 -1
  62. package/dist/wagmi/index.d.ts +1 -1
  63. package/dist/wagmi/index.d.ts.map +1 -1
  64. package/dist/wagmi/index.js +1 -1
  65. package/dist/wagmi/index.js.map +1 -1
  66. package/package.json +5 -13
  67. package/src/viem/Account.test.ts +1 -1
  68. package/src/viem/Account.ts +11 -2
  69. package/src/viem/Actions/account.ts +1 -1
  70. package/src/viem/Actions/amm.ts +1 -2
  71. package/src/viem/Actions/dex.test.ts +1 -195
  72. package/src/viem/Actions/dex.ts +0 -53
  73. package/src/viem/Actions/fee.test.ts +2 -2
  74. package/src/viem/Actions/fee.ts +1 -1
  75. package/src/viem/Actions/nonce.test.ts +27 -14
  76. package/src/viem/Actions/nonce.ts +6 -4
  77. package/src/viem/Actions/token.test.ts +18 -52
  78. package/src/viem/Actions/token.ts +1 -2
  79. package/src/viem/Chain.ts +3 -1
  80. package/src/viem/Decorator.ts +0 -30
  81. package/src/viem/Formatters.ts +9 -3
  82. package/src/viem/Transaction.ts +23 -7
  83. package/src/viem/e2e.test.ts +19 -0
  84. package/src/viem/index.ts +12 -1
  85. package/src/viem/internal/types.ts +1 -1
  86. package/src/wagmi/Actions/dex.test.ts +0 -26
  87. package/src/wagmi/Actions/dex.ts +1 -111
  88. package/src/wagmi/Actions/nonce.test.ts +8 -4
  89. package/src/wagmi/Actions/token.test.ts +2 -2
  90. package/src/wagmi/Connector.ts +1 -2
  91. package/src/wagmi/Hooks/dex.test.ts +0 -26
  92. package/src/wagmi/Hooks/dex.ts +1 -88
  93. package/src/wagmi/Hooks/nonce.test.ts +3 -3
  94. package/src/wagmi/index.ts +4 -1
  95. package/dist/ox/AuthorizationTempo.d.ts +0 -450
  96. package/dist/ox/AuthorizationTempo.d.ts.map +0 -1
  97. package/dist/ox/AuthorizationTempo.js +0 -433
  98. package/dist/ox/AuthorizationTempo.js.map +0 -1
  99. package/dist/ox/KeyAuthorization.d.ts +0 -356
  100. package/dist/ox/KeyAuthorization.d.ts.map +0 -1
  101. package/dist/ox/KeyAuthorization.js +0 -359
  102. package/dist/ox/KeyAuthorization.js.map +0 -1
  103. package/dist/ox/Order.d.ts +0 -92
  104. package/dist/ox/Order.d.ts.map +0 -1
  105. package/dist/ox/Order.js +0 -88
  106. package/dist/ox/Order.js.map +0 -1
  107. package/dist/ox/OrdersFilters.d.ts +0 -72
  108. package/dist/ox/OrdersFilters.d.ts.map +0 -1
  109. package/dist/ox/OrdersFilters.js +0 -100
  110. package/dist/ox/OrdersFilters.js.map +0 -1
  111. package/dist/ox/Pagination.d.ts +0 -128
  112. package/dist/ox/Pagination.d.ts.map +0 -1
  113. package/dist/ox/Pagination.js +0 -78
  114. package/dist/ox/Pagination.js.map +0 -1
  115. package/dist/ox/PoolId.d.ts +0 -18
  116. package/dist/ox/PoolId.d.ts.map +0 -1
  117. package/dist/ox/PoolId.js +0 -13
  118. package/dist/ox/PoolId.js.map +0 -1
  119. package/dist/ox/RpcSchema.d.ts +0 -32
  120. package/dist/ox/RpcSchema.d.ts.map +0 -1
  121. package/dist/ox/RpcSchema.js +0 -2
  122. package/dist/ox/RpcSchema.js.map +0 -1
  123. package/dist/ox/SignatureEnvelope.d.ts +0 -260
  124. package/dist/ox/SignatureEnvelope.d.ts.map +0 -1
  125. package/dist/ox/SignatureEnvelope.js +0 -477
  126. package/dist/ox/SignatureEnvelope.js.map +0 -1
  127. package/dist/ox/Tick.d.ts +0 -115
  128. package/dist/ox/Tick.d.ts.map +0 -1
  129. package/dist/ox/Tick.js +0 -127
  130. package/dist/ox/Tick.js.map +0 -1
  131. package/dist/ox/TokenId.d.ts +0 -25
  132. package/dist/ox/TokenId.d.ts.map +0 -1
  133. package/dist/ox/TokenId.js +0 -41
  134. package/dist/ox/TokenId.js.map +0 -1
  135. package/dist/ox/TokenRole.d.ts +0 -11
  136. package/dist/ox/TokenRole.d.ts.map +0 -1
  137. package/dist/ox/TokenRole.js +0 -22
  138. package/dist/ox/TokenRole.js.map +0 -1
  139. package/dist/ox/Transaction.d.ts +0 -201
  140. package/dist/ox/Transaction.d.ts.map +0 -1
  141. package/dist/ox/Transaction.js +0 -167
  142. package/dist/ox/Transaction.js.map +0 -1
  143. package/dist/ox/TransactionEnvelopeTempo.d.ts +0 -470
  144. package/dist/ox/TransactionEnvelopeTempo.d.ts.map +0 -1
  145. package/dist/ox/TransactionEnvelopeTempo.js +0 -547
  146. package/dist/ox/TransactionEnvelopeTempo.js.map +0 -1
  147. package/dist/ox/TransactionReceipt.d.ts +0 -155
  148. package/dist/ox/TransactionReceipt.d.ts.map +0 -1
  149. package/dist/ox/TransactionReceipt.js +0 -136
  150. package/dist/ox/TransactionReceipt.js.map +0 -1
  151. package/dist/ox/TransactionRequest.d.ts +0 -76
  152. package/dist/ox/TransactionRequest.d.ts.map +0 -1
  153. package/dist/ox/TransactionRequest.js +0 -93
  154. package/dist/ox/TransactionRequest.js.map +0 -1
  155. package/dist/ox/index.d.ts +0 -14
  156. package/dist/ox/index.d.ts.map +0 -1
  157. package/dist/ox/index.js +0 -14
  158. package/dist/ox/index.js.map +0 -1
  159. package/dist/prool/Instance.d.ts +0 -101
  160. package/dist/prool/Instance.d.ts.map +0 -1
  161. package/dist/prool/Instance.js +0 -136
  162. package/dist/prool/Instance.js.map +0 -1
  163. package/dist/prool/chain.json +0 -238
  164. package/dist/prool/index.d.ts +0 -2
  165. package/dist/prool/index.d.ts.map +0 -1
  166. package/dist/prool/index.js +0 -2
  167. package/dist/prool/index.js.map +0 -1
  168. package/src/ox/AuthorizationTempo.test.ts +0 -1256
  169. package/src/ox/AuthorizationTempo.ts +0 -648
  170. package/src/ox/KeyAuthorization.test.ts +0 -1332
  171. package/src/ox/KeyAuthorization.ts +0 -540
  172. package/src/ox/Order.test.ts +0 -78
  173. package/src/ox/Order.ts +0 -125
  174. package/src/ox/OrdersFilters.test.ts +0 -182
  175. package/src/ox/OrdersFilters.ts +0 -125
  176. package/src/ox/Pagination.test.ts +0 -162
  177. package/src/ox/Pagination.ts +0 -164
  178. package/src/ox/PoolId.test.ts +0 -33
  179. package/src/ox/PoolId.ts +0 -27
  180. package/src/ox/RpcSchema.ts +0 -35
  181. package/src/ox/SignatureEnvelope.test.ts +0 -1876
  182. package/src/ox/SignatureEnvelope.ts +0 -791
  183. package/src/ox/Tick.test.ts +0 -281
  184. package/src/ox/Tick.ts +0 -181
  185. package/src/ox/TokenId.test.ts +0 -40
  186. package/src/ox/TokenId.ts +0 -50
  187. package/src/ox/TokenRole.test.ts +0 -16
  188. package/src/ox/TokenRole.ts +0 -27
  189. package/src/ox/Transaction.test.ts +0 -523
  190. package/src/ox/Transaction.ts +0 -332
  191. package/src/ox/TransactionEnvelopeTempo.test.ts +0 -1352
  192. package/src/ox/TransactionEnvelopeTempo.ts +0 -905
  193. package/src/ox/TransactionReceipt.ts +0 -190
  194. package/src/ox/TransactionRequest.ts +0 -147
  195. package/src/ox/e2e.test.ts +0 -1393
  196. package/src/ox/index.ts +0 -13
  197. package/src/prool/Instance.test.ts +0 -43
  198. package/src/prool/Instance.ts +0 -247
  199. package/src/prool/chain.json +0 -238
  200. package/src/prool/index.ts +0 -1
  201. package/src/viem/Actions/__snapshots__/dex.test.ts.snap +0 -850
  202. package/src/wagmi/Actions/__snapshots__/dex.test.ts.snap +0 -310
  203. package/src/wagmi/Hooks/__snapshots__/dex.test.ts.snap +0 -457
@@ -1,523 +0,0 @@
1
- import { Transaction } from 'tempo.ts/ox'
2
- import { describe, expect, test } from 'vitest'
3
-
4
- describe('fromRpc', () => {
5
- test('default', () => {
6
- const transaction = Transaction.fromRpc({
7
- accessList: [],
8
- calls: [
9
- {
10
- input: '0xdeadbeef',
11
- to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
12
- value: '0x9b6e64a8ec60000',
13
- },
14
- ],
15
- maxFeePerGas: '0x2',
16
- maxPriorityFeePerGas: '0x1',
17
- hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',
18
- nonce: '0x357',
19
- blockHash:
20
- '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',
21
- blockNumber: '0x12f296f',
22
- transactionIndex: '0x2',
23
- feeToken: '0x20c0000000000000000000000000000000000000',
24
- from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',
25
- gas: '0x43f5d',
26
- gasPrice: '0x2ca6ae494',
27
- signature: {
28
- r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',
29
- s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',
30
- v: '0x0',
31
- type: 'secp256k1',
32
- yParity: '0x0',
33
- },
34
- chainId: '0x1',
35
- type: '0x76',
36
- })
37
- expect(transaction).toMatchInlineSnapshot(`
38
- {
39
- "accessList": [],
40
- "blockHash": "0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b",
41
- "blockNumber": 19868015n,
42
- "calls": [
43
- {
44
- "data": "0xdeadbeef",
45
- "to": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
46
- "value": 700000000000000000n,
47
- },
48
- ],
49
- "chainId": 1,
50
- "data": undefined,
51
- "feeToken": "0x20c0000000000000000000000000000000000000",
52
- "from": "0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6",
53
- "gas": 278365n,
54
- "gasPrice": 11985937556n,
55
- "hash": "0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0",
56
- "maxFeePerGas": 2n,
57
- "maxPriorityFeePerGas": 1n,
58
- "nonce": 855n,
59
- "signature": {
60
- "signature": {
61
- "r": 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
62
- "s": 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
63
- "yParity": 0,
64
- },
65
- "type": "secp256k1",
66
- },
67
- "transactionIndex": 2,
68
- "type": "tempo",
69
- "value": 0n,
70
- }
71
- `)
72
- })
73
-
74
- test('with feePayerSignature', () => {
75
- const transaction = Transaction.fromRpc({
76
- accessList: [],
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
- },
90
- maxFeePerGas: '0x2',
91
- maxPriorityFeePerGas: '0x1',
92
- hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',
93
- nonce: '0x357',
94
- blockHash:
95
- '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',
96
- blockNumber: '0x12f296f',
97
- transactionIndex: '0x2',
98
- feeToken: '0x20c0000000000000000000000000000000000000',
99
- from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',
100
- gas: '0x43f5d',
101
- gasPrice: '0x2ca6ae494',
102
- signature: {
103
- r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',
104
- s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',
105
- v: '0x0',
106
- type: 'secp256k1',
107
- yParity: '0x0',
108
- },
109
- chainId: '0x1',
110
- type: '0x76',
111
- })
112
-
113
- expect(transaction).toMatchInlineSnapshot(`
114
- {
115
- "accessList": [],
116
- "blockHash": "0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b",
117
- "blockNumber": 19868015n,
118
- "calls": [
119
- {
120
- "data": "0xdeadbeef",
121
- "to": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
122
- "value": 700000000000000000n,
123
- },
124
- ],
125
- "chainId": 1,
126
- "data": undefined,
127
- "feePayerSignature": {
128
- "r": 8574245934337799659042750864278046211314109527666697413298781631396794530078n,
129
- "s": 22549658598721143185960614158212618570884225122794367192341714237232002247296n,
130
- "v": 27,
131
- "yParity": 0,
132
- },
133
- "feeToken": "0x20c0000000000000000000000000000000000000",
134
- "from": "0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6",
135
- "gas": 278365n,
136
- "gasPrice": 11985937556n,
137
- "hash": "0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0",
138
- "maxFeePerGas": 2n,
139
- "maxPriorityFeePerGas": 1n,
140
- "nonce": 855n,
141
- "signature": {
142
- "signature": {
143
- "r": 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
144
- "s": 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
145
- "yParity": 0,
146
- },
147
- "type": "secp256k1",
148
- },
149
- "transactionIndex": 2,
150
- "type": "tempo",
151
- "value": 0n,
152
- }
153
- `)
154
- })
155
-
156
- test('with keyAuthorization', () => {
157
- const transaction = Transaction.fromRpc({
158
- accessList: [],
159
- calls: [
160
- {
161
- input: '0xdeadbeef',
162
- to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
163
- value: '0x9b6e64a8ec60000',
164
- },
165
- ],
166
- keyAuthorization: {
167
- expiry: '0xffffffffffff',
168
- keyId: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
169
- keyType: 'secp256k1',
170
- limits: [
171
- {
172
- token: '0x20c0000000000000000000000000000000000001',
173
- limit: '0x8ac7230489e80000',
174
- },
175
- ],
176
- signature: {
177
- r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',
178
- s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',
179
- type: 'secp256k1',
180
- yParity: '0x0',
181
- },
182
- },
183
- maxFeePerGas: '0x2',
184
- maxPriorityFeePerGas: '0x1',
185
- hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',
186
- nonce: '0x357',
187
- blockHash:
188
- '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',
189
- blockNumber: '0x12f296f',
190
- transactionIndex: '0x2',
191
- feeToken: '0x20c0000000000000000000000000000000000000',
192
- from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',
193
- gas: '0x43f5d',
194
- gasPrice: '0x2ca6ae494',
195
- signature: {
196
- r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',
197
- s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',
198
- v: '0x0',
199
- type: 'secp256k1',
200
- yParity: '0x0',
201
- },
202
- chainId: '0x1',
203
- type: '0x76',
204
- })
205
-
206
- expect(transaction).toMatchInlineSnapshot(`
207
- {
208
- "accessList": [],
209
- "blockHash": "0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b",
210
- "blockNumber": 19868015n,
211
- "calls": [
212
- {
213
- "data": "0xdeadbeef",
214
- "to": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
215
- "value": 700000000000000000n,
216
- },
217
- ],
218
- "chainId": 1,
219
- "data": undefined,
220
- "feeToken": "0x20c0000000000000000000000000000000000000",
221
- "from": "0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6",
222
- "gas": 278365n,
223
- "gasPrice": 11985937556n,
224
- "hash": "0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0",
225
- "keyAuthorization": {
226
- "address": "0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c",
227
- "chainId": 0n,
228
- "expiry": 281474976710655,
229
- "limits": [
230
- {
231
- "limit": 10000000000000000000n,
232
- "token": "0x20c0000000000000000000000000000000000001",
233
- },
234
- ],
235
- "signature": {
236
- "signature": {
237
- "r": 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
238
- "s": 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
239
- "yParity": 0,
240
- },
241
- "type": "secp256k1",
242
- },
243
- "type": "secp256k1",
244
- },
245
- "maxFeePerGas": 2n,
246
- "maxPriorityFeePerGas": 1n,
247
- "nonce": 855n,
248
- "signature": {
249
- "signature": {
250
- "r": 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
251
- "s": 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
252
- "yParity": 0,
253
- },
254
- "type": "secp256k1",
255
- },
256
- "transactionIndex": 2,
257
- "type": "tempo",
258
- "value": 0n,
259
- }
260
- `)
261
- })
262
- })
263
-
264
- describe('toRpc', () => {
265
- test('default', () => {
266
- const transaction = Transaction.toRpc({
267
- accessList: [],
268
- blockHash:
269
- '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',
270
- blockNumber: 19868015n,
271
- calls: [
272
- {
273
- data: '0xdeadbeef',
274
- to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
275
- value: 700000000000000000n,
276
- },
277
- ],
278
- chainId: 1,
279
- data: undefined,
280
- feeToken: '0x20c0000000000000000000000000000000000000',
281
- from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',
282
- gas: 278365n,
283
- gasPrice: 11985937556n,
284
- hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',
285
- maxFeePerGas: 2n,
286
- maxPriorityFeePerGas: 1n,
287
- nonce: 855n,
288
- signature: {
289
- signature: {
290
- r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
291
- s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
292
- yParity: 0,
293
- },
294
- type: 'secp256k1',
295
- },
296
- transactionIndex: 2,
297
- type: 'tempo',
298
- })
299
- expect(transaction).toMatchInlineSnapshot(`
300
- {
301
- "accessList": [],
302
- "blockHash": "0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b",
303
- "blockNumber": "0x12f296f",
304
- "calls": [
305
- {
306
- "data": "0xdeadbeef",
307
- "to": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
308
- "value": "0x9b6e64a8ec60000",
309
- },
310
- ],
311
- "chainId": "0x1",
312
- "feeToken": "0x20c0000000000000000000000000000000000000",
313
- "from": "0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6",
314
- "gas": "0x43f5d",
315
- "gasPrice": "0x2ca6ae494",
316
- "hash": "0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0",
317
- "input": undefined,
318
- "maxFeePerGas": "0x2",
319
- "maxPriorityFeePerGas": "0x1",
320
- "nonce": "0x357",
321
- "signature": {
322
- "r": "0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d",
323
- "s": "0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540",
324
- "type": "secp256k1",
325
- "yParity": "0x0",
326
- },
327
- "to": undefined,
328
- "transactionIndex": "0x2",
329
- "type": "0x76",
330
- "value": "0x0",
331
- }
332
- `)
333
- })
334
-
335
- test('default', () => {
336
- const transaction = Transaction.toRpc({
337
- accessList: [],
338
- blockHash:
339
- '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',
340
- blockNumber: 19868015n,
341
- calls: [
342
- {
343
- data: '0xdeadbeef',
344
- to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
345
- value: 700000000000000000n,
346
- },
347
- ],
348
- chainId: 1,
349
- data: undefined,
350
- feePayerSignature: {
351
- r: 8574245934337799659042750864278046211314109527666697413298781631396794530078n,
352
- s: 22549658598721143185960614158212618570884225122794367192341714237232002247296n,
353
- v: 27,
354
- yParity: 0,
355
- },
356
- feeToken: '0x20c0000000000000000000000000000000000000',
357
- from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',
358
- gas: 278365n,
359
- gasPrice: 11985937556n,
360
- hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',
361
- maxFeePerGas: 2n,
362
- maxPriorityFeePerGas: 1n,
363
- nonce: 855n,
364
- signature: {
365
- signature: {
366
- r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
367
- s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
368
- yParity: 0,
369
- },
370
- type: 'secp256k1',
371
- },
372
- transactionIndex: 2,
373
- type: 'tempo',
374
- })
375
- expect(transaction).toMatchInlineSnapshot(`
376
- {
377
- "accessList": [],
378
- "blockHash": "0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b",
379
- "blockNumber": "0x12f296f",
380
- "calls": [
381
- {
382
- "data": "0xdeadbeef",
383
- "to": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
384
- "value": "0x9b6e64a8ec60000",
385
- },
386
- ],
387
- "chainId": "0x1",
388
- "feePayerSignature": {
389
- "r": "0x12f4d9e9924f62b19de816252efc125006298f43e62d394151e62600e2c2f91e",
390
- "s": "0x31daa78bb3e95dd22f6370e59617c60d109bf28e55c92b25994ddbed420e2a80",
391
- "v": "0x1b",
392
- "yParity": "0x0",
393
- },
394
- "feeToken": "0x20c0000000000000000000000000000000000000",
395
- "from": "0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6",
396
- "gas": "0x43f5d",
397
- "gasPrice": "0x2ca6ae494",
398
- "hash": "0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0",
399
- "input": undefined,
400
- "maxFeePerGas": "0x2",
401
- "maxPriorityFeePerGas": "0x1",
402
- "nonce": "0x357",
403
- "signature": {
404
- "r": "0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d",
405
- "s": "0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540",
406
- "type": "secp256k1",
407
- "yParity": "0x0",
408
- },
409
- "to": undefined,
410
- "transactionIndex": "0x2",
411
- "type": "0x76",
412
- "value": "0x0",
413
- }
414
- `)
415
- })
416
-
417
- test('with keyAuthorization', () => {
418
- const transaction = Transaction.toRpc({
419
- accessList: [],
420
- blockHash:
421
- '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',
422
- blockNumber: 19868015n,
423
- calls: [
424
- {
425
- data: '0xdeadbeef',
426
- to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
427
- value: 700000000000000000n,
428
- },
429
- ],
430
- chainId: 1,
431
- data: undefined,
432
- keyAuthorization: {
433
- address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
434
- expiry: 281474976710655,
435
- type: 'secp256k1',
436
- limits: [
437
- {
438
- limit: 10000000000000000000n,
439
- token: '0x20c0000000000000000000000000000000000001',
440
- },
441
- ],
442
- signature: {
443
- signature: {
444
- r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
445
- s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
446
- yParity: 0,
447
- },
448
- type: 'secp256k1',
449
- },
450
- },
451
- feeToken: '0x20c0000000000000000000000000000000000000',
452
- from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',
453
- gas: 278365n,
454
- gasPrice: 11985937556n,
455
- hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',
456
- maxFeePerGas: 2n,
457
- maxPriorityFeePerGas: 1n,
458
- nonce: 855n,
459
- signature: {
460
- signature: {
461
- r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
462
- s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
463
- yParity: 0,
464
- },
465
- type: 'secp256k1',
466
- },
467
- transactionIndex: 2,
468
- type: 'tempo',
469
- })
470
- expect(transaction).toMatchInlineSnapshot(`
471
- {
472
- "accessList": [],
473
- "blockHash": "0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b",
474
- "blockNumber": "0x12f296f",
475
- "calls": [
476
- {
477
- "data": "0xdeadbeef",
478
- "to": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
479
- "value": "0x9b6e64a8ec60000",
480
- },
481
- ],
482
- "chainId": "0x1",
483
- "feeToken": "0x20c0000000000000000000000000000000000000",
484
- "from": "0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6",
485
- "gas": "0x43f5d",
486
- "gasPrice": "0x2ca6ae494",
487
- "hash": "0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0",
488
- "input": undefined,
489
- "keyAuthorization": {
490
- "chainId": "0x",
491
- "expiry": "0xffffffffffff",
492
- "keyId": "0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c",
493
- "keyType": "secp256k1",
494
- "limits": [
495
- {
496
- "limit": "0x8ac7230489e80000",
497
- "token": "0x20c0000000000000000000000000000000000001",
498
- },
499
- ],
500
- "signature": {
501
- "r": "0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d",
502
- "s": "0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540",
503
- "type": "secp256k1",
504
- "yParity": "0x0",
505
- },
506
- },
507
- "maxFeePerGas": "0x2",
508
- "maxPriorityFeePerGas": "0x1",
509
- "nonce": "0x357",
510
- "signature": {
511
- "r": "0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d",
512
- "s": "0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540",
513
- "type": "secp256k1",
514
- "yParity": "0x0",
515
- },
516
- "to": undefined,
517
- "transactionIndex": "0x2",
518
- "type": "0x76",
519
- "value": "0x0",
520
- }
521
- `)
522
- })
523
- })