😇
Purebet beta
  • About Purebet
    • 😇Why Purebet?
    • ❓What is Purebet?
      • 🔁On-chain exchange
      • 🤝Aggregation
  • Using Purebet
    • 👋Signing up
    • 👛Funding your wallet...
      • 🔃...if you have money on cryptocurrency exchange
      • ⛓️...if you have funds on another blockchain
      • 💳...if you only have money through your bank card
    • 📅Navigating events
    • 📗Understanding the trade page
    • 🗒️Placing bets
    • 🤑Redeeming winning bets
    • 💸Fees
    • ⚙️Settings
    • 💻API
  • Official links
    • 🌐Website
    • 🪙Token - NONE
    • 🐦Social media
  • Aggregated Protocols
    • 🚫Non-aggregated liquidity
    • 🦆BetDEX/Monaco
    • 🦓Overtime
    • 🐙Aver
    • 🌊Azuro
    • 🦈SX Bet
    • 🟦Divvy
  • Crypto help
    • ⛓️Blockchains
    • 👛Wallets
  • Sports betting help
    • ⚽Market types
    • 🔢Odds
    • 🟥Lay bets
  • Promotion terms
    • 🦆BetDEX beta users 17/01/23--ENDED
    • 🤑Phase 1 Completion Celebration Promotion 07/04/23
    • 💸Solana Degens Airdroped NFT Promotion
  • Purebet API
    • 👁️Overview
    • 📅Get events
    • ♻️Refresh Orderbooks
    • 💰Place bet
    • ⏱️Get pending orders
    • 🚫Cancel order
Powered by GitBook
On this page
  1. Purebet API

Overview

An overview of the Purebet API

PreviousSolana Degens Airdroped NFT PromotionNextGet events

Last updated 2 years ago

The API has 4 main functions required for betting on Purebet through code: seeing events and odds; seeing pending bets of a wallet; placing an order; cancelling an order. Placing and cancelling an order require users to make on-chain transactions to the Solana blockchain. Usually this is done via a wallet interface like Phantom on a UI, but can be done using a keypair wallet generated by the Solana web3 SDK.

The Purebet API is a simple REST API that works with a wide variety of programming languages. The Purebet API does not handle signing any transaction so that transactions can be signed however the user wishes.

When the endpoint for placing or cancelling a bet is called, the API response returns an array of numbers. This is a wire of a transaction which can be deserialized and signed using the Solana web3 SDK.

Each Purebet market has an id. This id is made up of 2 values, id1 and id2. It is essentially a base256 counting system. Both ids need to be used at all times. Incorrect id1-id2 combinations will result in errors being returned.

Examples of how to use each function can be found at . You can see the JS code by clicking the <> button on the top right. We will prepare a github repo of example JS and Python code in time (feel free to contribute to this - ping us on Discord).

You can get help on using the API in our discord server in the dev-chat channel:

👁️
https://replit.com/@purebet/api-example
https://discordapp.com/channels/904758233233752094/1068883224224333885