😇
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
  • Parameters
  • Response
  1. Purebet API

Cancel order

Returns an array of numbers which are the wire of a Solana transaction

PreviousGet pending orders

Last updated 2 years ago

Parameters

betAddr: string, the address of where the information for this bet is stored on the Solana blockchain. Obtain this from the "acc" field of the response from a get pending orders call.

Example call: https://api.purebet.io/cancel/bet?betAddr=EnwQr49cyfJgCbeCoV4r4nhKqc4KN4QSdUkg6wp8MGhb

Example response
{
  "status": 200,
  "body": [
    1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    0,
    3,
    8,
    157,
    54,
    73,
    227,
    44,
    58,
    3,
    77,
    195,
    204,
    209,
    174,
    93,
    159,
    201,
    163,
    77,
    17,
    52,
    4,
    59,
    30,
    209,
    192,
    23,
    228,
    220,
    244,
    216,
    91,
    142,
    106,
    57,
    152,
    66,
    118,
    192,
    60,
    7,
    126,
    173,
    213,
    207,
    96,
    33,
    85,
    27,
    111,
    236,
    137,
    151,
    110,
    198,
    42,
    245,
    67,
    158,
    103,
    132,
    16,
    244,
    80,
    124,
    196,
    67,
    238,
    169,
    22,
    178,
    129,
    196,
    196,
    193,
    31,
    159,
    3,
    121,
    133,
    221,
    56,
    108,
    125,
    9,
    209,
    201,
    222,
    158,
    88,
    129,
    67,
    7,
    225,
    18,
    250,
    12,
    71,
    152,
    74,
    6,
    81,
    46,
    91,
    163,
    238,
    166,
    201,
    143,
    153,
    111,
    160,
    52,
    68,
    213,
    199,
    225,
    127,
    50,
    65,
    127,
    65,
    34,
    1,
    173,
    76,
    186,
    13,
    96,
    48,
    198,
    250,
    122,
    243,
    190,
    219,
    173,
    58,
    61,
    101,
    243,
    106,
    171,
    201,
    116,
    49,
    177,
    187,
    228,
    194,
    210,
    246,
    224,
    228,
    124,
    166,
    2,
    3,
    69,
    47,
    93,
    97,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    31,
    245,
    250,
    111,
    64,
    43,
    235,
    200,
    103,
    141,
    128,
    70,
    18,
    187,
    108,
    113,
    203,
    205,
    1,
    164,
    255,
    104,
    133,
    133,
    80,
    237,
    132,
    255,
    89,
    64,
    157,
    138,
    6,
    221,
    246,
    225,
    215,
    101,
    161,
    147,
    217,
    203,
    225,
    70,
    206,
    235,
    121,
    172,
    28,
    180,
    133,
    237,
    95,
    91,
    55,
    145,
    58,
    140,
    245,
    133,
    126,
    255,
    0,
    169,
    116,
    29,
    104,
    74,
    88,
    209,
    91,
    196,
    83,
    87,
    192,
    12,
    73,
    189,
    141,
    204,
    55,
    12,
    24,
    4,
    204,
    85,
    115,
    114,
    105,
    176,
    155,
    213,
    6,
    89,
    135,
    110,
    2,
    5,
    2,
    0,
    1,
    110,
    3,
    0,
    0,
    0,
    157,
    54,
    73,
    227,
    44,
    58,
    3,
    77,
    195,
    204,
    209,
    174,
    93,
    159,
    201,
    163,
    77,
    17,
    52,
    4,
    59,
    30,
    209,
    192,
    23,
    228,
    220,
    244,
    216,
    91,
    142,
    106,
    18,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    97,
    51,
    48,
    54,
    48,
    54,
    53,
    52,
    52,
    56,
    56,
    53,
    48,
    46,
    51,
    49,
    52,
    49,
    80,
    34,
    21,
    0,
    0,
    0,
    0,
    0,
    71,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    31,
    245,
    250,
    111,
    64,
    43,
    235,
    200,
    103,
    141,
    128,
    70,
    18,
    187,
    108,
    113,
    203,
    205,
    1,
    164,
    255,
    104,
    133,
    133,
    80,
    237,
    132,
    255,
    89,
    64,
    157,
    138,
    6,
    6,
    1,
    7,
    2,
    4,
    3,
    0,
    7,
    0,
    62,
    14,
    19,
    136,
    47,
    218
  ]
}

Response

  • status: 200, indicates that the call was successful

  • body: list of numbers, this is the wire format of the transaction that you will sign in order to cancel the bet

If this endpoint is called with an address that is not a bet at Purebet, or a bet address that was placed within the last 35 seconds, or a bet that has already been matched, the call will return an error message. The 35 second delay exists in order to accommodate the time it takes to aggregate bets.

Note: The call assumes that the transaction signer is the same address as the placer of the bet. Only the bettor who placed the bet may sign the transaction to cancel the bet, otherwise the Purebet on-chain program will reject the transaction.

After receiving the response, use your preferred methods to deserialize and sign the transaction. The USDC wagered and the SOL paid for rent exemption will be refunded, and the wager will be cancelled.

🚫
https://api.purebet.io/cancel/betapi.purebet.io