Skip to content

feat(sdk): expose tokenPaymentInfo on high-level document transition APIs #3562

@thephez

Description

@thephez

Summary

The protocol and Rust SDK already support token-paid document transitions, but the high-level wasm-sdk document APIs do not expose tokenPaymentInfo.

Because of that, JS apps using the ergonomic high-level document APIs cannot work with contracts that require token payment for document actions such as create, transfer, purchase, delete, replace, or set price.

This also affects js-evo-sdk, since it forwards directly to these wasm-sdk methods.

Evidence

Rust SDK builders already support with_token_payment_info(...) for document transitions, including create / replace / delete / transfer / purchase / set price.

Low-level WASM-DPP document transition constructors also appear to support tokenPaymentInfo.

But the high-level methods in:

  • packages/wasm-sdk/src/state_transitions/document.rs

currently hardcode None for token payment info, or in the delete case do not expose it through the high-level options.

The JS facade in:

  • packages/js-evo-sdk/src/documents/facade.ts

just forwards to these methods, so the limitation propagates upward.

Why this matters

This blocks document/NFT token-economics use cases like:

  • burning a contract token to mint a document
  • requiring token payment to transfer a document
  • requiring token payment to purchase or reprice a document

The protocol appears to enforce this already via RequiredTokenPaymentInfoNotSetError, so this is not just a missing convenience feature — it can block valid contract designs from the normal JS/WASM path.

Request

Please add optional tokenPaymentInfo?: TokenPaymentInfo support to the high-level document transition option types and wire it through to the existing Rust SDK token payment plumbing for:

  • documentCreate
  • documentReplace
  • documentDelete
  • documentTransfer
  • documentPurchase
  • documentSetPrice

Suggested acceptance criteria

  • all six high-level document APIs accept optional tokenPaymentInfo
  • the field is passed through to the existing Rust SDK transition logic
  • TypeScript typings are updated
  • functional tests cover at least one token-costed document action
  • js-evo-sdk gets support automatically through forwarding

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions