Initiate new On-chain Swap Transaction

Initiate a new atomic on-chain asset swap between two users.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
uuid
required
Body Params

Carries the information required to initiate an atomic two-asset swap between two users.

string
required

Unique ID to ensure idempotency

uuid
required

ID of the counterparty user (the other side of the swap)

leg_a
object
required

The amount and fee configuration for one leg of a swap.

leg_b
object
required

The amount and fee configuration for one leg of a swap.

string | null

Optional memo to attach to the contract

Responses

400

Possible reasons:

  • counterparty user not found
  • custody vendor not configured
  • leg_a.amount must be positive
  • leg_b.amount must be positive
  • transaction with this external_id was already attempted
  • unknown asset_code for leg_a
  • unknown asset_code for leg_b
401

Not authenticated

403

the authority account cannot be used as the account for a transaction

404

Not found

409

user is archived

422

The request body is valid JSON but does not match the expected schema.

500

Possible reasons:

  • attempt to verify existing contract failed
  • could not begin transactional query
  • failed to build swap contract
  • failed to commit database transaction
  • failed to create transaction
  • failed to get asset code for leg_a
  • failed to get asset code for leg_b
  • failed to get treasury user
  • failed to look up counterparty user
  • failed to look up source vault for leg_a
  • failed to look up source vault for leg_b
  • failed to save contract
  • treasury user is not configured
Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json