Skip to content

feat: add Ripple Custody full api support - #38

Merged
pdp2121 merged 3 commits into
mainfrom
add-ripple-custody-full-api
Sep 9, 2026
Merged

pdp2121 merged 3 commits into
mainfrom
add-ripple-custody-full-api

Conversation

@pdp2121

@pdp2121 pdp2121 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

High Level Overview of Change

  • Add custody.api.call — a typed, unsigned HTTP passthrough to any Ripple Custody v1 endpoint the SDK doesn't model as a first-class vertical.
  • Add custody.api.propose — the signed governed-intent counterpart; wraps any intent payload in a Core_Propose envelope, signs it, and submits it (e.g. releasing quarantined transfers) without a dedicated method.

Context of Change

  • Previously the Ripple Custody adapter exposed only verticals and kept its HTTP client private, so unmodeled endpoints (reading intents/domains/transfers, quarantine release) were unreachable.
  • api.call mirrors the existing Palisade passthrough (generated route map + operations types).
  • api.propose reuses the existing IntentSigner; the envelope build/sign logic is extracted into a shared buildProposeEnvelope that the native transaction path now also uses (no duplication, behavior unchanged).

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)

Test Plan

  • Unit: new custody-api suite covering call routing/path-interpolation and propose envelope/signing/overrides; full unit tier green.
  • Contract (live sandbox): api.call reads (getMe, getAccounts), api.propose signed-envelope acceptance, and a non-mutating v0_ReleaseQuarantinedTransfers dry-run that validates the payload shape.
  • typecheck, lint, format, and the dual ESM+CJS build all pass.

Comment thread src/custodians/ripple/transport/custody-http-client.ts Outdated
Comment thread src/custodians/ripple/mapping/envelope.ts
Comment thread scripts/gen-custody-routes.mjs
Comment thread src/custodians/ripple/api.ts Outdated
function fillPath(template: string, params?: Record<string, unknown>): string {
return template.replace(/\{(?<key>\w+)\}/gu, (_match, key: string) => {
const value = params?.[key]
if (value === undefined) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

consider also adding a check for null like so:

if (value === undefined || value === null) {

this would ensure that "null" passed as a parameter would yield the same missing path parameter error

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

fixed in 7f115d9

@pdp2121
pdp2121 merged commit 457af59 into main Sep 9, 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.

2 participants