Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kynesys.xyz/llms.txt

Use this file to discover all available pages before exploring further.

The Rubic bridge integration lets clients quote and execute cross-chain swaps through a Demos node. The node forwards a BridgeTradePayload to the underlying RubicBridge flow and returns the result over standard RPC.

Surface

The node exposes the bridge over rpcCall({ method: "bridge", params: [...] }). The RubicBridge SDK class is a thin client wrapper around three RPC methods:
RPC methodSDK methodPurpose
get_tradeRubicBridge.getTrade(demos, chain, payload)Quote a cross-chain trade
execute_tradeRubicBridge.executeTrade(demos, chain, payload)Submit the trade for real
execute_mock_tradeRubicBridge.executeMockTrade(demos, chain, payload)Dev-only path that exercises the same RPC plumbing without broadcasting on the foreign chain
chain is a string from SupportedChains (e.g. "POLYGON", "ETH"). See the SDK reference for end-to-end usage.

Payload

export interface BridgeTradePayload {
    fromToken: "NATIVE" | "USDC" | "USDT"
    toToken:   "NATIVE" | "USDC" | "USDT"
    amount: number | string
    fromChainId: number
    toChainId: number
}
amount and the chain IDs refer to the foreign chain pair (e.g. USDT on Polygon → USDT on Ethereum). "NATIVE" is the foreign chain’s native token (ETH on EVM, MATIC on Polygon, etc.) — not Demos DEM. No OS conversion is applied. P4 widens amount to number | string so callers can pass BigInt-safe wire values for large foreign-chain amounts; the underlying semantics are unchanged.

Native bridge

Demos also ships a native (non-Rubic) bridge for stablecoin transfers across a curated EVM + Solana set. It is exposed via NativeBridgeMethods on @kynesyslabs/demosdk/bridge. Documenting that surface end-to-end is out of scope for this page — see the SDK barrel export for the available methods (validateChain, the supported-chain constants, USDC contract addresses per chain, etc.).