ox 0.14.67 → 0.14.69
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 +62 -0
- package/_cjs/core/AbiEvent.js +45 -1
- package/_cjs/core/AbiEvent.js.map +1 -1
- package/_cjs/core/AbiParameters.js +6 -2
- package/_cjs/core/AbiParameters.js.map +1 -1
- package/_cjs/core/Address.js +24 -21
- package/_cjs/core/Address.js.map +1 -1
- package/_cjs/core/Authorization.js +2 -0
- package/_cjs/core/Authorization.js.map +1 -1
- package/_cjs/core/Base58.js +14 -4
- package/_cjs/core/Base58.js.map +1 -1
- package/_cjs/core/BinaryStateTree.js +1 -1
- package/_cjs/core/BinaryStateTree.js.map +1 -1
- package/_cjs/core/Blobs.js +26 -34
- package/_cjs/core/Blobs.js.map +1 -1
- package/_cjs/core/Block.js +1 -0
- package/_cjs/core/Block.js.map +1 -1
- package/_cjs/core/BlockOverrides.js +1 -1
- package/_cjs/core/BlockOverrides.js.map +1 -1
- package/_cjs/core/Bytes.js +56 -13
- package/_cjs/core/Bytes.js.map +1 -1
- package/_cjs/core/Cbor.js +33 -18
- package/_cjs/core/Cbor.js.map +1 -1
- package/_cjs/core/FrameReceipt.js +6 -2
- package/_cjs/core/FrameReceipt.js.map +1 -1
- package/_cjs/core/Hex.js +54 -21
- package/_cjs/core/Hex.js.map +1 -1
- package/_cjs/core/Json.js +15 -2
- package/_cjs/core/Json.js.map +1 -1
- package/_cjs/core/Rlp.js +138 -94
- package/_cjs/core/Rlp.js.map +1 -1
- package/_cjs/core/RpcTransport.js +3 -1
- package/_cjs/core/RpcTransport.js.map +1 -1
- package/_cjs/core/Siwe.js +35 -9
- package/_cjs/core/Siwe.js.map +1 -1
- package/_cjs/core/Transaction.js +10 -4
- package/_cjs/core/Transaction.js.map +1 -1
- package/_cjs/core/TransactionReceipt.js +12 -4
- package/_cjs/core/TransactionReceipt.js.map +1 -1
- package/_cjs/core/TransactionRequest.js +6 -2
- package/_cjs/core/TransactionRequest.js.map +1 -1
- package/_cjs/core/TxEnvelopeEip4844.js +1 -1
- package/_cjs/core/TxEnvelopeEip4844.js.map +1 -1
- package/_cjs/core/TypedData.js +19 -8
- package/_cjs/core/TypedData.js.map +1 -1
- package/_cjs/core/internal/abiParameters.js +59 -18
- package/_cjs/core/internal/abiParameters.js.map +1 -1
- package/_cjs/core/internal/address.js +32 -0
- package/_cjs/core/internal/address.js.map +1 -0
- package/_cjs/core/internal/base58.js +11 -9
- package/_cjs/core/internal/base58.js.map +1 -1
- package/_cjs/core/internal/bytes.js +13 -22
- package/_cjs/core/internal/bytes.js.map +1 -1
- package/_cjs/core/internal/caches.js +1 -0
- package/_cjs/core/internal/caches.js.map +1 -1
- package/_cjs/core/internal/cursor.js +32 -10
- package/_cjs/core/internal/cursor.js.map +1 -1
- package/_cjs/core/internal/hex.js +3 -3
- package/_cjs/core/internal/hex.js.map +1 -1
- package/_cjs/core/internal/lru.js +6 -5
- package/_cjs/core/internal/lru.js.map +1 -1
- package/_cjs/core/internal/promise.js +3 -3
- package/_cjs/core/internal/promise.js.map +1 -1
- package/_cjs/erc6492/SignatureErc6492.js +1 -1
- package/_cjs/erc6492/SignatureErc6492.js.map +1 -1
- package/_cjs/tempo/Transaction.js +13 -7
- package/_cjs/tempo/Transaction.js.map +1 -1
- package/_cjs/tempo/TransactionRequest.js +23 -19
- package/_cjs/tempo/TransactionRequest.js.map +1 -1
- package/_cjs/tempo/TxEnvelopeTempo.js +23 -4
- package/_cjs/tempo/TxEnvelopeTempo.js.map +1 -1
- package/_cjs/tempo/ZoneId.js +3 -0
- package/_cjs/tempo/ZoneId.js.map +1 -1
- package/_cjs/tempo/internal/virtualMasterPool.js +12 -3
- package/_cjs/tempo/internal/virtualMasterPool.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/core/AbiError.js +2 -2
- package/_esm/core/AbiEvent.js +71 -2
- package/_esm/core/AbiEvent.js.map +1 -1
- package/_esm/core/AbiParameters.js +8 -2
- package/_esm/core/AbiParameters.js.map +1 -1
- package/_esm/core/Address.js +27 -21
- package/_esm/core/Address.js.map +1 -1
- package/_esm/core/Authorization.js +3 -0
- package/_esm/core/Authorization.js.map +1 -1
- package/_esm/core/Base58.js +16 -4
- package/_esm/core/Base58.js.map +1 -1
- package/_esm/core/BinaryStateTree.js +3 -1
- package/_esm/core/BinaryStateTree.js.map +1 -1
- package/_esm/core/Blobs.js +40 -41
- package/_esm/core/Blobs.js.map +1 -1
- package/_esm/core/Block.js +1 -0
- package/_esm/core/Block.js.map +1 -1
- package/_esm/core/BlockOverrides.js +3 -2
- package/_esm/core/BlockOverrides.js.map +1 -1
- package/_esm/core/Bytes.js +66 -13
- package/_esm/core/Bytes.js.map +1 -1
- package/_esm/core/Cbor.js +33 -17
- package/_esm/core/Cbor.js.map +1 -1
- package/_esm/core/Ens.js +1 -1
- package/_esm/core/FrameReceipt.js +6 -2
- package/_esm/core/FrameReceipt.js.map +1 -1
- package/_esm/core/Hash.js +1 -1
- package/_esm/core/Hex.js +70 -21
- package/_esm/core/Hex.js.map +1 -1
- package/_esm/core/Json.js +21 -2
- package/_esm/core/Json.js.map +1 -1
- package/_esm/core/Rlp.js +146 -97
- package/_esm/core/Rlp.js.map +1 -1
- package/_esm/core/RpcTransport.js +4 -1
- package/_esm/core/RpcTransport.js.map +1 -1
- package/_esm/core/Siwe.js +40 -10
- package/_esm/core/Siwe.js.map +1 -1
- package/_esm/core/Transaction.js +11 -4
- package/_esm/core/Transaction.js.map +1 -1
- package/_esm/core/TransactionReceipt.js +12 -4
- package/_esm/core/TransactionReceipt.js.map +1 -1
- package/_esm/core/TransactionRequest.js +6 -2
- package/_esm/core/TransactionRequest.js.map +1 -1
- package/_esm/core/TxEnvelopeEip4844.js +1 -1
- package/_esm/core/TxEnvelopeEip4844.js.map +1 -1
- package/_esm/core/TypedData.js +26 -10
- package/_esm/core/TypedData.js.map +1 -1
- package/_esm/core/internal/abiParameters.js +78 -18
- package/_esm/core/internal/abiParameters.js.map +1 -1
- package/_esm/core/internal/address.js +41 -0
- package/_esm/core/internal/address.js.map +1 -0
- package/_esm/core/internal/base58.js +15 -9
- package/_esm/core/internal/base58.js.map +1 -1
- package/_esm/core/internal/bytes.js +14 -22
- package/_esm/core/internal/bytes.js.map +1 -1
- package/_esm/core/internal/caches.js +1 -0
- package/_esm/core/internal/caches.js.map +1 -1
- package/_esm/core/internal/cursor.js +37 -10
- package/_esm/core/internal/cursor.js.map +1 -1
- package/_esm/core/internal/hex.js +5 -3
- package/_esm/core/internal/hex.js.map +1 -1
- package/_esm/core/internal/lru.js +7 -5
- package/_esm/core/internal/lru.js.map +1 -1
- package/_esm/core/internal/promise.js +4 -3
- package/_esm/core/internal/promise.js.map +1 -1
- package/_esm/erc6492/SignatureErc6492.js +1 -1
- package/_esm/erc6492/SignatureErc6492.js.map +1 -1
- package/_esm/tempo/Transaction.js +15 -7
- package/_esm/tempo/Transaction.js.map +1 -1
- package/_esm/tempo/TransactionRequest.js +25 -19
- package/_esm/tempo/TransactionRequest.js.map +1 -1
- package/_esm/tempo/TxEnvelopeTempo.js +30 -4
- package/_esm/tempo/TxEnvelopeTempo.js.map +1 -1
- package/_esm/tempo/ZoneId.js +7 -1
- package/_esm/tempo/ZoneId.js.map +1 -1
- package/_esm/tempo/internal/virtualMasterPool.js +16 -3
- package/_esm/tempo/internal/virtualMasterPool.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/core/AbiError.d.ts +3 -3
- package/_types/core/AbiEvent.d.ts +38 -3
- package/_types/core/AbiEvent.d.ts.map +1 -1
- package/_types/core/AbiParameters.d.ts +1 -1
- package/_types/core/AbiParameters.d.ts.map +1 -1
- package/_types/core/Address.d.ts.map +1 -1
- package/_types/core/Authorization.d.ts.map +1 -1
- package/_types/core/Base58.d.ts.map +1 -1
- package/_types/core/Blobs.d.ts +4 -5
- package/_types/core/Blobs.d.ts.map +1 -1
- package/_types/core/Block.d.ts +2 -0
- package/_types/core/Block.d.ts.map +1 -1
- package/_types/core/BlockOverrides.d.ts +2 -1
- package/_types/core/BlockOverrides.d.ts.map +1 -1
- package/_types/core/Bytes.d.ts +2 -0
- package/_types/core/Bytes.d.ts.map +1 -1
- package/_types/core/Cbor.d.ts +13 -6
- package/_types/core/Cbor.d.ts.map +1 -1
- package/_types/core/Ens.d.ts +1 -1
- package/_types/core/FrameReceipt.d.ts.map +1 -1
- package/_types/core/Hash.d.ts +1 -1
- package/_types/core/Hex.d.ts +3 -1
- package/_types/core/Hex.d.ts.map +1 -1
- package/_types/core/Json.d.ts.map +1 -1
- package/_types/core/Rlp.d.ts +38 -9
- package/_types/core/Rlp.d.ts.map +1 -1
- package/_types/core/RpcTransport.d.ts.map +1 -1
- package/_types/core/Siwe.d.ts +1 -0
- package/_types/core/Siwe.d.ts.map +1 -1
- package/_types/core/Transaction.d.ts.map +1 -1
- package/_types/core/TransactionReceipt.d.ts.map +1 -1
- package/_types/core/TransactionRequest.d.ts.map +1 -1
- package/_types/core/TypedData.d.ts +2 -2
- package/_types/core/TypedData.d.ts.map +1 -1
- package/_types/core/internal/abiParameters.d.ts +5 -5
- package/_types/core/internal/abiParameters.d.ts.map +1 -1
- package/_types/core/internal/address.d.ts +14 -0
- package/_types/core/internal/address.d.ts.map +1 -0
- package/_types/core/internal/base58.d.ts.map +1 -1
- package/_types/core/internal/bytes.d.ts +1 -10
- package/_types/core/internal/bytes.d.ts.map +1 -1
- package/_types/core/internal/caches.d.ts +1 -0
- package/_types/core/internal/caches.d.ts.map +1 -1
- package/_types/core/internal/cursor.d.ts +7 -2
- package/_types/core/internal/cursor.d.ts.map +1 -1
- package/_types/core/internal/hex.d.ts.map +1 -1
- package/_types/core/internal/lru.d.ts.map +1 -1
- package/_types/core/internal/promise.d.ts.map +1 -1
- package/_types/erc6492/SignatureErc6492.d.ts +1 -1
- package/_types/erc6492/SignatureErc6492.d.ts.map +1 -1
- package/_types/tempo/Transaction.d.ts.map +1 -1
- package/_types/tempo/TransactionRequest.d.ts.map +1 -1
- package/_types/tempo/TxEnvelopeTempo.d.ts.map +1 -1
- package/_types/tempo/ZoneId.d.ts +3 -1
- package/_types/tempo/ZoneId.d.ts.map +1 -1
- package/_types/tempo/internal/virtualMasterPool.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/core/AbiError.ts +3 -3
- package/core/AbiEvent.ts +74 -2
- package/core/AbiParameters.ts +8 -1
- package/core/Address.ts +25 -20
- package/core/Authorization.ts +3 -0
- package/core/Base58.ts +15 -4
- package/core/BinaryStateTree.ts +4 -1
- package/core/Blobs.ts +49 -53
- package/core/Block.ts +3 -0
- package/core/BlockOverrides.ts +3 -2
- package/core/Bytes.ts +68 -17
- package/core/Cbor.ts +33 -13
- package/core/Ens.ts +1 -1
- package/core/FrameReceipt.ts +6 -2
- package/core/Hash.ts +1 -1
- package/core/Hex.ts +79 -22
- package/core/Json.ts +23 -2
- package/core/Rlp.ts +184 -94
- package/core/RpcTransport.ts +4 -1
- package/core/Siwe.ts +41 -10
- package/core/Transaction.ts +11 -4
- package/core/TransactionReceipt.ts +13 -4
- package/core/TransactionRequest.ts +10 -6
- package/core/TxEnvelopeEip4844.ts +1 -1
- package/core/TypedData.ts +28 -10
- package/core/internal/abiParameters.ts +82 -23
- package/core/internal/address.ts +38 -0
- package/core/internal/base58.ts +14 -9
- package/core/internal/bytes.ts +13 -23
- package/core/internal/caches.ts +1 -0
- package/core/internal/cursor.ts +44 -16
- package/core/internal/hex.ts +5 -3
- package/core/internal/lru.ts +6 -7
- package/core/internal/promise.ts +5 -3
- package/erc6492/SignatureErc6492.ts +1 -1
- package/package.json +1 -1
- package/tempo/AccountSimulation.test.ts +1 -1
- package/tempo/SignaturePreAuthorized.test.ts +1 -1
- package/tempo/Transaction.ts +15 -9
- package/tempo/TransactionRequest.ts +31 -24
- package/tempo/TxEnvelopeTempo.test.ts +52 -0
- package/tempo/TxEnvelopeTempo.ts +32 -6
- package/tempo/ZoneId.test.ts +11 -0
- package/tempo/ZoneId.ts +7 -1
- package/tempo/internal/virtualMasterPool.ts +18 -4
- package/version.ts +1 -1
- package/_cjs/core/internal/uid.js +0 -17
- package/_cjs/core/internal/uid.js.map +0 -1
- package/_esm/core/internal/uid.js +0 -15
- package/_esm/core/internal/uid.js.map +0 -1
- package/_types/core/internal/uid.d.ts +0 -3
- package/_types/core/internal/uid.d.ts.map +0 -1
- package/core/internal/uid.ts +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxEnvelopeTempo.d.ts","sourceRoot":"","sources":["../../tempo/TxEnvelopeTempo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"TxEnvelopeTempo.d.ts","sourceRoot":"","sources":["../../tempo/TxEnvelopeTempo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAE7C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,EACV,MAAM,EACN,OAAO,EACP,KAAK,EACL,SAAS,EACT,cAAc,EACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AAErC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAA;AAEjD,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;;;;;GAMG;AACH,MAAM,M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;GAoBG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,eAAe,EAAE,MAAM,CAAC,WAOpE;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,KAAK,SAAS,GAAG,MAAM,CAAC,eAAe,CAAA;CACxC;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,eAAgB,SAAQ,MAAM,CAAC,SAAS;IACnD,SAAkB,IAAI,qCAAoC;;CAI3D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,yBAA0B,SAAQ,MAAM,CAAC,SAAS;IAC7D,SAAkB,IAAI,+CAA8C;gBACxD,EACV,IAAI,EACJ,KAAK,GACN,EAAE;QACD,IAAI,EAAE,YAAY,GAAG,aAAa,CAAA;QAClC,KAAK,EAAE,OAAO,CAAA;KACf;CAQF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,0BAA2B,SAAQ,MAAM,CAAC,SAAS;IAC9D,SAAkB,IAAI,gDAA+C;gBACzD,EACV,WAAW,EACX,UAAU,GACX,EAAE;QACD,WAAW,EAAE,MAAM,CAAA;QACnB,UAAU,EAAE,MAAM,CAAA;KACnB;CAKF"}
|
package/_types/tempo/ZoneId.d.ts
CHANGED
|
@@ -18,7 +18,9 @@ export type SourceId = keyof typeof chainIdConfig;
|
|
|
18
18
|
/**
|
|
19
19
|
* Derives a zone ID from a zone chain ID.
|
|
20
20
|
*
|
|
21
|
-
* Zone chain IDs use the base assigned to their Tempo source chain.
|
|
21
|
+
* Zone chain IDs use the base assigned to their Tempo source chain. Zones of other Tempo chains
|
|
22
|
+
* (such as devnets) encode the source chain ID in the high 32 bits and the zone ID in the low 32
|
|
23
|
+
* bits, so the zone ID is read from the chain ID alone.
|
|
22
24
|
*
|
|
23
25
|
* @example
|
|
24
26
|
* ```ts twoslash
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneId.d.ts","sourceRoot":"","sources":["../../tempo/ZoneId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAE3C,QAAA,MAAM,aAAa;;;;;;;;;CAST,CAAA;
|
|
1
|
+
{"version":3,"file":"ZoneId.d.ts","sourceRoot":"","sources":["../../tempo/ZoneId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAE3C,QAAA,MAAM,aAAa;;;;;;;;;CAST,CAAA;AAOV;;GAEG;AACH,eAAO,MAAM,WAAW,WAAsC,CAAA;AAE9D,6BAA6B;AAC7B,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,aAAa,CAAA;AAEjD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,QAA0B,GACnC,MAAM,CAGR;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,KAAK,SAAS,GAAG,OAAO,wBAAwB,GAAG,MAAM,CAAC,eAAe,CAAA;CAC1E;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,QAA0B,GACnC,MAAM,CAGR;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,KAAK,SAAS,GAAG,OAAO,wBAAwB,GAAG,MAAM,CAAC,eAAe,CAAA;CAC1E;AAED,0DAA0D;AAC1D,qBAAa,wBAAyB,SAAQ,MAAM,CAAC,SAAS;IAC5D,SAAkB,IAAI,qCAAoC;gBAC9C,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE;CAK/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtualMasterPool.d.ts","sourceRoot":"","sources":["../../../tempo/internal/virtualMasterPool.ts"],"names":[],"mappings":"AAEA,4DAA4D;AAC5D,MAAM,MAAM,OAAO,GACf;IAAE,IAAI,EAAE,M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AE1C,gEAAgE;AAChE,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,CACH,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,EACjC,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,GAC9B;QAAE,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;QAAC,SAAS,IAAI,IAAI,CAAA;KAAE,CAAA;CAC3D,CAAA;AAaD;;;;GAIG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAkBnD;AAED;;;;GAIG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAmC7D;AAED;;;;GAIG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAwBhE"}
|
package/_types/version.d.ts
CHANGED
package/core/AbiError.ts
CHANGED
|
@@ -305,7 +305,7 @@ export declare namespace decode {
|
|
|
305
305
|
* error, // [!code focus]
|
|
306
306
|
* [1n, 2n, 0] // [!code focus]
|
|
307
307
|
* ) // [!code focus]
|
|
308
|
-
* // @log: '
|
|
308
|
+
* // @log: '0xe466f0a5000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000'
|
|
309
309
|
* ```
|
|
310
310
|
*
|
|
311
311
|
* @example
|
|
@@ -701,7 +701,7 @@ export declare namespace fromAbi {
|
|
|
701
701
|
* import { AbiError } from 'ox'
|
|
702
702
|
*
|
|
703
703
|
* const selector = AbiError.getSelector('error BadSignatureV(uint8 v)')
|
|
704
|
-
* // @log: '
|
|
704
|
+
* // @log: '0x1f003d0a'
|
|
705
705
|
* ```
|
|
706
706
|
*
|
|
707
707
|
* @example
|
|
@@ -713,7 +713,7 @@ export declare namespace fromAbi {
|
|
|
713
713
|
* name: 'BadSignatureV',
|
|
714
714
|
* type: 'error'
|
|
715
715
|
* })
|
|
716
|
-
* // @log: '
|
|
716
|
+
* // @log: '0x1f003d0a'
|
|
717
717
|
* ```
|
|
718
718
|
*
|
|
719
719
|
* @param abiItem - The ABI item to compute the selector for.
|
package/core/AbiEvent.ts
CHANGED
|
@@ -14,6 +14,9 @@ import { prettyPrint } from './internal/errors.js'
|
|
|
14
14
|
import type { Compute, IsNarrowable } from './internal/types.js'
|
|
15
15
|
import * as Solidity from './Solidity.js'
|
|
16
16
|
|
|
17
|
+
const addressTopicPrefix = '0x000000000000000000000000'
|
|
18
|
+
const topicRegex = /^0x[0-9a-fA-F]{64}$/
|
|
19
|
+
|
|
17
20
|
/** Root type for an {@link ox#AbiItem.AbiItem} with an `event` type. */
|
|
18
21
|
export type AbiEvent = abitype.AbiEvent & {
|
|
19
22
|
hash?: Hex.Hex | undefined
|
|
@@ -463,6 +466,22 @@ export function decode(
|
|
|
463
466
|
param.type.match(/^(.*)\[(\d+)?\]$/)
|
|
464
467
|
)
|
|
465
468
|
return topic
|
|
469
|
+
// A topic is a single 32-byte word.
|
|
470
|
+
if (topic.length !== 66)
|
|
471
|
+
throw new TopicSizeMismatchError({
|
|
472
|
+
abiEvent,
|
|
473
|
+
param: param as abitype.AbiParameter & { indexed: boolean },
|
|
474
|
+
topic,
|
|
475
|
+
})
|
|
476
|
+
// Read common canonical words directly. Anything else (including a
|
|
477
|
+
// non-zero address padding) is left to `AbiParameters.decode`.
|
|
478
|
+
if (topicRegex.test(topic)) {
|
|
479
|
+
if (param.type === 'address' && topic.startsWith(addressTopicPrefix))
|
|
480
|
+
return `0x${topic.slice(26).toLowerCase()}`
|
|
481
|
+
if (param.type === 'uint256' || param.type === 'uint')
|
|
482
|
+
return BigInt(topic)
|
|
483
|
+
if (param.type === 'bytes32') return topic.toLowerCase()
|
|
484
|
+
}
|
|
466
485
|
const decoded = AbiParameters.decode([param], topic) || []
|
|
467
486
|
return decoded[0]
|
|
468
487
|
})()
|
|
@@ -540,6 +559,7 @@ export declare namespace decode {
|
|
|
540
559
|
| getSelector.ErrorType
|
|
541
560
|
| DataMismatchError
|
|
542
561
|
| SelectorTopicMismatchError
|
|
562
|
+
| TopicSizeMismatchError
|
|
543
563
|
| TopicsMismatchError
|
|
544
564
|
| Errors.GlobalErrorType
|
|
545
565
|
}
|
|
@@ -1032,7 +1052,7 @@ export declare namespace fromAbi {
|
|
|
1032
1052
|
* import { AbiEvent } from 'ox'
|
|
1033
1053
|
*
|
|
1034
1054
|
* const selector = AbiEvent.getSelector('event Transfer(address indexed from, address indexed to, uint256 value)')
|
|
1035
|
-
* // @log: '
|
|
1055
|
+
* // @log: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
|
|
1036
1056
|
* ```
|
|
1037
1057
|
*
|
|
1038
1058
|
* @example
|
|
@@ -1048,7 +1068,7 @@ export declare namespace fromAbi {
|
|
|
1048
1068
|
* { name: 'value', type: 'uint256' }
|
|
1049
1069
|
* ]
|
|
1050
1070
|
* })
|
|
1051
|
-
* // @log: '
|
|
1071
|
+
* // @log: '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
|
|
1052
1072
|
* ```
|
|
1053
1073
|
*
|
|
1054
1074
|
* @param abiItem - The ABI event to compute the selector for.
|
|
@@ -1378,6 +1398,58 @@ export class TopicsMismatchError extends Errors.BaseError {
|
|
|
1378
1398
|
}
|
|
1379
1399
|
}
|
|
1380
1400
|
|
|
1401
|
+
/**
|
|
1402
|
+
* Thrown when a topic for an indexed event parameter is not a 32-byte word.
|
|
1403
|
+
*
|
|
1404
|
+
* @example
|
|
1405
|
+
* ```ts twoslash
|
|
1406
|
+
* import { AbiEvent } from 'ox'
|
|
1407
|
+
*
|
|
1408
|
+
* const transfer = AbiEvent.from(
|
|
1409
|
+
* 'event Transfer(address indexed from, address indexed to, uint256 value)',
|
|
1410
|
+
* )
|
|
1411
|
+
*
|
|
1412
|
+
* AbiEvent.decode(transfer, {
|
|
1413
|
+
* data: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
1414
|
+
* topics: [
|
|
1415
|
+
* '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
|
|
1416
|
+
* '0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045',
|
|
1417
|
+
* '0x000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600',
|
|
1418
|
+
* ],
|
|
1419
|
+
* })
|
|
1420
|
+
* // @error: AbiEvent.TopicSizeMismatchError: Topic for indexed event parameter "to" of "event Transfer(address indexed from, address indexed to, uint256 value)" must be 32 bytes.
|
|
1421
|
+
* // @error: Topic: 0x000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600 (33 bytes)
|
|
1422
|
+
* ```
|
|
1423
|
+
*/
|
|
1424
|
+
export class TopicSizeMismatchError extends Errors.BaseError {
|
|
1425
|
+
override readonly name = 'AbiEvent.TopicSizeMismatchError'
|
|
1426
|
+
|
|
1427
|
+
abiEvent: AbiEvent
|
|
1428
|
+
topic: Hex.Hex
|
|
1429
|
+
|
|
1430
|
+
constructor({
|
|
1431
|
+
abiEvent,
|
|
1432
|
+
param,
|
|
1433
|
+
topic,
|
|
1434
|
+
}: {
|
|
1435
|
+
abiEvent: AbiEvent
|
|
1436
|
+
param: abitype.AbiParameter & { indexed: boolean }
|
|
1437
|
+
topic: Hex.Hex
|
|
1438
|
+
}) {
|
|
1439
|
+
super(
|
|
1440
|
+
`Topic for indexed event parameter${
|
|
1441
|
+
param.name ? ` "${param.name}"` : ''
|
|
1442
|
+
} of "${format(abiEvent)}" must be 32 bytes.`,
|
|
1443
|
+
{
|
|
1444
|
+
metaMessages: [`Topic: ${topic} (${Hex.size(topic)} bytes)`],
|
|
1445
|
+
},
|
|
1446
|
+
)
|
|
1447
|
+
|
|
1448
|
+
this.abiEvent = abiEvent
|
|
1449
|
+
this.topic = topic
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1381
1453
|
/**
|
|
1382
1454
|
* Thrown when the provided selector does not match the expected selector.
|
|
1383
1455
|
*
|
package/core/AbiParameters.ts
CHANGED
|
@@ -263,6 +263,7 @@ export function encodePacked<
|
|
|
263
263
|
export namespace encodePacked {
|
|
264
264
|
export type ErrorType =
|
|
265
265
|
| Hex.concat.ErrorType
|
|
266
|
+
| Hex.InvalidLengthError
|
|
266
267
|
| LengthMismatchError
|
|
267
268
|
| Errors.GlobalErrorType
|
|
268
269
|
|
|
@@ -289,7 +290,13 @@ export namespace encodePacked {
|
|
|
289
290
|
) as Address.Address
|
|
290
291
|
}
|
|
291
292
|
if (type === 'string') return Hex.fromString(value as string)
|
|
292
|
-
if (type === 'bytes')
|
|
293
|
+
if (type === 'bytes') {
|
|
294
|
+
const hex = value as Hex.Hex
|
|
295
|
+
// An unpaired nibble has no byte to belong to, so reject it instead of
|
|
296
|
+
// guessing which half of a byte it is.
|
|
297
|
+
if (hex.length % 2 !== 0) throw new Hex.InvalidLengthError(hex)
|
|
298
|
+
return hex
|
|
299
|
+
}
|
|
293
300
|
if (type === 'bool')
|
|
294
301
|
return Hex.padLeft(Hex.fromBoolean(value as boolean), isArray ? 32 : 1)
|
|
295
302
|
|
package/core/Address.ts
CHANGED
|
@@ -3,10 +3,9 @@ import * as Bytes from './Bytes.js'
|
|
|
3
3
|
import * as Caches from './Caches.js'
|
|
4
4
|
import * as Errors from './Errors.js'
|
|
5
5
|
import * as Hash from './Hash.js'
|
|
6
|
+
import * as internal from './internal/address.js'
|
|
6
7
|
import * as PublicKey from './PublicKey.js'
|
|
7
8
|
|
|
8
|
-
const addressRegex = /^0x[a-fA-F0-9]{40}$/
|
|
9
|
-
|
|
10
9
|
/** Root type for Address. */
|
|
11
10
|
export type Address = abitype_Address
|
|
12
11
|
|
|
@@ -37,20 +36,19 @@ export function assert(
|
|
|
37
36
|
): asserts value is Address {
|
|
38
37
|
const { strict = true } = options
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
const kind = internal.classify(value)
|
|
40
|
+
if (kind === 0)
|
|
41
41
|
throw new InvalidAddressError({
|
|
42
42
|
address: value,
|
|
43
43
|
cause: new InvalidInputError(),
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
})
|
|
53
|
-
}
|
|
46
|
+
// Lowercase inputs are exempt from checksum verification.
|
|
47
|
+
if (strict && kind === 2 && checksum(value as Address) !== value)
|
|
48
|
+
throw new InvalidAddressError({
|
|
49
|
+
address: value,
|
|
50
|
+
cause: new InvalidChecksumError(),
|
|
51
|
+
})
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
export declare namespace assert {
|
|
@@ -81,11 +79,20 @@ export declare namespace assert {
|
|
|
81
79
|
* @returns The checksummed address.
|
|
82
80
|
*/
|
|
83
81
|
export function checksum(address: string): Address {
|
|
84
|
-
|
|
82
|
+
// The checksum depends only on the lowercase address, so every casing of an
|
|
83
|
+
// address shares one cache entry, keyed by the lowercase form.
|
|
84
|
+
const direct = Caches.checksum.get(address)
|
|
85
|
+
if (direct !== undefined) return direct
|
|
85
86
|
|
|
86
87
|
assert(address, { strict: false })
|
|
87
88
|
|
|
88
|
-
const
|
|
89
|
+
const key = address.toLowerCase()
|
|
90
|
+
if (key !== address) {
|
|
91
|
+
const cached = Caches.checksum.get(key)
|
|
92
|
+
if (cached !== undefined) return cached
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const hexAddress = key.substring(2)
|
|
89
96
|
const hash = Hash.keccak256(Bytes.fromString(hexAddress), { as: 'Bytes' })
|
|
90
97
|
|
|
91
98
|
const characters = hexAddress.split('')
|
|
@@ -99,7 +106,7 @@ export function checksum(address: string): Address {
|
|
|
99
106
|
}
|
|
100
107
|
|
|
101
108
|
const result = `0x${characters.join('')}` as const
|
|
102
|
-
Caches.checksum.set(
|
|
109
|
+
Caches.checksum.set(key, result)
|
|
103
110
|
return result
|
|
104
111
|
}
|
|
105
112
|
|
|
@@ -295,12 +302,10 @@ export function validate(
|
|
|
295
302
|
options: validate.Options = {},
|
|
296
303
|
): address is Address {
|
|
297
304
|
const { strict = true } = options ?? {}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
return false
|
|
303
|
-
}
|
|
305
|
+
const kind = internal.classify(address)
|
|
306
|
+
if (kind === 0) return false
|
|
307
|
+
if (!strict || kind === 1) return true
|
|
308
|
+
return checksum(address as Address) === address
|
|
304
309
|
}
|
|
305
310
|
|
|
306
311
|
export declare namespace validate {
|
package/core/Authorization.ts
CHANGED
|
@@ -497,6 +497,9 @@ export function toRpc(authorization: Signed): Rpc {
|
|
|
497
497
|
chainId: Hex.fromNumber(chainId),
|
|
498
498
|
nonce: Hex.fromNumber(nonce),
|
|
499
499
|
...Signature.toRpc(signature),
|
|
500
|
+
// `r` and `s` are `uint256` quantities over RPC, so drop leading zeros.
|
|
501
|
+
r: Hex.fromNumber(signature.r),
|
|
502
|
+
s: Hex.fromNumber(signature.s),
|
|
500
503
|
// EIP-7702 permits any `y_parity` below 2**8 in an authorization tuple, so
|
|
501
504
|
// encode `yParity` as is instead of the 0 or 1 of `Signature.toRpc`.
|
|
502
505
|
yParity: Hex.fromNumber(signature.yParity),
|
package/core/Base58.ts
CHANGED
|
@@ -106,10 +106,14 @@ export declare namespace toBytes {
|
|
|
106
106
|
* @returns The decoded hex string.
|
|
107
107
|
*/
|
|
108
108
|
export function toHex(value: string): Hex.Hex {
|
|
109
|
-
let integer =
|
|
109
|
+
let integer = 0n
|
|
110
110
|
let pad = 0
|
|
111
111
|
let checkPad = true
|
|
112
112
|
|
|
113
|
+
// Accumulate up to nine digits as a number, since 58^9 is below 2^53, and
|
|
114
|
+
// fold each chunk into the BigInt at once.
|
|
115
|
+
let chunk = 0
|
|
116
|
+
let chunkBase = 1
|
|
113
117
|
for (let i = 0; i < value.length; i++) {
|
|
114
118
|
const char = value[i]!
|
|
115
119
|
|
|
@@ -118,12 +122,19 @@ export function toHex(value: string): Hex.Hex {
|
|
|
118
122
|
else checkPad = false
|
|
119
123
|
|
|
120
124
|
// check for invalid characters
|
|
121
|
-
|
|
125
|
+
const digit = internal.alphabetToInteger[char]
|
|
126
|
+
if (typeof digit !== 'bigint')
|
|
122
127
|
throw new Error('invalid base58 character: ' + char)
|
|
123
128
|
|
|
124
|
-
|
|
125
|
-
|
|
129
|
+
chunk = chunk * 58 + Number(digit)
|
|
130
|
+
chunkBase *= 58
|
|
131
|
+
if (chunkBase === 7_427_658_739_644_928) {
|
|
132
|
+
integer = integer * 7_427_658_739_644_928n + BigInt(chunk)
|
|
133
|
+
chunk = 0
|
|
134
|
+
chunkBase = 1
|
|
135
|
+
}
|
|
126
136
|
}
|
|
137
|
+
if (chunkBase > 1) integer = integer * BigInt(chunkBase) + BigInt(chunk)
|
|
127
138
|
|
|
128
139
|
if (!pad) return `0x${integer.toString(16)}` as Hex.Hex
|
|
129
140
|
return `0x${'0'.repeat(pad * 2)}${integer.toString(16)}` as Hex.Hex
|
package/core/BinaryStateTree.ts
CHANGED
|
@@ -266,6 +266,9 @@ function bitsToBytes(bits: number[]): Bytes.Bytes {
|
|
|
266
266
|
/** @internal */
|
|
267
267
|
function hash(bytes: Bytes.Bytes | undefined): Bytes.Bytes {
|
|
268
268
|
if (!bytes) return new Uint8Array(32).fill(0)
|
|
269
|
-
|
|
269
|
+
// EIP-7864 only hashes the 64-byte zero input to zero. A zero-valued leaf
|
|
270
|
+
// still hashes.
|
|
271
|
+
if (bytes.length === 64 && !bytes.some((byte) => byte !== 0))
|
|
272
|
+
return new Uint8Array(32).fill(0)
|
|
270
273
|
return blake3(bytes)
|
|
271
274
|
}
|
package/core/Blobs.ts
CHANGED
|
@@ -2,7 +2,6 @@ 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 Cursor from './internal/cursor.js'
|
|
6
5
|
import type { Compute, Mutable, OneOf, UnionCompute } from './internal/types.js'
|
|
7
6
|
import * as Kzg from './Kzg.js'
|
|
8
7
|
|
|
@@ -289,43 +288,40 @@ export function from<
|
|
|
289
288
|
size: size_,
|
|
290
289
|
})
|
|
291
290
|
|
|
292
|
-
const blobs = []
|
|
291
|
+
const blobs: Bytes.Bytes[] = []
|
|
293
292
|
|
|
294
293
|
let active = true
|
|
295
294
|
let position = 0
|
|
296
295
|
while (active) {
|
|
297
|
-
const blob =
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
296
|
+
const blob = new Uint8Array(bytesPerBlob)
|
|
297
|
+
|
|
298
|
+
// Each field element is a zero byte, so it doesn't overflow the BLS
|
|
299
|
+
// modulus, followed by 31 data bytes. The zero byte is already in place.
|
|
300
|
+
// Copying byte by byte beats a `subarray` view plus `set` at this size, and
|
|
301
|
+
// allocates nothing.
|
|
302
|
+
for (
|
|
303
|
+
let offset = 1;
|
|
304
|
+
offset < bytesPerBlob;
|
|
305
|
+
offset += bytesPerFieldElement
|
|
306
|
+
) {
|
|
307
|
+
const length = Math.min(31, size_ - position)
|
|
308
|
+
for (let i = 0; i < length; i++) blob[offset + i] = data_[position + i]!
|
|
309
|
+
|
|
310
|
+
// A segment shorter than 31 bytes ends the data: push a terminator byte
|
|
311
|
+
// to mark it.
|
|
312
|
+
if (length < 31) {
|
|
313
|
+
blob[offset + length] = 0x80
|
|
313
314
|
active = false
|
|
314
315
|
break
|
|
315
316
|
}
|
|
316
317
|
|
|
317
|
-
size++
|
|
318
318
|
position += 31
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
blobs.push(blob)
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
return (
|
|
325
|
-
as === 'Bytes'
|
|
326
|
-
? blobs.map((x) => x.bytes)
|
|
327
|
-
: blobs.map((x) => Hex.fromBytes(x.bytes))
|
|
328
|
-
) as never
|
|
324
|
+
return (as === 'Bytes' ? blobs : blobs.map((x) => Hex.fromBytes(x))) as never
|
|
329
325
|
}
|
|
330
326
|
|
|
331
327
|
export declare namespace from {
|
|
@@ -343,7 +339,6 @@ export declare namespace from {
|
|
|
343
339
|
| EmptyBlobError
|
|
344
340
|
| Bytes.fromHex.ErrorType
|
|
345
341
|
| Hex.fromBytes.ErrorType
|
|
346
|
-
| Cursor.create.ErrorType
|
|
347
342
|
| Bytes.size.ErrorType
|
|
348
343
|
| Errors.GlobalErrorType
|
|
349
344
|
}
|
|
@@ -463,7 +458,7 @@ export declare namespace sidecarsToVersionedHashes {
|
|
|
463
458
|
*
|
|
464
459
|
* const blobs = Blobs.from('0xdeadbeef')
|
|
465
460
|
* const data = Blobs.to(blobs, 'Bytes')
|
|
466
|
-
* // @log: Uint8Array [
|
|
461
|
+
* // @log: Uint8Array [ 222, 173, 190, 239 ]
|
|
467
462
|
* ```
|
|
468
463
|
*
|
|
469
464
|
* @param blobs - The {@link ox#Blobs.Blobs} to transform.
|
|
@@ -486,35 +481,37 @@ export function to<
|
|
|
486
481
|
: blobs
|
|
487
482
|
) as Bytes.Bytes[]
|
|
488
483
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
484
|
+
// Only the final blob contains a terminator: the last `0x80` byte in it, when
|
|
485
|
+
// that byte is data rather than the zero byte leading a field element.
|
|
486
|
+
// Preceding blobs contain only data.
|
|
487
|
+
const last = blobs_[blobs_.length - 1]
|
|
488
|
+
const terminator = last ? last.lastIndexOf(0x80) : -1
|
|
489
|
+
const lastEnd =
|
|
490
|
+
terminator % bytesPerFieldElement > 0 ? terminator : (last?.length ?? 0)
|
|
492
491
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
}
|
|
492
|
+
// Each field element contributes all of its bytes but the leading zero byte.
|
|
493
|
+
const dataSize = (end: number) =>
|
|
494
|
+
Math.floor(end / bytesPerFieldElement) * 31 +
|
|
495
|
+
Math.max(0, (end % bytesPerFieldElement) - 1)
|
|
496
|
+
|
|
497
|
+
let length = dataSize(lastEnd)
|
|
498
|
+
for (let index = 0; index < blobs_.length - 1; index++)
|
|
499
|
+
length += dataSize(blobs_[index]!.length)
|
|
500
|
+
|
|
501
|
+
const data = new Uint8Array(length)
|
|
502
|
+
let position = 0
|
|
503
|
+
for (let index = 0; index < blobs_.length; index++) {
|
|
504
|
+
const blob = blobs_[index]!
|
|
505
|
+
const end = index === blobs_.length - 1 ? lastEnd : blob.length
|
|
506
|
+
// Skip the zero byte leading each field element. Copying byte by byte
|
|
507
|
+
// beats a `subarray` view plus `set` for 31 bytes, and allocates nothing.
|
|
508
|
+
for (let offset = 1; offset < end; offset += bytesPerFieldElement) {
|
|
509
|
+
const stop = Math.min(offset + 31, end)
|
|
510
|
+
for (let i = offset; i < stop; i++) data[position++] = blob[i]!
|
|
513
511
|
}
|
|
514
512
|
}
|
|
515
513
|
|
|
516
|
-
|
|
517
|
-
return (to_ === 'Hex' ? Hex.fromBytes(trimmedData) : trimmedData) as never
|
|
514
|
+
return (to_ === 'Hex' ? Hex.fromBytes(data) : data) as never
|
|
518
515
|
}
|
|
519
516
|
|
|
520
517
|
export declare namespace to {
|
|
@@ -525,7 +522,6 @@ export declare namespace to {
|
|
|
525
522
|
type ErrorType =
|
|
526
523
|
| Hex.fromBytes.ErrorType
|
|
527
524
|
| Bytes.fromHex.ErrorType
|
|
528
|
-
| Cursor.create.ErrorType
|
|
529
525
|
| Errors.GlobalErrorType
|
|
530
526
|
}
|
|
531
527
|
|
|
@@ -561,7 +557,7 @@ export declare namespace toHex {
|
|
|
561
557
|
*
|
|
562
558
|
* const blobs = Blobs.from('0xdeadbeef')
|
|
563
559
|
* const data = Blobs.toBytes(blobs) // [!code focus]
|
|
564
|
-
* // @log: Uint8Array [
|
|
560
|
+
* // @log: Uint8Array [ 222, 173, 190, 239 ]
|
|
565
561
|
* ```
|
|
566
562
|
*/
|
|
567
563
|
export function toBytes(
|
package/core/Block.ts
CHANGED
|
@@ -48,6 +48,8 @@ export type Block<
|
|
|
48
48
|
parentHash: Hex.Hex
|
|
49
49
|
/** Root of the this block’s receipts trie */
|
|
50
50
|
receiptsRoot: Hex.Hex
|
|
51
|
+
/** EIP-7685 requests hash */
|
|
52
|
+
requestsHash?: Hex.Hex | undefined
|
|
51
53
|
sealFields?: readonly Hex.Hex[] | undefined
|
|
52
54
|
/** SHA3 of the uncles data in this block */
|
|
53
55
|
sha3Uncles: Hex.Hex
|
|
@@ -185,6 +187,7 @@ export function toRpc<
|
|
|
185
187
|
parentBeaconBlockRoot: block.parentBeaconBlockRoot,
|
|
186
188
|
parentHash: block.parentHash,
|
|
187
189
|
receiptsRoot: block.receiptsRoot,
|
|
190
|
+
requestsHash: block.requestsHash,
|
|
188
191
|
sealFields: block.sealFields,
|
|
189
192
|
sha3Uncles: block.sha3Uncles,
|
|
190
193
|
size: Hex.fromNumber(block.size),
|
package/core/BlockOverrides.ts
CHANGED
|
@@ -42,7 +42,8 @@ export type Rpc = BlockOverrides<Hex.Hex, Hex.Hex>
|
|
|
42
42
|
* feeRecipient: '0x0000000000000000000000000000000000000000',
|
|
43
43
|
* gasLimit: '0x4',
|
|
44
44
|
* number: '0x5',
|
|
45
|
-
* prevRandao:
|
|
45
|
+
* prevRandao:
|
|
46
|
+
* '0x0000000000000000000000000000000000000000000000000000000000000006',
|
|
46
47
|
* time: '0x1234567890',
|
|
47
48
|
* withdrawals: [
|
|
48
49
|
* {
|
|
@@ -134,7 +135,7 @@ export function toRpc(blockOverrides: BlockOverrides): Rpc {
|
|
|
134
135
|
number: Hex.fromNumber(blockOverrides.number),
|
|
135
136
|
}),
|
|
136
137
|
...(typeof blockOverrides.prevRandao === 'bigint' && {
|
|
137
|
-
prevRandao: Hex.fromNumber(blockOverrides.prevRandao),
|
|
138
|
+
prevRandao: Hex.fromNumber(blockOverrides.prevRandao, { size: 32 }),
|
|
138
139
|
}),
|
|
139
140
|
...(typeof blockOverrides.time === 'bigint' && {
|
|
140
141
|
time: Hex.fromNumber(blockOverrides.time),
|