Developer Hub
🔮 For applications
Toolkit
deBridge
createDeBridgeBet

Creates deBridge bet transaction to execute on Polygon originating from different blockchains, such as Arbitrum.

⚠️

This feature works only for Prematch Bets in Supported Blockchains (opens in a new tab)

Usage

import { createDeBridgeBet } from '@azuro-org/toolkit'
 
const chains = await createDeBridgeBet({
  account: '0xlkn123...',
  betAmount: 1, // 1 USDT
  dstChainId: 137, // Polygon
  srcChainId: 42161, // Arbitrum
  srcChainTokenIn: '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9', // USDT
  selections: [...],
  totalOdds: 10,
  slippage: 10, // 10%
  affiliate: '0x12knsfd12...',
referralCode: 17687, // your deBridge referral code
})

Props

{
  account: Address
  betAmount: string
  dstChainId: ChainId
  srcChainId: number
  srcChainTokenIn: string
  selections: Selection[]
  totalOdds: number
  slippage: number
  affiliate: Address
  referralCode: number
  deadline?: number
}
type Selection = {
  conditionId: string
  outcomeId: string
  coreAddress: string
}

Return Value

Promise<{
  orderId: Hex
  estimation: {
    srcChainTokenIn: {
      address: Address
      name: string
      symbol: string
      decimals: number
      amount: string
      approximateOperatingExpense: string
      mutatedWithOperatingExpense: boolean
    },
    srcChainTokenOut: {
      address: Address
      name: string
      symbol: string
      decimals: number
      amount: string
      maxRefundAmount: string
    }
    dstChainTokenOut: {
      address: Address
      name: string
      symbol: string
      decimals: number
      amount: string
      recommendedAmount: string
      withoutAdditionalTakerRewardsAmount: string
      maxTheoreticalAmount: string
    },
    recommendedSlippage: number
    costsDetails: [ string ]
  }
  tx: {
    to: Address
    data: Hex
    value: bigint
  }
  order: {
    approximateFulfillmentDelay: number
  },
  prependedOperatingExpenseCost: string
  fixFee: string
  userPoints: number
  integratorPoints: number
} | null>