Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
CleanBread committed Oct 1, 2024
2 parents be6d537 + 0581391 commit ac9b75b
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 2 deletions.
1 change: 1 addition & 0 deletions pages/hub/apps/sdk/data-hooks/useActiveConditions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const { loading, error, conditions } = useActiveConditions(props)
isLive: boolean // if the flag is set to true, useConditions will retrieve live conditions.
filter?: {
outcomeIds?: string[]
maxMargin?: number // max marginality
}
livePollInterval?: number // live conditions could be created at any time, and here, you can specify how frequently to check for new live conditions **measured in milliseconds**
}
Expand Down
1 change: 1 addition & 0 deletions pages/hub/apps/sdk/data-hooks/useActiveMarkets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const { loading, error, markets } = useActiveMarkets(props)
gameStatus: GameStatus // game status from `useGameStatus` hook or 'getGameStatus' function
filter?: {
outcomeIds?: string[]
maxMargin?: number // max marginality
}
livePollInterval?: number // live conditions could be created at any time, and here, you can specify how frequently to check for new live conditions **measured in milliseconds**
}
Expand Down
4 changes: 3 additions & 1 deletion pages/hub/apps/sdk/data-hooks/useGames.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const { loading, error, games } = useGames(props)
sportHub?: SportHub // returns games from specific hub
sportSlug?: string // returns games from specific sport
leaglueSlug?: string // returns games from specific league
maxMargin?: number // max marginality
}
orderBy?: Game_OrderBy // default: Game_OrderBy.CreatedBlockTimestamp` - orders rows by passed rule
orderDir?: OrderDirection // order direction: asc, desc
Expand All @@ -32,7 +33,8 @@ const { loading, error, games } = useGames(props)

enum SportHub {
Sports = 'sports',
Esports = 'esports'
Esports = 'esports',
Unique = 'unique'
}
```

Expand Down
11 changes: 11 additions & 0 deletions pages/hub/apps/sdk/data-hooks/useLiveBets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const { loading, error, bets } = useLiveBets(props)
{
filter: {
bettor: string // bettor address
affiliate?: string // affiliate address
type?: BetType // bet type
limit?: number // limit the number of rows returned from a query
offset?: number // omit a specified number of rows before the beginning of the result set
}
Expand All @@ -30,6 +32,14 @@ const { loading, error, bets } = useLiveBets(props)
}
```

```ts
enum BetType {
Unredeemed = 'unredeemed', // ready to redeem bets
Accepted = 'accepted', // not resolved bets
Settled = 'settled', // resolved bets
}
```

#### Custom query options

To accommodate additional arguments within your GraphQL query, the optimal approach is to create a custom hook. This can be achieved by leveraging the fundamental Apollo `useQuery` hook as your starting point.
Expand Down Expand Up @@ -76,6 +86,7 @@ type BetOutcome = {
} & Selection

type Bet = {
affiliate: string // affiliate address
tokenId: string // id of the bet's NFT
freebetId?: string | null // id of the freebet's NFT
freebetContractAddress?: Address // freebet contract address
Expand Down
11 changes: 11 additions & 0 deletions pages/hub/apps/sdk/data-hooks/useNavigation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,22 @@ const { loading, sports } = useNavigation(props)

```ts
{
filter?: {
sportHub?: SportHub
}
withGameCount?: boolean // adds the lightweight games data to sport for counting
isLive?: boolean // if `true`, the hook will retrieve live navigation
}
```

```ts
enum SportHub {
Sports = 'sports',
Esports = 'esports',
Unique = 'unique'
}
```

#### Return Value
```ts
{
Expand Down
11 changes: 11 additions & 0 deletions pages/hub/apps/sdk/data-hooks/usePrematchBets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const { loading, error, bets } = usePrematchBets(props)
{
filter: {
bettor: string // bettor address
affiliate?: string // affiliate address
type?: BetType // bet type
limit?: number // limit the number of rows returned from a query
offset?: number // omit a specified number of rows before the beginning of the result set
}
Expand All @@ -30,6 +32,14 @@ const { loading, error, bets } = usePrematchBets(props)
}
```

```ts
enum BetType {
Unredeemed = 'unredeemed', // ready to redeem bets
Accepted = 'accepted', // not resolved bets
Settled = 'settled', // resolved bets
}
```

#### Custom query options

To accommodate additional arguments within your GraphQL query, the optimal approach is to create a custom hook. This can be achieved by leveraging the fundamental Apollo `useQuery` hook as your starting point.
Expand Down Expand Up @@ -76,6 +86,7 @@ type BetOutcome = {
} & Selection

type Bet = {
affiliate: string // affiliate address
tokenId: string // id of the bet's NFT
freebetId?: string | null // id of the freebet's NFT
freebetContractAddress?: Address // freebet contract address
Expand Down
3 changes: 2 additions & 1 deletion pages/hub/apps/sdk/data-hooks/useSports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const { loading, error, sports } = useSports(props)

enum SportHub {
Sports = 'sports',
Esports = 'esports'
Esports = 'esports',
Unique = 'unique'
}
```

Expand Down
11 changes: 11 additions & 0 deletions pages/hub/apps/sdk/data-hooks/useSportsNavigation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,22 @@ const { loading, sports } = useSportsNavigation(props)

```ts
{
filter?: {
sportHub?: SportHub
}
withGameCount?: boolean // adds the lightweight games data to sport for counting
isLive?: boolean // if `true`, the hook will retrieve live navigation
}
```

```ts
enum SportHub {
Sports = 'sports',
Esports = 'esports',
Unique = 'unique'
}
```

#### Return Value
```ts
{
Expand Down
3 changes: 3 additions & 0 deletions pages/hub/apps/sdk/providers/betslip.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ enum BetslipDisableReason {

type Game = {
gameId: string
title: string
countryName: string
countrySlug: string
leagueName: string
Expand All @@ -172,6 +173,8 @@ type BetslipItem = {
lpAddress: string
game: Game
isExpressForbidden: boolean
marketName: string
selectionName: string
} & Selection

type AddItemProps = {
Expand Down
4 changes: 4 additions & 0 deletions pages/hub/apps/sdk/write-hooks/usePrepareBet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const {...} = usePrepareBet({
odds: Record<string, number>, // odds
totalOdds: number, // total odds
freeBet?: FreeBet // freeBet info
betGas?: Pick<SendTransactionParameters, 'gas' | 'gasPrice' | 'maxFeePerGas' | 'maxFeePerBlobGas' | 'maxPriorityFeePerGas'> // transaction gas parameters, prematch only
selections: Selection[] // user's choise for bet
liveEIP712Attention?: string // attention text for eip-712 sign (up to 160 chars)
deadline?: number // duration after which the bet will be canceled if it does not get included in a block
Expand All @@ -115,6 +116,8 @@ const {...} = usePrepareBet({
```
```ts
import { type SendTransactionParameters } from 'viem'

type Selection = {
conditionId: string
outcomeId: string
Expand Down Expand Up @@ -149,6 +152,7 @@ type FreeBet = {
isProcessing: boolean
}
betTx: { // bet transaction state
data: Hex | undefined
isPending: boolean
isProcessing: boolean
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const chains = await getDeBridgeSupportedChains()
```ts
Promise<{
chainId: number
originalChainId: number
chainName: string
}[] | null>
```
8 changes: 8 additions & 0 deletions pages/hub/apps/toolkit/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,27 @@ type Contracts = {
}

enum Environment {
GnosisDevXDAI = 'GnosisDevXDAI',
GnosisXDAI = 'GnosisXDAI',
PolygonUSDT = 'PolygonUSDT',
PolygonAmoyAZUSD = 'PolygonAmoyAZUSD',
PolygonAmoyUSDT = 'PolygonAmoyUSDT',
ChilizWCHZ = 'ChilizWCHZ',
ChilizSpicyWCHZ = 'ChilizSpicyWCHZ'
}
```
</Callout>

## Development mode
To enable Development mode set the `AZURO_UNSTABLE_DEV_ENABLED` env variable to `true` it will change `polygonAmoy` and `gnosis` to dev mode:
- contracts addresses to [dev mode](https://gem.azuro.org/contracts/deployment-addresses#contracts-development)
- all endpoint getters to [dev mode](https://gem.azuro.org/subgraph/overview#development-30)

## Constants

```ts
import {
MARGIN_DECIMALS, // marginality decimals
ODDS_DECIMALS, // odds decimals
MIN_LIVE_BET_AMOUNT, // min amount for live bet

Expand Down

0 comments on commit ac9b75b

Please sign in to comment.