Cons Docs
Home Open App
  1. Docs
  2. Build
1 min read

Developer Interface

Cons should feel like one Solana-native product even when several transport providers exist underneath it.

SDK Concept

A developer expresses the intended transfer instead of writing provider-specific code.

TypeScript
const route = await cons.transfer({
  sourceChain: "solana",
  destinationChain: "base",
  token: "USDC",
  amount: "100",
  recipient: "0x..."
});

The SDK conceptually handles:

  • Route discovery.
  • Provider selection.
  • Solana account discovery.
  • Transaction and instruction preparation.
  • Wallet-signature flow.
  • Status tracking.
  • Receipt generation.

Message Concept

TypeScript
const message = await cons.sendMessage({
  sourceChain: "solana",
  destinationChain: "ethereum",
  payload,
  recipient: destinationApplication
});

API Concept

EndpointPurpose
GET /v1/routesDiscover compatible routes
POST /v1/quoteReturn normalized route estimates
POST /v1/transferCreate or prepare a token-transfer request
POST /v1/messageCreate or prepare a cross-chain message request
GET /v1/messages/{id}Read normalized message status
GET /v1/transfers/{id}Read normalized transfer status
GET /v1/providersList supported providers
GET /v1/chainsList supported chains
GET /v1/tokensList supported assets and representations
GET /v1/healthRead Cons and provider health

These endpoints describe the product interface and do not prescribe the backend implementation.

Wallet Model

Cons does not take ownership of the user's wallet. When a Solana transaction requires user authorization, the application presents the prepared transaction or instructions to the user's Solana wallet for signing.

Core Developer Promise

A Solana developer integrates Cons once instead of maintaining separate bridge and messaging integrations for every supported provider.

Cons documentationPage 12 of 15