Skip to content

feat: v1#231

Open
jxom wants to merge 136 commits into
mainfrom
v1
Open

feat: v1#231
jxom wants to merge 136 commits into
mainfrom
v1

Conversation

@jxom
Copy link
Copy Markdown
Member

@jxom jxom commented May 7, 2026

Breaking changes

  • Hex-encoded crypto coordinates. Migrated Signature, PublicKey, BlsPoint, and all envelope types (Transaction, Authorization, ERC envelopes, Tempo) from bigint r/s/x/y/Fp/Fp2 to padded Hex.Hex (32-byte for secp256k1/P256/WebAuthnP256, 48-byte for BLS12-381). The bigintType generic is removed.

    - Signature.from({ r: 0x6e10...n, s: 0x4a90...n, yParity: 1 })
    + Signature.from({
    +   r: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf',
    +   s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8',
    +   yParity: 1,
    + })
  • @noble/* v2. Upgraded @noble/ciphers, @noble/curves, @noble/hashes, @scure/bip32, @scure/bip39. ECDSA signatures (Secp256k1, P256) now default to lowS: true. Module .noble re-exports follow v2 (randomSecretKey, Point, bls.longSignatures.*, etc.).

  • PeerDAS (EIP-7594) blob model. Removed the EIP-4844 blob-sidecar surface (Blobs.toSidecars, Blobs.BlobSidecar(s), TxEnvelopeEip4844.sidecars, Kzg.Kzg.computeBlobKzgProof). Added the BlobCells module for cell/column propagation. KZG backends must implement computeCells, computeCellsAndKzgProofs, recoverCellsAndKzgProofs, verifyCellKzgProofBatch.

    - sidecars: { blobs, commitments, proofs }
    + sidecars: { blobs, commitments, cellProofs }
  • ABI decode checksums by default. AbiParameters.decode (and downstream AbiFunction/AbiEvent/AbiError decoders) checksum decoded address outputs. Opt out with checksumAddress: false.

Notable additions

  • Crypto serialized inputs and as option. Secp256k1, P256, WebCryptoP256, and Bls now accept Hex.Hex | Bytes.Bytes | Signature.Signature | PublicKey.PublicKey for signature/publicKey params, and expose as: 'Hex' | 'Bytes' | 'Object' on sign / getPublicKey / recoverPublicKey.

    - const signature = Secp256k1.sign({ payload, privateKey })
    + const signature = Secp256k1.sign({ payload, privateKey, as: 'Hex' })
  • AbiEvent.decodeLog. Extract and decode an event log directly from an ABI.

    const abi = Abi.from([
      'event Transfer(address indexed from, address indexed to, uint256 value)',
    ])
    
    const { event, args } = AbiEvent.decodeLog(abi, {
      data: '0x0000000000000000000000000000000000000000000000000000000000000001',
      topics: [
        '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
        '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac',
        '0x000000000000000000000000a5cc3c03994db5b0d9a5eedd10cabab0813678ac',
      ],
    })
    // event: { name: 'Transfer', type: 'event', ... }
    // args:  { from: '0xa5cc...', to: '0xa5cc...', value: 1n }
  • AbiEvent.extractLogs. Filter and decode logs from a batch against an ABI.

    const logs = AbiEvent.extractLogs(abi, logs, { eventName: 'Transfer' })
    // [{ eventName: 'Transfer', args: { from, to, value }, topics, data }, ...]
  • AbiError.extract. Select the matching ABI error from revert data and decode its arguments.

    const abi = Abi.from([
      'error InvalidSignature(uint r, uint s, uint8 yParity)',
    ])
    
    const { error, args } = AbiError.extract(
      abi,
      '0xecde6349...0001a4...0045...0001',
    )
    // error: { name: 'InvalidSignature', type: 'error', ... }
    // args:  [420n, 69n, 1]
  • AbiFunction.decodeData selector inference. Pass an ABI plus calldata and the function is resolved from the 4-byte selector. Decoding selector-only calldata for a function with inputs now throws AbiParameters.DataSizeTooSmallError instead of silently returning undefined, and constructorless AbiConstructor deploy data is now allowed when there are no arguments.

    const abi = Abi.from(['function approve(address, uint256)', /* ... */])
    
    const input = AbiFunction.decodeData(
      abi,
      '0x095ea7b3000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa960450000000000000000000000000000000000000000000000000000000000010f2c',
    )
    // ['0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', 69420n]
  • Transaction envelope router. TxEnvelope.from / serialize / deserialize / hash / getSignPayload / toRpc infer the envelope type from input properties and route to the matching TxEnvelopeLegacy / TxEnvelopeEip2930 / TxEnvelopeEip1559 / TxEnvelopeEip4844 / TxEnvelopeEip7702 module.

    const envelope = TxEnvelope.from({
      chainId: 1,
      maxFeePerGas: 1n,
    })
    
    const serialized = TxEnvelope.serialize(envelope, { signature })
    const hash = TxEnvelope.hash(envelope)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ox Error Error May 21, 2026 8:56pm

Request Review

Bumps @noble/ciphers, @noble/curves, @noble/hashes, @scure/bip32,
and @scure/bip39 to v2 and refactors crypto wrappers to the new APIs
(Uint8Array signatures, Point.fromBytes, Signature.fromBytes/toBytes,
bls.longSignatures, randomSecretKey, .js import extensions).

Adds an internal helper for converting between ox's { r, s, yParity }
Signature shape and noble's compact/recovered byte layouts. Restores
ImportMeta.env types for tests now that vitest v4 dropped them.

Amp-Thread-ID: https://ampcode.com/threads/T-019e05c5-ba3e-711e-8ea5-532440226027
jxom added 20 commits May 8, 2026 15:25
Bumps @noble/ciphers, @noble/curves, @noble/hashes, @scure/bip32,
and @scure/bip39 to v2 and refactors crypto wrappers to the new APIs
(Uint8Array signatures, Point.fromBytes, Signature.fromBytes/toBytes,
bls.longSignatures, randomSecretKey, .js import extensions).

Adds an internal helper for converting between ox's { r, s, yParity }
Signature shape and noble's compact/recovered byte layouts. Restores
ImportMeta.env types for tests now that vitest v4 dropped them.

Amp-Thread-ID: https://ampcode.com/threads/T-019e05c5-ba3e-711e-8ea5-532440226027
The tempo node returns a blockTimestamp on transaction responses; add
it to the core Transaction type, parse it in fromRpc, and serialize it
in toRpc. Updates the tempo e2e tests to assert it on transactions
returned via Transaction.fromRpc.

Amp-Thread-ID: https://ampcode.com/threads/T-019e05c5-ba3e-711e-8ea5-532440226027
Implementation for the changeset added in 2b32e0c (the source change was lost in a concurrent stash on the previous commit).

Amp-Thread-ID: https://ampcode.com/threads/T-019e197d-5765-7569-9e8b-b992045f9165
Filter.Filter (and Filter.Rpc) now express the execution-apis filter.yaml
oneOf schema: callers may supply either fromBlock/toBlock or blockHash.
Filter.toRpc forwards blockHash when present.

Amp-Thread-ID: https://ampcode.com/threads/T-019e4422-9e7a-70de-bb9e-51613fe54d38
jxom added 5 commits May 21, 2026 12:31
Adds `// @noErrors` to JSDoc example snippets that intentionally trigger
type or runtime errors so they're recognized by zile's examples:check.

Also fixes two `Siwe.createMessage` examples in src/index.ts that used
`chainId: 1` instead of the required `chainId: 1n`.

Amp-Thread-ID: https://ampcode.com/threads/T-019e488f-68ce-7377-8ce7-b3848e22594b
Bumps zile to ^0.0.26 to pick up the `examples:check` command for
typechecking JSDoc snippets, adds a `pnpm check:examples --fix` script,
and runs it (without `--fix`) in the Verify CI job.

Amp-Thread-ID: https://ampcode.com/threads/T-019e488f-68ce-7377-8ce7-b3848e22594b
`Log.fromRpc` now converts `blockTimestamp` to bigint; the
`TransactionReceipt` test snapshot was still expecting the raw hex
string.

Amp-Thread-ID: https://ampcode.com/threads/T-019e488f-68ce-7377-8ce7-b3848e22594b
jxom added 4 commits May 21, 2026 15:02
Some RPC servers return `Content-Type: application/json` with an empty
body for error responses (e.g. `401 Unauthorized`). Previously
`response.json()` would throw a confusing `SyntaxError: Unexpected end
of JSON input` instead of surfacing the underlying HTTP error.

Now always read the response as text and parse JSON manually, so empty
bodies fall through to the existing `HttpError` path.

Amp-Thread-ID: https://ampcode.com/threads/T-019e488f-68ce-7377-8ce7-b3848e22594b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant