stellarcade-sdk

API Reference

Client

  • StellarCadeClient — the facade; owns games, prizes, quests, leaderboard, tournaments, and connector management.
  • createConfig(options) — builds and validates a StellarCadeConfig.
  • isMainnet(config)

Domain clients

  • GamesClientlist, get, commitRound, play, getResult
  • PrizesClientlistPools, getPool, claim
  • QuestsClientlistForPlayer, claim
  • LeaderboardClientget
  • TournamentsClientlist, get, enter

Wallets

  • ConnectorRegistry, WalletConnector (interface)
  • FreighterConnector

Fairness

  • verifyCommitment(commitment, reveal)
  • deriveOutcomeValue(reveal)
  • mapToRange(value, size)
  • verifyProof(commitment, proof)

Transactions

  • pollTxStatus(gatewayUrl, hash, options?)
  • request(baseUrl, path, options?) / withTimeout(ms) — the low-level fetch wrapper every client above is built on

Errors

All SDK errors extend StellarCadeError and carry a stable code:

Classcode
ConfigErrorCONFIG_ERROR
NetworkMismatchErrorNETWORK_MISMATCH
RpcErrorRPC_ERROR
NotConnectedErrorNOT_CONNECTED
FairnessVerificationErrorFAIRNESS_VERIFICATION_FAILED
TxTimeoutErrorTX_TIMEOUT

Full type definitions ship in dist/index.d.ts — your editor's autocomplete is the most current reference.