@azuro-org/toolkit 5.2.0-beta.1 → 6.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/dist/docs/bets/fragments/legacyLiveBet.d.ts +1 -0
- package/dist/docs/bets/fragments/legacyPrematchBet.d.ts +1 -0
- package/dist/docs/bets/legacyBets.d.ts +2 -0
- package/dist/docs/index.d.ts +0 -13
- package/dist/global.d.ts +33 -3
- package/dist/helpers/normalizeTimestampToMs.d.ts +9 -0
- package/dist/helpers/serializeApiParams.d.ts +4 -0
- package/dist/index.d.ts +27 -18
- package/dist/index.js +941 -607
- package/dist/index.js.map +1 -1
- package/dist/utils/bet/createBet.d.ts +39 -0
- package/dist/utils/bet/createComboBet.d.ts +44 -0
- package/dist/utils/bet/getBet.d.ts +28 -0
- package/dist/utils/{getBetCalculation.d.ts → bet/getBetCalculation.d.ts} +10 -15
- package/dist/utils/bet/getBetFee.d.ts +32 -0
- package/dist/utils/bet/getBetStatus.d.ts +43 -0
- package/dist/utils/bet/getBetTypedData.d.ts +38 -0
- package/dist/utils/bet/getBetsByBettor.d.ts +44 -0
- package/dist/utils/bet/getComboBetTypedData.d.ts +42 -0
- package/dist/utils/bet/types.d.ts +128 -0
- package/dist/utils/bonus/getAvailableFreebets.d.ts +26 -3
- package/dist/utils/bonus/getBonuses.d.ts +23 -3
- package/dist/utils/calcMinOdds.d.ts +20 -0
- package/dist/utils/cashout/createCashout.d.ts +26 -3
- package/dist/utils/cashout/getCalculatedCashout.d.ts +29 -4
- package/dist/utils/cashout/getCashout.d.ts +22 -3
- package/dist/utils/cashout/getCashoutTypedData.d.ts +30 -3
- package/dist/utils/cashout/getPrecalculatedCashouts.d.ts +31 -3
- package/dist/utils/feed/getConditionsByGameIds.d.ts +47 -0
- package/dist/utils/feed/getConditionsState.d.ts +34 -0
- package/dist/utils/feed/getGamesByFilters.d.ts +34 -0
- package/dist/utils/feed/getGamesByIds.d.ts +26 -0
- package/dist/utils/feed/getNavigation.d.ts +61 -0
- package/dist/utils/feed/getSports.d.ts +54 -0
- package/dist/utils/feed/searchGames.d.ts +29 -0
- package/dist/utils/feed/types.d.ts +47 -0
- package/dist/utils/getEndpoints.d.ts +1 -0
- package/dist/utils/getIsPendingResolution.d.ts +17 -4
- package/dist/utils/getProviderFromId.d.ts +12 -0
- package/dist/utils/groupConditionsByMarket.d.ts +22 -4
- package/package.json +6 -6
- package/dist/docs/bets/bets.d.ts +0 -67
- package/dist/docs/bets/fragments/bet.d.ts +0 -57
- package/dist/utils/calcMindOdds.d.ts +0 -6
- package/dist/utils/createBet.d.ts +0 -17
- package/dist/utils/createComboBet.d.ts +0 -17
- package/dist/utils/getBet.d.ts +0 -23
- package/dist/utils/getBetFee.d.ts +0 -14
- package/dist/utils/getBetStatus.d.ts +0 -19
- package/dist/utils/getBetTypedData.d.ts +0 -16
- package/dist/utils/getBetsHistory.d.ts +0 -71
- package/dist/utils/getComboBetTypedData.d.ts +0 -16
- package/dist/utils/getMaxBet.d.ts +0 -18
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import { type CreateBetResponse, type BetClientData } from '../../global';
|
|
3
|
+
export type CreateBetParams = {
|
|
4
|
+
account: Address;
|
|
5
|
+
clientData: BetClientData;
|
|
6
|
+
bet: {
|
|
7
|
+
conditionId: string | bigint;
|
|
8
|
+
outcomeId: string | number | bigint;
|
|
9
|
+
minOdds: string | bigint;
|
|
10
|
+
amount: string | bigint;
|
|
11
|
+
nonce: string | number | bigint;
|
|
12
|
+
};
|
|
13
|
+
signature: Hex;
|
|
14
|
+
bonusId?: string;
|
|
15
|
+
};
|
|
16
|
+
export type CreateBetResult = CreateBetResponse;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a single (ordinary) bet by submitting signed bet data to the Azuro API.
|
|
19
|
+
* This function sends the bet order to the relayer which will then place the bet on-chain.
|
|
20
|
+
*
|
|
21
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/utils/bet/createBet
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* import { createBet } from '@azuro-org/toolkit'
|
|
25
|
+
*
|
|
26
|
+
* const account = '0x...'
|
|
27
|
+
* const clientData = { chainId: 137, core: '0x...', ... }
|
|
28
|
+
* const bet = {
|
|
29
|
+
* conditionId: '1',
|
|
30
|
+
* outcomeId: '1',
|
|
31
|
+
* minOdds: '1500000000000',
|
|
32
|
+
* amount: '1000000',
|
|
33
|
+
* nonce: '1',
|
|
34
|
+
* }
|
|
35
|
+
* const signature = '0x...'
|
|
36
|
+
*
|
|
37
|
+
* const result = await createBet({ account, clientData, bet, signature })
|
|
38
|
+
* */
|
|
39
|
+
export declare const createBet: (props: CreateBetParams) => Promise<CreateBetResult>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import { type CreateBetResponse, type BetClientData } from '../../global';
|
|
3
|
+
export type CreateComboBetParams = {
|
|
4
|
+
account: Address;
|
|
5
|
+
amount: string | bigint;
|
|
6
|
+
minOdds: string | bigint;
|
|
7
|
+
nonce: string | number | bigint;
|
|
8
|
+
clientData: BetClientData;
|
|
9
|
+
bets: {
|
|
10
|
+
conditionId: string | bigint;
|
|
11
|
+
outcomeId: string | number | bigint;
|
|
12
|
+
}[];
|
|
13
|
+
signature: Hex;
|
|
14
|
+
bonusId?: string;
|
|
15
|
+
};
|
|
16
|
+
export type CreateComboBetResult = CreateBetResponse;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a combo (parlay) bet by submitting signed bet data to the Azuro API.
|
|
19
|
+
* This function sends the combo bet order to the relayer which will then place the bet on-chain.
|
|
20
|
+
*
|
|
21
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/utils/bet/createComboBet
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* import { createComboBet } from '@azuro-org/toolkit'
|
|
25
|
+
*
|
|
26
|
+
* const account = '0x...'
|
|
27
|
+
* const clientData = { chainId: 137, core: '0x...', ... }
|
|
28
|
+
* const bets = [
|
|
29
|
+
* { conditionId: '1', outcomeId: '1' },
|
|
30
|
+
* { conditionId: '2', outcomeId: '2' },
|
|
31
|
+
* ]
|
|
32
|
+
* const signature = '0x...'
|
|
33
|
+
*
|
|
34
|
+
* const result = await createComboBet({
|
|
35
|
+
* account,
|
|
36
|
+
* clientData,
|
|
37
|
+
* bets,
|
|
38
|
+
* amount: '1000000',
|
|
39
|
+
* minOdds: '3000000000000',
|
|
40
|
+
* nonce: '1',
|
|
41
|
+
* signature,
|
|
42
|
+
* })
|
|
43
|
+
* */
|
|
44
|
+
export declare const createComboBet: (props: CreateComboBetParams) => Promise<CreateComboBetResult>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ChainId } from '../../config';
|
|
2
|
+
import type { BetOrderData } from './types';
|
|
3
|
+
export type GetBetParams = {
|
|
4
|
+
chainId: ChainId;
|
|
5
|
+
orderId: string;
|
|
6
|
+
};
|
|
7
|
+
export type GetBetResponse = BetOrderData;
|
|
8
|
+
export type GetBetResult = GetBetResponse | null;
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves bet order data by order ID from the Azuro API.
|
|
11
|
+
* Returns null if the bet order is not found.
|
|
12
|
+
*
|
|
13
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/utils/bet/getBet
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* import { getBet } from '@azuro-org/toolkit'
|
|
17
|
+
*
|
|
18
|
+
* const orderId = '0x123...'
|
|
19
|
+
* const chainId = 137
|
|
20
|
+
*
|
|
21
|
+
* const bet = await getBet({ chainId, orderId })
|
|
22
|
+
*
|
|
23
|
+
* if (bet) {
|
|
24
|
+
* console.log('Bet state:', bet.state)
|
|
25
|
+
* console.log('Bet result:', bet.result)
|
|
26
|
+
* }
|
|
27
|
+
* */
|
|
28
|
+
export declare const getBet: ({ chainId, orderId }: GetBetParams) => Promise<GetBetResult>;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { type Address } from 'viem';
|
|
2
|
-
import { type ChainId } from '
|
|
3
|
-
import { type Selection } from '
|
|
2
|
+
import { type ChainId } from '../../config';
|
|
3
|
+
import { type Selection } from '../../global';
|
|
4
|
+
export type GetBetCalculationParams = {
|
|
5
|
+
chainId: ChainId;
|
|
6
|
+
selections: Selection[];
|
|
7
|
+
account: Address | undefined;
|
|
8
|
+
};
|
|
4
9
|
export type GetBetCalculationResponse = {
|
|
5
10
|
response: {
|
|
6
11
|
/** if `minBet` is `undefined`, there is no bottom limit */
|
|
@@ -9,17 +14,13 @@ export type GetBetCalculationResponse = {
|
|
|
9
14
|
maxPayout: `${number}`;
|
|
10
15
|
};
|
|
11
16
|
};
|
|
12
|
-
type
|
|
13
|
-
chainId: ChainId;
|
|
14
|
-
selections: Selection[];
|
|
15
|
-
account: Address | undefined;
|
|
16
|
-
};
|
|
17
|
+
export type GetBetCalculationResult = GetBetCalculationResponse['response'];
|
|
17
18
|
/**
|
|
18
19
|
* Calculates the minimum and maximum bet amount for given selections.
|
|
19
20
|
* User's account is required to provide the **correct** maximum bet amount.
|
|
20
21
|
* It may be undefined if the user isn't logged in.
|
|
21
22
|
*
|
|
22
|
-
* - Docs: https://gem.azuro.org/hub/apps/toolkit/utils/getBetCalculation
|
|
23
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/utils/bet/getBetCalculation
|
|
23
24
|
*
|
|
24
25
|
* @example
|
|
25
26
|
* import { getBetCalculation } from '@azuro-org/toolkit'
|
|
@@ -31,10 +32,4 @@ type GetBetCalculation = {
|
|
|
31
32
|
*
|
|
32
33
|
* const { minBet, maxBet } = await getBetCalculation({ selections, account })
|
|
33
34
|
* */
|
|
34
|
-
export declare const getBetCalculation: (props:
|
|
35
|
-
/** if `minBet` is `undefined`, there is no bottom limit */
|
|
36
|
-
minBet: number | undefined;
|
|
37
|
-
maxBet: number;
|
|
38
|
-
maxPayout: `${number}`;
|
|
39
|
-
} | null>;
|
|
40
|
-
export {};
|
|
35
|
+
export declare const getBetCalculation: (props: GetBetCalculationParams) => Promise<GetBetCalculationResult>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ChainId } from '../../config';
|
|
2
|
+
export type BetFeeResponse = {
|
|
3
|
+
gasLimit: number;
|
|
4
|
+
gasPrice: number;
|
|
5
|
+
betTokenRate: number;
|
|
6
|
+
gasPriceInBetToken: number;
|
|
7
|
+
slippage: number;
|
|
8
|
+
gasAmount: number;
|
|
9
|
+
relayerFeeAmount: string;
|
|
10
|
+
beautyRelayerFeeAmount: string;
|
|
11
|
+
symbol: string;
|
|
12
|
+
decimals: number;
|
|
13
|
+
};
|
|
14
|
+
export type GetBetFeeParams = ChainId;
|
|
15
|
+
export type GetBetFeeResult = BetFeeResponse;
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves the current relayer fee information for placing bets on a specific chain.
|
|
18
|
+
* Returns gas price, bet token rate, and calculated relayer fee amount.
|
|
19
|
+
*
|
|
20
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/utils/bet/getBetFee
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* import { getBetFee } from '@azuro-org/toolkit'
|
|
24
|
+
*
|
|
25
|
+
* const chainId = 137
|
|
26
|
+
*
|
|
27
|
+
* const feeInfo = await getBetFee(chainId)
|
|
28
|
+
*
|
|
29
|
+
* console.log('Relayer fee:', feeInfo.beautyRelayerFeeAmount, feeInfo.symbol)
|
|
30
|
+
* console.log('Gas limit:', feeInfo.gasLimit)
|
|
31
|
+
* */
|
|
32
|
+
export declare const getBetFee: (chainId: ChainId) => Promise<GetBetFeeResult>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BetStatus as GraphBetStatus } from '../../docs/bets/types';
|
|
2
|
+
import { BetOrderState, GameState } from '../../global';
|
|
3
|
+
export declare enum BetStatus {
|
|
4
|
+
Accepted = 0,
|
|
5
|
+
Live = 1,
|
|
6
|
+
PendingResolution = 2,
|
|
7
|
+
Resolved = 3,
|
|
8
|
+
Canceled = 4,
|
|
9
|
+
Preparing = 5,
|
|
10
|
+
Rejected = 6
|
|
11
|
+
}
|
|
12
|
+
type Game = {
|
|
13
|
+
state: GameState;
|
|
14
|
+
startsAt: string;
|
|
15
|
+
};
|
|
16
|
+
type Props = {
|
|
17
|
+
games: Game[];
|
|
18
|
+
orderState: BetOrderState | null;
|
|
19
|
+
graphStatus: GraphBetStatus | null;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Determines the current status of a bet based on order state, on-chain status, and game states.
|
|
23
|
+
* Returns a unified bet status that combines API order state and blockchain data.
|
|
24
|
+
*
|
|
25
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/utils/bet/getBetStatus
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* import { getBetStatus, BetStatus } from '@azuro-org/toolkit'
|
|
29
|
+
*
|
|
30
|
+
* const games = [
|
|
31
|
+
* { state: GameState.Live, startsAt: '1234567890' },
|
|
32
|
+
* ]
|
|
33
|
+
* const orderState = BetOrderState.Sent
|
|
34
|
+
* const graphStatus = GraphBetStatus.Accepted
|
|
35
|
+
*
|
|
36
|
+
* const status = getBetStatus({ games, orderState, graphStatus })
|
|
37
|
+
*
|
|
38
|
+
* if (status === BetStatus.Live) {
|
|
39
|
+
* console.log('Bet is live!')
|
|
40
|
+
* }
|
|
41
|
+
* */
|
|
42
|
+
export declare const getBetStatus: (props: Props) => BetStatus;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type SignTypedDataParameters, type Address } from 'viem';
|
|
2
|
+
import { BET_DATA_TYPES } from '../../config';
|
|
3
|
+
import { type BetClientData } from '../../global';
|
|
4
|
+
export type GetBetTypedDataParams = {
|
|
5
|
+
account: Address;
|
|
6
|
+
clientData: BetClientData;
|
|
7
|
+
bet: {
|
|
8
|
+
conditionId: string | bigint;
|
|
9
|
+
outcomeId: string | bigint;
|
|
10
|
+
minOdds: string | bigint;
|
|
11
|
+
amount: string | bigint;
|
|
12
|
+
nonce: string | bigint;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Generates EIP-712 typed data for signing a single (ordinary) bet.
|
|
17
|
+
* This typed data is used with wallet signing methods to create a bet signature.
|
|
18
|
+
*
|
|
19
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/utils/bet/getBetTypedData
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* import { getBetTypedData } from '@azuro-org/toolkit'
|
|
23
|
+
* import { signTypedData } from 'viem/actions'
|
|
24
|
+
*
|
|
25
|
+
* const account = '0x...'
|
|
26
|
+
* const clientData = { chainId: 137, core: '0x...', ... }
|
|
27
|
+
* const bet = {
|
|
28
|
+
* conditionId: '1',
|
|
29
|
+
* outcomeId: '1',
|
|
30
|
+
* minOdds: '1500000000000',
|
|
31
|
+
* amount: '1000000',
|
|
32
|
+
* nonce: '1',
|
|
33
|
+
* }
|
|
34
|
+
*
|
|
35
|
+
* const typedData = getBetTypedData({ account, clientData, bet })
|
|
36
|
+
* const signature = await signTypedData(walletClient, typedData)
|
|
37
|
+
* */
|
|
38
|
+
export declare const getBetTypedData: (props: GetBetTypedDataParams) => SignTypedDataParameters<typeof BET_DATA_TYPES>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import type { BetOrderData } from './types';
|
|
3
|
+
import { type BetOrderState, type BetOrderResult } from '../../global';
|
|
4
|
+
import { type ChainId } from '../../config';
|
|
5
|
+
export type GetBetsByBettorParams = {
|
|
6
|
+
chainId: ChainId;
|
|
7
|
+
bettor: Address;
|
|
8
|
+
affiliate?: Address;
|
|
9
|
+
result?: BetOrderResult | BetOrderResult[];
|
|
10
|
+
state?: BetOrderState | BetOrderState[];
|
|
11
|
+
isRedeemed?: boolean;
|
|
12
|
+
offset?: number;
|
|
13
|
+
/** default: 100 */
|
|
14
|
+
limit?: number;
|
|
15
|
+
};
|
|
16
|
+
export type GetBetsByBettorResponse = {
|
|
17
|
+
orders: BetOrderData[];
|
|
18
|
+
};
|
|
19
|
+
export type GetBetsByBettorResult = GetBetsByBettorResponse['orders'] | null;
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves all bet orders for a specific bettor address with optional filtering.
|
|
22
|
+
* Supports pagination and filtering by state, result, affiliate, and redemption status.
|
|
23
|
+
*
|
|
24
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/utils/bet/getBetsByBettor
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* import { getBetsByBettor } from '@azuro-org/toolkit'
|
|
28
|
+
*
|
|
29
|
+
* const chainId = 137
|
|
30
|
+
* const bettor = '0x...'
|
|
31
|
+
*
|
|
32
|
+
* // Get all bets
|
|
33
|
+
* const allBets = await getBetsByBettor({ chainId, bettor })
|
|
34
|
+
*
|
|
35
|
+
* // Get only resolved bets
|
|
36
|
+
* const resolvedBets = await getBetsByBettor({
|
|
37
|
+
* chainId,
|
|
38
|
+
* bettor,
|
|
39
|
+
* state: 'Sent',
|
|
40
|
+
* result: 'Won',
|
|
41
|
+
* limit: 50,
|
|
42
|
+
* })
|
|
43
|
+
* */
|
|
44
|
+
export declare const getBetsByBettor: (props: GetBetsByBettorParams) => Promise<GetBetsByBettorResult>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type SignTypedDataParameters, type Address } from 'viem';
|
|
2
|
+
import { COMBO_BET_DATA_TYPES } from '../../config';
|
|
3
|
+
import { type BetClientData } from '../../global';
|
|
4
|
+
export type GetComboBetTypedDataParams = {
|
|
5
|
+
account: Address;
|
|
6
|
+
minOdds: string | bigint;
|
|
7
|
+
amount: string | bigint;
|
|
8
|
+
nonce: string | bigint;
|
|
9
|
+
clientData: BetClientData;
|
|
10
|
+
bets: {
|
|
11
|
+
conditionId: string | bigint;
|
|
12
|
+
outcomeId: string | bigint;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Generates EIP-712 typed data for signing a combo (parlay) bet.
|
|
17
|
+
* This typed data is used with wallet signing methods to create a combo bet signature.
|
|
18
|
+
*
|
|
19
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/utils/bet/getComboBetTypedData
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* import { getComboBetTypedData } from '@azuro-org/toolkit'
|
|
23
|
+
* import { signTypedData } from 'viem/actions'
|
|
24
|
+
*
|
|
25
|
+
* const account = '0x...'
|
|
26
|
+
* const clientData = { chainId: 137, core: '0x...', ... }
|
|
27
|
+
* const bets = [
|
|
28
|
+
* { conditionId: '1', outcomeId: '1' },
|
|
29
|
+
* { conditionId: '2', outcomeId: '2' },
|
|
30
|
+
* ]
|
|
31
|
+
*
|
|
32
|
+
* const typedData = getComboBetTypedData({
|
|
33
|
+
* account,
|
|
34
|
+
* clientData,
|
|
35
|
+
* bets,
|
|
36
|
+
* amount: '1000000',
|
|
37
|
+
* minOdds: '3000000000000',
|
|
38
|
+
* nonce: '1',
|
|
39
|
+
* })
|
|
40
|
+
* const signature = await signTypedData(walletClient, typedData)
|
|
41
|
+
* */
|
|
42
|
+
export declare const getComboBetTypedData: (props: GetComboBetTypedDataParams) => SignTypedDataParameters<typeof COMBO_BET_DATA_TYPES>;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
import type { BetConditionStatus, BetResult, GraphBetStatus, SelectionResult } from '../../docs';
|
|
3
|
+
import type { ConditionStatus } from '../../docs/bets/types';
|
|
4
|
+
import type { Environment } from '../../envs';
|
|
5
|
+
import type { BetOrderResult, BetOrderState, GameState, ISOTimestamp } from '../../global';
|
|
6
|
+
export type BetMetaData = {
|
|
7
|
+
id: string;
|
|
8
|
+
core: {
|
|
9
|
+
type: 'V3';
|
|
10
|
+
address: Address;
|
|
11
|
+
liquidityPool: {
|
|
12
|
+
address: Address;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
odds: string;
|
|
16
|
+
actor: string;
|
|
17
|
+
betId: string;
|
|
18
|
+
nonce: string;
|
|
19
|
+
owner: Address;
|
|
20
|
+
amount: string;
|
|
21
|
+
bettor: Address;
|
|
22
|
+
payout: null | string;
|
|
23
|
+
result: BetResult | null;
|
|
24
|
+
status: GraphBetStatus;
|
|
25
|
+
rawOdds: string;
|
|
26
|
+
affiliate: Address;
|
|
27
|
+
rawAmount: string;
|
|
28
|
+
rawPayout: null | string;
|
|
29
|
+
isRedeemed: boolean;
|
|
30
|
+
selections: Array<{
|
|
31
|
+
id: string;
|
|
32
|
+
odds: string;
|
|
33
|
+
result: SelectionResult | null;
|
|
34
|
+
outcome: {
|
|
35
|
+
condition: {
|
|
36
|
+
id: string;
|
|
37
|
+
gameId: string;
|
|
38
|
+
status: ConditionStatus;
|
|
39
|
+
outcomes: {
|
|
40
|
+
result: SelectionResult | null;
|
|
41
|
+
outcomeId: string;
|
|
42
|
+
sortOrder: number;
|
|
43
|
+
}[];
|
|
44
|
+
conditionId: string;
|
|
45
|
+
coreAddress: Address;
|
|
46
|
+
wonOutcomeIds: null | string[];
|
|
47
|
+
_winningOutcomesCount: number;
|
|
48
|
+
createdBlockTimestamp: string;
|
|
49
|
+
resolvedBlockTimestamp: null | string;
|
|
50
|
+
};
|
|
51
|
+
outcomeId: string;
|
|
52
|
+
sortOrder: number;
|
|
53
|
+
};
|
|
54
|
+
rawOdds: string;
|
|
55
|
+
_outcomeId: string;
|
|
56
|
+
}>;
|
|
57
|
+
settledOdds: null | string;
|
|
58
|
+
createdTxHash: Hex;
|
|
59
|
+
rawSettledOdds: null | string;
|
|
60
|
+
potentialPayout: string;
|
|
61
|
+
potentialLossLimit: string;
|
|
62
|
+
rawPotentialPayout: string;
|
|
63
|
+
createdBlockTimestamp: string;
|
|
64
|
+
rawPotentialLossLimit: string;
|
|
65
|
+
resolvedBlockTimestamp: string | null;
|
|
66
|
+
isCashedOut: boolean;
|
|
67
|
+
isFreebetAmountReturnable: boolean | null;
|
|
68
|
+
paymasterContractAddress: Address | null;
|
|
69
|
+
redeemedTxHash: Hex | null;
|
|
70
|
+
cashout: null | {
|
|
71
|
+
payout: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export type BetOrderConditionData = {
|
|
75
|
+
conditionId: string;
|
|
76
|
+
outcomeId: number;
|
|
77
|
+
orderId: string;
|
|
78
|
+
gameId: string;
|
|
79
|
+
/**
|
|
80
|
+
* State of the game at the moment of bet placing, to determine whether the bet is Live or not.
|
|
81
|
+
* */
|
|
82
|
+
gameState: GameState.Live | GameState.Prematch;
|
|
83
|
+
conditionMargin: string;
|
|
84
|
+
selectionMargin: string;
|
|
85
|
+
settledSelectionMargin: string | null;
|
|
86
|
+
result: BetConditionStatus | null;
|
|
87
|
+
/**
|
|
88
|
+
* Formatted odds of the condition, e.g. "1.55"
|
|
89
|
+
* */
|
|
90
|
+
price: string;
|
|
91
|
+
/**
|
|
92
|
+
* Formatted amount,
|
|
93
|
+
* e.g. "18.5"
|
|
94
|
+
*
|
|
95
|
+
* in COMBO bets, it can have more fractional digits than bet token decimals,
|
|
96
|
+
* e.g. "18.057553956834532374" for 6 decimals USDT
|
|
97
|
+
* */
|
|
98
|
+
potentialAmount: string | null;
|
|
99
|
+
potentialLoss: string | null;
|
|
100
|
+
};
|
|
101
|
+
export type BetOrderData = {
|
|
102
|
+
id: string;
|
|
103
|
+
state: BetOrderState;
|
|
104
|
+
environment: Environment;
|
|
105
|
+
betType: 'ORDINARY' | 'COMBO';
|
|
106
|
+
core: Address;
|
|
107
|
+
bettor: Address;
|
|
108
|
+
owner: Address;
|
|
109
|
+
affiliate: Address;
|
|
110
|
+
amount: number;
|
|
111
|
+
payout: number | null;
|
|
112
|
+
odds: number;
|
|
113
|
+
bonusId: string | null;
|
|
114
|
+
isFreebet: boolean;
|
|
115
|
+
betId: number | null;
|
|
116
|
+
txHash: Hex | null;
|
|
117
|
+
margin: string;
|
|
118
|
+
settledMargin: string | null;
|
|
119
|
+
result: BetOrderResult | null;
|
|
120
|
+
createdAt: ISOTimestamp;
|
|
121
|
+
updatedAt: ISOTimestamp;
|
|
122
|
+
settledAt: ISOTimestamp | null;
|
|
123
|
+
redeemedAt: ISOTimestamp | null;
|
|
124
|
+
conditions: BetOrderConditionData[];
|
|
125
|
+
meta: BetMetaData | null;
|
|
126
|
+
error: string | null;
|
|
127
|
+
errorMessage: string | null;
|
|
128
|
+
};
|
|
@@ -5,12 +5,35 @@ import { type RawBonus } from './getBonuses';
|
|
|
5
5
|
export type GetFreebetsResponse = {
|
|
6
6
|
bonuses: RawBonus[];
|
|
7
7
|
};
|
|
8
|
-
type
|
|
8
|
+
export type GetAvailableFreebetsParams = {
|
|
9
9
|
chainId: ChainId;
|
|
10
10
|
account: Address;
|
|
11
11
|
affiliate: Address;
|
|
12
12
|
selections: Selection[];
|
|
13
13
|
};
|
|
14
|
+
export type GetAvailableFreebetsResult = Freebet[] | null;
|
|
15
|
+
/** @deprecated use GetAvailableFreebetsResult instead */
|
|
14
16
|
export type GetAvailableFreebets = Freebet[] | null;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves available freebets for a bettor that can be applied to specific bet selections.
|
|
19
|
+
* Returns null if no freebets are available for the given selections.
|
|
20
|
+
*
|
|
21
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/bonus/getAvailableFreebets
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* import { getAvailableFreebets } from '@azuro-org/toolkit'
|
|
25
|
+
*
|
|
26
|
+
* const account = userWallet?.address
|
|
27
|
+
* const affiliate = affiliateAddress
|
|
28
|
+
* const selections = [
|
|
29
|
+
* { conditionId: '1', outcomeId: '1' },
|
|
30
|
+
* ]
|
|
31
|
+
*
|
|
32
|
+
* const freebets = await getAvailableFreebets({
|
|
33
|
+
* chainId: 100,
|
|
34
|
+
* account,
|
|
35
|
+
* affiliate,
|
|
36
|
+
* selections
|
|
37
|
+
* })
|
|
38
|
+
* */
|
|
39
|
+
export declare const getAvailableFreebets: ({ chainId, account, affiliate, selections }: GetAvailableFreebetsParams) => Promise<GetAvailableFreebetsResult>;
|
|
@@ -46,12 +46,32 @@ export type RawBonus = {
|
|
|
46
46
|
createdAt: string;
|
|
47
47
|
publicCustomData: Record<string, string> | null;
|
|
48
48
|
};
|
|
49
|
+
export type GetBonusesResult = Bonus[] | null;
|
|
50
|
+
/** @deprecated use GetBonusesResult instead */
|
|
49
51
|
export type GetBonuses = Bonus[] | null;
|
|
50
|
-
type
|
|
52
|
+
export type GetBonusesParams = {
|
|
51
53
|
chainId: ChainId;
|
|
52
54
|
account: Address;
|
|
53
55
|
affiliate: Address;
|
|
54
56
|
bonusStatus?: BonusStatus;
|
|
55
57
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Fetches all bonuses for a bettor account filtered by status.
|
|
60
|
+
* By default, retrieves only available bonuses. Returns null if no bonuses are found.
|
|
61
|
+
*
|
|
62
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/bonus/getBonuses
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* import { getBonuses, BonusStatus } from '@azuro-org/toolkit'
|
|
66
|
+
*
|
|
67
|
+
* const account = userWallet?.address
|
|
68
|
+
* const affiliate = '0x123...'
|
|
69
|
+
*
|
|
70
|
+
* const bonuses = await getBonuses({
|
|
71
|
+
* chainId: 100,
|
|
72
|
+
* account,
|
|
73
|
+
* affiliate,
|
|
74
|
+
* bonusStatus: BonusStatus.Available
|
|
75
|
+
* })
|
|
76
|
+
* */
|
|
77
|
+
export declare const getBonuses: (props: GetBonusesParams) => Promise<GetBonusesResult>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type CalcMinOddsParams = {
|
|
2
|
+
odds: number | number[];
|
|
3
|
+
slippage?: number;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Calculates the minimum acceptable odds considering slippage for single or combo bets.
|
|
7
|
+
* For combo bets, applies fee modifiers and multiplies individual odds to calculate total odds.
|
|
8
|
+
*
|
|
9
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/utils/calcMinOdds
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { calcMindOdds } from '@azuro-org/toolkit'
|
|
13
|
+
*
|
|
14
|
+
* // Single bet with 5% slippage
|
|
15
|
+
* const minOdds = calcMindOdds({ odds: 1.5, slippage: 5 })
|
|
16
|
+
*
|
|
17
|
+
* // Combo bet with multiple odds
|
|
18
|
+
* const comboMinOdds = calcMindOdds({ odds: [1.5, 2.0, 1.8], slippage: 5 })
|
|
19
|
+
* */
|
|
20
|
+
export declare const calcMinOdds: (props: CalcMinOddsParams) => string;
|
|
@@ -11,11 +11,34 @@ export type CreateCashoutResponse = {
|
|
|
11
11
|
state: CashoutState;
|
|
12
12
|
errorMessage?: string;
|
|
13
13
|
};
|
|
14
|
-
type
|
|
14
|
+
export type CreateCashoutResult = CreateCashoutResponse;
|
|
15
|
+
export type CreateCashoutParams = {
|
|
15
16
|
chainId: ChainId;
|
|
16
17
|
calculationId: string;
|
|
17
18
|
attention: string;
|
|
18
19
|
signature: Hex;
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Creates a cashout order for an existing bet by submitting the signed cashout calculation to the Azuro API.
|
|
23
|
+
* This finalizes the cashout process after obtaining a calculation and signing the typed data.
|
|
24
|
+
*
|
|
25
|
+
* - Docs: https://gem.azuro.org/hub/apps/toolkit/utils/cashout/createCashout
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* import { createCashout } from '@azuro-org/toolkit'
|
|
29
|
+
*
|
|
30
|
+
* const chainId = 100
|
|
31
|
+
* const calculationId = 'gnosis_0x123_456'
|
|
32
|
+
* const attention = 'By signing this transaction, I agree to cash out on Azuro'
|
|
33
|
+
* const signature = '0xabc...'
|
|
34
|
+
*
|
|
35
|
+
* const result = await createCashout({
|
|
36
|
+
* chainId,
|
|
37
|
+
* calculationId,
|
|
38
|
+
* attention,
|
|
39
|
+
* signature,
|
|
40
|
+
* })
|
|
41
|
+
*
|
|
42
|
+
* console.log(result.state) // 'PROCESSING', 'ACCEPTED', 'REJECTED', or 'OPEN'
|
|
43
|
+
* */
|
|
44
|
+
export declare const createCashout: (props: CreateCashoutParams) => Promise<CreateCashoutResult>;
|