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/_types/index.d.ts
CHANGED
|
@@ -1372,6 +1372,10 @@ export * as Ed25519 from './core/Ed25519.js';
|
|
|
1372
1372
|
*/
|
|
1373
1373
|
export * as Ens from './core/Ens.js';
|
|
1374
1374
|
export * as Errors from './core/Errors.js';
|
|
1375
|
+
/**
|
|
1376
|
+
* @category Execution Spec
|
|
1377
|
+
*/
|
|
1378
|
+
export * as Fee from './core/Fee.js';
|
|
1375
1379
|
/**
|
|
1376
1380
|
* Utilities & types for working with Filters as defined in the [Execution API specification](https://github.com/ethereum/execution-apis/blob/main/src/schemas/filter.yaml)
|
|
1377
1381
|
*
|
|
@@ -1519,10 +1523,7 @@ export * as HdKey from './core/HdKey.js';
|
|
|
1519
1523
|
* @category Data
|
|
1520
1524
|
*/
|
|
1521
1525
|
export * as Hex from './core/Hex.js';
|
|
1522
|
-
|
|
1523
|
-
* @category Execution Spec
|
|
1524
|
-
*/
|
|
1525
|
-
export * as Fee from './core/Fee.js';
|
|
1526
|
+
export type { Register } from './core/internal/register.js';
|
|
1526
1527
|
/**
|
|
1527
1528
|
* Utility functions for working with JSON (with support for `bigint`).
|
|
1528
1529
|
*
|
|
@@ -1745,6 +1746,78 @@ export * as Log from './core/Log.js';
|
|
|
1745
1746
|
* @category Crypto
|
|
1746
1747
|
*/
|
|
1747
1748
|
export * as Mnemonic from './core/Mnemonic.js';
|
|
1749
|
+
/**
|
|
1750
|
+
* Utility functions for [NIST P256](https://csrc.nist.gov/csrc/media/events/workshop-on-elliptic-curve-cryptography-standards/documents/papers/session6-adalier-mehmet.pdf) ECDSA cryptography.
|
|
1751
|
+
*
|
|
1752
|
+
* :::info
|
|
1753
|
+
*
|
|
1754
|
+
* The `P256` module is a friendly wrapper over [`@noble/curves/p256`](https://github.com/paulmillr/noble-curves), an **audited** implementation of [P256](https://www.secg.org/sec2-v2.pdf)
|
|
1755
|
+
*
|
|
1756
|
+
* :::
|
|
1757
|
+
*
|
|
1758
|
+
* @example
|
|
1759
|
+
* ### Computing a Random Private Key
|
|
1760
|
+
*
|
|
1761
|
+
* A random private key can be computed using {@link ox#P256.(randomPrivateKey:function)}:
|
|
1762
|
+
*
|
|
1763
|
+
* ```ts twoslash
|
|
1764
|
+
* import { P256 } from 'ox'
|
|
1765
|
+
*
|
|
1766
|
+
* const privateKey = P256.randomPrivateKey()
|
|
1767
|
+
* // @log: '0x...'
|
|
1768
|
+
* ```
|
|
1769
|
+
*
|
|
1770
|
+
* @example
|
|
1771
|
+
* ### Getting a Public Key
|
|
1772
|
+
*
|
|
1773
|
+
* A public key can be derived from a private key using {@link ox#P256.(getPublicKey:function)}:
|
|
1774
|
+
*
|
|
1775
|
+
* ```ts twoslash
|
|
1776
|
+
* import { P256 } from 'ox'
|
|
1777
|
+
*
|
|
1778
|
+
* const privateKey = P256.randomPrivateKey()
|
|
1779
|
+
*
|
|
1780
|
+
* const publicKey = P256.getPublicKey({ privateKey }) // [!code focus]
|
|
1781
|
+
* // @log: { x: 3251...5152n, y: 1251...5152n }
|
|
1782
|
+
* ```
|
|
1783
|
+
*
|
|
1784
|
+
* @example
|
|
1785
|
+
* ### Signing a Payload
|
|
1786
|
+
*
|
|
1787
|
+
* A payload can be signed using {@link ox#P256.(sign:function)}:
|
|
1788
|
+
*
|
|
1789
|
+
* ```ts twoslash
|
|
1790
|
+
* import { P256 } from 'ox'
|
|
1791
|
+
*
|
|
1792
|
+
* const privateKey = P256.randomPrivateKey()
|
|
1793
|
+
*
|
|
1794
|
+
* const signature = P256.sign({ payload: '0xdeadbeef', privateKey }) // [!code focus]
|
|
1795
|
+
* // @log: { r: 1251...5152n, s: 1251...5152n, yParity: 1 }
|
|
1796
|
+
* ```
|
|
1797
|
+
*
|
|
1798
|
+
* @example
|
|
1799
|
+
* ### Verifying a Signature
|
|
1800
|
+
*
|
|
1801
|
+
* A signature can be verified using {@link ox#P256.(verify:function)}:
|
|
1802
|
+
*
|
|
1803
|
+
* ```ts twoslash
|
|
1804
|
+
* import { P256 } from 'ox'
|
|
1805
|
+
*
|
|
1806
|
+
* const privateKey = P256.randomPrivateKey()
|
|
1807
|
+
* const publicKey = P256.getPublicKey({ privateKey })
|
|
1808
|
+
* const signature = P256.sign({ payload: '0xdeadbeef', privateKey })
|
|
1809
|
+
*
|
|
1810
|
+
* const isValid = P256.verify({ // [!code focus]
|
|
1811
|
+
* payload: '0xdeadbeef', // [!code focus]
|
|
1812
|
+
* publicKey, // [!code focus]
|
|
1813
|
+
* signature, // [!code focus]
|
|
1814
|
+
* }) // [!code focus]
|
|
1815
|
+
* // @log: true
|
|
1816
|
+
* ```
|
|
1817
|
+
*
|
|
1818
|
+
* @category Crypto
|
|
1819
|
+
*/
|
|
1820
|
+
export * as P256 from './core/P256.js';
|
|
1748
1821
|
/**
|
|
1749
1822
|
* Utilities & types for working with [EIP-191 Personal Messages](https://eips.ethereum.org/EIPS/eip-191#version-0x45-e)
|
|
1750
1823
|
*
|
|
@@ -1888,7 +1961,6 @@ export * as Provider from './core/Provider.js';
|
|
|
1888
1961
|
* @category Crypto
|
|
1889
1962
|
*/
|
|
1890
1963
|
export * as PublicKey from './core/PublicKey.js';
|
|
1891
|
-
export type { Register } from './core/internal/register.js';
|
|
1892
1964
|
/**
|
|
1893
1965
|
* Utility functions for encoding and decoding [Recursive Length Prefix](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/) structures.
|
|
1894
1966
|
*
|
|
@@ -1906,12 +1978,6 @@ export type { Register } from './core/internal/register.js';
|
|
|
1906
1978
|
* @category Data
|
|
1907
1979
|
*/
|
|
1908
1980
|
export * as Rlp from './core/Rlp.js';
|
|
1909
|
-
/**
|
|
1910
|
-
* Utility types for working with Ethereum JSON-RPC namespaces & schemas.
|
|
1911
|
-
*
|
|
1912
|
-
* @category JSON-RPC
|
|
1913
|
-
*/
|
|
1914
|
-
export * as RpcSchema from './core/RpcSchema.js';
|
|
1915
1981
|
/**
|
|
1916
1982
|
* Utility types & functions for working with [JSON-RPC 2.0 Requests](https://www.jsonrpc.org/specification#request_object) and Ethereum JSON-RPC methods as
|
|
1917
1983
|
* defined on the [Ethereum API specification](https://github.com/ethereum/execution-apis)
|
|
@@ -2028,6 +2094,12 @@ export * as RpcRequest from './core/RpcRequest.js';
|
|
|
2028
2094
|
* @category JSON-RPC
|
|
2029
2095
|
*/
|
|
2030
2096
|
export * as RpcResponse from './core/RpcResponse.js';
|
|
2097
|
+
/**
|
|
2098
|
+
* Utility types for working with Ethereum JSON-RPC namespaces & schemas.
|
|
2099
|
+
*
|
|
2100
|
+
* @category JSON-RPC
|
|
2101
|
+
*/
|
|
2102
|
+
export * as RpcSchema from './core/RpcSchema.js';
|
|
2031
2103
|
/**
|
|
2032
2104
|
* Utility functions for working with JSON-RPC Transports.
|
|
2033
2105
|
*
|
|
@@ -2125,78 +2197,6 @@ export * as RpcTransport from './core/RpcTransport.js';
|
|
|
2125
2197
|
* @category Crypto
|
|
2126
2198
|
*/
|
|
2127
2199
|
export * as Secp256k1 from './core/Secp256k1.js';
|
|
2128
|
-
/**
|
|
2129
|
-
* Utility functions for [NIST P256](https://csrc.nist.gov/csrc/media/events/workshop-on-elliptic-curve-cryptography-standards/documents/papers/session6-adalier-mehmet.pdf) ECDSA cryptography.
|
|
2130
|
-
*
|
|
2131
|
-
* :::info
|
|
2132
|
-
*
|
|
2133
|
-
* The `P256` module is a friendly wrapper over [`@noble/curves/p256`](https://github.com/paulmillr/noble-curves), an **audited** implementation of [P256](https://www.secg.org/sec2-v2.pdf)
|
|
2134
|
-
*
|
|
2135
|
-
* :::
|
|
2136
|
-
*
|
|
2137
|
-
* @example
|
|
2138
|
-
* ### Computing a Random Private Key
|
|
2139
|
-
*
|
|
2140
|
-
* A random private key can be computed using {@link ox#P256.(randomPrivateKey:function)}:
|
|
2141
|
-
*
|
|
2142
|
-
* ```ts twoslash
|
|
2143
|
-
* import { P256 } from 'ox'
|
|
2144
|
-
*
|
|
2145
|
-
* const privateKey = P256.randomPrivateKey()
|
|
2146
|
-
* // @log: '0x...'
|
|
2147
|
-
* ```
|
|
2148
|
-
*
|
|
2149
|
-
* @example
|
|
2150
|
-
* ### Getting a Public Key
|
|
2151
|
-
*
|
|
2152
|
-
* A public key can be derived from a private key using {@link ox#P256.(getPublicKey:function)}:
|
|
2153
|
-
*
|
|
2154
|
-
* ```ts twoslash
|
|
2155
|
-
* import { P256 } from 'ox'
|
|
2156
|
-
*
|
|
2157
|
-
* const privateKey = P256.randomPrivateKey()
|
|
2158
|
-
*
|
|
2159
|
-
* const publicKey = P256.getPublicKey({ privateKey }) // [!code focus]
|
|
2160
|
-
* // @log: { x: 3251...5152n, y: 1251...5152n }
|
|
2161
|
-
* ```
|
|
2162
|
-
*
|
|
2163
|
-
* @example
|
|
2164
|
-
* ### Signing a Payload
|
|
2165
|
-
*
|
|
2166
|
-
* A payload can be signed using {@link ox#P256.(sign:function)}:
|
|
2167
|
-
*
|
|
2168
|
-
* ```ts twoslash
|
|
2169
|
-
* import { P256 } from 'ox'
|
|
2170
|
-
*
|
|
2171
|
-
* const privateKey = P256.randomPrivateKey()
|
|
2172
|
-
*
|
|
2173
|
-
* const signature = P256.sign({ payload: '0xdeadbeef', privateKey }) // [!code focus]
|
|
2174
|
-
* // @log: { r: 1251...5152n, s: 1251...5152n, yParity: 1 }
|
|
2175
|
-
* ```
|
|
2176
|
-
*
|
|
2177
|
-
* @example
|
|
2178
|
-
* ### Verifying a Signature
|
|
2179
|
-
*
|
|
2180
|
-
* A signature can be verified using {@link ox#P256.(verify:function)}:
|
|
2181
|
-
*
|
|
2182
|
-
* ```ts twoslash
|
|
2183
|
-
* import { P256 } from 'ox'
|
|
2184
|
-
*
|
|
2185
|
-
* const privateKey = P256.randomPrivateKey()
|
|
2186
|
-
* const publicKey = P256.getPublicKey({ privateKey })
|
|
2187
|
-
* const signature = P256.sign({ payload: '0xdeadbeef', privateKey })
|
|
2188
|
-
*
|
|
2189
|
-
* const isValid = P256.verify({ // [!code focus]
|
|
2190
|
-
* payload: '0xdeadbeef', // [!code focus]
|
|
2191
|
-
* publicKey, // [!code focus]
|
|
2192
|
-
* signature, // [!code focus]
|
|
2193
|
-
* }) // [!code focus]
|
|
2194
|
-
* // @log: true
|
|
2195
|
-
* ```
|
|
2196
|
-
*
|
|
2197
|
-
* @category Crypto
|
|
2198
|
-
*/
|
|
2199
|
-
export * as P256 from './core/P256.js';
|
|
2200
2200
|
/**
|
|
2201
2201
|
* Utility functions for working with ECDSA signatures.
|
|
2202
2202
|
*
|
|
@@ -2391,160 +2391,6 @@ export * as Transaction from './core/Transaction.js';
|
|
|
2391
2391
|
* @category Transaction Envelopes
|
|
2392
2392
|
*/
|
|
2393
2393
|
export * as TransactionEnvelope from './core/TransactionEnvelope.js';
|
|
2394
|
-
/**
|
|
2395
|
-
* Utility functions for working
|
|
2396
|
-
* with **Legacy Transaction Envelopes**.
|
|
2397
|
-
*
|
|
2398
|
-
* @example
|
|
2399
|
-
* ### Instantiating
|
|
2400
|
-
*
|
|
2401
|
-
* Transaction Envelopes can be instantiated using {@link ox#TransactionEnvelopeLegacy.(from:function)}:
|
|
2402
|
-
*
|
|
2403
|
-
* ```ts twoslash
|
|
2404
|
-
* import { TransactionEnvelopeLegacy, Value } from 'ox'
|
|
2405
|
-
*
|
|
2406
|
-
* const envelope = TransactionEnvelopeLegacy.from({
|
|
2407
|
-
* gasPrice: Value.fromGwei('10'),
|
|
2408
|
-
* to: '0x0000000000000000000000000000000000000000',
|
|
2409
|
-
* value: Value.fromEther('1'),
|
|
2410
|
-
* })
|
|
2411
|
-
* ```
|
|
2412
|
-
*
|
|
2413
|
-
* * @example
|
|
2414
|
-
* ### Signing
|
|
2415
|
-
*
|
|
2416
|
-
* Transaction Envelopes can be signed using {@link ox#TransactionEnvelopeLegacy.(getSignPayload:function)} and a signing function such as {@link ox#Secp256k1.(sign:function)} or {@link ox#P256.(sign:function)}:
|
|
2417
|
-
*
|
|
2418
|
-
* ```ts twoslash
|
|
2419
|
-
* // @noErrors
|
|
2420
|
-
* import { Secp256k1, TransactionEnvelopeLegacy } from 'ox'
|
|
2421
|
-
*
|
|
2422
|
-
* const envelope = TransactionEnvelopeLegacy.from({
|
|
2423
|
-
* nonce: 0n,
|
|
2424
|
-
* gasPrice: 1000000000n,
|
|
2425
|
-
* gas: 21000n,
|
|
2426
|
-
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
2427
|
-
* value: 1000000000000000000n,
|
|
2428
|
-
* })
|
|
2429
|
-
*
|
|
2430
|
-
* const signature = Secp256k1.sign({ // [!code focus]
|
|
2431
|
-
* payload: TransactionEnvelopeLegacy.getSignPayload(envelope), // [!code focus]
|
|
2432
|
-
* privateKey: '0x...' // [!code focus]
|
|
2433
|
-
* }) // [!code focus]
|
|
2434
|
-
*
|
|
2435
|
-
* const envelope_signed = TransactionEnvelopeLegacy.from(envelope, { signature })
|
|
2436
|
-
* ```
|
|
2437
|
-
*
|
|
2438
|
-
* @example
|
|
2439
|
-
* ### Serializing
|
|
2440
|
-
*
|
|
2441
|
-
* Transaction Envelopes can be serialized using {@link ox#TransactionEnvelopeLegacy.(serialize:function)}:
|
|
2442
|
-
*
|
|
2443
|
-
* ```ts twoslash
|
|
2444
|
-
* import { TransactionEnvelopeLegacy, Value } from 'ox'
|
|
2445
|
-
*
|
|
2446
|
-
* const envelope = TransactionEnvelopeLegacy.from({
|
|
2447
|
-
* chainId: 1,
|
|
2448
|
-
* gasPrice: Value.fromGwei('10'),
|
|
2449
|
-
* to: '0x0000000000000000000000000000000000000000',
|
|
2450
|
-
* value: Value.fromEther('1'),
|
|
2451
|
-
* })
|
|
2452
|
-
*
|
|
2453
|
-
* const serialized = TransactionEnvelopeLegacy.serialize(envelope) // [!code focus]
|
|
2454
|
-
* ```
|
|
2455
|
-
*
|
|
2456
|
-
* @example
|
|
2457
|
-
* ### Sending
|
|
2458
|
-
*
|
|
2459
|
-
* We can send a Transaction Envelope to the network by serializing the signed envelope with `.serialize`, and then broadcasting it over JSON-RPC with `eth_sendRawTransaction`.
|
|
2460
|
-
*
|
|
2461
|
-
* In this example, we will use {@link ox#RpcTransport.(fromHttp:function)} to broadcast a `eth_sendRawTransaction` request over HTTP JSON-RPC.
|
|
2462
|
-
*
|
|
2463
|
-
* ```ts twoslash
|
|
2464
|
-
* import { RpcTransport, TransactionEnvelopeLegacy, Secp256k1, Value } from 'ox'
|
|
2465
|
-
*
|
|
2466
|
-
* // Construct the Envelope.
|
|
2467
|
-
* const envelope = TransactionEnvelopeLegacy.from({
|
|
2468
|
-
* chainId: 1,
|
|
2469
|
-
* gasPrice: Value.fromGwei('10'),
|
|
2470
|
-
* nonce: 69n,
|
|
2471
|
-
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
2472
|
-
* value: Value.fromEther('1.5'),
|
|
2473
|
-
* })
|
|
2474
|
-
*
|
|
2475
|
-
* // Sign over the Envelope.
|
|
2476
|
-
* const signature = Secp256k1.sign({
|
|
2477
|
-
* payload: TransactionEnvelopeLegacy.getSignPayload(envelope),
|
|
2478
|
-
* privateKey: '0x...',
|
|
2479
|
-
* })
|
|
2480
|
-
*
|
|
2481
|
-
* // Serialize the Envelope with the Signature. // [!code focus]
|
|
2482
|
-
* const serialized = TransactionEnvelopeLegacy.serialize(envelope, { // [!code focus]
|
|
2483
|
-
* signature // [!code focus]
|
|
2484
|
-
* }) // [!code focus]
|
|
2485
|
-
*
|
|
2486
|
-
* // Broadcast the Envelope with `eth_sendRawTransaction`. // [!code focus]
|
|
2487
|
-
* const transport = RpcTransport.fromHttp('https://1.rpc.thirdweb.com') // [!code focus]
|
|
2488
|
-
* const hash = await transport.request({ // [!code focus]
|
|
2489
|
-
* method: 'eth_sendRawTransaction', // [!code focus]
|
|
2490
|
-
* params: [serialized], // [!code focus]
|
|
2491
|
-
* }) // [!code focus]
|
|
2492
|
-
* ```
|
|
2493
|
-
*
|
|
2494
|
-
* If you are interfacing with an RPC that supports `eth_sendTransaction`, you can also use
|
|
2495
|
-
* {@link ox#TransactionEnvelopeLegacy.(toRpc:function)} to convert an Envelope to an RPC-compatible format.
|
|
2496
|
-
* This means you can skip the ceremony of manually filling & signing the Transaction.
|
|
2497
|
-
*
|
|
2498
|
-
* ```ts twoslash
|
|
2499
|
-
* import 'ox/window'
|
|
2500
|
-
* import { Provider, TransactionEnvelopeLegacy, Value } from 'ox'
|
|
2501
|
-
*
|
|
2502
|
-
* const envelope = TransactionEnvelopeLegacy.from({
|
|
2503
|
-
* chainId: 1,
|
|
2504
|
-
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
2505
|
-
* value: Value.fromEther('1.5'),
|
|
2506
|
-
* })
|
|
2507
|
-
*
|
|
2508
|
-
* const envelope_rpc = TransactionEnvelopeLegacy.toRpc(envelope)
|
|
2509
|
-
*
|
|
2510
|
-
* const provider = Provider.from(window.ethereum)
|
|
2511
|
-
* const hash = await provider.request({
|
|
2512
|
-
* method: 'eth_sendTransaction',
|
|
2513
|
-
* params: [envelope_rpc],
|
|
2514
|
-
* })
|
|
2515
|
-
* ```
|
|
2516
|
-
*
|
|
2517
|
-
* @example
|
|
2518
|
-
* ### Computing Hashes
|
|
2519
|
-
*
|
|
2520
|
-
* Transaction Hashes can be computed using {@link ox#TransactionEnvelopeLegacy.(hash:function)}:
|
|
2521
|
-
*
|
|
2522
|
-
* ```ts twoslash
|
|
2523
|
-
* import { Secp256k1, TransactionEnvelopeLegacy } from 'ox'
|
|
2524
|
-
*
|
|
2525
|
-
* const envelope = TransactionEnvelopeLegacy.from({
|
|
2526
|
-
* chainId: 1,
|
|
2527
|
-
* nonce: 0n,
|
|
2528
|
-
* gasPrice: 1000000000n,
|
|
2529
|
-
* gas: 21000n,
|
|
2530
|
-
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
2531
|
-
* value: 1000000000000000000n,
|
|
2532
|
-
* data: '0x',
|
|
2533
|
-
* })
|
|
2534
|
-
*
|
|
2535
|
-
* const signature = Secp256k1.sign({
|
|
2536
|
-
* payload: TransactionEnvelopeLegacy.getSignPayload(envelope),
|
|
2537
|
-
* privateKey: '0x...'
|
|
2538
|
-
* })
|
|
2539
|
-
*
|
|
2540
|
-
* const envelope_signed = TransactionEnvelopeLegacy.from(envelope, { signature })
|
|
2541
|
-
*
|
|
2542
|
-
* const hash = TransactionEnvelopeLegacy.hash(envelope_signed) // [!code focus]
|
|
2543
|
-
* ```
|
|
2544
|
-
*
|
|
2545
|
-
* @category Transaction Envelopes
|
|
2546
|
-
*/
|
|
2547
|
-
export * as TransactionEnvelopeLegacy from './core/TransactionEnvelopeLegacy.js';
|
|
2548
2394
|
/**
|
|
2549
2395
|
* Utility functions for working with [EIP-1559 Typed Transaction Envelopes](https://eips.ethereum.org/EIPS/eip-1559)
|
|
2550
2396
|
*
|
|
@@ -3184,6 +3030,160 @@ export * as TransactionEnvelopeEip4844 from './core/TransactionEnvelopeEip4844.j
|
|
|
3184
3030
|
* @category Transaction Envelopes
|
|
3185
3031
|
*/
|
|
3186
3032
|
export * as TransactionEnvelopeEip7702 from './core/TransactionEnvelopeEip7702.js';
|
|
3033
|
+
/**
|
|
3034
|
+
* Utility functions for working
|
|
3035
|
+
* with **Legacy Transaction Envelopes**.
|
|
3036
|
+
*
|
|
3037
|
+
* @example
|
|
3038
|
+
* ### Instantiating
|
|
3039
|
+
*
|
|
3040
|
+
* Transaction Envelopes can be instantiated using {@link ox#TransactionEnvelopeLegacy.(from:function)}:
|
|
3041
|
+
*
|
|
3042
|
+
* ```ts twoslash
|
|
3043
|
+
* import { TransactionEnvelopeLegacy, Value } from 'ox'
|
|
3044
|
+
*
|
|
3045
|
+
* const envelope = TransactionEnvelopeLegacy.from({
|
|
3046
|
+
* gasPrice: Value.fromGwei('10'),
|
|
3047
|
+
* to: '0x0000000000000000000000000000000000000000',
|
|
3048
|
+
* value: Value.fromEther('1'),
|
|
3049
|
+
* })
|
|
3050
|
+
* ```
|
|
3051
|
+
*
|
|
3052
|
+
* * @example
|
|
3053
|
+
* ### Signing
|
|
3054
|
+
*
|
|
3055
|
+
* Transaction Envelopes can be signed using {@link ox#TransactionEnvelopeLegacy.(getSignPayload:function)} and a signing function such as {@link ox#Secp256k1.(sign:function)} or {@link ox#P256.(sign:function)}:
|
|
3056
|
+
*
|
|
3057
|
+
* ```ts twoslash
|
|
3058
|
+
* // @noErrors
|
|
3059
|
+
* import { Secp256k1, TransactionEnvelopeLegacy } from 'ox'
|
|
3060
|
+
*
|
|
3061
|
+
* const envelope = TransactionEnvelopeLegacy.from({
|
|
3062
|
+
* nonce: 0n,
|
|
3063
|
+
* gasPrice: 1000000000n,
|
|
3064
|
+
* gas: 21000n,
|
|
3065
|
+
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
3066
|
+
* value: 1000000000000000000n,
|
|
3067
|
+
* })
|
|
3068
|
+
*
|
|
3069
|
+
* const signature = Secp256k1.sign({ // [!code focus]
|
|
3070
|
+
* payload: TransactionEnvelopeLegacy.getSignPayload(envelope), // [!code focus]
|
|
3071
|
+
* privateKey: '0x...' // [!code focus]
|
|
3072
|
+
* }) // [!code focus]
|
|
3073
|
+
*
|
|
3074
|
+
* const envelope_signed = TransactionEnvelopeLegacy.from(envelope, { signature })
|
|
3075
|
+
* ```
|
|
3076
|
+
*
|
|
3077
|
+
* @example
|
|
3078
|
+
* ### Serializing
|
|
3079
|
+
*
|
|
3080
|
+
* Transaction Envelopes can be serialized using {@link ox#TransactionEnvelopeLegacy.(serialize:function)}:
|
|
3081
|
+
*
|
|
3082
|
+
* ```ts twoslash
|
|
3083
|
+
* import { TransactionEnvelopeLegacy, Value } from 'ox'
|
|
3084
|
+
*
|
|
3085
|
+
* const envelope = TransactionEnvelopeLegacy.from({
|
|
3086
|
+
* chainId: 1,
|
|
3087
|
+
* gasPrice: Value.fromGwei('10'),
|
|
3088
|
+
* to: '0x0000000000000000000000000000000000000000',
|
|
3089
|
+
* value: Value.fromEther('1'),
|
|
3090
|
+
* })
|
|
3091
|
+
*
|
|
3092
|
+
* const serialized = TransactionEnvelopeLegacy.serialize(envelope) // [!code focus]
|
|
3093
|
+
* ```
|
|
3094
|
+
*
|
|
3095
|
+
* @example
|
|
3096
|
+
* ### Sending
|
|
3097
|
+
*
|
|
3098
|
+
* We can send a Transaction Envelope to the network by serializing the signed envelope with `.serialize`, and then broadcasting it over JSON-RPC with `eth_sendRawTransaction`.
|
|
3099
|
+
*
|
|
3100
|
+
* In this example, we will use {@link ox#RpcTransport.(fromHttp:function)} to broadcast a `eth_sendRawTransaction` request over HTTP JSON-RPC.
|
|
3101
|
+
*
|
|
3102
|
+
* ```ts twoslash
|
|
3103
|
+
* import { RpcTransport, TransactionEnvelopeLegacy, Secp256k1, Value } from 'ox'
|
|
3104
|
+
*
|
|
3105
|
+
* // Construct the Envelope.
|
|
3106
|
+
* const envelope = TransactionEnvelopeLegacy.from({
|
|
3107
|
+
* chainId: 1,
|
|
3108
|
+
* gasPrice: Value.fromGwei('10'),
|
|
3109
|
+
* nonce: 69n,
|
|
3110
|
+
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
3111
|
+
* value: Value.fromEther('1.5'),
|
|
3112
|
+
* })
|
|
3113
|
+
*
|
|
3114
|
+
* // Sign over the Envelope.
|
|
3115
|
+
* const signature = Secp256k1.sign({
|
|
3116
|
+
* payload: TransactionEnvelopeLegacy.getSignPayload(envelope),
|
|
3117
|
+
* privateKey: '0x...',
|
|
3118
|
+
* })
|
|
3119
|
+
*
|
|
3120
|
+
* // Serialize the Envelope with the Signature. // [!code focus]
|
|
3121
|
+
* const serialized = TransactionEnvelopeLegacy.serialize(envelope, { // [!code focus]
|
|
3122
|
+
* signature // [!code focus]
|
|
3123
|
+
* }) // [!code focus]
|
|
3124
|
+
*
|
|
3125
|
+
* // Broadcast the Envelope with `eth_sendRawTransaction`. // [!code focus]
|
|
3126
|
+
* const transport = RpcTransport.fromHttp('https://1.rpc.thirdweb.com') // [!code focus]
|
|
3127
|
+
* const hash = await transport.request({ // [!code focus]
|
|
3128
|
+
* method: 'eth_sendRawTransaction', // [!code focus]
|
|
3129
|
+
* params: [serialized], // [!code focus]
|
|
3130
|
+
* }) // [!code focus]
|
|
3131
|
+
* ```
|
|
3132
|
+
*
|
|
3133
|
+
* If you are interfacing with an RPC that supports `eth_sendTransaction`, you can also use
|
|
3134
|
+
* {@link ox#TransactionEnvelopeLegacy.(toRpc:function)} to convert an Envelope to an RPC-compatible format.
|
|
3135
|
+
* This means you can skip the ceremony of manually filling & signing the Transaction.
|
|
3136
|
+
*
|
|
3137
|
+
* ```ts twoslash
|
|
3138
|
+
* import 'ox/window'
|
|
3139
|
+
* import { Provider, TransactionEnvelopeLegacy, Value } from 'ox'
|
|
3140
|
+
*
|
|
3141
|
+
* const envelope = TransactionEnvelopeLegacy.from({
|
|
3142
|
+
* chainId: 1,
|
|
3143
|
+
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
3144
|
+
* value: Value.fromEther('1.5'),
|
|
3145
|
+
* })
|
|
3146
|
+
*
|
|
3147
|
+
* const envelope_rpc = TransactionEnvelopeLegacy.toRpc(envelope)
|
|
3148
|
+
*
|
|
3149
|
+
* const provider = Provider.from(window.ethereum)
|
|
3150
|
+
* const hash = await provider.request({
|
|
3151
|
+
* method: 'eth_sendTransaction',
|
|
3152
|
+
* params: [envelope_rpc],
|
|
3153
|
+
* })
|
|
3154
|
+
* ```
|
|
3155
|
+
*
|
|
3156
|
+
* @example
|
|
3157
|
+
* ### Computing Hashes
|
|
3158
|
+
*
|
|
3159
|
+
* Transaction Hashes can be computed using {@link ox#TransactionEnvelopeLegacy.(hash:function)}:
|
|
3160
|
+
*
|
|
3161
|
+
* ```ts twoslash
|
|
3162
|
+
* import { Secp256k1, TransactionEnvelopeLegacy } from 'ox'
|
|
3163
|
+
*
|
|
3164
|
+
* const envelope = TransactionEnvelopeLegacy.from({
|
|
3165
|
+
* chainId: 1,
|
|
3166
|
+
* nonce: 0n,
|
|
3167
|
+
* gasPrice: 1000000000n,
|
|
3168
|
+
* gas: 21000n,
|
|
3169
|
+
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
3170
|
+
* value: 1000000000000000000n,
|
|
3171
|
+
* data: '0x',
|
|
3172
|
+
* })
|
|
3173
|
+
*
|
|
3174
|
+
* const signature = Secp256k1.sign({
|
|
3175
|
+
* payload: TransactionEnvelopeLegacy.getSignPayload(envelope),
|
|
3176
|
+
* privateKey: '0x...'
|
|
3177
|
+
* })
|
|
3178
|
+
*
|
|
3179
|
+
* const envelope_signed = TransactionEnvelopeLegacy.from(envelope, { signature })
|
|
3180
|
+
*
|
|
3181
|
+
* const hash = TransactionEnvelopeLegacy.hash(envelope_signed) // [!code focus]
|
|
3182
|
+
* ```
|
|
3183
|
+
*
|
|
3184
|
+
* @category Transaction Envelopes
|
|
3185
|
+
*/
|
|
3186
|
+
export * as TransactionEnvelopeLegacy from './core/TransactionEnvelopeLegacy.js';
|
|
3187
3187
|
/**
|
|
3188
3188
|
* Utilities & types for working with **Transaction Receipts** as defined in the [Execution API specification](https://github.com/ethereum/execution-apis/blob/main/src/schemas/receipt.yaml)
|
|
3189
3189
|
*
|
package/_types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B,YAAY,EAAE,CAAA;AAEd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkHG;AACH,OAAO,KAAK,GAAG,MAAM,eAAe,CAAA;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAElE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,kBAAkB,MAAM,8BAA8B,CAAA;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,OAAO,KAAK,SAAS,MAAM,qBAAqB,CAAA;AAEhD;;;;GAIG;AACH,OAAO,KAAK,aAAa,MAAM,yBAAyB,CAAA;AAExD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,OAAO,KAAK,YAAY,MAAM,wBAAwB,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,OAAO,KAAK,aAAa,MAAM,yBAAyB,CAAA;AAExD;;;;GAIG;AACH,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAA"}
|
package/_types/index.docs.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.docs.d.ts","sourceRoot":"","sources":["../index.docs.ts"],"names":[],"mappings":"AACA,2FAA2F;
|
|
1
|
+
{"version":3,"file":"index.docs.d.ts","sourceRoot":"","sources":["../index.docs.ts"],"names":[],"mappings":"AACA,2FAA2F;AAE3F,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../trusted-setups/internal/paths.ts"],"names":[],"mappings":"AAGA,gBAAgB;AAChB,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../trusted-setups/internal/paths.ts"],"names":[],"mappings":"AAGA,gBAAgB;AAChB,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,UAShC"}
|
package/_types/version.d.ts
CHANGED
package/core/AbiEvent.ts
CHANGED
|
@@ -11,8 +11,7 @@ import type * as internal from './internal/abiEvent.js'
|
|
|
11
11
|
import type * as AbiItem_internal from './internal/abiItem.js'
|
|
12
12
|
import * as Cursor from './internal/cursor.js'
|
|
13
13
|
import { prettyPrint } from './internal/errors.js'
|
|
14
|
-
import type { Compute } from './internal/types.js'
|
|
15
|
-
import type { IsNarrowable } from './internal/types.js'
|
|
14
|
+
import type { Compute, IsNarrowable } from './internal/types.js'
|
|
16
15
|
|
|
17
16
|
/** Root type for an {@link ox#AbiItem.AbiItem} with an `event` type. */
|
|
18
17
|
export type AbiEvent = abitype.AbiEvent & {
|
|
@@ -509,9 +508,9 @@ export function encode<const abiEvent extends AbiEvent>(
|
|
|
509
508
|
const args_ = Array.isArray(args)
|
|
510
509
|
? args
|
|
511
510
|
: Object.values(args).length > 0
|
|
512
|
-
? indexedInputs?.map(
|
|
511
|
+
? (indexedInputs?.map(
|
|
513
512
|
(x: any, i: number) => (args as any)[x.name ?? i],
|
|
514
|
-
) ?? []
|
|
513
|
+
) ?? [])
|
|
515
514
|
: []
|
|
516
515
|
|
|
517
516
|
if (args_.length > 0) {
|
package/core/AbiItem.ts
CHANGED
|
@@ -357,7 +357,7 @@ export function fromAbi<
|
|
|
357
357
|
...(prepare ? { hash: getSignatureHash(abiItems[0]!) } : {}),
|
|
358
358
|
} as never
|
|
359
359
|
|
|
360
|
-
let matchedAbiItem: AbiItem | undefined
|
|
360
|
+
let matchedAbiItem: AbiItem | undefined
|
|
361
361
|
for (const abiItem of abiItems) {
|
|
362
362
|
if (!('inputs' in abiItem)) continue
|
|
363
363
|
if (!args || args.length === 0) {
|
package/core/AbiParameters.ts
CHANGED
|
@@ -3,9 +3,9 @@ import * as Address from './Address.js'
|
|
|
3
3
|
import * as Bytes from './Bytes.js'
|
|
4
4
|
import * as Errors from './Errors.js'
|
|
5
5
|
import * as Hex from './Hex.js'
|
|
6
|
-
import * as Solidity from './Solidity.js'
|
|
7
6
|
import * as internal from './internal/abiParameters.js'
|
|
8
7
|
import * as Cursor from './internal/cursor.js'
|
|
8
|
+
import * as Solidity from './Solidity.js'
|
|
9
9
|
|
|
10
10
|
/** Root type for ABI parameters. */
|
|
11
11
|
export type AbiParameters = readonly abitype.AbiParameter[]
|
|
@@ -294,7 +294,7 @@ export namespace encodePacked {
|
|
|
294
294
|
const intMatch = (type as string).match(Solidity.integerRegex)
|
|
295
295
|
if (intMatch) {
|
|
296
296
|
const [_type, baseType, bits = '256'] = intMatch
|
|
297
|
-
const size = Number.parseInt(bits) / 8
|
|
297
|
+
const size = Number.parseInt(bits, 10) / 8
|
|
298
298
|
return Hex.fromNumber(value as number, {
|
|
299
299
|
size: isArray ? 32 : size,
|
|
300
300
|
signed: baseType === 'int',
|
|
@@ -304,9 +304,9 @@ export namespace encodePacked {
|
|
|
304
304
|
const bytesMatch = (type as string).match(Solidity.bytesRegex)
|
|
305
305
|
if (bytesMatch) {
|
|
306
306
|
const [_type, size] = bytesMatch
|
|
307
|
-
if (Number.parseInt(size
|
|
307
|
+
if (Number.parseInt(size!, 10) !== ((value as Hex.Hex).length - 2) / 2)
|
|
308
308
|
throw new BytesSizeMismatchError({
|
|
309
|
-
expectedSize: Number.parseInt(size
|
|
309
|
+
expectedSize: Number.parseInt(size!, 10),
|
|
310
310
|
value: value as Hex.Hex,
|
|
311
311
|
})
|
|
312
312
|
return Hex.padRight(value as Hex.Hex, isArray ? 32 : 0) as Hex.Hex
|
package/core/Authorization.ts
CHANGED
|
@@ -2,9 +2,9 @@ import type * 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 type { Compute, Mutable, Undefined } from './internal/types.js'
|
|
5
6
|
import * as Rlp from './Rlp.js'
|
|
6
7
|
import * as Signature from './Signature.js'
|
|
7
|
-
import type { Compute, Mutable, Undefined } from './internal/types.js'
|
|
8
8
|
|
|
9
9
|
/** Root type for an EIP-7702 Authorization. */
|
|
10
10
|
export type Authorization<
|
package/core/Blobs.ts
CHANGED
|
@@ -2,9 +2,9 @@ import * as Bytes from './Bytes.js'
|
|
|
2
2
|
import * as Errors from './Errors.js'
|
|
3
3
|
import * as Hash from './Hash.js'
|
|
4
4
|
import * as Hex from './Hex.js'
|
|
5
|
-
import * as Kzg from './Kzg.js'
|
|
6
5
|
import * as Cursor from './internal/cursor.js'
|
|
7
6
|
import type { Compute, Mutable, OneOf, UnionCompute } from './internal/types.js'
|
|
7
|
+
import * as Kzg from './Kzg.js'
|
|
8
8
|
|
|
9
9
|
/** Blob limit per transaction. */
|
|
10
10
|
const blobsPerTransaction = 6
|