Build routes for every action, submission, status, admission requests and the faucet.
Every action on the ledger is one transaction the API builds and the wallet signs:
POST /v1/build/{action} checks the action against the register and returns an unsigned v0 transaction with a summary of what it will move. A refused action returns an error before anything is signed: NOT_FOUND for an offer or repo that doesn't exist, otherwise the program error or API refusal that stops it, as listed in Errors.
The wallet signs transactionBase64.
POST /v1/transactions/submit sends it, or records the signature of one the wallet sent itself.
GET /v1/transactions/{id} reports its status until it settles.
The build's id. Submit and follow the transaction by it.
transactionBase64
Base64
The unsigned v0 transaction for the wallet to sign.
blockhash
Address
The blockhash the transaction was built on.
lastValidBlockHeight
integer
The block height after which the transaction can't land. Build again after it.
cosigned
boolean
true when the server adds a signature at submit (admission, which the operator co-signs). Submit it in relay mode.
summary
ActionSummary
What the transaction will move, for the confirmation screen.
ActionSummary
Field
Type
Description
action
string
The build action.
description
string
One sentence saying what moves.
legs
SettlementLeg[]
The legs the transaction will settle.
fee
U64
The settlement fee in cash atoms (take-offer).
repurchaseAmount
U64
Cash atoms to repay (take-repo, repay).
maturity
Timestamp
When the repo matures (take-repo, repay). For take-repo it is the build time plus the term; the program fixes it when the transaction lands.
perUnitScaled
BaseUnits
Cash atoms per unit, scaled by 10^12 (pay-income).
The summary's legs use the same shape as a settlement's: SettlementLeg. Show them before the wallet signs: they are what the settlement will record.
Build routes
Every request names the signing wallet. Units, amounts and prices are strings; rates and terms are integers.
POST /v1/build/admit
Admits the wallet once its request is approved (Admission requests). The build is cosigned: submit it in relay mode, and the API adds the operator's signature.
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
POST /v1/build/deposit
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
amount
PositiveU64
yes
USDC atoms to move from the wallet's cash ATA into free ledger cash.
POST /v1/build/withdraw
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
amount
PositiveU64
yes
Free cash atoms to send to the wallet's cash ATA.
POST /v1/build/list-instrument
For an equity:
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
code
Code
yes
The new instrument's code.
name
string
yes
Its name: text, at most 80 UTF-8 bytes.
kind
"equity"
yes
equity or bond.
For a bond:
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
code
Code
yes
The new instrument's code.
name
string
yes
Its name: text, at most 80 UTF-8 bytes.
kind
"bond"
yes
equity or bond.
couponBps
integer
yes
Yearly coupon in basis points.
maturity
Timestamp
yes
Maturity, later than now.
POST /v1/build/issue
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
code
Code
yes
The instrument code.
recipient
Address
yes
The admitted wallet to credit.
units
PositiveU64
yes
Whole units to credit to the recipient's free lane.
POST /v1/build/post-offer
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
code
Code
yes
The instrument code.
side
"buy" | "sell"
yes
buy (a bid) or sell (an ask).
units
PositiveU64
yes
Whole units offered.
price
PositiveU64
yes
Cash atoms per unit.
POST /v1/build/cancel-offer
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
offerId
Address
yes
The Offer account's address.
POST /v1/build/take-offer
The summary includes the fee.
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
offerId
Address
yes
The Offer account's address.
units
PositiveU64
yes
Whole units to fill, at most the offer's open size.
POST /v1/build/post-repo-offer
The cash locked is units × advancePerUnit.
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
code
Code
yes
The instrument code.
units
PositiveU64
yes
Units the offer lends against. The cash locked is units times advancePerUnit.
advancePerUnit
PositiveU64
yes
Cash atoms advanced per pledged unit.
rateBps
integer
yes
Yearly rate in basis points.
termSeconds
integer
yes
Repo term in seconds.
POST /v1/build/cancel-repo-offer
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
repoOfferId
Address
yes
The RepoOffer account's address.
POST /v1/build/take-repo
The summary includes the repurchaseAmount and maturity, both fixed when the repo opens.
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
repoOfferId
Address
yes
The RepoOffer account's address.
units
PositiveU64
yes
Whole units to pledge. Their advance must fit in the offer's available cash.
POST /v1/build/repay
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
repoId
Address
yes
The Repo account's address.
POST /v1/build/settle-default
Any wallet may build it; the wallet needn't be a member.
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
repoId
Address
yes
The Repo account's address.
POST /v1/build/pay-income
The summary includes perUnitScaled.
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
code
Code
yes
The instrument code.
amount
PositiveU64
yes
Cash atoms to pay into the instrument from the issuer's free cash.
POST /v1/build/claim-income
Field
Type
Required
Description
wallet
Address
yes
The wallet's address.
code
Code
yes
The instrument code.
Submit
POST /v1/transactions/submit takes one of two bodies, by mode.
relay: the API sends the signed transaction.
Field
Type
Required
Description
buildId
TransactionId
yes
The id the build route returned.
idempotencyKey
string
yes
A key you choose, 1 to 128 characters. Resending the same submission with it returns the first result.
mode
"relay"
yes
relay: the API sends the signed transaction. wallet-sent: the wallet already sent it.
signedTransactionBase64
string
yes
The transaction as the wallet signed it.
wallet-sent: the wallet signed and sent it itself, and the API follows its signature. Not for co-signed builds.
Field
Type
Required
Description
buildId
TransactionId
yes
The id the build route returned.
idempotencyKey
string
yes
A key you choose, 1 to 128 characters. Resending the same submission with it returns the first result.
mode
"wallet-sent"
yes
relay: the API sends the signed transaction. wallet-sent: the wallet already sent it.
signature
Signature
yes
The signature the wallet's send returned.
Submitting again with the same idempotencyKey and body sends nothing twice: it returns that transaction's status. The same key with a different build or body is an IDEMPOTENCY_CONFLICT. The response is a TxStatus.
Status
GET /v1/transactions/{id}, with the build's id, returns:
submitted, unconfirmed, confirmed, finalized, failed or expired.
signature
Signature
The transaction signature, once known.
error
TxFailure
Why it failed, when status is failed.
Read it until the status is confirmed, finalized, failed or expired; the client's settled(status) says when. expired means the blockhash passed lastValidBlockHeight before the transaction landed: build again. A failure says where and why:
Where it failed: build, wallet-rejected, wallet-changed, simulation, send or confirm.
message
string
A sentence the app can show.
nextStep
string
What to do next.
retryable
boolean
true when trying again can succeed.
program
object
The program that refused it, for program errors.
program.address
Address
The refusing program's address.
program.code
integer | null
Its custom error code.
program.name
string | null
Its error name.
Admission requests
POST /v1/admissions asks the operator to admit a wallet and returns its admission state. The wallet signs the request itself (Wallet Standard signMessage, UTF-8) over this text, which admissionMessage({ wallet, entity, role, signedAt }) in the TypeScript client builds:
The entity is trimmed. The API accepts the signature for ten minutes after signedAt; an older one is a VALIDATION_ERROR on signedAt, and one made by another key is UNAUTHORIZED.
Sending the same entity and role again returns the request as it stands. A different entity or role replaces it, clears any rejection and sends it back for approval, approved at once where admissionMode is instant. An admitted wallet gets admitted.
Field
Type
Required
Description
wallet
Address
yes
The wallet to admit.
entity
string
yes
The entity's name: text, at most 80 UTF-8 bytes.
role
"holder" | "issuer"
yes
holder or issuer.
signedAt
Timestamp
yes
When the wallet signed the request. The API accepts it for ten minutes.
signature
Signature
yes
The wallet's Ed25519 signature over admissionMessage of this request, base58.
Faucet
POST /v1/faucet sends test USD and SOL to a wallet, where GET /v1/config reports faucetAvailable: true.