@azuro-org/toolkit 5.2.0-beta.1 → 6.0.0-beta.0
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 +942 -605
- 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 +52 -0
- package/dist/utils/feed/getConditionsState.d.ts +34 -0
- package/dist/utils/feed/getGamesByFilters.d.ts +35 -0
- package/dist/utils/feed/getGamesByIds.d.ts +26 -0
- package/dist/utils/feed/getNavigation.d.ts +58 -0
- package/dist/utils/feed/getSports.d.ts +57 -0
- package/dist/utils/feed/searchGames.d.ts +29 -0
- package/dist/utils/feed/types.d.ts +46 -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 +1 -1
- 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
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as Types from '../types';
|
|
2
|
-
export type BetFragment = {
|
|
3
|
-
__typename?: 'V3_Bet';
|
|
4
|
-
id: string;
|
|
5
|
-
actor: string;
|
|
6
|
-
amount: string;
|
|
7
|
-
status: Types.BetStatus;
|
|
8
|
-
potentialPayout: string;
|
|
9
|
-
payout?: string | null;
|
|
10
|
-
result?: Types.BetResult | null;
|
|
11
|
-
odds: string;
|
|
12
|
-
settledOdds?: string | null;
|
|
13
|
-
redeemedTxHash?: string | null;
|
|
14
|
-
affiliate: string;
|
|
15
|
-
isRedeemed: boolean;
|
|
16
|
-
isRedeemable: boolean;
|
|
17
|
-
isCashedOut: boolean;
|
|
18
|
-
freebetId?: string | null;
|
|
19
|
-
isFreebetAmountReturnable?: boolean | null;
|
|
20
|
-
paymasterContractAddress?: string | null;
|
|
21
|
-
tokenId: string;
|
|
22
|
-
createdAt: string;
|
|
23
|
-
resolvedAt?: string | null;
|
|
24
|
-
txHash: string;
|
|
25
|
-
core: {
|
|
26
|
-
__typename?: 'CoreContract';
|
|
27
|
-
address: string;
|
|
28
|
-
liquidityPool: {
|
|
29
|
-
__typename?: 'LiquidityPoolContract';
|
|
30
|
-
address: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
selections: Array<{
|
|
34
|
-
__typename?: 'V3_Selection';
|
|
35
|
-
odds: string;
|
|
36
|
-
result?: Types.SelectionResult | null;
|
|
37
|
-
conditionKind: Types.V3_SelectionConditionKind;
|
|
38
|
-
outcome: {
|
|
39
|
-
__typename?: 'V3_Outcome';
|
|
40
|
-
outcomeId: string;
|
|
41
|
-
title?: string | null;
|
|
42
|
-
condition: {
|
|
43
|
-
__typename?: 'V3_Condition';
|
|
44
|
-
conditionId: string;
|
|
45
|
-
title?: string | null;
|
|
46
|
-
status: Types.ConditionStatus;
|
|
47
|
-
gameId: string;
|
|
48
|
-
wonOutcomeIds?: Array<string> | null;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
}>;
|
|
52
|
-
cashout?: {
|
|
53
|
-
__typename?: 'Cashout';
|
|
54
|
-
payout: string;
|
|
55
|
-
} | null;
|
|
56
|
-
};
|
|
57
|
-
export declare const BetFragmentDoc: import("graphql/language/ast").DocumentNode;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Address, type Hex } from 'viem';
|
|
2
|
-
import { type CreateBetResponse, type BetClientData } from '../global';
|
|
3
|
-
type Props = {
|
|
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 declare const createBet: (props: Props) => Promise<CreateBetResponse | null>;
|
|
17
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Address, type Hex } from 'viem';
|
|
2
|
-
import { type CreateBetResponse, type BetClientData } from '../global';
|
|
3
|
-
type Props = {
|
|
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 declare const createComboBet: (props: Props) => Promise<CreateBetResponse | null>;
|
|
17
|
-
export {};
|
package/dist/utils/getBet.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type CreateBetResponse } from '../global';
|
|
2
|
-
import { type ChainId } from '../config';
|
|
3
|
-
import { type Environment } from '../envs';
|
|
4
|
-
export type GetBetResponse = {
|
|
5
|
-
txHash: string;
|
|
6
|
-
odds: number;
|
|
7
|
-
clearOdds: number;
|
|
8
|
-
betId: number;
|
|
9
|
-
createdAt: string;
|
|
10
|
-
updatedAt: string;
|
|
11
|
-
core: string;
|
|
12
|
-
bettor: string;
|
|
13
|
-
affiliate: string;
|
|
14
|
-
stake: number;
|
|
15
|
-
maxStake: number;
|
|
16
|
-
environment: Environment;
|
|
17
|
-
} & CreateBetResponse;
|
|
18
|
-
type Props = {
|
|
19
|
-
chainId: ChainId;
|
|
20
|
-
orderId: string;
|
|
21
|
-
};
|
|
22
|
-
export declare const getBet: ({ chainId, orderId }: Props) => Promise<GetBetResponse | null>;
|
|
23
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
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 declare const getBetFee: (chainId: ChainId) => Promise<BetFeeResponse>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { GameState } from '../docs/feed/types';
|
|
2
|
-
import { BetStatus as GraphBetStatus } from '../docs/bets/types';
|
|
3
|
-
export declare enum BetStatus {
|
|
4
|
-
Accepted = 0,
|
|
5
|
-
Live = 1,
|
|
6
|
-
PendingResolution = 2,
|
|
7
|
-
Resolved = 3,
|
|
8
|
-
Canceled = 4
|
|
9
|
-
}
|
|
10
|
-
type Game = {
|
|
11
|
-
state: GameState;
|
|
12
|
-
startsAt: string;
|
|
13
|
-
};
|
|
14
|
-
type Props = {
|
|
15
|
-
games: Game[];
|
|
16
|
-
graphStatus: GraphBetStatus;
|
|
17
|
-
};
|
|
18
|
-
export declare const getBetStatus: (props: Props) => BetStatus;
|
|
19
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type SignTypedDataParameters, type Address } from 'viem';
|
|
2
|
-
import { BET_DATA_TYPES } from '../config';
|
|
3
|
-
import { type BetClientData } from '../global';
|
|
4
|
-
type Props = {
|
|
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
|
-
export declare const getBetTypedData: (props: Props) => SignTypedDataParameters<typeof BET_DATA_TYPES>;
|
|
16
|
-
export {};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem';
|
|
2
|
-
import type { GameState } from '../docs';
|
|
3
|
-
import { type BetState, type CreateBetResponse } from '../global';
|
|
4
|
-
import { type ChainId } from '../config';
|
|
5
|
-
import { type Environment } from '../envs';
|
|
6
|
-
export type Bet = {
|
|
7
|
-
txHash: Hex | null;
|
|
8
|
-
odds: number;
|
|
9
|
-
clearOdds: number;
|
|
10
|
-
betId: number;
|
|
11
|
-
createdAt: string;
|
|
12
|
-
updatedAt: string;
|
|
13
|
-
redeemedAt: string | null;
|
|
14
|
-
core: Hex;
|
|
15
|
-
bettor: Address;
|
|
16
|
-
affiliate: Address;
|
|
17
|
-
stake: number;
|
|
18
|
-
maxStake: number;
|
|
19
|
-
environment: Environment;
|
|
20
|
-
} & CreateBetResponse;
|
|
21
|
-
export type GetOrderConditionSpecResponse = {
|
|
22
|
-
conditionId: string;
|
|
23
|
-
outcomeId: number;
|
|
24
|
-
orderId: string;
|
|
25
|
-
gameState: GameState;
|
|
26
|
-
conditionMargin: string;
|
|
27
|
-
selectionMargin: string;
|
|
28
|
-
settledSelectionMargin: string | null;
|
|
29
|
-
result: any;
|
|
30
|
-
};
|
|
31
|
-
export type GetOrderResponse = {
|
|
32
|
-
id: string;
|
|
33
|
-
environment: Environment;
|
|
34
|
-
state: string;
|
|
35
|
-
createdAt: Date;
|
|
36
|
-
updatedAt: Date;
|
|
37
|
-
core: string;
|
|
38
|
-
bettor: string;
|
|
39
|
-
owner: string;
|
|
40
|
-
affiliate: string;
|
|
41
|
-
amount: number;
|
|
42
|
-
payout: number;
|
|
43
|
-
odds: number;
|
|
44
|
-
bonusId: string | null;
|
|
45
|
-
isFreebet: boolean;
|
|
46
|
-
betId: number | null;
|
|
47
|
-
txHash: Hex | null;
|
|
48
|
-
margin: string;
|
|
49
|
-
settledMargin: string | null;
|
|
50
|
-
result: string | null;
|
|
51
|
-
settledAt: Date | null;
|
|
52
|
-
redeemedAt: Date | null;
|
|
53
|
-
error: string | null;
|
|
54
|
-
errorMessage: string | null;
|
|
55
|
-
conditions?: GetOrderConditionSpecResponse[];
|
|
56
|
-
} & CreateBetResponse;
|
|
57
|
-
export type GetBetsHistoryResponse = {
|
|
58
|
-
orders: Bet[];
|
|
59
|
-
};
|
|
60
|
-
export type GetBetsHistoryProps = {
|
|
61
|
-
chainId: ChainId;
|
|
62
|
-
bettor: Address;
|
|
63
|
-
filter?: {
|
|
64
|
-
result?: 'Won' | 'Lost' | 'Canceled';
|
|
65
|
-
state?: BetState | BetState[];
|
|
66
|
-
isRedeemed?: boolean;
|
|
67
|
-
};
|
|
68
|
-
offset?: number;
|
|
69
|
-
limit?: number;
|
|
70
|
-
};
|
|
71
|
-
export declare const getBetsHistory: ({ chainId, bettor, filter, offset, limit }: GetBetsHistoryProps) => Promise<Bet[] | null>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type SignTypedDataParameters, type Address } from 'viem';
|
|
2
|
-
import { COMBO_BET_DATA_TYPES } from '../config';
|
|
3
|
-
import { type BetClientData } from '../global';
|
|
4
|
-
type Props = {
|
|
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
|
-
export declare const getComboBetTypedData: (props: Props) => SignTypedDataParameters<typeof COMBO_BET_DATA_TYPES>;
|
|
16
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type ChainId } from '../config';
|
|
2
|
-
import { type Selection } from '../global';
|
|
3
|
-
export type GetMaxBetResponse = {
|
|
4
|
-
response: {
|
|
5
|
-
maxBet: string;
|
|
6
|
-
maxPayout: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
type Props = {
|
|
10
|
-
chainId: ChainId;
|
|
11
|
-
selections: Selection[];
|
|
12
|
-
};
|
|
13
|
-
/** @deprecated use `getBetCalculation` instead */
|
|
14
|
-
export declare const getMaxBet: (props: Props) => Promise<{
|
|
15
|
-
maxBet: string;
|
|
16
|
-
maxPayout: string;
|
|
17
|
-
} | null>;
|
|
18
|
-
export {};
|