Skip to content

feat(abi): move human-readable ABI utils into ox#274

Merged
jxom merged 5 commits into
v1from
tmm/human-readable-abi-ox
Jun 23, 2026
Merged

feat(abi): move human-readable ABI utils into ox#274
jxom merged 5 commits into
v1from
tmm/human-readable-abi-ox

Conversation

@tmm

@tmm tmm commented Jun 19, 2026

Copy link
Copy Markdown
Member

Moves the human-readable ABI parser/formatter runtime and type-level return shapes from abitype into ox internals, while preserving ox namespace APIs. Also adds the singular AbiParameter module, upstream runtime/type coverage, and type-instantiation regression guards.

import { Abi, AbiItem, AbiParameter, AbiParameters } from 'ox'

const abi = Abi.from([
  'function approve(address spender, uint256 amount) returns (bool)',
])
//    ^? const abi: readonly [{ readonly name: "approve"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "spender"; }, { readonly type: "uint256"; readonly name: "amount"; }]; readonly outputs: readonly [{ readonly type: "bool"; }]; }]

const item = AbiItem.from('function approve(address spender, uint256 amount)')
//    ^? const item: { readonly name: "approve"; readonly type: "function"; readonly stateMutability: "nonpayable"; readonly inputs: readonly [{ readonly type: "address"; readonly name: "spender"; }, { readonly type: "uint256"; readonly name: "amount"; }]; readonly outputs: readonly [] }

const parameters = AbiParameters.from('address spender, uint256 amount')
//    ^? const parameters: readonly [{ readonly type: "address"; readonly name: "spender"; }, { readonly type: "uint256"; readonly name: "amount"; }]

const parameter = AbiParameter.from('address spender')
//    ^? const parameter: { readonly type: "address"; readonly name: "spender"; }

const formatted = Abi.format(abi)
//    ^? const formatted: readonly ["function approve(address spender, uint256 amount) returns (bool)"]

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
ox Error Error Jun 22, 2026 9:35pm

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Jun 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/ox@274

commit: 97f8b33

@tmm tmm mentioned this pull request Jun 19, 2026
@tmm tmm force-pushed the tmm/human-readable-abi-ox branch from ee84e52 to e46672f Compare June 21, 2026 18:31
@tmm tmm force-pushed the tmm/human-readable-abi-ox branch from e46672f to e4ccb62 Compare June 21, 2026 18:44
@tmm tmm force-pushed the tmm/human-readable-abi-ox branch from e4ccb62 to 90b1a95 Compare June 21, 2026 18:45
@tmm tmm force-pushed the tmm/human-readable-abi-ox branch from 90b1a95 to 90457cc Compare June 21, 2026 18:47
@tmm tmm force-pushed the tmm/human-readable-abi-ox branch from 90457cc to 727f4fe Compare June 21, 2026 18:49
@tmm tmm force-pushed the tmm/human-readable-abi-ox branch from 727f4fe to 8169c07 Compare June 21, 2026 18:53
@tmm tmm force-pushed the tmm/human-readable-abi-ox branch from 8169c07 to 4259289 Compare June 21, 2026 19:24
@tmm tmm force-pushed the tmm/human-readable-abi-ox branch from 4259289 to 5661308 Compare June 22, 2026 16:25
@tmm tmm force-pushed the tmm/human-readable-abi-ox branch from 5661308 to 29bf505 Compare June 22, 2026 16:57
@tmm tmm force-pushed the tmm/human-readable-abi-ox branch from 29bf505 to 4a378cf Compare June 22, 2026 17:03
@tmm tmm force-pushed the tmm/human-readable-abi-ox branch from 4a378cf to 907d3f9 Compare June 22, 2026 18:33
@tmm tmm marked this pull request as ready for review June 22, 2026 20:41
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedvocs@​2.0.17901008896100

View full report

@jxom jxom merged commit 584db0d into v1 Jun 23, 2026
12 of 13 checks passed
@jxom jxom deleted the tmm/human-readable-abi-ox branch June 23, 2026 00:51
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.

2 participants