ox 0.1.7 → 0.2.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 (405) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/_cjs/core/Abi.js +0 -2
  3. package/_cjs/core/Abi.js.map +1 -1
  4. package/_cjs/core/AbiConstructor.js +0 -5
  5. package/_cjs/core/AbiConstructor.js.map +1 -1
  6. package/_cjs/core/AbiError.js +0 -5
  7. package/_cjs/core/AbiError.js.map +1 -1
  8. package/_cjs/core/AbiEvent.js +0 -7
  9. package/_cjs/core/AbiEvent.js.map +1 -1
  10. package/_cjs/core/AbiFunction.js +0 -5
  11. package/_cjs/core/AbiFunction.js.map +1 -1
  12. package/_cjs/core/AbiItem.js +0 -6
  13. package/_cjs/core/AbiItem.js.map +1 -1
  14. package/_cjs/core/AbiParameters.js +0 -5
  15. package/_cjs/core/AbiParameters.js.map +1 -1
  16. package/_cjs/core/Address.js +0 -5
  17. package/_cjs/core/Address.js.map +1 -1
  18. package/_cjs/core/AesGcm.js +0 -4
  19. package/_cjs/core/AesGcm.js.map +1 -1
  20. package/_cjs/core/Authorization.js +0 -11
  21. package/_cjs/core/Authorization.js.map +1 -1
  22. package/_cjs/core/Base58.js +0 -6
  23. package/_cjs/core/Base58.js.map +1 -1
  24. package/_cjs/core/Base64.js +0 -6
  25. package/_cjs/core/Base64.js.map +1 -1
  26. package/_cjs/core/Blobs.js +0 -11
  27. package/_cjs/core/Blobs.js.map +1 -1
  28. package/_cjs/core/Block.js +0 -2
  29. package/_cjs/core/Block.js.map +1 -1
  30. package/_cjs/core/Bloom.js +0 -2
  31. package/_cjs/core/Bloom.js.map +1 -1
  32. package/_cjs/core/Bls.js +0 -3
  33. package/_cjs/core/Bls.js.map +1 -1
  34. package/_cjs/core/BlsPoint.js +0 -4
  35. package/_cjs/core/BlsPoint.js.map +1 -1
  36. package/_cjs/core/Bytes.js +0 -22
  37. package/_cjs/core/Bytes.js.map +1 -1
  38. package/_cjs/core/ContractAddress.js +0 -3
  39. package/_cjs/core/ContractAddress.js.map +1 -1
  40. package/_cjs/core/Ens.js +0 -3
  41. package/_cjs/core/Ens.js.map +1 -1
  42. package/_cjs/core/Filter.js +0 -2
  43. package/_cjs/core/Filter.js.map +1 -1
  44. package/_cjs/core/Hash.js +0 -4
  45. package/_cjs/core/Hash.js.map +1 -1
  46. package/_cjs/core/HdKey.js +0 -4
  47. package/_cjs/core/HdKey.js.map +1 -1
  48. package/_cjs/core/Hex.js +0 -21
  49. package/_cjs/core/Hex.js.map +1 -1
  50. package/_cjs/core/Json.js +0 -2
  51. package/_cjs/core/Json.js.map +1 -1
  52. package/_cjs/core/Kzg.js +0 -1
  53. package/_cjs/core/Kzg.js.map +1 -1
  54. package/_cjs/core/Log.js +0 -2
  55. package/_cjs/core/Log.js.map +1 -1
  56. package/_cjs/core/Mnemonic.js +0 -5
  57. package/_cjs/core/Mnemonic.js.map +1 -1
  58. package/_cjs/core/P256.js +0 -3
  59. package/_cjs/core/P256.js.map +1 -1
  60. package/_cjs/core/PersonalMessage.js +0 -2
  61. package/_cjs/core/PersonalMessage.js.map +1 -1
  62. package/_cjs/core/Provider.js +0 -2
  63. package/_cjs/core/Provider.js.map +1 -1
  64. package/_cjs/core/PublicKey.js +0 -6
  65. package/_cjs/core/PublicKey.js.map +1 -1
  66. package/_cjs/core/Rlp.js +0 -6
  67. package/_cjs/core/Rlp.js.map +1 -1
  68. package/_cjs/core/RpcRequest.js +0 -2
  69. package/_cjs/core/RpcRequest.js.map +1 -1
  70. package/_cjs/core/RpcResponse.js +0 -1
  71. package/_cjs/core/RpcResponse.js.map +1 -1
  72. package/_cjs/core/RpcTransport.js +0 -1
  73. package/_cjs/core/RpcTransport.js.map +1 -1
  74. package/_cjs/core/Secp256k1.js +0 -4
  75. package/_cjs/core/Secp256k1.js.map +1 -1
  76. package/_cjs/core/Signature.js +0 -17
  77. package/_cjs/core/Signature.js.map +1 -1
  78. package/_cjs/core/Siwe.js +0 -1
  79. package/_cjs/core/Siwe.js.map +1 -1
  80. package/_cjs/core/Transaction.js +0 -2
  81. package/_cjs/core/Transaction.js.map +1 -1
  82. package/_cjs/core/TransactionEnvelopeEip1559.js +0 -8
  83. package/_cjs/core/TransactionEnvelopeEip1559.js.map +1 -1
  84. package/_cjs/core/TransactionEnvelopeEip2930.js +0 -8
  85. package/_cjs/core/TransactionEnvelopeEip2930.js.map +1 -1
  86. package/_cjs/core/TransactionEnvelopeEip4844.js +0 -8
  87. package/_cjs/core/TransactionEnvelopeEip4844.js.map +1 -1
  88. package/_cjs/core/TransactionEnvelopeEip7702.js +0 -7
  89. package/_cjs/core/TransactionEnvelopeEip7702.js.map +1 -1
  90. package/_cjs/core/TransactionEnvelopeLegacy.js +0 -8
  91. package/_cjs/core/TransactionEnvelopeLegacy.js.map +1 -1
  92. package/_cjs/core/TransactionReceipt.js +0 -2
  93. package/_cjs/core/TransactionReceipt.js.map +1 -1
  94. package/_cjs/core/TransactionRequest.js +0 -1
  95. package/_cjs/core/TransactionRequest.js.map +1 -1
  96. package/_cjs/core/TypedData.js +19 -12
  97. package/_cjs/core/TypedData.js.map +1 -1
  98. package/_cjs/core/ValidatorData.js +0 -2
  99. package/_cjs/core/ValidatorData.js.map +1 -1
  100. package/_cjs/core/Value.js +0 -6
  101. package/_cjs/core/Value.js.map +1 -1
  102. package/_cjs/core/WebAuthnP256.js +2 -9
  103. package/_cjs/core/WebAuthnP256.js.map +1 -1
  104. package/_cjs/core/WebCryptoP256.js +0 -3
  105. package/_cjs/core/WebCryptoP256.js.map +1 -1
  106. package/_cjs/core/Withdrawal.js +0 -2
  107. package/_cjs/core/Withdrawal.js.map +1 -1
  108. package/_cjs/core/internal/base58.js +0 -1
  109. package/_cjs/core/internal/base58.js.map +1 -1
  110. package/_cjs/core/internal/promise.js +0 -1
  111. package/_cjs/core/internal/promise.js.map +1 -1
  112. package/_cjs/core/internal/rpcTransport.js +0 -1
  113. package/_cjs/core/internal/rpcTransport.js.map +1 -1
  114. package/_cjs/core/internal/webauthn.js +36 -8
  115. package/_cjs/core/internal/webauthn.js.map +1 -1
  116. package/_cjs/version.js +1 -1
  117. package/_esm/core/Abi.js +0 -6
  118. package/_esm/core/Abi.js.map +1 -1
  119. package/_esm/core/AbiConstructor.js +0 -15
  120. package/_esm/core/AbiConstructor.js.map +1 -1
  121. package/_esm/core/AbiError.js +0 -14
  122. package/_esm/core/AbiError.js.map +1 -1
  123. package/_esm/core/AbiEvent.js +0 -20
  124. package/_esm/core/AbiEvent.js.map +1 -1
  125. package/_esm/core/AbiFunction.js +0 -14
  126. package/_esm/core/AbiFunction.js.map +1 -1
  127. package/_esm/core/AbiItem.js +0 -16
  128. package/_esm/core/AbiItem.js.map +1 -1
  129. package/_esm/core/AbiParameters.js +0 -14
  130. package/_esm/core/AbiParameters.js.map +1 -1
  131. package/_esm/core/Address.js +0 -13
  132. package/_esm/core/Address.js.map +1 -1
  133. package/_esm/core/AesGcm.js +0 -12
  134. package/_esm/core/AesGcm.js.map +1 -1
  135. package/_esm/core/Authorization.js +0 -33
  136. package/_esm/core/Authorization.js.map +1 -1
  137. package/_esm/core/Base58.js +0 -18
  138. package/_esm/core/Base58.js.map +1 -1
  139. package/_esm/core/Base64.js +0 -18
  140. package/_esm/core/Base64.js.map +1 -1
  141. package/_esm/core/Blobs.js +0 -28
  142. package/_esm/core/Blobs.js.map +1 -1
  143. package/_esm/core/Block.js +0 -6
  144. package/_esm/core/Block.js.map +1 -1
  145. package/_esm/core/Bloom.js +0 -5
  146. package/_esm/core/Bloom.js.map +1 -1
  147. package/_esm/core/Bls.js +0 -8
  148. package/_esm/core/Bls.js.map +1 -1
  149. package/_esm/core/BlsPoint.js +0 -8
  150. package/_esm/core/BlsPoint.js.map +1 -1
  151. package/_esm/core/Bytes.js +0 -53
  152. package/_esm/core/Bytes.js.map +1 -1
  153. package/_esm/core/ContractAddress.js +0 -9
  154. package/_esm/core/ContractAddress.js.map +1 -1
  155. package/_esm/core/Ens.js +0 -9
  156. package/_esm/core/Ens.js.map +1 -1
  157. package/_esm/core/Filter.js +0 -6
  158. package/_esm/core/Filter.js.map +1 -1
  159. package/_esm/core/Hash.js +0 -8
  160. package/_esm/core/Hash.js.map +1 -1
  161. package/_esm/core/HdKey.js +0 -11
  162. package/_esm/core/HdKey.js.map +1 -1
  163. package/_esm/core/Hex.js +0 -45
  164. package/_esm/core/Hex.js.map +1 -1
  165. package/_esm/core/Json.js +0 -6
  166. package/_esm/core/Json.js.map +1 -1
  167. package/_esm/core/Kzg.js +0 -2
  168. package/_esm/core/Kzg.js.map +1 -1
  169. package/_esm/core/Log.js +0 -6
  170. package/_esm/core/Log.js.map +1 -1
  171. package/_esm/core/Mnemonic.js +0 -15
  172. package/_esm/core/Mnemonic.js.map +1 -1
  173. package/_esm/core/P256.js +0 -7
  174. package/_esm/core/P256.js.map +1 -1
  175. package/_esm/core/PersonalMessage.js +0 -4
  176. package/_esm/core/PersonalMessage.js.map +1 -1
  177. package/_esm/core/Provider.js +0 -5
  178. package/_esm/core/Provider.js.map +1 -1
  179. package/_esm/core/PublicKey.js +0 -18
  180. package/_esm/core/PublicKey.js.map +1 -1
  181. package/_esm/core/Rlp.js +0 -18
  182. package/_esm/core/Rlp.js.map +1 -1
  183. package/_esm/core/RpcRequest.js +0 -6
  184. package/_esm/core/RpcRequest.js.map +1 -1
  185. package/_esm/core/RpcResponse.js +0 -3
  186. package/_esm/core/RpcResponse.js.map +1 -1
  187. package/_esm/core/RpcTransport.js +0 -3
  188. package/_esm/core/RpcTransport.js.map +1 -1
  189. package/_esm/core/Secp256k1.js +0 -12
  190. package/_esm/core/Secp256k1.js.map +1 -1
  191. package/_esm/core/Signature.js +0 -49
  192. package/_esm/core/Signature.js.map +1 -1
  193. package/_esm/core/Siwe.js +0 -3
  194. package/_esm/core/Siwe.js.map +1 -1
  195. package/_esm/core/Transaction.js +0 -6
  196. package/_esm/core/Transaction.js.map +1 -1
  197. package/_esm/core/TransactionEnvelopeEip1559.js +0 -22
  198. package/_esm/core/TransactionEnvelopeEip1559.js.map +1 -1
  199. package/_esm/core/TransactionEnvelopeEip2930.js +0 -23
  200. package/_esm/core/TransactionEnvelopeEip2930.js.map +1 -1
  201. package/_esm/core/TransactionEnvelopeEip4844.js +0 -24
  202. package/_esm/core/TransactionEnvelopeEip4844.js.map +1 -1
  203. package/_esm/core/TransactionEnvelopeEip7702.js +0 -21
  204. package/_esm/core/TransactionEnvelopeEip7702.js.map +1 -1
  205. package/_esm/core/TransactionEnvelopeLegacy.js +0 -24
  206. package/_esm/core/TransactionEnvelopeLegacy.js.map +1 -1
  207. package/_esm/core/TransactionReceipt.js +0 -6
  208. package/_esm/core/TransactionReceipt.js.map +1 -1
  209. package/_esm/core/TransactionRequest.js +0 -3
  210. package/_esm/core/TransactionRequest.js.map +1 -1
  211. package/_esm/core/TypedData.js +18 -26
  212. package/_esm/core/TypedData.js.map +1 -1
  213. package/_esm/core/ValidatorData.js +0 -4
  214. package/_esm/core/ValidatorData.js.map +1 -1
  215. package/_esm/core/Value.js +0 -12
  216. package/_esm/core/Value.js.map +1 -1
  217. package/_esm/core/WebAuthnP256.js +2 -23
  218. package/_esm/core/WebAuthnP256.js.map +1 -1
  219. package/_esm/core/WebCryptoP256.js +0 -9
  220. package/_esm/core/WebCryptoP256.js.map +1 -1
  221. package/_esm/core/Withdrawal.js +0 -6
  222. package/_esm/core/Withdrawal.js.map +1 -1
  223. package/_esm/core/internal/base58.js +0 -3
  224. package/_esm/core/internal/base58.js.map +1 -1
  225. package/_esm/core/internal/promise.js +0 -3
  226. package/_esm/core/internal/promise.js.map +1 -1
  227. package/_esm/core/internal/rpcTransport.js +0 -4
  228. package/_esm/core/internal/rpcTransport.js.map +1 -1
  229. package/_esm/core/internal/webauthn.js +40 -8
  230. package/_esm/core/internal/webauthn.js.map +1 -1
  231. package/_esm/version.js +1 -1
  232. package/_types/core/Abi.d.ts +0 -6
  233. package/_types/core/Abi.d.ts.map +1 -1
  234. package/_types/core/AbiConstructor.d.ts +0 -15
  235. package/_types/core/AbiConstructor.d.ts.map +1 -1
  236. package/_types/core/AbiError.d.ts +1 -16
  237. package/_types/core/AbiError.d.ts.map +1 -1
  238. package/_types/core/AbiEvent.d.ts +0 -21
  239. package/_types/core/AbiEvent.d.ts.map +1 -1
  240. package/_types/core/AbiFunction.d.ts +0 -15
  241. package/_types/core/AbiFunction.d.ts.map +1 -1
  242. package/_types/core/AbiItem.d.ts +0 -18
  243. package/_types/core/AbiItem.d.ts.map +1 -1
  244. package/_types/core/AbiParameters.d.ts +0 -15
  245. package/_types/core/AbiParameters.d.ts.map +1 -1
  246. package/_types/core/Address.d.ts +0 -15
  247. package/_types/core/Address.d.ts.map +1 -1
  248. package/_types/core/AesGcm.d.ts +0 -9
  249. package/_types/core/AesGcm.d.ts.map +1 -1
  250. package/_types/core/Authorization.d.ts +0 -33
  251. package/_types/core/Authorization.d.ts.map +1 -1
  252. package/_types/core/Base58.d.ts +0 -18
  253. package/_types/core/Base58.d.ts.map +1 -1
  254. package/_types/core/Base64.d.ts +0 -18
  255. package/_types/core/Base64.d.ts.map +1 -1
  256. package/_types/core/Blobs.d.ts +0 -33
  257. package/_types/core/Blobs.d.ts.map +1 -1
  258. package/_types/core/Block.d.ts +0 -6
  259. package/_types/core/Block.d.ts.map +1 -1
  260. package/_types/core/Bloom.d.ts +0 -6
  261. package/_types/core/Bloom.d.ts.map +1 -1
  262. package/_types/core/Bls.d.ts +0 -9
  263. package/_types/core/Bls.d.ts.map +1 -1
  264. package/_types/core/BlsPoint.d.ts +0 -12
  265. package/_types/core/BlsPoint.d.ts.map +1 -1
  266. package/_types/core/Bytes.d.ts +0 -66
  267. package/_types/core/Bytes.d.ts.map +1 -1
  268. package/_types/core/ContractAddress.d.ts +0 -9
  269. package/_types/core/ContractAddress.d.ts.map +1 -1
  270. package/_types/core/Ens.d.ts +0 -9
  271. package/_types/core/Ens.d.ts.map +1 -1
  272. package/_types/core/Filter.d.ts +0 -6
  273. package/_types/core/Filter.d.ts.map +1 -1
  274. package/_types/core/Hash.d.ts +0 -12
  275. package/_types/core/Hash.d.ts.map +1 -1
  276. package/_types/core/HdKey.d.ts +0 -12
  277. package/_types/core/HdKey.d.ts.map +1 -1
  278. package/_types/core/Hex.d.ts +0 -63
  279. package/_types/core/Hex.d.ts.map +1 -1
  280. package/_types/core/Json.d.ts +0 -6
  281. package/_types/core/Json.d.ts.map +1 -1
  282. package/_types/core/Kzg.d.ts +0 -3
  283. package/_types/core/Kzg.d.ts.map +1 -1
  284. package/_types/core/Log.d.ts +0 -6
  285. package/_types/core/Log.d.ts.map +1 -1
  286. package/_types/core/Mnemonic.d.ts +0 -15
  287. package/_types/core/Mnemonic.d.ts.map +1 -1
  288. package/_types/core/P256.d.ts +0 -9
  289. package/_types/core/P256.d.ts.map +1 -1
  290. package/_types/core/PersonalMessage.d.ts +0 -6
  291. package/_types/core/PersonalMessage.d.ts.map +1 -1
  292. package/_types/core/Provider.d.ts +0 -6
  293. package/_types/core/Provider.d.ts.map +1 -1
  294. package/_types/core/PublicKey.d.ts +0 -18
  295. package/_types/core/PublicKey.d.ts.map +1 -1
  296. package/_types/core/Rlp.d.ts +1 -18
  297. package/_types/core/Rlp.d.ts.map +1 -1
  298. package/_types/core/RpcRequest.d.ts +0 -6
  299. package/_types/core/RpcRequest.d.ts.map +1 -1
  300. package/_types/core/RpcResponse.d.ts +0 -3
  301. package/_types/core/RpcResponse.d.ts.map +1 -1
  302. package/_types/core/RpcTransport.d.ts +0 -3
  303. package/_types/core/RpcTransport.d.ts.map +1 -1
  304. package/_types/core/Secp256k1.d.ts +0 -12
  305. package/_types/core/Secp256k1.d.ts.map +1 -1
  306. package/_types/core/Signature.d.ts +0 -51
  307. package/_types/core/Signature.d.ts.map +1 -1
  308. package/_types/core/Siwe.d.ts +0 -3
  309. package/_types/core/Siwe.d.ts.map +1 -1
  310. package/_types/core/Transaction.d.ts +0 -6
  311. package/_types/core/Transaction.d.ts.map +1 -1
  312. package/_types/core/TransactionEnvelopeEip1559.d.ts +0 -24
  313. package/_types/core/TransactionEnvelopeEip1559.d.ts.map +1 -1
  314. package/_types/core/TransactionEnvelopeEip2930.d.ts +0 -24
  315. package/_types/core/TransactionEnvelopeEip2930.d.ts.map +1 -1
  316. package/_types/core/TransactionEnvelopeEip4844.d.ts +0 -24
  317. package/_types/core/TransactionEnvelopeEip4844.d.ts.map +1 -1
  318. package/_types/core/TransactionEnvelopeEip7702.d.ts +0 -21
  319. package/_types/core/TransactionEnvelopeEip7702.d.ts.map +1 -1
  320. package/_types/core/TransactionEnvelopeLegacy.d.ts +0 -24
  321. package/_types/core/TransactionEnvelopeLegacy.d.ts.map +1 -1
  322. package/_types/core/TransactionReceipt.d.ts +0 -6
  323. package/_types/core/TransactionReceipt.d.ts.map +1 -1
  324. package/_types/core/TransactionRequest.d.ts +0 -3
  325. package/_types/core/TransactionRequest.d.ts.map +1 -1
  326. package/_types/core/TypedData.d.ts +7 -30
  327. package/_types/core/TypedData.d.ts.map +1 -1
  328. package/_types/core/ValidatorData.d.ts +0 -6
  329. package/_types/core/ValidatorData.d.ts.map +1 -1
  330. package/_types/core/Value.d.ts +0 -18
  331. package/_types/core/Value.d.ts.map +1 -1
  332. package/_types/core/WebAuthnP256.d.ts +1 -25
  333. package/_types/core/WebAuthnP256.d.ts.map +1 -1
  334. package/_types/core/WebCryptoP256.d.ts +0 -9
  335. package/_types/core/WebCryptoP256.d.ts.map +1 -1
  336. package/_types/core/Withdrawal.d.ts +0 -6
  337. package/_types/core/Withdrawal.d.ts.map +1 -1
  338. package/_types/core/internal/base58.d.ts +1 -3
  339. package/_types/core/internal/base58.d.ts.map +1 -1
  340. package/_types/core/internal/promise.d.ts +1 -3
  341. package/_types/core/internal/promise.d.ts.map +1 -1
  342. package/_types/core/internal/rpcTransport.d.ts +0 -3
  343. package/_types/core/internal/rpcTransport.d.ts.map +1 -1
  344. package/_types/core/internal/webauthn.d.ts +6 -2
  345. package/_types/core/internal/webauthn.d.ts.map +1 -1
  346. package/_types/version.d.ts +1 -1
  347. package/core/Abi.ts +0 -8
  348. package/core/AbiConstructor.ts +0 -20
  349. package/core/AbiError.ts +1 -20
  350. package/core/AbiEvent.ts +0 -27
  351. package/core/AbiFunction.ts +0 -19
  352. package/core/AbiItem.ts +0 -22
  353. package/core/AbiParameters.ts +0 -19
  354. package/core/Address.ts +0 -18
  355. package/core/AesGcm.ts +0 -16
  356. package/core/Authorization.ts +0 -44
  357. package/core/Base58.ts +0 -24
  358. package/core/Base64.ts +0 -24
  359. package/core/Blobs.ts +0 -39
  360. package/core/Block.ts +0 -8
  361. package/core/Bloom.ts +0 -7
  362. package/core/Bls.ts +0 -11
  363. package/core/BlsPoint.ts +0 -12
  364. package/core/Bytes.ts +0 -75
  365. package/core/ContractAddress.ts +0 -12
  366. package/core/Ens.ts +0 -12
  367. package/core/Filter.ts +0 -8
  368. package/core/Hash.ts +0 -12
  369. package/core/HdKey.ts +0 -15
  370. package/core/Hex.ts +0 -66
  371. package/core/Json.ts +0 -8
  372. package/core/Kzg.ts +0 -3
  373. package/core/Log.ts +0 -8
  374. package/core/Mnemonic.ts +0 -20
  375. package/core/P256.ts +0 -10
  376. package/core/PersonalMessage.ts +0 -7
  377. package/core/Provider.ts +0 -7
  378. package/core/PublicKey.ts +0 -24
  379. package/core/Rlp.ts +0 -23
  380. package/core/RpcRequest.ts +0 -8
  381. package/core/RpcResponse.ts +0 -4
  382. package/core/RpcTransport.ts +0 -4
  383. package/core/Secp256k1.ts +0 -16
  384. package/core/Signature.ts +0 -66
  385. package/core/Siwe.ts +0 -4
  386. package/core/Transaction.ts +0 -8
  387. package/core/TransactionEnvelopeEip1559.ts +0 -30
  388. package/core/TransactionEnvelopeEip2930.ts +0 -31
  389. package/core/TransactionEnvelopeEip4844.ts +0 -32
  390. package/core/TransactionEnvelopeEip7702.ts +0 -28
  391. package/core/TransactionEnvelopeLegacy.ts +0 -32
  392. package/core/TransactionReceipt.ts +0 -8
  393. package/core/TransactionRequest.ts +0 -4
  394. package/core/TypedData.ts +15 -36
  395. package/core/ValidatorData.ts +0 -7
  396. package/core/Value.ts +0 -18
  397. package/core/WebAuthnP256.ts +5 -34
  398. package/core/WebCryptoP256.ts +0 -12
  399. package/core/Withdrawal.ts +0 -8
  400. package/core/internal/base58.ts +0 -3
  401. package/core/internal/promise.ts +0 -3
  402. package/core/internal/rpcTransport.ts +0 -5
  403. package/core/internal/webauthn.ts +58 -17
  404. package/package.json +1 -1
  405. package/version.ts +1 -1
package/core/TypedData.ts CHANGED
@@ -157,7 +157,10 @@ export function assert<
157
157
  }
158
158
 
159
159
  // Validate domain types.
160
- if (types.EIP712Domain && domain) validateData(types.EIP712Domain, domain)
160
+ if (types.EIP712Domain && domain) {
161
+ if (typeof domain !== 'object') throw new InvalidDomainError({ domain })
162
+ validateData(types.EIP712Domain, domain)
163
+ }
161
164
 
162
165
  // Validate message types.
163
166
  if (primaryType !== 'EIP712Domain') {
@@ -181,10 +184,6 @@ export declare namespace assert {
181
184
  | Errors.GlobalErrorType
182
185
  }
183
186
 
184
- assert.parseError = (error: unknown) =>
185
- /* v8 ignore next */
186
- error as assert.ErrorType
187
-
188
187
  /**
189
188
  * Creates [EIP-712 Typed Data](https://eips.ethereum.org/EIPS/eip-712) [`domainSeparator`](https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator) for the provided domain.
190
189
  *
@@ -214,10 +213,6 @@ export declare namespace domainSeparator {
214
213
  type ErrorType = hashDomain.ErrorType | Errors.GlobalErrorType
215
214
  }
216
215
 
217
- domainSeparator.parseError = (error: unknown) =>
218
- /* v8 ignore next */
219
- error as domainSeparator.ErrorType
220
-
221
216
  /**
222
217
  * Encodes typed data in [EIP-712 format](https://eips.ethereum.org/EIPS/eip-712): `0x19 ‖ 0x01 ‖ domainSeparator ‖ hashStruct(message)`.
223
218
  *
@@ -320,9 +315,6 @@ export declare namespace encode {
320
315
  | Errors.GlobalErrorType
321
316
  }
322
317
 
323
- /* v8 ignore next */
324
- encode.parseError = (error: unknown) => error as encode.ErrorType
325
-
326
318
  /**
327
319
  * Encodes [EIP-712 Typed Data](https://eips.ethereum.org/EIPS/eip-712) schema for the provided primaryType.
328
320
  *
@@ -372,9 +364,6 @@ export declare namespace encodeType {
372
364
  type ErrorType = findTypeDependencies.ErrorType | Errors.GlobalErrorType
373
365
  }
374
366
 
375
- /* v8 ignore next */
376
- encodeType.parseError = (error: unknown) => error as encodeType.ErrorType
377
-
378
367
  /**
379
368
  * Gets [EIP-712 Typed Data](https://eips.ethereum.org/EIPS/eip-712) schema for EIP-721 domain.
380
369
  *
@@ -421,10 +410,6 @@ export declare namespace extractEip712DomainTypes {
421
410
  type ErrorType = Errors.GlobalErrorType
422
411
  }
423
412
 
424
- extractEip712DomainTypes.parseError = (error: unknown) =>
425
- /* v8 ignore next */
426
- error as extractEip712DomainTypes.ErrorType
427
-
428
413
  /**
429
414
  * Gets the payload to use for signing typed data in [EIP-712 format](https://eips.ethereum.org/EIPS/eip-712).
430
415
  *
@@ -484,10 +469,6 @@ export declare namespace getSignPayload {
484
469
  | Errors.GlobalErrorType
485
470
  }
486
471
 
487
- getSignPayload.parseError = (error: unknown) =>
488
- /* v8 ignore next */
489
- error as getSignPayload.ErrorType
490
-
491
472
  /**
492
473
  * Hashes [EIP-712 Typed Data](https://eips.ethereum.org/EIPS/eip-712) domain.
493
474
  *
@@ -537,9 +518,6 @@ export declare namespace hashDomain {
537
518
  type ErrorType = hashStruct.ErrorType | Errors.GlobalErrorType
538
519
  }
539
520
 
540
- /* v8 ignore next */
541
- hashDomain.parseError = (error: unknown) => error as hashDomain.ErrorType
542
-
543
521
  /**
544
522
  * Hashes [EIP-712 Typed Data](https://eips.ethereum.org/EIPS/eip-712) struct.
545
523
  *
@@ -594,9 +572,6 @@ export declare namespace hashStruct {
594
572
  | Errors.GlobalErrorType
595
573
  }
596
574
 
597
- /* v8 ignore next */
598
- hashStruct.parseError = (error: unknown) => error as hashStruct.ErrorType
599
-
600
575
  /**
601
576
  * Serializes [EIP-712 Typed Data](https://eips.ethereum.org/EIPS/eip-712) schema into string.
602
577
  *
@@ -681,10 +656,6 @@ export declare namespace serialize {
681
656
  type ErrorType = Json.stringify.ErrorType | Errors.GlobalErrorType
682
657
  }
683
658
 
684
- serialize.parseError = (error: unknown) =>
685
- /* v8 ignore next */
686
- error as serialize.ErrorType
687
-
688
659
  /**
689
660
  * Checks if [EIP-712 Typed Data](https://eips.ethereum.org/EIPS/eip-712) is valid.
690
661
  *
@@ -734,9 +705,6 @@ export declare namespace validate {
734
705
  type ErrorType = assert.ErrorType | Errors.GlobalErrorType
735
706
  }
736
707
 
737
- /* v8 ignore next */
738
- validate.parseError = (error: unknown) => error as validate.ErrorType
739
-
740
708
  /** Thrown when the bytes size of a typed data value does not match the expected size. */
741
709
  export class BytesSizeMismatchError extends Errors.BaseError {
742
710
  override readonly name = 'TypedData.BytesSizeMismatchError'
@@ -749,6 +717,17 @@ export class BytesSizeMismatchError extends Errors.BaseError {
749
717
  }
750
718
  }
751
719
 
720
+ /** Thrown when the domain is invalid. */
721
+ export class InvalidDomainError extends Errors.BaseError {
722
+ override readonly name = 'TypedData.InvalidDomainError'
723
+
724
+ constructor({ domain }: { domain: unknown }) {
725
+ super(`Invalid domain "${Json.stringify(domain)}".`, {
726
+ metaMessages: ['Must be a valid EIP-712 domain.'],
727
+ })
728
+ }
729
+ }
730
+
752
731
  /** Thrown when the primary type of a typed data value is invalid. */
753
732
  export class InvalidPrimaryTypeError extends Errors.BaseError {
754
733
  override readonly name = 'TypedData.InvalidPrimaryTypeError'
@@ -45,9 +45,6 @@ export declare namespace encode {
45
45
  | Errors.GlobalErrorType
46
46
  }
47
47
 
48
- /* v8 ignore next */
49
- encode.parseError = (error: unknown) => error as encode.ErrorType
50
-
51
48
  /**
52
49
  * Gets the payload to use for signing [ERC-191 formatted](https://eips.ethereum.org/EIPS/eip-191#0x00) data with an intended validator.
53
50
  *
@@ -81,7 +78,3 @@ export declare namespace getSignPayload {
81
78
  | encode.ErrorType
82
79
  | Errors.GlobalErrorType
83
80
  }
84
-
85
- /* v8 ignore next */
86
- getSignPayload.parseError = (error: unknown) =>
87
- error as getSignPayload.ErrorType
package/core/Value.ts CHANGED
@@ -46,9 +46,6 @@ export declare namespace format {
46
46
  type ErrorType = Errors.GlobalErrorType
47
47
  }
48
48
 
49
- /* v8 ignore next */
50
- format.parseError = (error: unknown) => error as format.ErrorType
51
-
52
49
  /**
53
50
  * Formats a `bigint` Value (default: wei) to a string representation of Ether.
54
51
  *
@@ -75,9 +72,6 @@ export declare namespace formatEther {
75
72
  type ErrorType = format.ErrorType | Errors.GlobalErrorType
76
73
  }
77
74
 
78
- /* v8 ignore next */
79
- formatEther.parseError = (error: unknown) => error as formatEther.ErrorType
80
-
81
75
  /**
82
76
  * Formats a `bigint` Value (default: wei) to a string representation of Gwei.
83
77
  *
@@ -101,9 +95,6 @@ export declare namespace formatGwei {
101
95
  type ErrorType = format.ErrorType | Errors.GlobalErrorType
102
96
  }
103
97
 
104
- /* v8 ignore next */
105
- formatGwei.parseError = (error: unknown) => error as formatGwei.ErrorType
106
-
107
98
  /**
108
99
  * Parses a `string` representation of a Value to `bigint` (multiplied by the given exponent).
109
100
  *
@@ -165,9 +156,6 @@ export declare namespace from {
165
156
  type ErrorType = Errors.GlobalErrorType
166
157
  }
167
158
 
168
- /* v8 ignore next */
169
- from.parseError = (error: unknown) => error as from.ErrorType
170
-
171
159
  /**
172
160
  * Parses a string representation of Ether to a `bigint` Value (default: wei).
173
161
  *
@@ -194,9 +182,6 @@ export declare namespace fromEther {
194
182
  type ErrorType = from.ErrorType | Errors.GlobalErrorType
195
183
  }
196
184
 
197
- /* v8 ignore next */
198
- fromEther.parseError = (error: unknown) => error as fromEther.ErrorType
199
-
200
185
  /**
201
186
  * Parses a string representation of Gwei to a `bigint` Value (default: wei).
202
187
  *
@@ -220,9 +205,6 @@ export declare namespace fromGwei {
220
205
  type ErrorType = from.ErrorType | Errors.GlobalErrorType
221
206
  }
222
207
 
223
- /* v8 ignore next */
224
- fromGwei.parseError = (error: unknown) => error as fromGwei.ErrorType
225
-
226
208
  /**
227
209
  * Thrown when a value is not a valid decimal number.
228
210
  *
@@ -67,9 +67,10 @@ export async function createCredential(
67
67
  creationOptions,
68
68
  )) as internal.PublicKeyCredential
69
69
  if (!credential) throw new CredentialCreationFailedError()
70
- const publicKey = await internal.parseCredentialPublicKey(
71
- new Uint8Array((credential.response as any).getPublicKey()),
72
- )
70
+
71
+ const response = credential.response as AuthenticatorAttestationResponse
72
+ const publicKey = await internal.parseCredentialPublicKey(response)
73
+
73
74
  return {
74
75
  id: credential.id,
75
76
  publicKey,
@@ -99,13 +100,10 @@ export declare namespace createCredential {
99
100
 
100
101
  type ErrorType =
101
102
  | getCredentialCreationOptions.ErrorType
103
+ | internal.parseCredentialPublicKey.ErrorType
102
104
  | Errors.GlobalErrorType
103
105
  }
104
106
 
105
- createCredential.parseError = (error: unknown) =>
106
- /* v8 ignore next */
107
- error as createCredential.ErrorType
108
-
109
107
  /**
110
108
  * Gets the authenticator data which contains information about the
111
109
  * processing of an authenticator request (ie. from `WebAuthnP256.sign`).
@@ -156,10 +154,6 @@ export declare namespace getAuthenticatorData {
156
154
  type ErrorType = Errors.GlobalErrorType
157
155
  }
158
156
 
159
- getAuthenticatorData.parseError = (error: unknown) =>
160
- /* v8 ignore next */
161
- error as getAuthenticatorData.ErrorType
162
-
163
157
  /**
164
158
  * Constructs the Client Data in stringified JSON format which represents client data that
165
159
  * was passed to `credentials.get()` in {@link ox#WebAuthnP256.(sign:function)}.
@@ -219,10 +213,6 @@ export declare namespace getClientDataJSON {
219
213
  type ErrorType = Errors.GlobalErrorType
220
214
  }
221
215
 
222
- getClientDataJSON.parseError = (error: unknown) =>
223
- /* v8 ignore next */
224
- error as getClientDataJSON.ErrorType
225
-
226
216
  /**
227
217
  * Returns the creation options for a P256 WebAuthn Credential to be used with
228
218
  * the Web Authentication API.
@@ -361,10 +351,6 @@ export declare namespace getCredentialCreationOptions {
361
351
  | Errors.GlobalErrorType
362
352
  }
363
353
 
364
- getCredentialCreationOptions.parseError = (error: unknown) =>
365
- /* v8 ignore next */
366
- error as getCredentialCreationOptions.ErrorType
367
-
368
354
  /**
369
355
  * Returns the request options to sign a challenge with the Web Authentication API.
370
356
  *
@@ -430,9 +416,6 @@ export declare namespace getCredentialRequestOptions {
430
416
  | Errors.GlobalErrorType
431
417
  }
432
418
 
433
- getCredentialRequestOptions.parseError = (error: unknown) =>
434
- error as getCredentialRequestOptions.ErrorType
435
-
436
419
  /**
437
420
  * Constructs the final digest that was signed and computed by the authenticator. This payload includes
438
421
  * the cryptographic `challenge`, as well as authenticator metadata (`authenticatorData` + `clientDataJSON`).
@@ -557,10 +540,6 @@ export declare namespace getSignPayload {
557
540
  | Errors.GlobalErrorType
558
541
  }
559
542
 
560
- getSignPayload.parseError = (error: unknown) =>
561
- /* v8 ignore next */
562
- error as getSignPayload.ErrorType
563
-
564
543
  /**
565
544
  * Signs a challenge using a stored WebAuthn P256 Credential. If no Credential is provided,
566
545
  * a prompt will be displayed for the user to select an existing Credential
@@ -664,10 +643,6 @@ export declare namespace sign {
664
643
  | Errors.GlobalErrorType
665
644
  }
666
645
 
667
- sign.parseError = (error: unknown) =>
668
- /* v8 ignore next */
669
- error as sign.ErrorType
670
-
671
646
  /**
672
647
  * Verifies a signature using the Credential's public key and the challenge which was signed.
673
648
  *
@@ -776,10 +751,6 @@ export declare namespace verify {
776
751
  | Errors.GlobalErrorType
777
752
  }
778
753
 
779
- verify.parseError = (error: unknown) =>
780
- /* v8 ignore next */
781
- error as verify.ErrorType
782
-
783
754
  /** Thrown when a WebAuthn P256 credential creation fails. */
784
755
  export class CredentialCreationFailedError extends Errors.BaseError<Error> {
785
756
  override readonly name = 'WebAuthnP256.CredentialCreationFailedError'
@@ -68,10 +68,6 @@ export declare namespace createKeyPair {
68
68
  type ErrorType = PublicKey.from.ErrorType | Errors.GlobalErrorType
69
69
  }
70
70
 
71
- createKeyPair.parseError = (error: unknown) =>
72
- /* v8 ignore next */
73
- error as createKeyPair.ErrorType
74
-
75
71
  /**
76
72
  * Signs a payload with the provided `CryptoKey` private key and returns a P256 signature.
77
73
  *
@@ -124,10 +120,6 @@ export declare namespace sign {
124
120
  type ErrorType = Bytes.fromArray.ErrorType | Errors.GlobalErrorType
125
121
  }
126
122
 
127
- sign.parseError = (error: unknown) =>
128
- /* v8 ignore next */
129
- error as sign.ErrorType
130
-
131
123
  /**
132
124
  * Verifies a payload was signed by the provided public key.
133
125
  *
@@ -184,7 +176,3 @@ export declare namespace verify {
184
176
 
185
177
  type ErrorType = Errors.GlobalErrorType
186
178
  }
187
-
188
- verify.parseError = (error: unknown) =>
189
- /* v8 ignore next */
190
- error as verify.ErrorType
@@ -49,10 +49,6 @@ export declare namespace fromRpc {
49
49
  export type ErrorType = Errors.GlobalErrorType
50
50
  }
51
51
 
52
- fromRpc.parseError = (error: unknown) =>
53
- /* v8 ignore next */
54
- error as fromRpc.ErrorType
55
-
56
52
  /**
57
53
  * Converts a {@link ox#Withdrawal.Withdrawal} to an {@link ox#Withdrawal.Rpc}.
58
54
  *
@@ -89,7 +85,3 @@ export function toRpc(withdrawal: Withdrawal): Rpc {
89
85
  export declare namespace toRpc {
90
86
  export type ErrorType = Errors.GlobalErrorType
91
87
  }
92
-
93
- toRpc.parseError = (error: unknown) =>
94
- /* v8 ignore next */
95
- error as toRpc.ErrorType
@@ -101,6 +101,3 @@ export declare namespace from {
101
101
  }
102
102
 
103
103
  /** @internal */
104
- from.parseError = (error: unknown) =>
105
- /* v8 ignore next */
106
- error as from.ErrorType
@@ -49,9 +49,6 @@ export declare namespace withTimeout {
49
49
  }
50
50
 
51
51
  /** @internal */
52
- withTimeout.parseError = (error: unknown) =>
53
- /* v8 ignore next */
54
- error as withTimeout.ErrorType
55
52
 
56
53
  /**
57
54
  * Thrown when an operation times out.
@@ -67,8 +67,3 @@ export declare namespace create {
67
67
  | RpcResponse.parse.ErrorType
68
68
  | Errors.GlobalErrorType
69
69
  }
70
-
71
- /** @internal */
72
- create.parseError = (error: unknown) =>
73
- /* v8 ignore next */
74
- error as create.ErrorType
@@ -1,7 +1,8 @@
1
1
  import { p256 } from '@noble/curves/p256'
2
- import type * as Bytes from '../Bytes.js'
2
+ import type * as Errors from '../Errors.js'
3
3
  import * as Hex from '../Hex.js'
4
4
  import * as PublicKey from '../PublicKey.js'
5
+ import { CredentialCreationFailedError } from '../WebAuthnP256.js'
5
6
 
6
7
  /** @internal */
7
8
  export type AttestationConveyancePreference =
@@ -178,21 +179,61 @@ export function parseAsn1Signature(bytes: Uint8Array) {
178
179
  * @internal
179
180
  */
180
181
  export async function parseCredentialPublicKey(
181
- cPublicKey: Bytes.Bytes,
182
+ response: AuthenticatorAttestationResponse,
182
183
  ): Promise<PublicKey.PublicKey> {
183
- const cryptoKey = await crypto.subtle.importKey(
184
- 'spki',
185
- new Uint8Array(cPublicKey),
186
- {
187
- name: 'ECDSA',
188
- namedCurve: 'P-256',
189
- hash: 'SHA-256',
190
- },
191
- true,
192
- ['verify'],
193
- )
194
- const publicKey = new Uint8Array(
195
- await crypto.subtle.exportKey('raw', cryptoKey),
196
- )
197
- return PublicKey.from(publicKey)
184
+ try {
185
+ const publicKeyBuffer = response.getPublicKey()
186
+ if (!publicKeyBuffer) throw new CredentialCreationFailedError()
187
+
188
+ // Converting `publicKeyBuffer` throws when credential is created by 1Password Firefox Add-on
189
+ const publicKeyBytes = new Uint8Array(publicKeyBuffer)
190
+ const cryptoKey = await crypto.subtle.importKey(
191
+ 'spki',
192
+ new Uint8Array(publicKeyBytes),
193
+ {
194
+ name: 'ECDSA',
195
+ namedCurve: 'P-256',
196
+ hash: 'SHA-256',
197
+ },
198
+ true,
199
+ ['verify'],
200
+ )
201
+ const publicKey = new Uint8Array(
202
+ await crypto.subtle.exportKey('raw', cryptoKey),
203
+ )
204
+ return PublicKey.from(publicKey)
205
+ } catch (error) {
206
+ // Fallback for 1Password Firefox Add-on restricts access to certain credential properties
207
+ // so we need to use `attestationObject` to extract the public key.
208
+ // https://github.com/passwordless-id/webauthn/issues/50#issuecomment-2072902094
209
+ if ((error as Error).message !== 'Permission denied to access object')
210
+ throw error
211
+
212
+ const data = new Uint8Array(response.attestationObject)
213
+ const coordinateLength = 0x20
214
+ const cborPrefix = 0x58
215
+
216
+ const findStart = (key: number) => {
217
+ const coordinate = new Uint8Array([key, cborPrefix, coordinateLength])
218
+ for (let i = 0; i < data.length - coordinate.length; i++)
219
+ if (coordinate.every((byte, j) => data[i + j] === byte))
220
+ return i + coordinate.length
221
+ throw new CredentialCreationFailedError()
222
+ }
223
+
224
+ const xStart = findStart(0x21)
225
+ const yStart = findStart(0x22)
226
+
227
+ return PublicKey.from(
228
+ new Uint8Array([
229
+ 0x04,
230
+ ...data.slice(xStart, xStart + coordinateLength),
231
+ ...data.slice(yStart, yStart + coordinateLength),
232
+ ]),
233
+ )
234
+ }
235
+ }
236
+
237
+ export declare namespace parseCredentialPublicKey {
238
+ type ErrorType = CredentialCreationFailedError | Errors.GlobalErrorType
198
239
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ox",
3
3
  "description": "Ethereum Standard Library",
4
- "version": "0.1.7",
4
+ "version": "0.2.0",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
package/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** @internal */
2
- export const version = '0.1.7'
2
+ export const version = '0.2.0'