ox 0.8.9 → 0.9.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 (247) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/_cjs/core/AbiEvent.js +1 -1
  3. package/_cjs/core/AbiEvent.js.map +1 -1
  4. package/_cjs/core/AbiItem.js +1 -1
  5. package/_cjs/core/AbiItem.js.map +1 -1
  6. package/_cjs/core/AbiParameters.js +4 -4
  7. package/_cjs/core/AbiParameters.js.map +1 -1
  8. package/_cjs/core/Authorization.js.map +1 -1
  9. package/_cjs/core/Blobs.js +1 -1
  10. package/_cjs/core/Blobs.js.map +1 -1
  11. package/_cjs/core/Block.js.map +1 -1
  12. package/_cjs/core/Bytes.js +1 -1
  13. package/_cjs/core/Bytes.js.map +1 -1
  14. package/_cjs/core/ContractAddress.js.map +1 -1
  15. package/_cjs/core/HdKey.js.map +1 -1
  16. package/_cjs/core/Hex.js +1 -1
  17. package/_cjs/core/Hex.js.map +1 -1
  18. package/_cjs/core/Keystore.js.map +1 -1
  19. package/_cjs/core/Mnemonic.js +2 -2
  20. package/_cjs/core/Mnemonic.js.map +1 -1
  21. package/_cjs/core/P256.js +1 -1
  22. package/_cjs/core/P256.js.map +1 -1
  23. package/_cjs/core/Provider.js.map +1 -1
  24. package/_cjs/core/PublicKey.js +1 -1
  25. package/_cjs/core/PublicKey.js.map +1 -1
  26. package/_cjs/core/RpcTransport.js +1 -1
  27. package/_cjs/core/RpcTransport.js.map +1 -1
  28. package/_cjs/core/Secp256k1.js +1 -1
  29. package/_cjs/core/Secp256k1.js.map +1 -1
  30. package/_cjs/core/Signature.js.map +1 -1
  31. package/_cjs/core/Siwe.js +4 -4
  32. package/_cjs/core/Siwe.js.map +1 -1
  33. package/_cjs/core/Transaction.js.map +1 -1
  34. package/_cjs/core/TransactionEnvelope.js.map +1 -1
  35. package/_cjs/core/TransactionEnvelopeEip1559.js.map +1 -1
  36. package/_cjs/core/TransactionEnvelopeEip2930.js.map +1 -1
  37. package/_cjs/core/TransactionEnvelopeEip4844.js.map +1 -1
  38. package/_cjs/core/TransactionEnvelopeEip7702.js.map +1 -1
  39. package/_cjs/core/TransactionEnvelopeLegacy.js.map +1 -1
  40. package/_cjs/core/TransactionReceipt.js.map +1 -1
  41. package/_cjs/core/TypedData.js +3 -3
  42. package/_cjs/core/TypedData.js.map +1 -1
  43. package/_cjs/core/WebAuthnP256.js +1 -1
  44. package/_cjs/core/WebAuthnP256.js.map +1 -1
  45. package/_cjs/core/WebCryptoP256.js.map +1 -1
  46. package/_cjs/core/internal/abiParameters.js +4 -4
  47. package/_cjs/core/internal/abiParameters.js.map +1 -1
  48. package/_cjs/core/internal/promise.js.map +1 -1
  49. package/_cjs/erc4337/UserOperation.js.map +1 -1
  50. package/_cjs/erc6492/{WrappedSignature.js → SignatureErc6492.js} +9 -11
  51. package/_cjs/erc6492/SignatureErc6492.js.map +1 -0
  52. package/_cjs/erc6492/index.js +2 -2
  53. package/_cjs/erc8010/SignatureErc8010.js +93 -0
  54. package/_cjs/erc8010/SignatureErc8010.js.map +1 -0
  55. package/_cjs/erc8010/index.js +5 -0
  56. package/_cjs/erc8010/index.js.map +1 -0
  57. package/_cjs/index.docs.js +1 -0
  58. package/_cjs/index.docs.js.map +1 -1
  59. package/_cjs/index.js +6 -6
  60. package/_cjs/index.js.map +1 -1
  61. package/_cjs/trusted-setups/internal/paths.js.map +1 -1
  62. package/_cjs/version.js +1 -1
  63. package/_esm/core/AbiEvent.js +1 -1
  64. package/_esm/core/AbiEvent.js.map +1 -1
  65. package/_esm/core/AbiItem.js +1 -1
  66. package/_esm/core/AbiItem.js.map +1 -1
  67. package/_esm/core/AbiParameters.js +4 -4
  68. package/_esm/core/AbiParameters.js.map +1 -1
  69. package/_esm/core/Authorization.js.map +1 -1
  70. package/_esm/core/Blobs.js +1 -1
  71. package/_esm/core/Blobs.js.map +1 -1
  72. package/_esm/core/Block.js.map +1 -1
  73. package/_esm/core/Bytes.js +1 -1
  74. package/_esm/core/Bytes.js.map +1 -1
  75. package/_esm/core/ContractAddress.js.map +1 -1
  76. package/_esm/core/HdKey.js.map +1 -1
  77. package/_esm/core/Hex.js +1 -1
  78. package/_esm/core/Hex.js.map +1 -1
  79. package/_esm/core/Keystore.js +3 -2
  80. package/_esm/core/Keystore.js.map +1 -1
  81. package/_esm/core/Mnemonic.js +1 -1
  82. package/_esm/core/Mnemonic.js.map +1 -1
  83. package/_esm/core/P256.js +1 -1
  84. package/_esm/core/P256.js.map +1 -1
  85. package/_esm/core/Provider.js.map +1 -1
  86. package/_esm/core/PublicKey.js +1 -1
  87. package/_esm/core/PublicKey.js.map +1 -1
  88. package/_esm/core/RpcTransport.js +1 -1
  89. package/_esm/core/RpcTransport.js.map +1 -1
  90. package/_esm/core/Secp256k1.js +1 -1
  91. package/_esm/core/Secp256k1.js.map +1 -1
  92. package/_esm/core/Signature.js.map +1 -1
  93. package/_esm/core/Siwe.js +4 -4
  94. package/_esm/core/Siwe.js.map +1 -1
  95. package/_esm/core/Transaction.js.map +1 -1
  96. package/_esm/core/TransactionEnvelope.js.map +1 -1
  97. package/_esm/core/TransactionEnvelopeEip1559.js.map +1 -1
  98. package/_esm/core/TransactionEnvelopeEip2930.js.map +1 -1
  99. package/_esm/core/TransactionEnvelopeEip4844.js.map +1 -1
  100. package/_esm/core/TransactionEnvelopeEip7702.js.map +1 -1
  101. package/_esm/core/TransactionEnvelopeLegacy.js.map +1 -1
  102. package/_esm/core/TransactionReceipt.js.map +1 -1
  103. package/_esm/core/TypedData.js +3 -3
  104. package/_esm/core/TypedData.js.map +1 -1
  105. package/_esm/core/WebAuthnP256.js +1 -1
  106. package/_esm/core/WebAuthnP256.js.map +1 -1
  107. package/_esm/core/WebCryptoP256.js.map +1 -1
  108. package/_esm/core/internal/abiParameters.js +4 -4
  109. package/_esm/core/internal/abiParameters.js.map +1 -1
  110. package/_esm/core/internal/promise.js.map +1 -1
  111. package/_esm/erc4337/UserOperation.js.map +1 -1
  112. package/_esm/erc6492/{WrappedSignature.js → SignatureErc6492.js} +18 -20
  113. package/_esm/erc6492/SignatureErc6492.js.map +1 -0
  114. package/_esm/erc6492/index.js +3 -3
  115. package/_esm/erc8010/SignatureErc8010.js +182 -0
  116. package/_esm/erc8010/SignatureErc8010.js.map +1 -0
  117. package/_esm/erc8010/index.js +40 -0
  118. package/_esm/erc8010/index.js.map +1 -0
  119. package/_esm/index.docs.js +2 -0
  120. package/_esm/index.docs.js.map +1 -1
  121. package/_esm/index.js +236 -236
  122. package/_esm/index.js.map +1 -1
  123. package/_esm/trusted-setups/internal/paths.js +1 -0
  124. package/_esm/trusted-setups/internal/paths.js.map +1 -1
  125. package/_esm/version.js +1 -1
  126. package/_types/core/AbiEvent.d.ts +1 -2
  127. package/_types/core/AbiEvent.d.ts.map +1 -1
  128. package/_types/core/AbiParameters.d.ts.map +1 -1
  129. package/_types/core/Authorization.d.ts +1 -1
  130. package/_types/core/Authorization.d.ts.map +1 -1
  131. package/_types/core/Blobs.d.ts +1 -1
  132. package/_types/core/Blobs.d.ts.map +1 -1
  133. package/_types/core/Block.d.ts +1 -1
  134. package/_types/core/Block.d.ts.map +1 -1
  135. package/_types/core/Bytes.d.ts.map +1 -1
  136. package/_types/core/ContractAddress.d.ts +1 -1
  137. package/_types/core/ContractAddress.d.ts.map +1 -1
  138. package/_types/core/HdKey.d.ts +1 -1
  139. package/_types/core/HdKey.d.ts.map +1 -1
  140. package/_types/core/Hex.d.ts.map +1 -1
  141. package/_types/core/Keystore.d.ts.map +1 -1
  142. package/_types/core/Mnemonic.d.ts +1 -1
  143. package/_types/core/Mnemonic.d.ts.map +1 -1
  144. package/_types/core/P256.d.ts.map +1 -1
  145. package/_types/core/Provider.d.ts +2 -2
  146. package/_types/core/Provider.d.ts.map +1 -1
  147. package/_types/core/PublicKey.d.ts.map +1 -1
  148. package/_types/core/RpcRequest.d.ts +1 -1
  149. package/_types/core/RpcRequest.d.ts.map +1 -1
  150. package/_types/core/RpcTransport.d.ts +2 -2
  151. package/_types/core/RpcTransport.d.ts.map +1 -1
  152. package/_types/core/Secp256k1.d.ts +1 -1
  153. package/_types/core/Secp256k1.d.ts.map +1 -1
  154. package/_types/core/Signature.d.ts.map +1 -1
  155. package/_types/core/Siwe.d.ts.map +1 -1
  156. package/_types/core/Transaction.d.ts +1 -2
  157. package/_types/core/Transaction.d.ts.map +1 -1
  158. package/_types/core/TransactionEnvelope.d.ts.map +1 -1
  159. package/_types/core/TransactionEnvelopeEip1559.d.ts +1 -1
  160. package/_types/core/TransactionEnvelopeEip1559.d.ts.map +1 -1
  161. package/_types/core/TransactionEnvelopeEip2930.d.ts +1 -1
  162. package/_types/core/TransactionEnvelopeEip2930.d.ts.map +1 -1
  163. package/_types/core/TransactionEnvelopeEip4844.d.ts +1 -1
  164. package/_types/core/TransactionEnvelopeEip4844.d.ts.map +1 -1
  165. package/_types/core/TransactionEnvelopeEip7702.d.ts +1 -3
  166. package/_types/core/TransactionEnvelopeEip7702.d.ts.map +1 -1
  167. package/_types/core/TransactionEnvelopeLegacy.d.ts +1 -1
  168. package/_types/core/TransactionEnvelopeLegacy.d.ts.map +1 -1
  169. package/_types/core/TransactionReceipt.d.ts +1 -1
  170. package/_types/core/TransactionReceipt.d.ts.map +1 -1
  171. package/_types/core/TypedData.d.ts +1 -1
  172. package/_types/core/TypedData.d.ts.map +1 -1
  173. package/_types/core/WebAuthnP256.d.ts +2 -2
  174. package/_types/core/WebAuthnP256.d.ts.map +1 -1
  175. package/_types/core/WebCryptoP256.d.ts +1 -1
  176. package/_types/core/WebCryptoP256.d.ts.map +1 -1
  177. package/_types/core/internal/abiParameters.d.ts +1 -1
  178. package/_types/core/internal/abiParameters.d.ts.map +1 -1
  179. package/_types/core/internal/promise.d.ts.map +1 -1
  180. package/_types/core/internal/register.d.ts +1 -2
  181. package/_types/core/internal/register.d.ts.map +1 -1
  182. package/_types/erc4337/UserOperation.d.ts +1 -1
  183. package/_types/erc4337/UserOperation.d.ts.map +1 -1
  184. package/_types/erc6492/{WrappedSignature.d.ts → SignatureErc6492.d.ts} +28 -26
  185. package/_types/erc6492/SignatureErc6492.d.ts.map +1 -0
  186. package/_types/erc6492/index.d.ts +3 -3
  187. package/_types/erc8010/SignatureErc8010.d.ts +138 -0
  188. package/_types/erc8010/SignatureErc8010.d.ts.map +1 -0
  189. package/_types/erc8010/index.d.ts +42 -0
  190. package/_types/erc8010/index.d.ts.map +1 -0
  191. package/_types/index.d.ts +237 -237
  192. package/_types/index.d.ts.map +1 -1
  193. package/_types/index.docs.d.ts +1 -0
  194. package/_types/index.docs.d.ts.map +1 -1
  195. package/_types/trusted-setups/internal/paths.d.ts.map +1 -1
  196. package/_types/version.d.ts +1 -1
  197. package/core/AbiEvent.ts +3 -4
  198. package/core/AbiItem.ts +1 -1
  199. package/core/AbiParameters.ts +4 -4
  200. package/core/Authorization.ts +1 -1
  201. package/core/Blobs.ts +1 -1
  202. package/core/Block.ts +1 -1
  203. package/core/Bytes.ts +1 -1
  204. package/core/ContractAddress.ts +1 -1
  205. package/core/HdKey.ts +1 -1
  206. package/core/Hex.ts +1 -1
  207. package/core/Keystore.ts +3 -2
  208. package/core/Mnemonic.ts +1 -1
  209. package/core/P256.ts +1 -1
  210. package/core/Provider.ts +2 -2
  211. package/core/PublicKey.ts +2 -2
  212. package/core/RpcRequest.ts +1 -1
  213. package/core/RpcTransport.ts +3 -3
  214. package/core/Secp256k1.ts +2 -2
  215. package/core/Signature.ts +1 -1
  216. package/core/Siwe.ts +4 -5
  217. package/core/Transaction.ts +1 -2
  218. package/core/TransactionEnvelope.ts +1 -1
  219. package/core/TransactionEnvelopeEip1559.ts +3 -3
  220. package/core/TransactionEnvelopeEip2930.ts +3 -3
  221. package/core/TransactionEnvelopeEip4844.ts +5 -5
  222. package/core/TransactionEnvelopeEip7702.ts +6 -5
  223. package/core/TransactionEnvelopeLegacy.ts +3 -3
  224. package/core/TransactionReceipt.ts +1 -1
  225. package/core/TypedData.ts +4 -4
  226. package/core/WebAuthnP256.ts +2 -2
  227. package/core/WebCryptoP256.ts +1 -1
  228. package/core/internal/abiParameters.ts +5 -5
  229. package/core/internal/promise.ts +3 -1
  230. package/core/internal/register.ts +1 -2
  231. package/erc4337/UserOperation.ts +1 -1
  232. package/erc6492/SignatureErc6492/package.json +6 -0
  233. package/erc6492/{WrappedSignature.ts → SignatureErc6492.ts} +31 -30
  234. package/erc6492/index.ts +3 -3
  235. package/erc8010/SignatureErc8010/package.json +6 -0
  236. package/erc8010/SignatureErc8010.ts +227 -0
  237. package/erc8010/index.ts +43 -0
  238. package/erc8010/package.json +6 -0
  239. package/index.docs.ts +2 -0
  240. package/index.ts +237 -261
  241. package/package.json +15 -5
  242. package/trusted-setups/internal/paths.ts +1 -0
  243. package/version.ts +1 -1
  244. package/_cjs/erc6492/WrappedSignature.js.map +0 -1
  245. package/_esm/erc6492/WrappedSignature.js.map +0 -1
  246. package/_types/erc6492/WrappedSignature.d.ts.map +0 -1
  247. package/erc6492/WrappedSignature/package.json +0 -6
package/core/Block.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type * as Address from './Address.js'
2
2
  import type * as Errors from './Errors.js'
3
3
  import * as Hex from './Hex.js'
4
+ import type { Compute, OneOf } from './internal/types.js'
4
5
  import * as Transaction from './Transaction.js'
5
6
  import * as Withdrawal from './Withdrawal.js'
6
- import type { Compute, OneOf } from './internal/types.js'
7
7
 
8
8
  /** A Block as defined in the [Execution API specification](https://github.com/ethereum/execution-apis/blob/main/src/schemas/block.yaml). */
9
9
  export type Block<
package/core/Bytes.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { equalBytes } from '@noble/curves/abstract/utils'
2
2
  import * as Errors from './Errors.js'
3
3
  import * as Hex from './Hex.js'
4
- import * as Json from './Json.js'
5
4
  import * as internal from './internal/bytes.js'
6
5
  import * as internal_hex from './internal/hex.js'
6
+ import * as Json from './Json.js'
7
7
 
8
8
  const decoder = /*#__PURE__*/ new TextDecoder()
9
9
  const encoder = /*#__PURE__*/ new TextEncoder()
@@ -3,8 +3,8 @@ import * as Bytes from './Bytes.js'
3
3
  import type * as Errors from './Errors.js'
4
4
  import * as Hash from './Hash.js'
5
5
  import * as Hex from './Hex.js'
6
- import * as Rlp from './Rlp.js'
7
6
  import type { OneOf } from './internal/types.js'
7
+ import * as Rlp from './Rlp.js'
8
8
 
9
9
  /**
10
10
  * Computes Contract Address generated by the [CREATE](https://ethereum.stackexchange.com/questions/68943/create-opcode-what-does-it-really-do/68945#68945) or [CREATE2](https://eips.ethereum.org/EIPS/eip-1014) opcode.
package/core/HdKey.ts CHANGED
@@ -2,8 +2,8 @@ import { HDKey, type Versions } from '@scure/bip32'
2
2
  import * as Bytes from './Bytes.js'
3
3
  import type * as Errors from './Errors.js'
4
4
  import type * as Hex from './Hex.js'
5
- import type * as PublicKey from './PublicKey.js'
6
5
  import * as internal from './internal/hdKey.js'
6
+ import type * as PublicKey from './PublicKey.js'
7
7
 
8
8
  /** Root type for a Hierarchical Deterministic (HD) Key. */
9
9
  export type HdKey = {
package/core/Hex.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { equalBytes } from '@noble/curves/abstract/utils'
2
2
  import * as Bytes from './Bytes.js'
3
3
  import * as Errors from './Errors.js'
4
- import * as Json from './Json.js'
5
4
  import * as internal_bytes from './internal/bytes.js'
6
5
  import * as internal from './internal/hex.js'
6
+ import * as Json from './Json.js'
7
7
 
8
8
  const encoder = /*#__PURE__*/ new TextEncoder()
9
9
 
package/core/Keystore.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { ctr } from '@noble/ciphers/aes'
2
2
  import {
3
- pbkdf2Async as pbkdf2Async_noble,
4
3
  pbkdf2 as pbkdf2_noble,
4
+ pbkdf2Async as pbkdf2Async_noble,
5
5
  } from '@noble/hashes/pbkdf2'
6
6
  import {
7
- scryptAsync as scryptAsync_noble,
8
7
  scrypt as scrypt_noble,
8
+ scryptAsync as scryptAsync_noble,
9
9
  } from '@noble/hashes/scrypt'
10
10
  import { sha256 } from '@noble/hashes/sha2'
11
11
  import * as Bytes from './Bytes.js'
@@ -524,6 +524,7 @@ export declare namespace toKeyAsync {
524
524
  ///////////////////////////////////////////////////////////////////////////
525
525
 
526
526
  /** @internal */
527
+ // biome-ignore lint/correctness/noUnusedVariables: _
527
528
  function defineKey<
528
529
  const key extends Key,
529
530
  const options extends defineKey.Options,
package/core/Mnemonic.ts CHANGED
@@ -11,8 +11,8 @@ import type * as Hex from './Hex.js'
11
11
  export { path } from './HdKey.js'
12
12
 
13
13
  export {
14
- english,
15
14
  czech,
15
+ english,
16
16
  french,
17
17
  italian,
18
18
  japanese,
package/core/P256.ts CHANGED
@@ -2,9 +2,9 @@ import { secp256r1 } from '@noble/curves/p256'
2
2
  import * as Bytes from './Bytes.js'
3
3
  import type * as Errors from './Errors.js'
4
4
  import * as Hex from './Hex.js'
5
+ import * as Entropy from './internal/entropy.js'
5
6
  import * as PublicKey from './PublicKey.js'
6
7
  import type * as Signature from './Signature.js'
7
- import * as Entropy from './internal/entropy.js'
8
8
 
9
9
  /** Re-export of noble/curves P256 utilities. */
10
10
  export const noble = secp256r1
package/core/Provider.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { EventEmitter } from 'eventemitter3'
2
2
  import type * as Address from './Address.js'
3
3
  import * as Errors from './Errors.js'
4
- import * as RpcResponse from './RpcResponse.js'
5
- import type * as RpcSchema from './RpcSchema.js'
6
4
  import type * as RpcSchema_internal from './internal/rpcSchema.js'
7
5
  import type { Compute, IsNarrowable, IsNever } from './internal/types.js'
6
+ import * as RpcResponse from './RpcResponse.js'
7
+ import type * as RpcSchema from './RpcSchema.js'
8
8
 
9
9
  /** Options for a {@link ox#Provider.Provider}. */
10
10
  export type Options = {
package/core/PublicKey.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as Bytes from './Bytes.js'
2
2
  import * as Errors from './Errors.js'
3
3
  import * as Hex from './Hex.js'
4
- import * as Json from './Json.js'
5
4
  import type { Compute, ExactPartial } from './internal/types.js'
5
+ import * as Json from './Json.js'
6
6
 
7
7
  /** Root type for an ECDSA Public Key. */
8
8
  export type PublicKey<
@@ -431,7 +431,7 @@ export function validate(
431
431
  try {
432
432
  assert(publicKey, options)
433
433
  return true
434
- } catch (error) {
434
+ } catch (_error) {
435
435
  return false
436
436
  }
437
437
  }
@@ -1,7 +1,7 @@
1
1
  import type { Errors } from '../index.js'
2
- import type * as RpcSchema from './RpcSchema.js'
3
2
  import type * as RpcSchema_internal from './internal/rpcSchema.js'
4
3
  import type { Compute } from './internal/types.js'
4
+ import type * as RpcSchema from './RpcSchema.js'
5
5
 
6
6
  /** A JSON-RPC request object as per the [JSON-RPC 2.0 specification](https://www.jsonrpc.org/specification#request_object). */
7
7
  export type RpcRequest<schema extends RpcSchema.Generic = RpcSchema.Generic> =
@@ -1,11 +1,11 @@
1
1
  import * as Errors from './Errors.js'
2
- import type * as RpcResponse from './RpcResponse.js'
3
- import type * as RpcSchema from './RpcSchema.js'
4
2
  import { getUrl } from './internal/errors.js'
5
3
  import * as promise from './internal/promise.js'
6
4
  import type * as RpcSchema_internal from './internal/rpcSchema.js'
7
5
  import * as internal from './internal/rpcTransport.js'
8
6
  import type { Compute } from './internal/types.js'
7
+ import type * as RpcResponse from './RpcResponse.js'
8
+ import type * as RpcSchema from './RpcSchema.js'
9
9
 
10
10
  /** Root type for an RPC Transport. */
11
11
  export type RpcTransport<
@@ -124,7 +124,7 @@ export function fromHttp<
124
124
  return response.text().then((data) => {
125
125
  try {
126
126
  return JSON.parse(data || '{}')
127
- } catch (err) {
127
+ } catch (_err) {
128
128
  if (response.ok)
129
129
  throw new MalformedResponseError({
130
130
  response: data,
package/core/Secp256k1.ts CHANGED
@@ -3,10 +3,10 @@ import * as Address from './Address.js'
3
3
  import * as Bytes from './Bytes.js'
4
4
  import type * as Errors from './Errors.js'
5
5
  import * as Hex from './Hex.js'
6
- import * as PublicKey from './PublicKey.js'
7
- import type * as Signature from './Signature.js'
8
6
  import * as Entropy from './internal/entropy.js'
9
7
  import type { OneOf } from './internal/types.js'
8
+ import * as PublicKey from './PublicKey.js'
9
+ import type * as Signature from './Signature.js'
10
10
 
11
11
  /** Re-export of noble/curves secp256k1 utilities. */
12
12
  export const noble = secp256k1
package/core/Signature.ts CHANGED
@@ -2,9 +2,9 @@ import { secp256k1 } from '@noble/curves/secp256k1'
2
2
  import * as Bytes from './Bytes.js'
3
3
  import * as Errors from './Errors.js'
4
4
  import * as Hex from './Hex.js'
5
+ import type { Compute, ExactPartial, OneOf } from './internal/types.js'
5
6
  import * as Json from './Json.js'
6
7
  import * as Solidity from './Solidity.js'
7
- import type { Compute, ExactPartial, OneOf } from './internal/types.js'
8
8
 
9
9
  /** Root type for an ECDSA signature. */
10
10
  export type Signature<
package/core/Siwe.ts CHANGED
@@ -4,7 +4,7 @@ import type { ExactPartial } from './internal/types.js'
4
4
  import { uid } from './internal/uid.js'
5
5
 
6
6
  export const domainRegex =
7
- /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(:[0-9]{1,5})?$/
7
+ /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(:[0-9]{1,5})?$/
8
8
 
9
9
  export const ipRegex =
10
10
  /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:[0-9]{1,5})?$/
@@ -285,8 +285,7 @@ export function generateNonce(): string {
285
285
  // based on https://github.com/ogt/valid-url
286
286
  export function isUri(value: string): false | string {
287
287
  // check for illegal characters
288
- if (/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(value))
289
- return false
288
+ if (/[^a-z0-9:/?#[\]@!$&'()*+,;=.\-_~%]/i.test(value)) return false
290
289
 
291
290
  // check for hex escapes that aren't complete
292
291
  if (/%[^0-9a-f]/i.test(value)) return false
@@ -312,7 +311,7 @@ export function isUri(value: string): false | string {
312
311
  }
313
312
 
314
313
  // scheme must begin with a letter, then consist of letters, digits, +, ., or -
315
- if (!/^[a-z][a-z0-9\+\-\.]*$/.test(scheme.toLowerCase())) return false
314
+ if (!/^[a-z][a-z0-9+\-.]*$/.test(scheme.toLowerCase())) return false
316
315
 
317
316
  let out = ''
318
317
  // re-assemble the URL per section 5.3 in RFC 3986
@@ -329,7 +328,7 @@ export function isUri(value: string): false | string {
329
328
 
330
329
  function splitUri(value: string) {
331
330
  return value.match(
332
- /(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/,
331
+ /(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/,
333
332
  )!
334
333
  }
335
334
 
@@ -3,9 +3,8 @@ import type * as Address from './Address.js'
3
3
  import * as Authorization from './Authorization.js'
4
4
  import type * as Errors from './Errors.js'
5
5
  import * as Hex from './Hex.js'
6
+ import type { Compute, OneOf, UnionCompute } from './internal/types.js'
6
7
  import * as Signature from './Signature.js'
7
- import type { Compute, UnionCompute } from './internal/types.js'
8
- import type { OneOf } from './internal/types.js'
9
8
 
10
9
  /**
11
10
  * A Transaction as defined in the [Execution API specification](https://github.com/ethereum/execution-apis/blob/main/src/schemas/transaction.yaml).
@@ -1,8 +1,8 @@
1
1
  import type * as Address from './Address.js'
2
2
  import * as Errors from './Errors.js'
3
3
  import type * as Hex from './Hex.js'
4
- import * as Value from './Value.js'
5
4
  import type { Compute } from './internal/types.js'
5
+ import * as Value from './Value.js'
6
6
 
7
7
  /** Base type for a Transaction Envelope. Transaction Envelopes inherit this type. */
8
8
  export type Base<
@@ -3,15 +3,15 @@ import * as Address from './Address.js'
3
3
  import type * as Errors from './Errors.js'
4
4
  import * as Hash from './Hash.js'
5
5
  import * as Hex from './Hex.js'
6
- import * as Rlp from './Rlp.js'
7
- import * as Signature from './Signature.js'
8
- import * as TransactionEnvelope from './TransactionEnvelope.js'
9
6
  import type {
10
7
  Assign,
11
8
  Compute,
12
9
  PartialBy,
13
10
  UnionPartialBy,
14
11
  } from './internal/types.js'
12
+ import * as Rlp from './Rlp.js'
13
+ import * as Signature from './Signature.js'
14
+ import * as TransactionEnvelope from './TransactionEnvelope.js'
15
15
 
16
16
  export type TransactionEnvelopeEip1559<
17
17
  signed extends boolean = boolean,
@@ -3,15 +3,15 @@ import * as Address from './Address.js'
3
3
  import type * as Errors from './Errors.js'
4
4
  import * as Hash from './Hash.js'
5
5
  import * as Hex from './Hex.js'
6
- import * as Rlp from './Rlp.js'
7
- import * as Signature from './Signature.js'
8
- import * as TransactionEnvelope from './TransactionEnvelope.js'
9
6
  import type {
10
7
  Assign,
11
8
  Compute,
12
9
  PartialBy,
13
10
  UnionPartialBy,
14
11
  } from './internal/types.js'
12
+ import * as Rlp from './Rlp.js'
13
+ import * as Signature from './Signature.js'
14
+ import * as TransactionEnvelope from './TransactionEnvelope.js'
15
15
 
16
16
  export type TransactionEnvelopeEip2930<
17
17
  signed extends boolean = boolean,
@@ -3,17 +3,17 @@ import * as Blobs from './Blobs.js'
3
3
  import type * as Errors from './Errors.js'
4
4
  import * as Hash from './Hash.js'
5
5
  import * as Hex from './Hex.js'
6
- import * as Kzg from './Kzg.js'
7
- import * as Rlp from './Rlp.js'
8
- import * as Signature from './Signature.js'
9
- import * as TransactionEnvelope from './TransactionEnvelope.js'
10
- import * as TransactionEnvelopeEip1559 from './TransactionEnvelopeEip1559.js'
11
6
  import type {
12
7
  Assign,
13
8
  Compute,
14
9
  PartialBy,
15
10
  UnionPartialBy,
16
11
  } from './internal/types.js'
12
+ import * as Kzg from './Kzg.js'
13
+ import * as Rlp from './Rlp.js'
14
+ import * as Signature from './Signature.js'
15
+ import * as TransactionEnvelope from './TransactionEnvelope.js'
16
+ import * as TransactionEnvelopeEip1559 from './TransactionEnvelopeEip1559.js'
17
17
 
18
18
  export type TransactionEnvelopeEip4844<
19
19
  signed extends boolean = boolean,
@@ -1,18 +1,19 @@
1
- import type { Assign } from './internal/types.js'
2
-
3
- import type { PartialBy, UnionPartialBy } from './internal/types.js'
4
-
5
1
  import * as AccessList from './AccessList.js'
6
2
  import * as Address from './Address.js'
7
3
  import * as Authorization from './Authorization.js'
8
4
  import type * as Errors from './Errors.js'
9
5
  import * as Hash from './Hash.js'
10
6
  import * as Hex from './Hex.js'
7
+ import type {
8
+ Assign,
9
+ Compute,
10
+ PartialBy,
11
+ UnionPartialBy,
12
+ } from './internal/types.js'
11
13
  import * as Rlp from './Rlp.js'
12
14
  import * as Signature from './Signature.js'
13
15
  import * as TransactionEnvelope from './TransactionEnvelope.js'
14
16
  import * as TransactionEnvelopeEip1559 from './TransactionEnvelopeEip1559.js'
15
- import type { Compute } from './internal/types.js'
16
17
 
17
18
  export type TransactionEnvelopeEip7702<
18
19
  signed extends boolean = boolean,
@@ -2,9 +2,6 @@ import * as Address from './Address.js'
2
2
  import type * as Errors from './Errors.js'
3
3
  import * as Hash from './Hash.js'
4
4
  import * as Hex from './Hex.js'
5
- import * as Rlp from './Rlp.js'
6
- import * as Signature from './Signature.js'
7
- import * as TransactionEnvelope from './TransactionEnvelope.js'
8
5
  import type {
9
6
  Assign,
10
7
  Branded,
@@ -12,6 +9,9 @@ import type {
12
9
  PartialBy,
13
10
  UnionPartialBy,
14
11
  } from './internal/types.js'
12
+ import * as Rlp from './Rlp.js'
13
+ import * as Signature from './Signature.js'
14
+ import * as TransactionEnvelope from './TransactionEnvelope.js'
15
15
 
16
16
  export type TransactionEnvelopeLegacy<
17
17
  signed extends boolean = boolean,
@@ -1,8 +1,8 @@
1
1
  import type * as Address from './Address.js'
2
2
  import type * as Errors from './Errors.js'
3
3
  import * as Hex from './Hex.js'
4
- import * as Log from './Log.js'
5
4
  import type { Compute } from './internal/types.js'
5
+ import * as Log from './Log.js'
6
6
 
7
7
  /** An Transaction Receipt as defined in the [Execution API specification](https://github.com/ethereum/execution-apis/blob/main/src/schemas/receipt.yaml). */
8
8
  export type TransactionReceipt<
package/core/TypedData.ts CHANGED
@@ -5,9 +5,9 @@ import * as Bytes from './Bytes.js'
5
5
  import * as Errors from './Errors.js'
6
6
  import * as Hash from './Hash.js'
7
7
  import * as Hex from './Hex.js'
8
+ import type { Compute } from './internal/types.js'
8
9
  import * as Json from './Json.js'
9
10
  import * as Solidity from './Solidity.js'
10
- import type { Compute } from './internal/types.js'
11
11
 
12
12
  export type TypedData = abitype.TypedData
13
13
  export type Domain = abitype.TypedDataDomain
@@ -124,7 +124,7 @@ export function assert<
124
124
  // and will throw.
125
125
  Hex.fromNumber(value, {
126
126
  signed: base === 'int',
127
- size: Number.parseInt(size_ ?? '') / 8,
127
+ size: Number.parseInt(size_ ?? '', 10) / 8,
128
128
  })
129
129
  }
130
130
 
@@ -141,9 +141,9 @@ export function assert<
141
141
  const bytesMatch = type.match(Solidity.bytesRegex)
142
142
  if (bytesMatch) {
143
143
  const [, size] = bytesMatch
144
- if (size && Hex.size(value as Hex.Hex) !== Number.parseInt(size))
144
+ if (size && Hex.size(value as Hex.Hex) !== Number.parseInt(size, 10))
145
145
  throw new BytesSizeMismatchError({
146
- expectedSize: Number.parseInt(size),
146
+ expectedSize: Number.parseInt(size, 10),
147
147
  givenSize: Hex.size(value as Hex.Hex),
148
148
  })
149
149
  }
@@ -3,11 +3,11 @@ import * as Bytes from './Bytes.js'
3
3
  import * as Errors from './Errors.js'
4
4
  import * as Hash from './Hash.js'
5
5
  import * as Hex from './Hex.js'
6
+ import type { Compute, OneOf } from './internal/types.js'
7
+ import * as internal from './internal/webauthn.js'
6
8
  import * as P256 from './P256.js'
7
9
  import type * as PublicKey from './PublicKey.js'
8
10
  import type * as Signature from './Signature.js'
9
- import type { Compute, OneOf } from './internal/types.js'
10
- import * as internal from './internal/webauthn.js'
11
11
 
12
12
  /** A WebAuthn-flavored P256 credential. */
13
13
  export type P256Credential = {
@@ -2,9 +2,9 @@ import { p256 } from '@noble/curves/p256'
2
2
  import * as Bytes from './Bytes.js'
3
3
  import type * as Errors from './Errors.js'
4
4
  import * as Hex from './Hex.js'
5
+ import type { Compute } from './internal/types.js'
5
6
  import * as PublicKey from './PublicKey.js'
6
7
  import type * as Signature from './Signature.js'
7
- import type { Compute } from './internal/types.js'
8
8
 
9
9
  /**
10
10
  * Generates an ECDSA P256 key pair that includes:
@@ -1,8 +1,8 @@
1
1
  import type {
2
2
  AbiParameter,
3
3
  AbiParameterKind,
4
- AbiParameterToPrimitiveType,
5
4
  AbiParametersToPrimitiveTypes,
5
+ AbiParameterToPrimitiveType,
6
6
  } from 'abitype'
7
7
  import * as AbiParameters from '../AbiParameters.js'
8
8
  import * as Address from '../Address.js'
@@ -258,7 +258,7 @@ export function decodeBytes(
258
258
  return [Hex.fromBytes(data), 32]
259
259
  }
260
260
 
261
- const value = Hex.fromBytes(cursor.readBytes(Number.parseInt(size), 32))
261
+ const value = Hex.fromBytes(cursor.readBytes(Number.parseInt(size, 10), 32))
262
262
  return [value, 32]
263
263
  }
264
264
 
@@ -275,7 +275,7 @@ export function decodeNumber(
275
275
  param: AbiParameters.Parameter,
276
276
  ) {
277
277
  const signed = param.type.startsWith('int')
278
- const size = Number.parseInt(param.type.split('int')[1] || '256')
278
+ const size = Number.parseInt(param.type.split('int')[1] || '256', 10)
279
279
  const value = cursor.readBytes(32)
280
280
  return [
281
281
  size > 48
@@ -644,9 +644,9 @@ export function encodeBytes(
644
644
  ),
645
645
  }
646
646
  }
647
- if (bytesSize !== Number.parseInt(parametersize))
647
+ if (bytesSize !== Number.parseInt(parametersize, 10))
648
648
  throw new AbiParameters.BytesSizeMismatchError({
649
- expectedSize: Number.parseInt(parametersize),
649
+ expectedSize: Number.parseInt(parametersize, 10),
650
650
  value,
651
651
  })
652
652
  return { dynamic: false, encoded: Hex.padRight(value) }
@@ -34,7 +34,9 @@ export function withTimeout<data>(
34
34
  export declare namespace withTimeout {
35
35
  type Fn<data> = ({
36
36
  signal,
37
- }: { signal: AbortController['signal'] | null }) => Promise<data>
37
+ }: {
38
+ signal: AbortController['signal'] | null
39
+ }) => Promise<data>
38
40
 
39
41
  type Options = {
40
42
  // The error instance to throw when the timeout is reached.
@@ -1,7 +1,6 @@
1
1
  import type * as RpcSchema from '../RpcSchema.js'
2
2
 
3
- // biome-ignore lint/suspicious/noEmptyInterface:
4
- export interface Register {}
3
+ export type Register = {}
5
4
 
6
5
  export type ResolvedRegister = {
7
6
  RpcSchema: Register extends { RpcSchema: infer schema }
@@ -4,9 +4,9 @@ import type * as Authorization from '../core/Authorization.js'
4
4
  import type * as Errors from '../core/Errors.js'
5
5
  import * as Hash from '../core/Hash.js'
6
6
  import * as Hex from '../core/Hex.js'
7
+ import type { Assign, Compute, OneOf } from '../core/internal/types.js'
7
8
  import * as Signature from '../core/Signature.js'
8
9
  import * as TypedData from '../core/TypedData.js'
9
- import type { Assign, Compute, OneOf } from '../core/internal/types.js'
10
10
  import type * as EntryPoint from './EntryPoint.js'
11
11
 
12
12
  /** User Operation. */
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "module",
3
+ "types": "../../_types/erc6492/SignatureErc6492.d.ts",
4
+ "main": "../../_cjs/erc6492/SignatureErc6492.js",
5
+ "module": "../../_esm/erc6492/SignatureErc6492.js"
6
+ }