ox 0.9.16 → 0.10.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.
Files changed (216) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +4 -4
  3. package/TxEnvelope/package.json +6 -0
  4. package/TxEnvelopeEip1559/package.json +6 -0
  5. package/TxEnvelopeEip2930/package.json +6 -0
  6. package/TxEnvelopeEip4844/package.json +6 -0
  7. package/TxEnvelopeEip7702/package.json +6 -0
  8. package/TxEnvelopeLegacy/package.json +6 -0
  9. package/_cjs/core/{TransactionEnvelope.js → TxEnvelope.js} +1 -1
  10. package/_cjs/core/TxEnvelope.js.map +1 -0
  11. package/_cjs/core/{TransactionEnvelopeEip1559.js → TxEnvelopeEip1559.js} +2 -2
  12. package/_cjs/core/TxEnvelopeEip1559.js.map +1 -0
  13. package/_cjs/core/{TransactionEnvelopeEip2930.js → TxEnvelopeEip2930.js} +2 -2
  14. package/_cjs/core/TxEnvelopeEip2930.js.map +1 -0
  15. package/_cjs/core/{TransactionEnvelopeEip4844.js → TxEnvelopeEip4844.js} +4 -4
  16. package/_cjs/core/TxEnvelopeEip4844.js.map +1 -0
  17. package/_cjs/core/{TransactionEnvelopeEip7702.js → TxEnvelopeEip7702.js} +4 -4
  18. package/_cjs/core/TxEnvelopeEip7702.js.map +1 -0
  19. package/_cjs/core/{TransactionEnvelopeLegacy.js → TxEnvelopeLegacy.js} +2 -2
  20. package/_cjs/core/TxEnvelopeLegacy.js.map +1 -0
  21. package/_cjs/core/WebAuthnP256.js +1 -1
  22. package/_cjs/core/WebAuthnP256.js.map +1 -1
  23. package/_cjs/erc8021/Attribution.js +36 -6
  24. package/_cjs/erc8021/Attribution.js.map +1 -1
  25. package/_cjs/index.docs.js +1 -0
  26. package/_cjs/index.docs.js.map +1 -1
  27. package/_cjs/index.js +7 -7
  28. package/_cjs/index.js.map +1 -1
  29. package/_cjs/tempo/AuthorizationTempo.js +101 -0
  30. package/_cjs/tempo/AuthorizationTempo.js.map +1 -0
  31. package/_cjs/tempo/KeyAuthorization.js +123 -0
  32. package/_cjs/tempo/KeyAuthorization.js.map +1 -0
  33. package/_cjs/tempo/PoolId.js +10 -0
  34. package/_cjs/tempo/PoolId.js.map +1 -0
  35. package/_cjs/tempo/SignatureEnvelope.js +394 -0
  36. package/_cjs/tempo/SignatureEnvelope.js.map +1 -0
  37. package/_cjs/tempo/Tick.js +77 -0
  38. package/_cjs/tempo/Tick.js.map +1 -0
  39. package/_cjs/tempo/TokenId.js +28 -0
  40. package/_cjs/tempo/TokenId.js.map +1 -0
  41. package/_cjs/tempo/TokenRole.js +26 -0
  42. package/_cjs/tempo/TokenRole.js.map +1 -0
  43. package/_cjs/tempo/Transaction.js +80 -0
  44. package/_cjs/tempo/Transaction.js.map +1 -0
  45. package/_cjs/tempo/TransactionReceipt.js +26 -0
  46. package/_cjs/tempo/TransactionReceipt.js.map +1 -0
  47. package/_cjs/tempo/TransactionRequest.js +53 -0
  48. package/_cjs/tempo/TransactionRequest.js.map +1 -0
  49. package/_cjs/tempo/TxEnvelopeTempo.js +267 -0
  50. package/_cjs/tempo/TxEnvelopeTempo.js.map +1 -0
  51. package/_cjs/tempo/index.js +15 -0
  52. package/_cjs/tempo/index.js.map +1 -0
  53. package/_cjs/version.js +1 -1
  54. package/_esm/core/Blobs.js +8 -8
  55. package/_esm/core/{TransactionEnvelope.js → TxEnvelope.js} +11 -11
  56. package/_esm/core/TxEnvelope.js.map +1 -0
  57. package/_esm/core/{TransactionEnvelopeEip1559.js → TxEnvelopeEip1559.js} +42 -42
  58. package/_esm/core/TxEnvelopeEip1559.js.map +1 -0
  59. package/_esm/core/{TransactionEnvelopeEip2930.js → TxEnvelopeEip2930.js} +43 -43
  60. package/_esm/core/TxEnvelopeEip2930.js.map +1 -0
  61. package/_esm/core/{TransactionEnvelopeEip4844.js → TxEnvelopeEip4844.js} +42 -42
  62. package/_esm/core/TxEnvelopeEip4844.js.map +1 -0
  63. package/_esm/core/{TransactionEnvelopeEip7702.js → TxEnvelopeEip7702.js} +40 -40
  64. package/_esm/core/TxEnvelopeEip7702.js.map +1 -0
  65. package/_esm/core/{TransactionEnvelopeLegacy.js → TxEnvelopeLegacy.js} +42 -42
  66. package/_esm/core/TxEnvelopeLegacy.js.map +1 -0
  67. package/_esm/core/WebAuthnP256.js +1 -1
  68. package/_esm/core/WebAuthnP256.js.map +1 -1
  69. package/_esm/erc8021/Attribution.js +58 -13
  70. package/_esm/erc8021/Attribution.js.map +1 -1
  71. package/_esm/index.docs.js +1 -0
  72. package/_esm/index.docs.js.map +1 -1
  73. package/_esm/index.js +192 -192
  74. package/_esm/index.js.map +1 -1
  75. package/_esm/tempo/AuthorizationTempo.js +664 -0
  76. package/_esm/tempo/AuthorizationTempo.js.map +1 -0
  77. package/_esm/tempo/KeyAuthorization.js +426 -0
  78. package/_esm/tempo/KeyAuthorization.js.map +1 -0
  79. package/_esm/tempo/PoolId.js +28 -0
  80. package/_esm/tempo/PoolId.js.map +1 -0
  81. package/_esm/tempo/SignatureEnvelope.js +660 -0
  82. package/_esm/tempo/SignatureEnvelope.js.map +1 -0
  83. package/_esm/tempo/Tick.js +147 -0
  84. package/_esm/tempo/Tick.js.map +1 -0
  85. package/_esm/tempo/TokenId.js +71 -0
  86. package/_esm/tempo/TokenId.js.map +1 -0
  87. package/_esm/tempo/TokenRole.js +40 -0
  88. package/_esm/tempo/TokenRole.js.map +1 -0
  89. package/_esm/tempo/Transaction.js +167 -0
  90. package/_esm/tempo/Transaction.js.map +1 -0
  91. package/_esm/tempo/TransactionReceipt.js +138 -0
  92. package/_esm/tempo/TransactionReceipt.js.map +1 -0
  93. package/_esm/tempo/TransactionRequest.js +99 -0
  94. package/_esm/tempo/TransactionRequest.js.map +1 -0
  95. package/_esm/tempo/TxEnvelopeTempo.js +607 -0
  96. package/_esm/tempo/TxEnvelopeTempo.js.map +1 -0
  97. package/_esm/tempo/index.js +298 -0
  98. package/_esm/tempo/index.js.map +1 -0
  99. package/_esm/version.js +1 -1
  100. package/_types/core/Blobs.d.ts +8 -8
  101. package/_types/core/{TransactionEnvelope.d.ts → TxEnvelope.d.ts} +11 -11
  102. package/_types/core/TxEnvelope.d.ts.map +1 -0
  103. package/_types/core/{TransactionEnvelopeEip1559.d.ts → TxEnvelopeEip1559.d.ts} +54 -54
  104. package/_types/core/TxEnvelopeEip1559.d.ts.map +1 -0
  105. package/_types/core/{TransactionEnvelopeEip2930.d.ts → TxEnvelopeEip2930.d.ts} +55 -55
  106. package/_types/core/TxEnvelopeEip2930.d.ts.map +1 -0
  107. package/_types/core/{TransactionEnvelopeEip4844.d.ts → TxEnvelopeEip4844.d.ts} +54 -54
  108. package/_types/core/TxEnvelopeEip4844.d.ts.map +1 -0
  109. package/_types/core/{TransactionEnvelopeEip7702.d.ts → TxEnvelopeEip7702.d.ts} +49 -49
  110. package/_types/core/TxEnvelopeEip7702.d.ts.map +1 -0
  111. package/_types/core/{TransactionEnvelopeLegacy.d.ts → TxEnvelopeLegacy.d.ts} +54 -54
  112. package/_types/core/TxEnvelopeLegacy.d.ts.map +1 -0
  113. package/_types/core/WebAuthnP256.d.ts +1 -1
  114. package/_types/core/WebAuthnP256.d.ts.map +1 -1
  115. package/_types/erc8021/Attribution.d.ts +20 -6
  116. package/_types/erc8021/Attribution.d.ts.map +1 -1
  117. package/_types/index.d.ts +192 -192
  118. package/_types/index.d.ts.map +1 -1
  119. package/_types/index.docs.d.ts +1 -0
  120. package/_types/index.docs.d.ts.map +1 -1
  121. package/_types/tempo/AuthorizationTempo.d.ts +688 -0
  122. package/_types/tempo/AuthorizationTempo.d.ts.map +1 -0
  123. package/_types/tempo/KeyAuthorization.d.ts +437 -0
  124. package/_types/tempo/KeyAuthorization.d.ts.map +1 -0
  125. package/_types/tempo/PoolId.d.ts +33 -0
  126. package/_types/tempo/PoolId.d.ts.map +1 -0
  127. package/_types/tempo/SignatureEnvelope.d.ts +438 -0
  128. package/_types/tempo/SignatureEnvelope.d.ts.map +1 -0
  129. package/_types/tempo/Tick.d.ts +120 -0
  130. package/_types/tempo/Tick.d.ts.map +1 -0
  131. package/_types/tempo/TokenId.d.ts +55 -0
  132. package/_types/tempo/TokenId.d.ts.map +1 -0
  133. package/_types/tempo/TokenRole.d.ts +29 -0
  134. package/_types/tempo/TokenRole.d.ts.map +1 -0
  135. package/_types/tempo/Transaction.d.ts +208 -0
  136. package/_types/tempo/Transaction.d.ts.map +1 -0
  137. package/_types/tempo/TransactionReceipt.d.ts +165 -0
  138. package/_types/tempo/TransactionReceipt.d.ts.map +1 -0
  139. package/_types/tempo/TransactionRequest.d.ts +89 -0
  140. package/_types/tempo/TransactionRequest.d.ts.map +1 -0
  141. package/_types/tempo/TxEnvelopeTempo.d.ts +551 -0
  142. package/_types/tempo/TxEnvelopeTempo.d.ts.map +1 -0
  143. package/_types/tempo/index.d.ts +300 -0
  144. package/_types/tempo/index.d.ts.map +1 -0
  145. package/_types/version.d.ts +1 -1
  146. package/core/Blobs.ts +8 -8
  147. package/core/{TransactionEnvelope.ts → TxEnvelope.ts} +10 -10
  148. package/core/{TransactionEnvelopeEip1559.ts → TxEnvelopeEip1559.ts} +60 -69
  149. package/core/{TransactionEnvelopeEip2930.ts → TxEnvelopeEip2930.ts} +61 -72
  150. package/core/{TransactionEnvelopeEip4844.ts → TxEnvelopeEip4844.ts} +62 -71
  151. package/core/{TransactionEnvelopeEip7702.ts → TxEnvelopeEip7702.ts} +58 -67
  152. package/core/{TransactionEnvelopeLegacy.ts → TxEnvelopeLegacy.ts} +59 -68
  153. package/core/WebAuthnP256.ts +3 -1
  154. package/erc8021/Attribution.ts +77 -15
  155. package/index.docs.ts +1 -0
  156. package/index.ts +192 -195
  157. package/package.json +91 -31
  158. package/tempo/AuthorizationTempo/package.json +6 -0
  159. package/tempo/AuthorizationTempo.test.ts +1293 -0
  160. package/tempo/AuthorizationTempo.ts +884 -0
  161. package/tempo/KeyAuthorization/package.json +6 -0
  162. package/tempo/KeyAuthorization.test.ts +1373 -0
  163. package/tempo/KeyAuthorization.ts +622 -0
  164. package/tempo/PoolId/package.json +6 -0
  165. package/tempo/PoolId.test.ts +33 -0
  166. package/tempo/PoolId.ts +42 -0
  167. package/tempo/SignatureEnvelope/package.json +6 -0
  168. package/tempo/SignatureEnvelope.test.ts +1877 -0
  169. package/tempo/SignatureEnvelope.ts +973 -0
  170. package/tempo/Tick/package.json +6 -0
  171. package/tempo/Tick.test.ts +281 -0
  172. package/tempo/Tick.ts +186 -0
  173. package/tempo/TokenId/package.json +6 -0
  174. package/tempo/TokenId.test.ts +40 -0
  175. package/tempo/TokenId.ts +80 -0
  176. package/tempo/TokenRole/package.json +6 -0
  177. package/tempo/TokenRole.test.ts +16 -0
  178. package/tempo/TokenRole.ts +45 -0
  179. package/tempo/Transaction/package.json +6 -0
  180. package/tempo/Transaction.test.ts +523 -0
  181. package/tempo/Transaction.ts +339 -0
  182. package/tempo/TransactionReceipt/package.json +6 -0
  183. package/tempo/TransactionReceipt.ts +200 -0
  184. package/tempo/TransactionRequest/package.json +6 -0
  185. package/tempo/TransactionRequest.ts +160 -0
  186. package/tempo/TxEnvelopeTempo/package.json +6 -0
  187. package/tempo/TxEnvelopeTempo.test.ts +1371 -0
  188. package/tempo/TxEnvelopeTempo.ts +972 -0
  189. package/tempo/e2e.test.ts +1387 -0
  190. package/tempo/index.ts +308 -0
  191. package/tempo/package.json +6 -0
  192. package/version.ts +1 -1
  193. package/TransactionEnvelope/package.json +0 -6
  194. package/TransactionEnvelopeEip1559/package.json +0 -6
  195. package/TransactionEnvelopeEip2930/package.json +0 -6
  196. package/TransactionEnvelopeEip4844/package.json +0 -6
  197. package/TransactionEnvelopeEip7702/package.json +0 -6
  198. package/TransactionEnvelopeLegacy/package.json +0 -6
  199. package/_cjs/core/TransactionEnvelope.js.map +0 -1
  200. package/_cjs/core/TransactionEnvelopeEip1559.js.map +0 -1
  201. package/_cjs/core/TransactionEnvelopeEip2930.js.map +0 -1
  202. package/_cjs/core/TransactionEnvelopeEip4844.js.map +0 -1
  203. package/_cjs/core/TransactionEnvelopeEip7702.js.map +0 -1
  204. package/_cjs/core/TransactionEnvelopeLegacy.js.map +0 -1
  205. package/_esm/core/TransactionEnvelope.js.map +0 -1
  206. package/_esm/core/TransactionEnvelopeEip1559.js.map +0 -1
  207. package/_esm/core/TransactionEnvelopeEip2930.js.map +0 -1
  208. package/_esm/core/TransactionEnvelopeEip4844.js.map +0 -1
  209. package/_esm/core/TransactionEnvelopeEip7702.js.map +0 -1
  210. package/_esm/core/TransactionEnvelopeLegacy.js.map +0 -1
  211. package/_types/core/TransactionEnvelope.d.ts.map +0 -1
  212. package/_types/core/TransactionEnvelopeEip1559.d.ts.map +0 -1
  213. package/_types/core/TransactionEnvelopeEip2930.d.ts.map +0 -1
  214. package/_types/core/TransactionEnvelopeEip4844.d.ts.map +0 -1
  215. package/_types/core/TransactionEnvelopeEip7702.d.ts.map +0 -1
  216. package/_types/core/TransactionEnvelopeLegacy.d.ts.map +0 -1
@@ -0,0 +1,298 @@
1
+ /**
2
+ * Utilities for Tempo-flavoured EIP-7702 authorizations.
3
+ *
4
+ * Tempo extends EIP-7702 to support more signature types (secp256k1, P256, and WebAuthn),
5
+ * enabling passkey-based account delegation. Authorizations delegate an account to a specified
6
+ * implementation contract.
7
+ *
8
+ * [Tempo Authorization Specification](https://docs.tempo.xyz/protocol/transactions/spec-tempo-transaction#tempo-authorization-list)
9
+ *
10
+ * @example
11
+ * ```ts twoslash
12
+ * import { Secp256k1 } from 'ox'
13
+ * import { AuthorizationTempo } from 'ox/tempo'
14
+ *
15
+ * const authorization = AuthorizationTempo.from({
16
+ * address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
17
+ * chainId: 1,
18
+ * nonce: 40n,
19
+ * })
20
+ *
21
+ * const payload = AuthorizationTempo.getSignPayload(authorization)
22
+ *
23
+ * const signature = Secp256k1.sign({ payload, privateKey: '0x...' })
24
+ *
25
+ * const authorization_signed = AuthorizationTempo.from(
26
+ * authorization,
27
+ * { signature }
28
+ * )
29
+ * ```
30
+ *
31
+ * @category Reference
32
+ */
33
+ export * as AuthorizationTempo from './AuthorizationTempo.js';
34
+ /**
35
+ * Tempo key authorization utilities for provisioning and signing access keys.
36
+ *
37
+ * Access keys allow a root key (e.g., a passkey) to delegate transaction signing to secondary
38
+ * keys with customizable permissions including expiry timestamps and per-TIP-20 token spending
39
+ * limits. This enables a user to sign transactions without repeated passkey prompts.
40
+ *
41
+ * [Access Keys Specification](https://docs.tempo.xyz/protocol/transactions/spec-tempo-transaction#access-keys)
42
+ *
43
+ * @example
44
+ * ```ts twoslash
45
+ * import { KeyAuthorization, SignatureEnvelope } from 'ox/tempo'
46
+ * import { Address, Secp256k1, WebCryptoP256, Value } from 'ox'
47
+ *
48
+ * const keyPair = await WebCryptoP256.createKeyPair()
49
+ * const address = Address.fromPublicKey(keyPair.publicKey)
50
+ *
51
+ * const authorization = KeyAuthorization.from({
52
+ * address,
53
+ * expiry: 1234567890,
54
+ * type: 'p256',
55
+ * limits: [{
56
+ * token: '0x20c0000000000000000000000000000000000001',
57
+ * limit: Value.from('10', 6),
58
+ * }],
59
+ * })
60
+ *
61
+ * const privateKey = '0x...'
62
+ * const payload = KeyAuthorization.getSignPayload(authorization)
63
+ * const signature = SignatureEnvelope.from(
64
+ * Secp256k1.sign({ payload, privateKey }),
65
+ * )
66
+ *
67
+ * KeyAuthorization.from(authorization, { signature })
68
+ * ```
69
+ *
70
+ * @category Reference
71
+ */
72
+ export * as KeyAuthorization from './KeyAuthorization.js';
73
+ /**
74
+ * Pool ID utilities for computing pool identifiers from token pairs.
75
+ *
76
+ * Pool IDs are deterministic keys derived from two token addresses (order-independent)
77
+ * used to identify trading pairs on Tempo's enshrined stablecoin DEX.
78
+ *
79
+ * [Stablecoin DEX Specification](https://docs.tempo.xyz/protocol/exchange/spec)
80
+ *
81
+ * @example
82
+ * ```ts twoslash
83
+ * import { PoolId } from 'ox/tempo'
84
+ *
85
+ * const poolId = PoolId.from({
86
+ * userToken: 1n,
87
+ * validatorToken: 2n,
88
+ * })
89
+ * ```
90
+ *
91
+ * @category Reference
92
+ */
93
+ export * as PoolId from './PoolId.js';
94
+ /**
95
+ * Signature envelope utilities for secp256k1, P256, WebAuthn, and keychain signatures.
96
+ *
97
+ * Tempo transactions support multiple signature types: secp256k1 (65 bytes), P256 for passkeys
98
+ * (type `0x01`), WebAuthn (type `0x02`), and Keychain for access keys (type `0x03`).
99
+ *
100
+ * [Signature Types Specification](https://docs.tempo.xyz/protocol/transactions/spec-tempo-transaction#signature-types)
101
+ *
102
+ * @example
103
+ * ```ts twoslash
104
+ * import { Secp256k1 } from 'ox'
105
+ * import { SignatureEnvelope } from 'ox/tempo'
106
+ *
107
+ * const privateKey = Secp256k1.randomPrivateKey()
108
+ * const signature = Secp256k1.sign({ payload: '0xdeadbeef', privateKey })
109
+ *
110
+ * const envelope = SignatureEnvelope.from(signature)
111
+ * ```
112
+ *
113
+ * @category Reference
114
+ */
115
+ export * as SignatureEnvelope from './SignatureEnvelope.js';
116
+ /**
117
+ * Tick-based pricing utilities for DEX price conversions.
118
+ *
119
+ * Prices on Tempo's stablecoin DEX are discretized into integer ticks with a tick size of 0.1 bps
120
+ * (where `price = PRICE_SCALE + tick` and `PRICE_SCALE = 100_000`). Orders must be placed at ticks
121
+ * divisible by `TICK_SPACING = 10` (1 bp grid), within bounds of ±2000 ticks (±2%).
122
+ *
123
+ * [Stablecoin DEX Pricing](https://docs.tempo.xyz/protocol/exchange/spec#key-concepts)
124
+ *
125
+ * @example
126
+ * ```ts twoslash
127
+ * import { Tick } from 'ox/tempo'
128
+ *
129
+ * const price = Tick.toPrice(100) // "1.001" (0.1% above 1.0)
130
+ * const tick = Tick.fromPrice('0.999') // -100
131
+ * ```
132
+ *
133
+ * @category Reference
134
+ */
135
+ export * as Tick from './Tick.js';
136
+ /**
137
+ * TIP-20 token ID utilities for converting between token IDs and addresses.
138
+ *
139
+ * TIP-20 is Tempo's native token standard for stablecoins with deterministic addresses
140
+ * derived from sequential token IDs. TIP-20 extends ERC-20 with payment features like
141
+ * configurable fee tokens, transfer memos, and built-in role-based access control.
142
+ *
143
+ * [TIP-20 Token Standard](https://docs.tempo.xyz/protocol/tip20/overview)
144
+ *
145
+ * @example
146
+ * ```ts twoslash
147
+ * import { TokenId } from 'ox/tempo'
148
+ *
149
+ * const tokenId = TokenId.from(1n)
150
+ * const address = TokenId.toAddress(1n)
151
+ * // '0x20c0000000000000000000000000000000000001'
152
+ * ```
153
+ *
154
+ * @category Reference
155
+ */
156
+ export * as TokenId from './TokenId.js';
157
+ /**
158
+ * Token role utilities for serializing role identifiers to keccak256 hashes.
159
+ *
160
+ * TIP-20 includes a built-in RBAC system with roles like `ISSUER_ROLE` (mint/burn),
161
+ * `PAUSE_ROLE`/`UNPAUSE_ROLE` (emergency controls), and `BURN_BLOCKED_ROLE` (compliance).
162
+ *
163
+ * [TIP-20 RBAC](https://docs.tempo.xyz/protocol/tip20/overview#role-based-access-control-rbac)
164
+ *
165
+ * @example
166
+ * ```ts twoslash
167
+ * import { TokenRole } from 'ox/tempo'
168
+ *
169
+ * const hash = TokenRole.serialize('issuer')
170
+ * ```
171
+ *
172
+ * @category Reference
173
+ */
174
+ export * as TokenRole from './TokenRole.js';
175
+ /**
176
+ * Utilities for converting between RPC and structured transaction formats.
177
+ *
178
+ * Tempo Transactions (type `0x76`) are a new EIP-2718 transaction type with native support
179
+ * for passkeys, call batching, fee sponsorship, parallelizable nonces, and scheduled execution.
180
+ *
181
+ * [Tempo Transactions](https://docs.tempo.xyz/protocol/transactions)
182
+ *
183
+ * @example
184
+ * ```ts twoslash
185
+ * // @noErrors
186
+ * import { Transaction } from 'ox/tempo'
187
+ *
188
+ * const transaction = Transaction.fromRpc({
189
+ * hash: '0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',
190
+ * nonce: '0x357',
191
+ * blockHash:
192
+ * '0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',
193
+ * blockNumber: '0x12f296f',
194
+ * calls: [
195
+ * {
196
+ * input: '0xdeadbeef',
197
+ * to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
198
+ * value: '0x9b6e64a8ec60000',
199
+ * },
200
+ * ],
201
+ * feeToken: '0x20c0000000000000000000000000000000000000',
202
+ * transactionIndex: '0x2',
203
+ * from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',
204
+ * value: '0x9b6e64a8ec60000',
205
+ * gas: '0x43f5d',
206
+ * maxFeePerGas: '0x2ca6ae494',
207
+ * maxPriorityFeePerGas: '0x41cc3c0',
208
+ * input:
209
+ * '0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006643504700000000000000000000000000000000000000000000000000000000000000040b080604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec600000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000009b6e64a8ec60000000000000000000000000000000000000000000000000000019124bb5ae978c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b80000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b8000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c00000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c56c7a0eaa804f854b536a5f3d5f49d2ec4b12b800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000190240001b9872b',
210
+ * signature: {
211
+ * r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',
212
+ * s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',
213
+ * type: 'secp256k1',
214
+ * yParity: '0x0',
215
+ * },
216
+ * chainId: '0x1',
217
+ * accessList: [],
218
+ * type: '0x76',
219
+ * })
220
+ * ```
221
+ *
222
+ * @category Reference
223
+ */
224
+ export * as Transaction from './Transaction.js';
225
+ /**
226
+ * Utilities for working with Tempo transaction receipts.
227
+ *
228
+ * Tempo receipts include additional fields like `feePayer` (the address that paid fees)
229
+ * and `feeToken` (the TIP-20 token used for fee payment).
230
+ *
231
+ * [Tempo Transactions](https://docs.tempo.xyz/protocol/transactions)
232
+ *
233
+ * @example
234
+ * ```ts twoslash
235
+ * import { TransactionReceipt } from 'ox/tempo'
236
+ *
237
+ * const receipt = TransactionReceipt.fromRpc({
238
+ * status: '0x1',
239
+ * feePayer: '0x...',
240
+ * feeToken: '0x20c0000000000000000000000000000000000001',
241
+ * // ... other fields
242
+ * } as any)
243
+ * ```
244
+ *
245
+ * @category Reference
246
+ */
247
+ export * as TransactionReceipt from './TransactionReceipt.js';
248
+ /**
249
+ * Utilities for preparing RPC-formatted transaction requests.
250
+ *
251
+ * Convert structured transaction requests to RPC format for submission to Tempo nodes,
252
+ * including support for batched calls and fee token specification.
253
+ *
254
+ * [Tempo Transactions](https://docs.tempo.xyz/protocol/transactions)
255
+ *
256
+ * @example
257
+ * ```ts twoslash
258
+ * import { TransactionRequest } from 'ox/tempo'
259
+ *
260
+ * const request = TransactionRequest.toRpc({
261
+ * calls: [{ to: '0xcafebabecafebabecafebabecafebabecafebabe', data: '0xdeadbeef' }],
262
+ * feeToken: '0x20c0000000000000000000000000000000000000',
263
+ * })
264
+ * ```
265
+ *
266
+ * @category Reference
267
+ */
268
+ export * as TransactionRequest from './TransactionRequest.js';
269
+ /**
270
+ * Utilities for instantiating, serializing, and hashing Tempo transaction envelopes.
271
+ *
272
+ * Create, sign, and serialize Tempo transactions with support for configurable fee tokens,
273
+ * call batching, fee sponsorship, access keys, and scheduled execution via `validAfter`/`validBefore`.
274
+ *
275
+ * [Tempo Transaction Specification](https://docs.tempo.xyz/protocol/transactions/spec-tempo-transaction)
276
+ *
277
+ * @example
278
+ * ```ts twoslash
279
+ * import { Secp256k1, Value } from 'ox'
280
+ * import { TxEnvelopeTempo } from 'ox/tempo'
281
+ *
282
+ * const envelope = TxEnvelopeTempo.from({
283
+ * chainId: 1,
284
+ * calls: [{ to: '0x0000000000000000000000000000000000000000', data: '0xdeadbeef' }],
285
+ * maxFeePerGas: Value.fromGwei('10'),
286
+ * })
287
+ *
288
+ * const payload = TxEnvelopeTempo.getSignPayload(envelope)
289
+ * const signature = Secp256k1.sign({ payload, privateKey: '0x...' })
290
+ *
291
+ * const envelope_signed = TxEnvelopeTempo.from(envelope, { signature })
292
+ * const envelope_serialized = TxEnvelopeTempo.serialize(envelope_signed)
293
+ * ```
294
+ *
295
+ * @category Reference
296
+ */
297
+ export * as TxEnvelopeTempo from './TxEnvelopeTempo.js';
298
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../tempo/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAE3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA"}
package/_esm/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /** @internal */
2
- export const version = '0.9.16';
2
+ export const version = '0.10.0';
3
3
  //# sourceMappingURL=version.js.map
@@ -31,7 +31,7 @@ export type BlobSidecar<type extends Hex.Hex | Bytes.Bytes = Hex.Hex | Bytes.Byt
31
31
  * @example
32
32
  * ```ts twoslash
33
33
  * // @noErrors
34
- * import { Blobs } from 'viem'
34
+ * import { Blobs } from 'ox'
35
35
  * import { kzg } from './kzg'
36
36
  *
37
37
  * const blobs = Blobs.from('0xdeadbeef')
@@ -47,7 +47,7 @@ export type BlobSidecar<type extends Hex.Hex | Bytes.Bytes = Hex.Hex | Bytes.Byt
47
47
  *
48
48
  * ```ts twoslash
49
49
  * // @noErrors
50
- * import { Blobs } from 'viem'
50
+ * import { Blobs } from 'ox'
51
51
  * import { kzg } from './kzg'
52
52
  *
53
53
  * const blobs = Blobs.from('0xdeadbeef')
@@ -65,7 +65,7 @@ export type BlobSidecar<type extends Hex.Hex | Bytes.Bytes = Hex.Hex | Bytes.Byt
65
65
  *
66
66
  * ```ts twoslash
67
67
  * // @noErrors
68
- * import { Blobs } from 'viem'
68
+ * import { Blobs } from 'ox'
69
69
  * import { kzg } from './kzg'
70
70
  *
71
71
  * const blobs = Blobs.from('0xdeadbeef')
@@ -111,7 +111,7 @@ export declare namespace commitmentsToVersionedHashes {
111
111
  *
112
112
  * ```ts twoslash
113
113
  * // @noErrors
114
- * import { Blobs } from 'viem'
114
+ * import { Blobs } from 'ox'
115
115
  * import { kzg } from './kzg'
116
116
  *
117
117
  * const blobs = Blobs.from('0xdeadbeef')
@@ -129,7 +129,7 @@ export declare namespace commitmentsToVersionedHashes {
129
129
  *
130
130
  * ```ts twoslash
131
131
  * // @noErrors
132
- * import { Blobs } from 'viem'
132
+ * import { Blobs } from 'ox'
133
133
  * import { kzg } from './kzg'
134
134
  *
135
135
  * const blobs = Blobs.from('0xdeadbeef')
@@ -222,7 +222,7 @@ export declare namespace from {
222
222
  *
223
223
  * ```ts twoslash
224
224
  * // @noErrors
225
- * import { Blobs } from 'viem'
225
+ * import { Blobs } from 'ox'
226
226
  * import { kzg } from './kzg'
227
227
  *
228
228
  * const blobs = Blobs.from('0xdeadbeef')
@@ -240,7 +240,7 @@ export declare namespace from {
240
240
  *
241
241
  * ```ts twoslash
242
242
  * // @noErrors
243
- * import { Blobs } from 'viem'
243
+ * import { Blobs } from 'ox'
244
244
  * import { kzg } from './kzg'
245
245
  *
246
246
  * const blobs = Blobs.from('0xdeadbeef')
@@ -385,7 +385,7 @@ export declare namespace toBytes {
385
385
  * @example
386
386
  * ```ts twoslash
387
387
  * // @noErrors
388
- * import { Blobs } from 'viem'
388
+ * import { Blobs } from 'ox'
389
389
  * import { kzg } from './kzg'
390
390
  *
391
391
  * const blobs = Blobs.from('0xdeadbeef')
@@ -43,9 +43,9 @@ export type BaseSigned<type extends string = string> = Base<type, true>;
43
43
  *
44
44
  * @example
45
45
  * ```ts twoslash
46
- * import { TransactionEnvelopeEip1559 } from 'ox'
46
+ * import { TxEnvelopeEip1559 } from 'ox'
47
47
  *
48
- * TransactionEnvelopeEip1559.assert({
48
+ * TxEnvelopeEip1559.assert({
49
49
  * maxFeePerGas: 2n ** 256n - 1n + 1n,
50
50
  * chainId: 1,
51
51
  * })
@@ -63,9 +63,9 @@ export declare class FeeCapTooHighError extends Errors.BaseError {
63
63
  *
64
64
  * @example
65
65
  * ```ts twoslash
66
- * import { TransactionEnvelopeLegacy } from 'ox'
66
+ * import { TxEnvelopeLegacy } from 'ox'
67
67
  *
68
- * TransactionEnvelopeLegacy.assert({
68
+ * TxEnvelopeLegacy.assert({
69
69
  * gasPrice: 2n ** 256n - 1n + 1n,
70
70
  * chainId: 1,
71
71
  * })
@@ -83,9 +83,9 @@ export declare class GasPriceTooHighError extends Errors.BaseError {
83
83
  *
84
84
  * @example
85
85
  * ```ts twoslash
86
- * import { TransactionEnvelopeEip1559 } from 'ox'
86
+ * import { TxEnvelopeEip1559 } from 'ox'
87
87
  *
88
- * TransactionEnvelopeEip1559.assert({ chainId: 0 })
88
+ * TxEnvelopeEip1559.assert({ chainId: 0 })
89
89
  * // @error: TransactionEnvelope.InvalidChainIdError: Chain ID "0" is invalid.
90
90
  * ```
91
91
  */
@@ -100,9 +100,9 @@ export declare class InvalidChainIdError extends Errors.BaseError {
100
100
  *
101
101
  * @example
102
102
  * ```ts twoslash
103
- * import { TransactionEnvelopeEip1559 } from 'ox'
103
+ * import { TxEnvelopeEip1559 } from 'ox'
104
104
  *
105
- * TransactionEnvelopeEip1559.deserialize('0x02c0')
105
+ * TxEnvelopeEip1559.deserialize('0x02c0')
106
106
  * // @error: TransactionEnvelope.InvalidSerializedError: Invalid serialized transaction of type "eip1559" was provided.
107
107
  * // @error: Serialized Transaction: "0x02c0"
108
108
  * // @error: Missing Attributes: chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gas, to, value, data, accessList
@@ -121,9 +121,9 @@ export declare class InvalidSerializedError extends Errors.BaseError {
121
121
  *
122
122
  * @example
123
123
  * ```ts twoslash
124
- * import { TransactionEnvelopeEip1559 } from 'ox'
124
+ * import { TxEnvelopeEip1559 } from 'ox'
125
125
  *
126
- * TransactionEnvelopeEip1559.assert({
126
+ * TxEnvelopeEip1559.assert({
127
127
  * chainId: 1,
128
128
  * maxFeePerGas: 10n,
129
129
  * maxPriorityFeePerGas: 11n,
@@ -138,4 +138,4 @@ export declare class TipAboveFeeCapError extends Errors.BaseError {
138
138
  maxFeePerGas?: bigint | undefined;
139
139
  });
140
140
  }
141
- //# sourceMappingURL=TransactionEnvelope.d.ts.map
141
+ //# sourceMappingURL=TxEnvelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TxEnvelope.d.ts","sourceRoot":"","sources":["../../core/TxEnvelope.ts"],"names":[],"mappings":"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"}