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.
Files changed (195) hide show
  1. package/dist/chains.d.ts +244 -541
  2. package/dist/chains.d.ts.map +1 -1
  3. package/dist/chains.js +10 -23
  4. package/dist/chains.js.map +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/ox/SignatureEnvelope.d.ts +245 -0
  7. package/dist/ox/SignatureEnvelope.d.ts.map +1 -0
  8. package/dist/ox/SignatureEnvelope.js +437 -0
  9. package/dist/ox/SignatureEnvelope.js.map +1 -0
  10. package/dist/ox/Transaction.d.ts +61 -24
  11. package/dist/ox/Transaction.d.ts.map +1 -1
  12. package/dist/ox/Transaction.js +63 -18
  13. package/dist/ox/Transaction.js.map +1 -1
  14. package/dist/ox/TransactionEnvelopeAA.d.ts +461 -0
  15. package/dist/ox/TransactionEnvelopeAA.d.ts.map +1 -0
  16. package/dist/ox/TransactionEnvelopeAA.js +528 -0
  17. package/dist/ox/TransactionEnvelopeAA.js.map +1 -0
  18. package/dist/ox/TransactionRequest.d.ts +7 -5
  19. package/dist/ox/TransactionRequest.d.ts.map +1 -1
  20. package/dist/ox/TransactionRequest.js +21 -12
  21. package/dist/ox/TransactionRequest.js.map +1 -1
  22. package/dist/ox/index.d.ts +5 -4
  23. package/dist/ox/index.d.ts.map +1 -1
  24. package/dist/ox/index.js +5 -4
  25. package/dist/ox/index.js.map +1 -1
  26. package/dist/prool/Instance.d.ts +0 -4
  27. package/dist/prool/Instance.d.ts.map +1 -1
  28. package/dist/prool/Instance.js +7 -7
  29. package/dist/prool/Instance.js.map +1 -1
  30. package/dist/prool/index.d.ts +1 -1
  31. package/dist/prool/index.d.ts.map +1 -1
  32. package/dist/prool/index.js +1 -1
  33. package/dist/prool/index.js.map +1 -1
  34. package/dist/viem/{abis.d.ts → Abis.d.ts} +523 -9
  35. package/dist/viem/Abis.d.ts.map +1 -0
  36. package/dist/viem/{abis.js → Abis.js} +321 -9
  37. package/dist/viem/Abis.js.map +1 -0
  38. package/dist/viem/{actions → Actions}/amm.d.ts +21 -21
  39. package/dist/viem/Actions/amm.d.ts.map +1 -0
  40. package/dist/viem/{actions → Actions}/amm.js +55 -43
  41. package/dist/viem/Actions/amm.js.map +1 -0
  42. package/dist/viem/Actions/dex.d.ts +3263 -0
  43. package/dist/viem/Actions/dex.d.ts.map +1 -0
  44. package/dist/viem/Actions/dex.js +1357 -0
  45. package/dist/viem/Actions/dex.js.map +1 -0
  46. package/dist/viem/{actions → Actions}/fee.d.ts +8 -8
  47. package/dist/viem/Actions/fee.d.ts.map +1 -0
  48. package/dist/viem/{actions → Actions}/fee.js +14 -13
  49. package/dist/viem/Actions/fee.js.map +1 -0
  50. package/dist/viem/Actions/index.d.ts +6 -0
  51. package/dist/viem/Actions/index.d.ts.map +1 -0
  52. package/dist/viem/Actions/index.js +6 -0
  53. package/dist/viem/Actions/index.js.map +1 -0
  54. package/dist/viem/{actions → Actions}/policy.d.ts +19 -19
  55. package/dist/viem/Actions/policy.d.ts.map +1 -0
  56. package/dist/viem/{actions → Actions}/policy.js +59 -46
  57. package/dist/viem/Actions/policy.js.map +1 -0
  58. package/dist/viem/{actions → Actions}/token.d.ts +3275 -698
  59. package/dist/viem/Actions/token.d.ts.map +1 -0
  60. package/dist/viem/{actions → Actions}/token.js +458 -84
  61. package/dist/viem/Actions/token.js.map +1 -0
  62. package/dist/viem/Addresses.d.ts +9 -0
  63. package/dist/viem/Addresses.d.ts.map +1 -0
  64. package/dist/viem/Addresses.js +9 -0
  65. package/dist/viem/Addresses.js.map +1 -0
  66. package/dist/viem/{chain.d.ts → Chain.d.ts} +81 -57
  67. package/dist/viem/Chain.d.ts.map +1 -0
  68. package/dist/viem/{chain.js → Chain.js} +7 -7
  69. package/dist/viem/Chain.js.map +1 -0
  70. package/dist/viem/{client.d.ts → Client.d.ts} +4 -4
  71. package/dist/viem/Client.d.ts.map +1 -0
  72. package/dist/viem/{client.js → Client.js} +3 -3
  73. package/dist/viem/Client.js.map +1 -0
  74. package/dist/viem/{decorator.d.ts → Decorator.d.ts} +507 -5
  75. package/dist/viem/Decorator.d.ts.map +1 -0
  76. package/dist/viem/{decorator.js → Decorator.js} +31 -5
  77. package/dist/viem/Decorator.js.map +1 -0
  78. package/dist/viem/{formatters.d.ts → Formatters.d.ts} +2 -2
  79. package/dist/viem/Formatters.d.ts.map +1 -0
  80. package/dist/viem/{formatters.js → Formatters.js} +24 -17
  81. package/dist/viem/Formatters.js.map +1 -0
  82. package/dist/viem/Tick.d.ts +111 -0
  83. package/dist/viem/Tick.d.ts.map +1 -0
  84. package/dist/viem/Tick.js +127 -0
  85. package/dist/viem/Tick.js.map +1 -0
  86. package/dist/viem/TokenIds.d.ts +3 -0
  87. package/dist/viem/TokenIds.d.ts.map +1 -0
  88. package/dist/viem/TokenIds.js +3 -0
  89. package/dist/viem/TokenIds.js.map +1 -0
  90. package/dist/viem/Transaction.d.ts +57 -0
  91. package/dist/viem/Transaction.d.ts.map +1 -0
  92. package/dist/viem/Transaction.js +137 -0
  93. package/dist/viem/Transaction.js.map +1 -0
  94. package/dist/viem/{transport.d.ts → Transport.d.ts} +3 -3
  95. package/dist/viem/Transport.d.ts.map +1 -0
  96. package/dist/viem/{transport.js → Transport.js} +3 -3
  97. package/dist/viem/Transport.js.map +1 -0
  98. package/dist/viem/index.d.ts +13 -9
  99. package/dist/viem/index.d.ts.map +1 -1
  100. package/dist/viem/index.js +13 -9
  101. package/dist/viem/index.js.map +1 -1
  102. package/dist/viem/{types.d.ts → internal/types.d.ts} +3 -3
  103. package/dist/viem/internal/types.d.ts.map +1 -0
  104. package/dist/viem/{types.js.map → internal/types.js.map} +1 -1
  105. package/dist/viem/internal/utils.d.ts.map +1 -0
  106. package/dist/viem/internal/utils.js.map +1 -0
  107. package/package.json +87 -101
  108. package/src/chains.ts +10 -24
  109. package/src/ox/SignatureEnvelope.test.ts +1252 -0
  110. package/src/ox/SignatureEnvelope.ts +709 -0
  111. package/src/ox/Transaction.test.ts +144 -89
  112. package/src/ox/Transaction.ts +104 -29
  113. package/src/ox/TransactionEnvelopeAA.test.ts +1533 -0
  114. package/src/ox/TransactionEnvelopeAA.ts +858 -0
  115. package/src/ox/TransactionRequest.ts +25 -17
  116. package/src/ox/index.ts +2 -1
  117. package/src/prool/Instance.ts +6 -14
  118. package/src/prool/internal/chain.json +101 -27
  119. package/src/viem/{abis.ts → Abis.ts} +322 -8
  120. package/src/viem/{actions → Actions}/amm.test.ts +65 -68
  121. package/src/viem/{actions → Actions}/amm.ts +72 -60
  122. package/src/viem/Actions/dex.test.ts +1608 -0
  123. package/src/viem/Actions/dex.ts +2026 -0
  124. package/src/viem/{actions → Actions}/fee.test.ts +34 -36
  125. package/src/viem/{actions → Actions}/fee.ts +18 -17
  126. package/src/viem/{actions → Actions}/index.ts +1 -0
  127. package/src/viem/{actions → Actions}/policy.test.ts +2 -2
  128. package/src/viem/{actions → Actions}/policy.ts +77 -64
  129. package/src/viem/{actions → Actions}/token.test.ts +419 -64
  130. package/src/viem/{actions → Actions}/token.ts +751 -145
  131. package/src/viem/Addresses.ts +9 -0
  132. package/src/viem/{chain.ts → Chain.ts} +6 -6
  133. package/src/viem/{client.bench-d.ts → Client.bench-d.ts} +2 -2
  134. package/src/viem/{client.test.ts → Client.test.ts} +31 -6
  135. package/src/viem/{client.ts → Client.ts} +1 -1
  136. package/src/viem/{decorator.bench-d.ts → Decorator.bench-d.ts} +2 -2
  137. package/src/viem/{decorator.test.ts → Decorator.test.ts} +1 -0
  138. package/src/viem/{decorator.ts → Decorator.ts} +586 -4
  139. package/src/viem/{formatters.ts → Formatters.ts} +31 -20
  140. package/src/viem/Tick.test.ts +281 -0
  141. package/src/viem/Tick.ts +176 -0
  142. package/src/viem/TokenIds.ts +2 -0
  143. package/src/viem/Transaction.ts +303 -0
  144. package/src/viem/{transport.ts → Transport.ts} +5 -5
  145. package/src/viem/e2e.test.ts +153 -78
  146. package/src/viem/index.ts +13 -9
  147. package/src/viem/{types.ts → internal/types.ts} +3 -3
  148. package/dist/ox/TransactionEnvelopeFeeToken.d.ts +0 -393
  149. package/dist/ox/TransactionEnvelopeFeeToken.d.ts.map +0 -1
  150. package/dist/ox/TransactionEnvelopeFeeToken.js +0 -452
  151. package/dist/ox/TransactionEnvelopeFeeToken.js.map +0 -1
  152. package/dist/viem/abis.d.ts.map +0 -1
  153. package/dist/viem/abis.js.map +0 -1
  154. package/dist/viem/actions/amm.d.ts.map +0 -1
  155. package/dist/viem/actions/amm.js.map +0 -1
  156. package/dist/viem/actions/fee.d.ts.map +0 -1
  157. package/dist/viem/actions/fee.js.map +0 -1
  158. package/dist/viem/actions/index.d.ts +0 -5
  159. package/dist/viem/actions/index.d.ts.map +0 -1
  160. package/dist/viem/actions/index.js +0 -5
  161. package/dist/viem/actions/index.js.map +0 -1
  162. package/dist/viem/actions/policy.d.ts.map +0 -1
  163. package/dist/viem/actions/policy.js.map +0 -1
  164. package/dist/viem/actions/token.d.ts.map +0 -1
  165. package/dist/viem/actions/token.js.map +0 -1
  166. package/dist/viem/addresses.d.ts +0 -8
  167. package/dist/viem/addresses.d.ts.map +0 -1
  168. package/dist/viem/addresses.js +0 -8
  169. package/dist/viem/addresses.js.map +0 -1
  170. package/dist/viem/chain.d.ts.map +0 -1
  171. package/dist/viem/chain.js.map +0 -1
  172. package/dist/viem/client.d.ts.map +0 -1
  173. package/dist/viem/client.js.map +0 -1
  174. package/dist/viem/decorator.d.ts.map +0 -1
  175. package/dist/viem/decorator.js.map +0 -1
  176. package/dist/viem/formatters.d.ts.map +0 -1
  177. package/dist/viem/formatters.js.map +0 -1
  178. package/dist/viem/transaction.d.ts +0 -54
  179. package/dist/viem/transaction.d.ts.map +0 -1
  180. package/dist/viem/transaction.js +0 -108
  181. package/dist/viem/transaction.js.map +0 -1
  182. package/dist/viem/transport.d.ts.map +0 -1
  183. package/dist/viem/transport.js.map +0 -1
  184. package/dist/viem/types.d.ts.map +0 -1
  185. package/dist/viem/utils.d.ts.map +0 -1
  186. package/dist/viem/utils.js.map +0 -1
  187. package/src/ox/TransactionEnvelopeFeeToken.test.ts +0 -1119
  188. package/src/ox/TransactionEnvelopeFeeToken.ts +0 -717
  189. package/src/prool/internal/consensus.toml +0 -32
  190. package/src/viem/addresses.ts +0 -10
  191. package/src/viem/transaction.ts +0 -253
  192. /package/dist/viem/{types.js → internal/types.js} +0 -0
  193. /package/dist/viem/{utils.d.ts → internal/utils.d.ts} +0 -0
  194. /package/dist/viem/{utils.js → internal/utils.js} +0 -0
  195. /package/src/viem/{utils.ts → internal/utils.ts} +0 -0
@@ -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 * as actions from 'tempo.ts/viem/actions'
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 { parseTransaction } from './transaction.js'
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
- feeToken: '0x20c0000000000000000000000000000000000000',
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": "0x",
50
+ "data": undefined,
43
51
  "feePayerSignature": undefined,
44
- "feeToken": "0x20c0000000000000000000000000000000000000",
52
+ "feeToken": "0x20c0000000000000000000000000000000000001",
45
53
  "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
46
- "gas": 21000n,
54
+ "gas": 53793n,
47
55
  "gasPrice": 44n,
48
- "hash": "0x2dc7455a259871cc354fe83a904a1a003555d5d365a81dd4dc7b1ca42e63f2dc",
49
- "input": "0x",
56
+ "hash": "0xab174e234e36ccb8bfa8c4917541b283c6bb71c0018b22aab44e2ac3d6472487",
50
57
  "maxFeePerBlobGas": undefined,
51
58
  "maxFeePerGas": 52n,
52
59
  "maxPriorityFeePerGas": 0n,
53
60
  "nonce": 0,
54
- "r": "0x17d8f3e7638105d316e004faa8e6b680d6f55e0326bf2f0534a0d83b46b6d3fb",
55
- "s": "0x4a83f0e41f1f13bbbe0b53e4b57d2fb2d2542927e2331016c55265eb0bf5e80a",
56
- "to": "0x0000000000000000000000000000000000000000",
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": "feeToken",
59
- "typeHex": "0x77",
60
- "v": 28n,
72
+ "type": "aa",
73
+ "typeHex": "0x76",
74
+ "v": undefined,
75
+ "validAfter": null,
76
+ "validBefore": null,
61
77
  "value": 0n,
62
- "yParity": 1,
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": "0xe9ae5c5301000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000020fc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001447b155afa000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000000000000000000000000000000000000000000c5465737420546f6b656e20330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000554455354330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003555344000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
125
+ "data": undefined,
103
126
  "feePayerSignature": undefined,
104
127
  "feeToken": null,
105
128
  "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
106
- "gas": 30090n,
129
+ "gas": 53793n,
107
130
  "gasPrice": 44n,
108
- "hash": "0xdac9fd849170da469ed362cbe83e65b28ec04206e4be12a87ca719f2727a9f0e",
109
- "input": "0xe9ae5c5301000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000020fc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001447b155afa000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266000000000000000000000000000000000000000000000000000000000000000c5465737420546f6b656e20330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000554455354330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003555344000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
131
+ "hash": "0xaac409f81cf7a716479d4a1b516a3514edbe9d6def569725de8a36715e30f4c5",
110
132
  "maxFeePerBlobGas": undefined,
111
133
  "maxFeePerGas": 52n,
112
134
  "maxPriorityFeePerGas": 0n,
113
135
  "nonce": 0,
114
- "r": "0x3c55f0844854fcabd0fb085202a78de58e92b0389b5d0d5b623b4eaafe2c1c7d",
115
- "s": "0x5d9019302d458f76b424f242b1212ffb2fc3301f4cd23b4b6d2493cb38d5361b",
116
- "to": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
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": "feeToken",
119
- "typeHex": "0x77",
120
- "v": 27n,
147
+ "type": "aa",
148
+ "typeHex": "0x76",
149
+ "v": undefined,
150
+ "validAfter": null,
151
+ "validBefore": null,
121
152
  "value": 0n,
122
- "yParity": 0,
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": "0x",
199
+ "data": undefined,
162
200
  "feePayer": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
163
201
  "feePayerSignature": {
164
- "r": "0x5d32035dfaa049e95bf9baa487f817a824ef154e7252587a88f0e1d46077790b",
165
- "s": "0x3583f71d8df11e2e7976336ae0ee960521e80af5719e6387d7dc832f5bace402",
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": 21000n,
209
+ "gas": 53793n,
172
210
  "gasPrice": 44n,
173
- "hash": "0xc4a600da90b6267bec6f414b378819dc95c597820df324b0df4e16b63cee430b",
174
- "input": "0x",
211
+ "hash": "0x5b7ae2e6eb4d460522a62cf031ec37f9ce649f0fa1108071a7ba15c6d20f8f3b",
175
212
  "maxFeePerBlobGas": undefined,
176
213
  "maxFeePerGas": 52n,
177
214
  "maxPriorityFeePerGas": 0n,
178
215
  "nonce": 0,
179
- "r": "0x1f1297f1407dd0676e1c832c62838051927c0cdabdd5ff8e30a6946cd57adb79",
180
- "s": "0x779c8374b9a22585f05d4484f1c4b2b022cc114cb7002b525f66873dd43e1fa9",
181
- "to": "0x0000000000000000000000000000000000000000",
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": "feeToken",
184
- "typeHex": "0x77",
185
- "v": 28n,
227
+ "type": "aa",
228
+ "typeHex": "0x76",
229
+ "v": undefined,
230
+ "validAfter": null,
231
+ "validBefore": null,
186
232
  "value": 0n,
187
- "yParity": 1,
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
- ...parseTransaction(transaction),
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": "0xdeadbeef",
292
+ "data": undefined,
241
293
  "feePayer": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
242
294
  "feePayerSignature": {
243
- "r": "0xd855471eb74e1225bb0f12b105c8b22849af6bdbdc88e69fc4a22a0760fdb980",
244
- "s": "0x4bb4c1c891657b24170fb839aaad72b11038a3d01d4f21dd912e3a3052c9c59c",
245
- "v": 28n,
246
- "yParity": 1,
295
+ "r": "0xd2174d7e41dec16cea89d13e8411e6e69cc9d7a1711861eba587bd02d1ba49f6",
296
+ "s": "0x30410097984493bdb80c6cb0cbc48055c9f570d161bdb8e9c23b8da71aa4769c",
297
+ "v": 27n,
298
+ "yParity": 0,
247
299
  },
248
300
  "feeToken": null,
249
301
  "from": "0x740474977e01d056f04a314b5537e4dd88f35952",
250
- "gas": 21326n,
302
+ "gas": 53793n,
251
303
  "gasPrice": 44n,
252
- "hash": "0x63f48eadae4ab046e9ca41bcfa59a0c6046da2b04f210ba6e49182d8f73e8e63",
253
- "input": "0xdeadbeef",
304
+ "hash": "0xc54c8ffa49ca69692cadbba5ac6e0f888c7fad53b59f6258f3fde027775832c9",
254
305
  "maxFeePerBlobGas": undefined,
255
306
  "maxFeePerGas": 52n,
256
307
  "maxPriorityFeePerGas": 0n,
257
308
  "nonce": 0,
258
- "r": "0xbb738db362d493d3d2674a1542ffc188b7ccc3e0cd162d571f382f2baa130180",
259
- "s": "0x6fe0bbf76e60f89b4f9e3a94124c46d182e194a55caee95bef400ddb27974aea",
260
- "to": "0xcafebabecafebabecafebabecafebabecafebabe",
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": "feeToken",
263
- "typeHex": "0x77",
264
- "v": 28n,
320
+ "type": "aa",
321
+ "typeHex": "0x76",
322
+ "v": undefined,
323
+ "validAfter": null,
324
+ "validBefore": null,
265
325
  "value": 0n,
266
- "yParity": 1,
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 `0x77${string}`
305
- if (!serialized.startsWith('0x77'))
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 = parseTransaction(serialized)
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": "0xe789744400000000000000000000000020c0000000000000000000000000000000000001",
447
+ "data": undefined,
381
448
  "feePayer": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
382
449
  "feePayerSignature": {
383
- "r": "0xfe9df92927697e996652682213d142b2ffb6fdab9777979c78f62cb3e061674b",
384
- "s": "0x104fb902e6e4b704792e12ebc6236831a38492d439974a4ee215af191c83ab3a",
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": 22563n,
457
+ "gas": 53793n,
391
458
  "gasPrice": 44n,
392
- "hash": "0xdf9d902872fbe0a631a66f7a629da6746c0bcc1e11cd3374d4db899ae4af175f",
393
- "input": "0xe789744400000000000000000000000020c0000000000000000000000000000000000001",
459
+ "hash": "0xcb8f0e58ddb27f9fb3cbf200ec3023dffd43ced39c2e187c7907373082707420",
394
460
  "maxFeePerBlobGas": undefined,
395
461
  "maxFeePerGas": 52n,
396
462
  "maxPriorityFeePerGas": 0n,
397
463
  "nonce": 0,
398
- "r": "0x65b6e02e960b2e7dc5c04436d041a6f327180269303c5a897b669be783ddbc8c",
399
- "s": "0x497a98ff1ca644dd98a25181044112868b46fedbbbc55b278ba4d8139a6b4b54",
400
- "to": "0xfeec000000000000000000000000000000000000",
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": "feeToken",
403
- "typeHex": "0x77",
404
- "v": 28n,
475
+ "type": "aa",
476
+ "typeHex": "0x76",
477
+ "v": undefined,
478
+ "validAfter": null,
479
+ "validBefore": null,
405
480
  "value": 0n,
406
- "yParity": 1,
481
+ "yParity": undefined,
407
482
  }
408
483
  `)
409
484
  })
package/src/viem/index.ts CHANGED
@@ -1,9 +1,13 @@
1
- export * from './abis.js'
2
- export * as actions from './actions/index.js'
3
- export * from './addresses.js'
4
- export * from './chain.js'
5
- export * from './client.js'
6
- export { decorator as tempoActions } from './decorator.js'
7
- export * from './formatters.js'
8
- export * from './transaction.js'
9
- export * from './transport.js'
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 '../internal/types.js'
13
- import type { TransactionRequestFeeToken } from './transaction.js'
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<TransactionRequestFeeToken, 'feePayer' | 'feeToken'>
56
+ UnionPick<TransactionRequestAA, 'feePayer' | 'feeToken'>