Skip to main content

Client + config

import { BridgeSDK } from "@satsterminal-sdk/bridge";
// or via suite: const { bridge } = createClient({ apiKey, bridge: true });

const bridge = new BridgeSDK({ apiKey, baseUrl }); // baseUrl optional; defaults to core API
  • Amounts: strings in smallest units (6 decimals).
  • Namespace: bridge.spark.stables.

Direction model

  • direction=in (default): USDC -> USDB (inbound).
  • direction=out: USDB -> USDC (outbound).
Only quote requires direction. Other endpoints infer it from ids or tx hashes, but you can pass direction explicitly.

Supported chains

Inbound sourceChain and outbound destinationChain support: solana, base, polygon, arbitrum, optimism, ethereum. Outbound status responses use source_chain: "spark".

Methods

bridge.spark.stables.quote(params)

Request a quote and a direction-specific deposit address.
ParamTypeNotes
direction?"in" | "out"Default "in"; use "out" for outbound quotes
sourceChain?stringRequired for inbound quotes
destinationChain?stringRequired for outbound quotes
destinationAddress?stringRequired for outbound quotes
amountstringAmount in smallest units (6 decimals)
userSparkAddressstringSpark address
Returns: { quoteId, depositAddress, amountIn, fee, amountOut, expiresAt, sourceChain?, destinationChain?, direction? } Notes:
  • Inbound depositAddress is an EVM/Solana address for USDC.
  • Outbound depositAddress is a Spark address for USDB.

bridge.spark.stables.submit(params)

Submit a transaction hash after sending funds to the deposit address.
ParamTypeNotes
quoteIdstringQuote identifier
txHashstringSource chain tx (inbound) or Spark tx (outbound)
sourceAddressstringSender address on the deposit chain
direction?"in" | "out"Optional explicit direction
Returns: { bridgeId, status, message }

bridge.spark.stables.process(id)

Process or poll a bridge transaction by id. Returns: { bridgeId, status, message?, braleTransferId?, sparkTxHash?, destinationTxHash?, fastFill?, error? }

bridge.spark.stables.status(params)

Fetch a bridge status by id, quote, or tx hash.
ParamTypeNotes
id?stringBridge id
quoteId?stringQuote id
txHash?stringSource chain tx (inbound) or Spark tx (outbound)
chain?stringSource chain (alias: sourceChain, inbound only)
direction?"in" | "out"Optional explicit direction
Returns: SparkStablesStatusResponse (deposit status or quote status).

bridge.spark.stables.lookup(query)

Lookup a bridge by any identifier (bridge id, quote id, tx hash, Brale transfer id, Spark tx hash, destination tx hash). Returns: { matchedBy, bridge }

bridge.spark.stables.history(params)

Fetch bridge history for a Spark address.
ParamTypeNotes
addressstringSpark address
status?stringFilter by status
limit?numberPagination limit
offset?numberPagination offset
direction?"in" | "out"Optional filter; omit for both
Returns: { direction, bridges, pagination }

Status shapes

Inbound deposit status (USDC -> USDB):
FieldTypeNotes
idstringBridge id
quote_idstringQuote id
status"processing" | "confirming" | "minting" | "completed" | "failed"Bridge lifecycle state
tx_hashstringSource chain tx hash
source_chainstringSource chain
amount_instringUSDC amount in smallest units
amount_outstringUSDB amount out
feestringFee in smallest units
spark_addressstringDestination Spark address
brale_transfer_id`stringnull`Brale transfer id
spark_tx_hash`stringnull`Spark transaction hash
error`stringnull`Error message
created_atstringISO timestamp
completed_at`stringnull`ISO timestamp
Outbound withdrawal status (USDB -> USDC):
FieldTypeNotes
idstringBridge id
quote_idstringQuote id
status"processing" | "confirming" | "minting" | "completed" | "failed"Bridge lifecycle state
tx_hashstringSpark tx hash
source_chain"spark"Source chain
destination_chainstringDestination chain
destination_addressstringDestination address
amount_instringUSDB amount in smallest units
amount_outstringUSDC amount out
feestringFee in smallest units
spark_addressstringSource Spark address
brale_transfer_id`stringnull`Brale transfer id
destination_tx_hash`stringnull`Destination chain tx hash
error`stringnull`Error message
created_atstringISO timestamp
completed_at`stringnull`ISO timestamp
Quote status (before submit):
FieldTypeNotes
type"quote"Response discriminator
idstringQuote id
status"pending" | "expired" | "completed"Quote lifecycle state
sourceChainstringSource chain ("spark" for outbound)
destinationChain?stringDestination chain for outbound quotes
amountInstringAmount in smallest units
amountOutstringAmount out in smallest units
feestringFee in smallest units
expiresAtstringISO timestamp
createdAtstringISO timestamp
direction?"in" | "out"Optional direction indicator

Status reference

StatusMeaning
processingDeposit submitted, waiting for verification
confirmingTx found, waiting for chain confirmations
mintingBrale transfer in progress
completedUSDB sent to Spark (inbound) or USDC sent to destination chain (outbound)
failedTerminal failure; request a new quote