Skip to content

feat(tempo): add funding requirements and policies - #468

Open
jxom wants to merge 8 commits into
mainfrom
jxom/tip-1120-funding
Open

jxom wants to merge 8 commits into
mainfrom
jxom/tip-1120-funding

Conversation

@jxom

@jxom jxom commented Sep 23, 2026

Copy link
Copy Markdown
Member

Added TIP-1120 funding transactions, committed policy rules, and access key policy authorization, with native DEX payload codecs and backward-compatible encoding.

Implements tempoxyz/tempo#7678.

@vercel

vercel Bot commented Sep 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ox Error Error Sep 23, 2026 9:49pm UTC

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Sep 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 45c2c9d

@jxom
jxom marked this pull request as ready for review September 23, 2026 20:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-23T21:53:50.501285Z 45c2c9d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c2408b86a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1,5 @@
---
"ox": patch

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark the new public API as a minor release

When Changesets versions this commit, patch will publish these additions as a bug-fix release even though the commit adds new public subpath exports and new requireFunds/fundingPolicy API fields. This is an additive feature and should use a minor changeset so consumers can rely on patch releases not expanding the public API.

Useful? React with 👍 / 👎.

Comment thread src/tempo/Transaction.ts
Comment on lines +259 to +262
if (transaction.requireFunds)
transaction_.requireFunds = transaction.requireFunds.map(
FundingRequirement.fromRpc,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize null funding lists in transaction responses

When the Tempo node serializes an absent optional requireFunds field as null, this falsy branch skips conversion, but ox_Transaction.fromRpc has already copied the raw field via object spread. Because requireFunds was not added to the optional-null scrub list below, Transaction.fromRpc returns requireFunds: null despite the domain type allowing only an array or undefined; the Zod transaction codec has the same omission in nullableFields and rejects such a response outright.

Useful? React with 👍 / 👎.

Comment thread src/tempo/Transaction.ts
/** Effective gas price paid by the sender in wei. */
gasPrice?: bigintType | undefined
/** Key authorization for provisioning a new access key. */
/** Required balances before application calls. */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore TSDoc for keyAuthorization

Adding requireFunds between the existing key-authorization comment and the keyAuthorization property leaves that public property without attached TSDoc, so its description disappears from generated API documentation. Move the existing comment back immediately above keyAuthorization while keeping the new funding comment with requireFunds.

AGENTS.md reference: AGENTS.md:L65-L65

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99c0b75af9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +596 to +598
...(authorization.fundingPolicy !== undefined
? { fundingPolicy: FundingPolicy.fromRpc(authorization.fundingPolicy) }
: {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat null funding policies as absent

When the node returns a key authorization without a funding policy as fundingPolicy: null, this condition treats the field as present and passes null to FundingPolicy.fromRpc, which eventually dereferences admins and throws. The neighboring optional RPC fields already normalize the node's null representation with ?? undefined; fundingPolicy should do the same, and the Zod RPC schema should accept null as well.

Useful? React with 👍 / 👎.

Comment on lines +460 to +461
if (auth.fundingPolicy !== undefined)
FundingPolicy.toTuple(auth.fundingPolicy)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add funding-policy failures to public error unions

For invalid policy IDs or inline rules, this newly added call can throw FundingPolicy.InvalidPolicyError, but from.ErrorType still lists only the preexisting signature/account errors. The same omission affects the other conversion paths that now invoke FundingPolicy; include the funding-policy failure in their exported ErrorType unions so consumers do not receive incomplete public error typing.

AGENTS.md reference: AGENTS.md:L78-L78

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45c2c9d10b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

* })
* ```
*/
export function assert(value: FundingRequirement): void {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish error unions for the funding codecs

This new public module's throwing exports (assert, from, toTuple, fromTuple, fromRpc, and toRpc) have no matching function namespaces containing ErrorType, so consumers cannot derive their possible failures using the standard Ox API pattern. Add per-function error unions, including InvalidRequirementError and delegated address/hex errors; the other new funding codec modules need the same treatment.

AGENTS.md reference: AGENTS.md:L74-L78

Useful? React with 👍 / 👎.

This branch had an error being deployed

1 failed deployment
Preview 45c2c9d1 Deployed Sep 23, 2026 by vercel[bot]
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