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.
- package/CHANGELOG.md +19 -0
- package/_cjs/core/AbiEvent.js +1 -1
- package/_cjs/core/AbiEvent.js.map +1 -1
- package/_cjs/core/AbiItem.js +1 -1
- package/_cjs/core/AbiItem.js.map +1 -1
- package/_cjs/core/AbiParameters.js +4 -4
- package/_cjs/core/AbiParameters.js.map +1 -1
- package/_cjs/core/Authorization.js.map +1 -1
- package/_cjs/core/Blobs.js +1 -1
- package/_cjs/core/Blobs.js.map +1 -1
- package/_cjs/core/Block.js.map +1 -1
- package/_cjs/core/Bytes.js +1 -1
- package/_cjs/core/Bytes.js.map +1 -1
- package/_cjs/core/ContractAddress.js.map +1 -1
- package/_cjs/core/HdKey.js.map +1 -1
- package/_cjs/core/Hex.js +1 -1
- package/_cjs/core/Hex.js.map +1 -1
- package/_cjs/core/Keystore.js.map +1 -1
- package/_cjs/core/Mnemonic.js +2 -2
- package/_cjs/core/Mnemonic.js.map +1 -1
- package/_cjs/core/P256.js +1 -1
- package/_cjs/core/P256.js.map +1 -1
- package/_cjs/core/Provider.js.map +1 -1
- package/_cjs/core/PublicKey.js +1 -1
- package/_cjs/core/PublicKey.js.map +1 -1
- package/_cjs/core/RpcTransport.js +1 -1
- package/_cjs/core/RpcTransport.js.map +1 -1
- package/_cjs/core/Secp256k1.js +1 -1
- package/_cjs/core/Secp256k1.js.map +1 -1
- package/_cjs/core/Signature.js.map +1 -1
- package/_cjs/core/Siwe.js +4 -4
- package/_cjs/core/Siwe.js.map +1 -1
- package/_cjs/core/Transaction.js.map +1 -1
- package/_cjs/core/TransactionEnvelope.js.map +1 -1
- package/_cjs/core/TransactionEnvelopeEip1559.js.map +1 -1
- package/_cjs/core/TransactionEnvelopeEip2930.js.map +1 -1
- package/_cjs/core/TransactionEnvelopeEip4844.js.map +1 -1
- package/_cjs/core/TransactionEnvelopeEip7702.js.map +1 -1
- package/_cjs/core/TransactionEnvelopeLegacy.js.map +1 -1
- package/_cjs/core/TransactionReceipt.js.map +1 -1
- package/_cjs/core/TypedData.js +3 -3
- package/_cjs/core/TypedData.js.map +1 -1
- package/_cjs/core/WebAuthnP256.js +1 -1
- package/_cjs/core/WebAuthnP256.js.map +1 -1
- package/_cjs/core/WebCryptoP256.js.map +1 -1
- package/_cjs/core/internal/abiParameters.js +4 -4
- package/_cjs/core/internal/abiParameters.js.map +1 -1
- package/_cjs/core/internal/promise.js.map +1 -1
- package/_cjs/erc4337/UserOperation.js.map +1 -1
- package/_cjs/erc6492/{WrappedSignature.js → SignatureErc6492.js} +9 -11
- package/_cjs/erc6492/SignatureErc6492.js.map +1 -0
- package/_cjs/erc6492/index.js +2 -2
- package/_cjs/erc8010/SignatureErc8010.js +93 -0
- package/_cjs/erc8010/SignatureErc8010.js.map +1 -0
- package/_cjs/erc8010/index.js +5 -0
- package/_cjs/erc8010/index.js.map +1 -0
- package/_cjs/index.docs.js +1 -0
- package/_cjs/index.docs.js.map +1 -1
- package/_cjs/index.js +6 -6
- package/_cjs/index.js.map +1 -1
- package/_cjs/trusted-setups/internal/paths.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/core/AbiEvent.js +1 -1
- package/_esm/core/AbiEvent.js.map +1 -1
- package/_esm/core/AbiItem.js +1 -1
- package/_esm/core/AbiItem.js.map +1 -1
- package/_esm/core/AbiParameters.js +4 -4
- package/_esm/core/AbiParameters.js.map +1 -1
- package/_esm/core/Authorization.js.map +1 -1
- package/_esm/core/Blobs.js +1 -1
- package/_esm/core/Blobs.js.map +1 -1
- package/_esm/core/Block.js.map +1 -1
- package/_esm/core/Bytes.js +1 -1
- package/_esm/core/Bytes.js.map +1 -1
- package/_esm/core/ContractAddress.js.map +1 -1
- package/_esm/core/HdKey.js.map +1 -1
- package/_esm/core/Hex.js +1 -1
- package/_esm/core/Hex.js.map +1 -1
- package/_esm/core/Keystore.js +3 -2
- package/_esm/core/Keystore.js.map +1 -1
- package/_esm/core/Mnemonic.js +1 -1
- package/_esm/core/Mnemonic.js.map +1 -1
- package/_esm/core/P256.js +1 -1
- package/_esm/core/P256.js.map +1 -1
- package/_esm/core/Provider.js.map +1 -1
- package/_esm/core/PublicKey.js +1 -1
- package/_esm/core/PublicKey.js.map +1 -1
- package/_esm/core/RpcTransport.js +1 -1
- package/_esm/core/RpcTransport.js.map +1 -1
- package/_esm/core/Secp256k1.js +1 -1
- package/_esm/core/Secp256k1.js.map +1 -1
- package/_esm/core/Signature.js.map +1 -1
- package/_esm/core/Siwe.js +4 -4
- package/_esm/core/Siwe.js.map +1 -1
- package/_esm/core/Transaction.js.map +1 -1
- package/_esm/core/TransactionEnvelope.js.map +1 -1
- package/_esm/core/TransactionEnvelopeEip1559.js.map +1 -1
- package/_esm/core/TransactionEnvelopeEip2930.js.map +1 -1
- package/_esm/core/TransactionEnvelopeEip4844.js.map +1 -1
- package/_esm/core/TransactionEnvelopeEip7702.js.map +1 -1
- package/_esm/core/TransactionEnvelopeLegacy.js.map +1 -1
- package/_esm/core/TransactionReceipt.js.map +1 -1
- package/_esm/core/TypedData.js +3 -3
- package/_esm/core/TypedData.js.map +1 -1
- package/_esm/core/WebAuthnP256.js +1 -1
- package/_esm/core/WebAuthnP256.js.map +1 -1
- package/_esm/core/WebCryptoP256.js.map +1 -1
- package/_esm/core/internal/abiParameters.js +4 -4
- package/_esm/core/internal/abiParameters.js.map +1 -1
- package/_esm/core/internal/promise.js.map +1 -1
- package/_esm/erc4337/UserOperation.js.map +1 -1
- package/_esm/erc6492/{WrappedSignature.js → SignatureErc6492.js} +18 -20
- package/_esm/erc6492/SignatureErc6492.js.map +1 -0
- package/_esm/erc6492/index.js +3 -3
- package/_esm/erc8010/SignatureErc8010.js +182 -0
- package/_esm/erc8010/SignatureErc8010.js.map +1 -0
- package/_esm/erc8010/index.js +40 -0
- package/_esm/erc8010/index.js.map +1 -0
- package/_esm/index.docs.js +2 -0
- package/_esm/index.docs.js.map +1 -1
- package/_esm/index.js +236 -236
- package/_esm/index.js.map +1 -1
- package/_esm/trusted-setups/internal/paths.js +1 -0
- package/_esm/trusted-setups/internal/paths.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/core/AbiEvent.d.ts +1 -2
- package/_types/core/AbiEvent.d.ts.map +1 -1
- package/_types/core/AbiParameters.d.ts.map +1 -1
- package/_types/core/Authorization.d.ts +1 -1
- package/_types/core/Authorization.d.ts.map +1 -1
- package/_types/core/Blobs.d.ts +1 -1
- package/_types/core/Blobs.d.ts.map +1 -1
- package/_types/core/Block.d.ts +1 -1
- package/_types/core/Block.d.ts.map +1 -1
- package/_types/core/Bytes.d.ts.map +1 -1
- package/_types/core/ContractAddress.d.ts +1 -1
- package/_types/core/ContractAddress.d.ts.map +1 -1
- package/_types/core/HdKey.d.ts +1 -1
- package/_types/core/HdKey.d.ts.map +1 -1
- package/_types/core/Hex.d.ts.map +1 -1
- package/_types/core/Keystore.d.ts.map +1 -1
- package/_types/core/Mnemonic.d.ts +1 -1
- package/_types/core/Mnemonic.d.ts.map +1 -1
- package/_types/core/P256.d.ts.map +1 -1
- package/_types/core/Provider.d.ts +2 -2
- package/_types/core/Provider.d.ts.map +1 -1
- package/_types/core/PublicKey.d.ts.map +1 -1
- package/_types/core/RpcRequest.d.ts +1 -1
- package/_types/core/RpcRequest.d.ts.map +1 -1
- package/_types/core/RpcTransport.d.ts +2 -2
- package/_types/core/RpcTransport.d.ts.map +1 -1
- package/_types/core/Secp256k1.d.ts +1 -1
- package/_types/core/Secp256k1.d.ts.map +1 -1
- package/_types/core/Signature.d.ts.map +1 -1
- package/_types/core/Siwe.d.ts.map +1 -1
- package/_types/core/Transaction.d.ts +1 -2
- package/_types/core/Transaction.d.ts.map +1 -1
- package/_types/core/TransactionEnvelope.d.ts.map +1 -1
- package/_types/core/TransactionEnvelopeEip1559.d.ts +1 -1
- package/_types/core/TransactionEnvelopeEip1559.d.ts.map +1 -1
- package/_types/core/TransactionEnvelopeEip2930.d.ts +1 -1
- package/_types/core/TransactionEnvelopeEip2930.d.ts.map +1 -1
- package/_types/core/TransactionEnvelopeEip4844.d.ts +1 -1
- package/_types/core/TransactionEnvelopeEip4844.d.ts.map +1 -1
- package/_types/core/TransactionEnvelopeEip7702.d.ts +1 -3
- package/_types/core/TransactionEnvelopeEip7702.d.ts.map +1 -1
- package/_types/core/TransactionEnvelopeLegacy.d.ts +1 -1
- package/_types/core/TransactionEnvelopeLegacy.d.ts.map +1 -1
- package/_types/core/TransactionReceipt.d.ts +1 -1
- package/_types/core/TransactionReceipt.d.ts.map +1 -1
- package/_types/core/TypedData.d.ts +1 -1
- package/_types/core/TypedData.d.ts.map +1 -1
- package/_types/core/WebAuthnP256.d.ts +2 -2
- package/_types/core/WebAuthnP256.d.ts.map +1 -1
- package/_types/core/WebCryptoP256.d.ts +1 -1
- package/_types/core/WebCryptoP256.d.ts.map +1 -1
- package/_types/core/internal/abiParameters.d.ts +1 -1
- package/_types/core/internal/abiParameters.d.ts.map +1 -1
- package/_types/core/internal/promise.d.ts.map +1 -1
- package/_types/core/internal/register.d.ts +1 -2
- package/_types/core/internal/register.d.ts.map +1 -1
- package/_types/erc4337/UserOperation.d.ts +1 -1
- package/_types/erc4337/UserOperation.d.ts.map +1 -1
- package/_types/erc6492/{WrappedSignature.d.ts → SignatureErc6492.d.ts} +28 -26
- package/_types/erc6492/SignatureErc6492.d.ts.map +1 -0
- package/_types/erc6492/index.d.ts +3 -3
- package/_types/erc8010/SignatureErc8010.d.ts +138 -0
- package/_types/erc8010/SignatureErc8010.d.ts.map +1 -0
- package/_types/erc8010/index.d.ts +42 -0
- package/_types/erc8010/index.d.ts.map +1 -0
- package/_types/index.d.ts +237 -237
- package/_types/index.d.ts.map +1 -1
- package/_types/index.docs.d.ts +1 -0
- package/_types/index.docs.d.ts.map +1 -1
- package/_types/trusted-setups/internal/paths.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/core/AbiEvent.ts +3 -4
- package/core/AbiItem.ts +1 -1
- package/core/AbiParameters.ts +4 -4
- package/core/Authorization.ts +1 -1
- package/core/Blobs.ts +1 -1
- package/core/Block.ts +1 -1
- package/core/Bytes.ts +1 -1
- package/core/ContractAddress.ts +1 -1
- package/core/HdKey.ts +1 -1
- package/core/Hex.ts +1 -1
- package/core/Keystore.ts +3 -2
- package/core/Mnemonic.ts +1 -1
- package/core/P256.ts +1 -1
- package/core/Provider.ts +2 -2
- package/core/PublicKey.ts +2 -2
- package/core/RpcRequest.ts +1 -1
- package/core/RpcTransport.ts +3 -3
- package/core/Secp256k1.ts +2 -2
- package/core/Signature.ts +1 -1
- package/core/Siwe.ts +4 -5
- package/core/Transaction.ts +1 -2
- package/core/TransactionEnvelope.ts +1 -1
- package/core/TransactionEnvelopeEip1559.ts +3 -3
- package/core/TransactionEnvelopeEip2930.ts +3 -3
- package/core/TransactionEnvelopeEip4844.ts +5 -5
- package/core/TransactionEnvelopeEip7702.ts +6 -5
- package/core/TransactionEnvelopeLegacy.ts +3 -3
- package/core/TransactionReceipt.ts +1 -1
- package/core/TypedData.ts +4 -4
- package/core/WebAuthnP256.ts +2 -2
- package/core/WebCryptoP256.ts +1 -1
- package/core/internal/abiParameters.ts +5 -5
- package/core/internal/promise.ts +3 -1
- package/core/internal/register.ts +1 -2
- package/erc4337/UserOperation.ts +1 -1
- package/erc6492/SignatureErc6492/package.json +6 -0
- package/erc6492/{WrappedSignature.ts → SignatureErc6492.ts} +31 -30
- package/erc6492/index.ts +3 -3
- package/erc8010/SignatureErc8010/package.json +6 -0
- package/erc8010/SignatureErc8010.ts +227 -0
- package/erc8010/index.ts +43 -0
- package/erc8010/package.json +6 -0
- package/index.docs.ts +2 -0
- package/index.ts +237 -261
- package/package.json +15 -5
- package/trusted-setups/internal/paths.ts +1 -0
- package/version.ts +1 -1
- package/_cjs/erc6492/WrappedSignature.js.map +0 -1
- package/_esm/erc6492/WrappedSignature.js.map +0 -1
- package/_types/erc6492/WrappedSignature.d.ts.map +0 -1
- 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()
|
package/core/ContractAddress.ts
CHANGED
|
@@ -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
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 (
|
|
434
|
+
} catch (_error) {
|
|
435
435
|
return false
|
|
436
436
|
}
|
|
437
437
|
}
|
package/core/RpcRequest.ts
CHANGED
|
@@ -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> =
|
package/core/RpcTransport.ts
CHANGED
|
@@ -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 (
|
|
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
|
|
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
|
|
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
|
|
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
|
|
package/core/Transaction.ts
CHANGED
|
@@ -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
|
}
|
package/core/WebAuthnP256.ts
CHANGED
|
@@ -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 = {
|
package/core/WebCryptoP256.ts
CHANGED
|
@@ -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) }
|
package/core/internal/promise.ts
CHANGED
|
@@ -34,7 +34,9 @@ export function withTimeout<data>(
|
|
|
34
34
|
export declare namespace withTimeout {
|
|
35
35
|
type Fn<data> = ({
|
|
36
36
|
signal,
|
|
37
|
-
}: {
|
|
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.
|
package/erc4337/UserOperation.ts
CHANGED
|
@@ -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. */
|