Skip to content

feat: return MptokenIssuanceID for token.issue() - #40

Merged
pdp2121 merged 1 commit into
mainfrom
token-issue-returns-id
Sep 10, 2026
Merged

pdp2121 merged 1 commit into
mainfrom
token-issue-returns-id

Conversation

@pdp2121

@pdp2121 pdp2121 commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

High Level Overview of Change

  • Fix Token.issue() returning an empty mptIssuanceId when issuing an MPT through Ripple Custody. The id is now recovered from the on-chain transaction metadata by hash.

Context of Change

  • Ripple Custody confirms an MPTokenIssuanceCreate and returns the ledger tx hash, but its transaction record has ledgerData: null and rawTransaction: null — the two fields the SDK reads/reconstructs the issuance id from — so mptIssuanceId came back '' (and token.retrieve then found nothing). A probe confirmed this is Custody omitting the fields, not a timing lag (identical at t+0/+5s/+15s).
  • Fix: after the existing custody poll, if the id is still empty but a confirmed txHash exists, Token.issue() reads it from the on-chain tx metadata (tx request) — the authoritative source. General to any custodian with the same behavior; best-effort (never throws).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)

Test Plan

  • Unit: 2 new tests — recovers the id from the ledger tx when the result omits it, and leaves it empty without throwing when the ledger lookup fails. Full unit tier green (683).
  • Contract (live sandbox): new MPT-issuance test asserting mptIssuanceId is a valid 48-hex MPTokenIssuanceID (not '') and resolves on-ledger as an issuance owned by the primary.
  • Verified live against the Custody sandbox: token.issue() now returns a real id internally, no workaround.

@pdp2121
pdp2121 merged commit e90c9cc into main Sep 10, 2026
6 checks passed
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