@azuro-org/toolkit 4.4.1 → 4.5.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 +3 -3
- package/dist/config.d.ts +28 -23
- package/dist/docs/prematch/fragments/liveBet.d.ts +3 -2
- package/dist/docs/prematch/fragments/prematchBet.d.ts +3 -2
- package/dist/docs/prematch/liveBets.d.ts +3 -2
- package/dist/docs/prematch/prematchBets.d.ts +3 -2
- package/dist/docs/prematch/types.d.ts +696 -0
- package/dist/global.d.ts +23 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +251 -14
- package/dist/utils/cashout/createCashout.d.ts +22 -0
- package/dist/utils/cashout/getCalculatedCashout.d.ts +22 -0
- package/dist/utils/cashout/getCashout.d.ts +11 -0
- package/dist/utils/cashout/getCashoutTypedData.d.ts +13 -0
- package/dist/utils/cashout/getPrecalculatedCashouts.d.ts +18 -0
- package/dist/utils/getEndpoints.d.ts +1 -1
- package/dist/utils/getLiveBetTypedData.d.ts +2 -2
- package/dist/utils/setupContracts.d.ts +11 -2
- package/package.json +4 -4
package/dist/global.d.ts
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
|
-
import { type Address } from 'viem';
|
|
1
|
+
import { type Address, type Chain } from 'viem';
|
|
2
|
+
import { type Environment } from './envs';
|
|
3
|
+
import { type Contracts } from './utils/setupContracts';
|
|
2
4
|
import { type ChainId } from './config';
|
|
5
|
+
type BetToken = {
|
|
6
|
+
address: Address;
|
|
7
|
+
symbol: string;
|
|
8
|
+
decimals: number;
|
|
9
|
+
};
|
|
10
|
+
export type ChainData = {
|
|
11
|
+
chain: Omit<Chain, 'id'> & {
|
|
12
|
+
id: ChainId;
|
|
13
|
+
};
|
|
14
|
+
graphql: {
|
|
15
|
+
prematch: string;
|
|
16
|
+
live: string;
|
|
17
|
+
};
|
|
18
|
+
socket: string;
|
|
19
|
+
api: string;
|
|
20
|
+
environment: Environment;
|
|
21
|
+
contracts: Contracts;
|
|
22
|
+
betToken: BetToken;
|
|
23
|
+
};
|
|
3
24
|
export type Selection = {
|
|
4
25
|
outcomeId: string;
|
|
5
26
|
conditionId: string;
|
|
@@ -19,3 +40,4 @@ export type LiveBet = {
|
|
|
19
40
|
expiresAt: number;
|
|
20
41
|
relayerFeeAmount: string;
|
|
21
42
|
};
|
|
43
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { environments, Environment } from './envs';
|
|
2
|
-
export
|
|
2
|
+
export * from './config';
|
|
3
3
|
export * from './global';
|
|
4
4
|
export * from './abis';
|
|
5
5
|
export * from './docs';
|
|
@@ -26,3 +26,8 @@ export { createDeBridgeBet, type DeBridgeCreateTxResponse } from './utils/deBrid
|
|
|
26
26
|
export { getDeBridgeSupportedChains, deBridgeChainIdByOriginalChainId, type DeBridgeSupportedChains } from './utils/deBridge/getDeBridgeSupportedChains';
|
|
27
27
|
export { getDeBridgeSupportedTokens, type DeBridgeSupportedTokens } from './utils/deBridge/getDeBridgeSupportedTokens';
|
|
28
28
|
export { getDeBridgeOrder, DeBridgeOrderStatus, DeBridgeExternalCallStatus } from './utils/deBridge/getDeBridgeOrder';
|
|
29
|
+
export { getPrecalculatedCashouts, type GetPrecalculatedCashouts } from './utils/cashout/getPrecalculatedCashouts';
|
|
30
|
+
export { getCalculatedCashout, type GetCalculatedCashout } from './utils/cashout/getCalculatedCashout';
|
|
31
|
+
export { getCashoutTypedData } from './utils/cashout/getCashoutTypedData';
|
|
32
|
+
export { createCashout, CashoutState, type CreateCashoutResponse } from './utils/cashout/createCashout';
|
|
33
|
+
export { getCashout, type GetCashoutResponse } from './utils/cashout/getCashout';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {gnosis,polygon,polygonAmoy,chiliz,spicy}from'viem/chains';import {gql}from'@apollo/client';import {readContracts,readContract}from'@wagmi/core';import {
|
|
1
|
+
import {gnosis,polygon,polygonAmoy,chiliz,spicy}from'viem/chains';import {erc721Abi,parseUnits,formatUnits,encodeAbiParameters,parseAbiParameters,encodeFunctionData}from'viem';import {gql}from'@apollo/client';import {readContracts,readContract}from'@wagmi/core';import {dictionaries,getMarketKey,getMarketName,getSelectionName,getMarketDescription}from'@azuro-org/dictionaries';const isDevEnabled = Boolean(JSON.parse(process.env.AZURO_UNSTABLE_DEV_ENABLED || 'false'));
|
|
2
2
|
var Environment;
|
|
3
3
|
(function (Environment) {
|
|
4
4
|
Environment["GnosisDevXDAI"] = "GnosisDevXDAI";
|
|
@@ -3855,7 +3855,7 @@ const environments = {
|
|
|
3855
3855
|
'stateMutability': 'payable',
|
|
3856
3856
|
'type': 'receive',
|
|
3857
3857
|
},
|
|
3858
|
-
];var FreeBet = [{ 'inputs': [], 'name': 'AlreadyResolved', 'type': 'error' }, { 'inputs': [], 'name': 'BetAlreadyClaimed', 'type': 'error' }, { 'inputs': [], 'name': 'BetExpired', 'type': 'error' }, { 'inputs': [], 'name': 'IncorrectChainId', 'type': 'error' }, { 'inputs': [], 'name': 'InsufficientContractBalance', 'type': 'error' }, { 'inputs': [], 'name': 'InvalidSignature', 'type': 'error' }, { 'inputs': [], 'name': 'OnlyBetOwner', 'type': 'error' }, { 'inputs': [], 'name': 'OnlyFreeBetOwner', 'type': 'error' }, { 'inputs': [], 'name': 'OnlyManager', 'type': 'error' }, { 'inputs': [], 'name': 'SmallMinOdds', 'type': 'error' }, { 'anonymous': false, 'inputs': [{ 'indexed': false, 'internalType': 'address', 'name': 'newAffiliate', 'type': 'address' }], 'name': 'AffiliateChanged', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'internalType': 'address', 'name': 'core', 'type': 'address' }, { 'indexed': true, 'internalType': 'address', 'name': 'bettor', 'type': 'address' }, { 'indexed': true, 'internalType': 'uint256', 'name': 'freeBetId', 'type': 'uint256' }, { 'indexed': false, 'internalType': 'uint256', 'name': 'amount', 'type': 'uint256' }], 'name': 'BettorWin', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': false, 'internalType': 'uint8', 'name': 'version', 'type': 'uint8' }], 'name': 'Initialized', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'internalType': 'address', 'name': 'newLp', 'type': 'address' }], 'name': 'LpChanged', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': false, 'internalType': 'address', 'name': 'newManager', 'type': 'address' }], 'name': 'ManagerChanged', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'internalType': 'uint256', 'name': 'freeBetId', 'type': 'uint256' }, { 'indexed': false, 'internalType': 'address', 'name': 'core', 'type': 'address' }, { 'indexed': true, 'internalType': 'address', 'name': 'bettor', 'type': 'address' }, { 'indexed': true, 'internalType': 'uint256', 'name': 'azuroBetId', 'type': 'uint256' }, { 'indexed': false, 'internalType': 'uint128', 'name': 'amount', 'type': 'uint128' }, { 'indexed': false, 'internalType': 'uint64', 'name': 'minOdds', 'type': 'uint64' }, { 'indexed': false, 'internalType': 'uint64', 'name': 'expiresAt', 'type': 'uint64' }], 'name': 'NewBet', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'internalType': 'address', 'name': 'previousOwner', 'type': 'address' }, { 'indexed': true, 'internalType': 'address', 'name': 'newOwner', 'type': 'address' }], 'name': 'OwnershipTransferred', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': false, 'internalType': 'uint256[]', 'name': 'azuroBetId', 'type': 'uint256[]' }], 'name': 'PayoutsResolved', 'type': 'event' }, { 'inputs': [], 'name': 'affiliate', 'outputs': [{ 'internalType': 'address', 'name': '', 'type': 'address' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [{ 'components': [{ 'internalType': 'uint256', 'name': 'chainId', 'type': 'uint256' }, { 'internalType': 'uint256', 'name': 'freeBetId', 'type': 'uint256' }, { 'internalType': 'address', 'name': 'owner', 'type': 'address' }, { 'internalType': 'uint128', 'name': 'amount', 'type': 'uint128' }, { 'internalType': 'uint64', 'name': 'minOdds', 'type': 'uint64' }, { 'internalType': 'uint64', 'name': 'expiresAt', 'type': 'uint64' }], 'internalType': 'struct IFreeBet.FreeBetData', 'name': 'freeBetData', 'type': 'tuple' }, { 'internalType': 'bytes', 'name': 'signature', 'type': 'bytes' }, { 'internalType': 'address', 'name': 'core', 'type': 'address' }, { 'internalType': 'uint256', 'name': 'conditionId', 'type': 'uint256' }, { 'internalType': 'uint64', 'name': 'outcomeId', 'type': 'uint64' }, { 'internalType': 'uint64', 'name': 'deadline', 'type': 'uint64' }, { 'internalType': 'uint64', 'name': 'minOdds', 'type': 'uint64' }], 'name': 'bet', 'outputs': [{ 'internalType': 'uint256', 'name': 'azuroBetId', 'type': 'uint256' }], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'internalType': 'address', 'name': 'account', 'type': 'address' }], 'name': 'checkOwner', 'outputs': [], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [{ 'internalType': 'uint256', 'name': '', 'type': 'uint256' }], 'name': 'freeBets', 'outputs': [{ 'internalType': 'address', 'name': 'owner', 'type': 'address' }, { 'internalType': 'address', 'name': 'core', 'type': 'address' }, { 'internalType': 'uint256', 'name': 'azuroBetId', 'type': 'uint256' }, { 'internalType': 'uint128', 'name': 'amount', 'type': 'uint128' }, { 'internalType': 'uint128', 'name': 'payout', 'type': 'uint128' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [{ 'internalType': 'address', 'name': 'lpAddress', 'type': 'address' }, { 'internalType': 'address', 'name': 'affiliate_', 'type': 'address' }, { 'internalType': 'address', 'name': 'manager_', 'type': 'address' }], 'name': 'initialize', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [], 'name': 'lockedReserve', 'outputs': [{ 'internalType': 'uint256', 'name': '', 'type': 'uint256' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [], 'name': 'lp', 'outputs': [{ 'internalType': 'contract ILP', 'name': '', 'type': 'address' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [], 'name': 'manager', 'outputs': [{ 'internalType': 'address', 'name': '', 'type': 'address' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [], 'name': 'owner', 'outputs': [{ 'internalType': 'address', 'name': '', 'type': 'address' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [{ 'internalType': 'uint256[]', 'name': 'freeBetIds', 'type': 'uint256[]' }], 'name': 'resolvePayout', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'internalType': 'address', 'name': 'affiliate_', 'type': 'address' }], 'name': 'setAffiliate', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'internalType': 'address', 'name': 'lp_', 'type': 'address' }], 'name': 'setLp', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'internalType': 'address', 'name': 'manager_', 'type': 'address' }], 'name': 'setManager', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [], 'name': 'token', 'outputs': [{ 'internalType': 'address', 'name': '', 'type': 'address' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [{ 'internalType': 'address', 'name': 'newOwner', 'type': 'address' }], 'name': 'transferOwnership', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'internalType': 'uint256', 'name': 'freeBetId', 'type': 'uint256' }], 'name': 'withdrawPayout', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'internalType': 'uint256', 'name': 'amount', 'type': 'uint256' }], 'name': 'withdrawReserve', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'stateMutability': 'payable', 'type': 'receive' }];const setupContracts = ({ lp, prematchCore, prematchComboCore, proxyFront, liveRelayer, liveCore }) => {
|
|
3858
|
+
];var FreeBet = [{ 'inputs': [], 'name': 'AlreadyResolved', 'type': 'error' }, { 'inputs': [], 'name': 'BetAlreadyClaimed', 'type': 'error' }, { 'inputs': [], 'name': 'BetExpired', 'type': 'error' }, { 'inputs': [], 'name': 'IncorrectChainId', 'type': 'error' }, { 'inputs': [], 'name': 'InsufficientContractBalance', 'type': 'error' }, { 'inputs': [], 'name': 'InvalidSignature', 'type': 'error' }, { 'inputs': [], 'name': 'OnlyBetOwner', 'type': 'error' }, { 'inputs': [], 'name': 'OnlyFreeBetOwner', 'type': 'error' }, { 'inputs': [], 'name': 'OnlyManager', 'type': 'error' }, { 'inputs': [], 'name': 'SmallMinOdds', 'type': 'error' }, { 'anonymous': false, 'inputs': [{ 'indexed': false, 'internalType': 'address', 'name': 'newAffiliate', 'type': 'address' }], 'name': 'AffiliateChanged', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'internalType': 'address', 'name': 'core', 'type': 'address' }, { 'indexed': true, 'internalType': 'address', 'name': 'bettor', 'type': 'address' }, { 'indexed': true, 'internalType': 'uint256', 'name': 'freeBetId', 'type': 'uint256' }, { 'indexed': false, 'internalType': 'uint256', 'name': 'amount', 'type': 'uint256' }], 'name': 'BettorWin', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': false, 'internalType': 'uint8', 'name': 'version', 'type': 'uint8' }], 'name': 'Initialized', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'internalType': 'address', 'name': 'newLp', 'type': 'address' }], 'name': 'LpChanged', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': false, 'internalType': 'address', 'name': 'newManager', 'type': 'address' }], 'name': 'ManagerChanged', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'internalType': 'uint256', 'name': 'freeBetId', 'type': 'uint256' }, { 'indexed': false, 'internalType': 'address', 'name': 'core', 'type': 'address' }, { 'indexed': true, 'internalType': 'address', 'name': 'bettor', 'type': 'address' }, { 'indexed': true, 'internalType': 'uint256', 'name': 'azuroBetId', 'type': 'uint256' }, { 'indexed': false, 'internalType': 'uint128', 'name': 'amount', 'type': 'uint128' }, { 'indexed': false, 'internalType': 'uint64', 'name': 'minOdds', 'type': 'uint64' }, { 'indexed': false, 'internalType': 'uint64', 'name': 'expiresAt', 'type': 'uint64' }], 'name': 'NewBet', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': true, 'internalType': 'address', 'name': 'previousOwner', 'type': 'address' }, { 'indexed': true, 'internalType': 'address', 'name': 'newOwner', 'type': 'address' }], 'name': 'OwnershipTransferred', 'type': 'event' }, { 'anonymous': false, 'inputs': [{ 'indexed': false, 'internalType': 'uint256[]', 'name': 'azuroBetId', 'type': 'uint256[]' }], 'name': 'PayoutsResolved', 'type': 'event' }, { 'inputs': [], 'name': 'affiliate', 'outputs': [{ 'internalType': 'address', 'name': '', 'type': 'address' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [{ 'components': [{ 'internalType': 'uint256', 'name': 'chainId', 'type': 'uint256' }, { 'internalType': 'uint256', 'name': 'freeBetId', 'type': 'uint256' }, { 'internalType': 'address', 'name': 'owner', 'type': 'address' }, { 'internalType': 'uint128', 'name': 'amount', 'type': 'uint128' }, { 'internalType': 'uint64', 'name': 'minOdds', 'type': 'uint64' }, { 'internalType': 'uint64', 'name': 'expiresAt', 'type': 'uint64' }], 'internalType': 'struct IFreeBet.FreeBetData', 'name': 'freeBetData', 'type': 'tuple' }, { 'internalType': 'bytes', 'name': 'signature', 'type': 'bytes' }, { 'internalType': 'address', 'name': 'core', 'type': 'address' }, { 'internalType': 'uint256', 'name': 'conditionId', 'type': 'uint256' }, { 'internalType': 'uint64', 'name': 'outcomeId', 'type': 'uint64' }, { 'internalType': 'uint64', 'name': 'deadline', 'type': 'uint64' }, { 'internalType': 'uint64', 'name': 'minOdds', 'type': 'uint64' }], 'name': 'bet', 'outputs': [{ 'internalType': 'uint256', 'name': 'azuroBetId', 'type': 'uint256' }], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'internalType': 'address', 'name': 'account', 'type': 'address' }], 'name': 'checkOwner', 'outputs': [], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [{ 'internalType': 'uint256', 'name': '', 'type': 'uint256' }], 'name': 'freeBets', 'outputs': [{ 'internalType': 'address', 'name': 'owner', 'type': 'address' }, { 'internalType': 'address', 'name': 'core', 'type': 'address' }, { 'internalType': 'uint256', 'name': 'azuroBetId', 'type': 'uint256' }, { 'internalType': 'uint128', 'name': 'amount', 'type': 'uint128' }, { 'internalType': 'uint128', 'name': 'payout', 'type': 'uint128' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [{ 'internalType': 'address', 'name': 'lpAddress', 'type': 'address' }, { 'internalType': 'address', 'name': 'affiliate_', 'type': 'address' }, { 'internalType': 'address', 'name': 'manager_', 'type': 'address' }], 'name': 'initialize', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [], 'name': 'lockedReserve', 'outputs': [{ 'internalType': 'uint256', 'name': '', 'type': 'uint256' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [], 'name': 'lp', 'outputs': [{ 'internalType': 'contract ILP', 'name': '', 'type': 'address' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [], 'name': 'manager', 'outputs': [{ 'internalType': 'address', 'name': '', 'type': 'address' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [], 'name': 'owner', 'outputs': [{ 'internalType': 'address', 'name': '', 'type': 'address' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [{ 'internalType': 'uint256[]', 'name': 'freeBetIds', 'type': 'uint256[]' }], 'name': 'resolvePayout', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'internalType': 'address', 'name': 'affiliate_', 'type': 'address' }], 'name': 'setAffiliate', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'internalType': 'address', 'name': 'lp_', 'type': 'address' }], 'name': 'setLp', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'internalType': 'address', 'name': 'manager_', 'type': 'address' }], 'name': 'setManager', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [], 'name': 'token', 'outputs': [{ 'internalType': 'address', 'name': '', 'type': 'address' }], 'stateMutability': 'view', 'type': 'function' }, { 'inputs': [{ 'internalType': 'address', 'name': 'newOwner', 'type': 'address' }], 'name': 'transferOwnership', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'internalType': 'uint256', 'name': 'freeBetId', 'type': 'uint256' }], 'name': 'withdrawPayout', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'inputs': [{ 'internalType': 'uint256', 'name': 'amount', 'type': 'uint256' }], 'name': 'withdrawReserve', 'outputs': [], 'stateMutability': 'nonpayable', 'type': 'function' }, { 'stateMutability': 'payable', 'type': 'receive' }];const setupContracts = ({ lp, prematchCore, prematchComboCore, proxyFront, azuroBet, cashout, liveRelayer, liveCore, }) => {
|
|
3859
3859
|
const contracts = {
|
|
3860
3860
|
lp: {
|
|
3861
3861
|
address: lp,
|
|
@@ -3873,12 +3873,21 @@ const environments = {
|
|
|
3873
3873
|
address: proxyFront,
|
|
3874
3874
|
abi: proxyFrontAbi,
|
|
3875
3875
|
},
|
|
3876
|
+
azuroBet: {
|
|
3877
|
+
address: azuroBet,
|
|
3878
|
+
abi: erc721Abi,
|
|
3879
|
+
},
|
|
3876
3880
|
};
|
|
3877
3881
|
if (liveRelayer) {
|
|
3878
3882
|
contracts.liveRelayer = {
|
|
3879
3883
|
address: liveRelayer,
|
|
3880
3884
|
};
|
|
3881
3885
|
}
|
|
3886
|
+
if (cashout) {
|
|
3887
|
+
contracts.cashout = {
|
|
3888
|
+
address: cashout,
|
|
3889
|
+
};
|
|
3890
|
+
}
|
|
3882
3891
|
if (liveCore) {
|
|
3883
3892
|
contracts.liveCore = {
|
|
3884
3893
|
address: liveCore,
|
|
@@ -3914,12 +3923,12 @@ const getLiveGraphqlEndpoint = (chainId) => {
|
|
|
3914
3923
|
};
|
|
3915
3924
|
const getSocketEndpoint = (chainId) => {
|
|
3916
3925
|
if (isDev(chainId)) {
|
|
3917
|
-
return 'wss://dev-streams.azuro.org/v1/streams
|
|
3926
|
+
return 'wss://dev-streams.azuro.org/v1/streams';
|
|
3918
3927
|
}
|
|
3919
3928
|
if (chainId === polygonAmoy.id) {
|
|
3920
|
-
return 'wss://preprod-streams.azuro.org/v1/streams
|
|
3929
|
+
return 'wss://preprod-streams.azuro.org/v1/streams';
|
|
3921
3930
|
}
|
|
3922
|
-
return 'wss://streams.azuro.org/v1/streams
|
|
3931
|
+
return 'wss://streams.azuro.org/v1/streams';
|
|
3923
3932
|
};
|
|
3924
3933
|
const getApiEndpoint = (chainId) => {
|
|
3925
3934
|
if (isDev(chainId)) {
|
|
@@ -3949,6 +3958,21 @@ const LIVE_BET_DATA_TYPES = {
|
|
|
3949
3958
|
};
|
|
3950
3959
|
const LIVE_TYPED_DATA_DOMAIN_NAME = 'Live Betting';
|
|
3951
3960
|
const LIVE_TYPED_DATA_DOMAIN_VERSION = '1.0.0';
|
|
3961
|
+
const CASHOUT_DATA_TYPES = {
|
|
3962
|
+
CashOutItem: [
|
|
3963
|
+
{ name: 'betId', type: 'uint256' },
|
|
3964
|
+
{ name: 'bettingContract', type: 'address' },
|
|
3965
|
+
{ name: 'minOdds', type: 'uint64' },
|
|
3966
|
+
],
|
|
3967
|
+
CashOutOrder: [
|
|
3968
|
+
{ name: 'attention', type: 'string' },
|
|
3969
|
+
{ name: 'chainId', type: 'uint256' },
|
|
3970
|
+
{ name: 'items', type: 'CashOutItem[]' },
|
|
3971
|
+
{ name: 'expiresAt', type: 'uint64' },
|
|
3972
|
+
],
|
|
3973
|
+
};
|
|
3974
|
+
const CASHOUT_TYPED_DATA_DOMAIN_NAME = 'Cash Out';
|
|
3975
|
+
const CASHOUT_TYPED_DATA_DOMAIN_VERSION = '1.0.0';
|
|
3952
3976
|
const deBridgeUrl = 'https://api.dln.trade/v1.0';
|
|
3953
3977
|
const deBridgeTxUrl = 'https://stats-api.dln.trade/api';
|
|
3954
3978
|
const liveHostAddress = '0x67Fca88E2f5F2C33b86bFa4EccfCb8dCD6a56D17';
|
|
@@ -3967,6 +3991,7 @@ const gnosisData = {
|
|
|
3967
3991
|
prematchCore: '0x7f3F3f19c4e4015fd9Db2f22e653c766154091EF',
|
|
3968
3992
|
prematchComboCore: '0xDbC3BE2DDB53e1a288F7b7a4d020F8056D3b0F7C',
|
|
3969
3993
|
proxyFront: '0x3A1c6640daeAc3513726F06A9f03911CC1080251',
|
|
3994
|
+
azuroBet: '0xA3A1B460c68dc91c5B3f71f5487A76fac42858bf',
|
|
3970
3995
|
liveRelayer: '0x936c02503A32aA23BCF7CFaF5c29100b0F93FCfe',
|
|
3971
3996
|
liveCore: '0x0223ff7efca5aec919c471fa2eb44cda466f1500',
|
|
3972
3997
|
}),
|
|
@@ -3990,6 +4015,8 @@ const gnosisDevData = {
|
|
|
3990
4015
|
prematchCore: '0x0eaa5283990af9ca915b1d82261663d25d039d03',
|
|
3991
4016
|
prematchComboCore: '0xdab6c085e2a24d3417875ea154c1d0abb5d427f9',
|
|
3992
4017
|
proxyFront: '0xB02205C9e5DdFFa3EEa2731fE76e505B0d3eCCb0',
|
|
4018
|
+
azuroBet: '0x9AEb928E13b989d5F013b33c14853d8a944Acbf1',
|
|
4019
|
+
cashout: '0x483779Ff0F54Be733F513c14AA3a8382AB1cE019',
|
|
3993
4020
|
liveRelayer: '0x3B0213eB35735A8E2b19F13C5Ec0a65a8226D5B2',
|
|
3994
4021
|
liveCore: '0xFc4910f0E7523063f3640e249Fc0f25542b76899',
|
|
3995
4022
|
}),
|
|
@@ -4013,6 +4040,7 @@ const polygonData = {
|
|
|
4013
4040
|
prematchCore: '0xA40F8D69D412b79b49EAbdD5cf1b5706395bfCf7',
|
|
4014
4041
|
prematchComboCore: '0x92a4e8Bc6B92a2e1ced411f41013B5FE6BE07613',
|
|
4015
4042
|
proxyFront: '0x0DEE52b98ba8326DaD4C346a4F806Fd871360a00',
|
|
4043
|
+
azuroBet: '0x8ed7296b5CAe379d07C70280Af622BC410F01Ed7',
|
|
4016
4044
|
liveRelayer: '0xC6BB817a7f02874F360d135D880200A2E440207D',
|
|
4017
4045
|
liveCore: '0xc389558Faca41bC747F763cf8616704187CDcD04',
|
|
4018
4046
|
}),
|
|
@@ -4036,6 +4064,7 @@ const polygonAmoyData = {
|
|
|
4036
4064
|
prematchCore: '0x2477B960080B3439b4684df3D9CE53B2ACe64315',
|
|
4037
4065
|
prematchComboCore: '0xdF71998f7931caD24439A12A2F56D7326C3D0295',
|
|
4038
4066
|
proxyFront: '0x7003CaA0847CA296EBF51C43D9021656a663304f',
|
|
4067
|
+
azuroBet: '0x5E59ee1b09Cb2Cf031e4Beaa8dB48D4B8b7e38AD',
|
|
4039
4068
|
liveRelayer: '0x355B8493380fA5D57E4d3aFBF7C5f38b64AD5eA9',
|
|
4040
4069
|
liveCore: '0x51eD5C2596d9AE32cE53ac1915Cb9333AFeF3156',
|
|
4041
4070
|
}),
|
|
@@ -4059,6 +4088,8 @@ const polygonAmoyDevData = {
|
|
|
4059
4088
|
prematchCore: '0x87EBFFe283bE8dEd47c3C87451d1B89c8a2C441A',
|
|
4060
4089
|
prematchComboCore: '0x471DaC1052248602fdF05377EF99B5b7b3a769a1',
|
|
4061
4090
|
proxyFront: '0x7003CaA0847CA296EBF51C43D9021656a663304f',
|
|
4091
|
+
azuroBet: '0x68af5E36EF6474036604702B33014D3b4dcc93f2',
|
|
4092
|
+
cashout: '0x914669F2BE69b1FE2a4927E9C84d1F0b4E933Ab6',
|
|
4062
4093
|
liveRelayer: '0x38633e7Cbd86959453445C170168855ed1151C22',
|
|
4063
4094
|
liveCore: '0x00232f2dEEae4541da1C5eC265193C879B2304Eb',
|
|
4064
4095
|
}),
|
|
@@ -4082,6 +4113,7 @@ const chilizData = {
|
|
|
4082
4113
|
prematchCore: '0x1a21C681Cc83889f4b213485aB6cF4971C43114B',
|
|
4083
4114
|
prematchComboCore: '0x724fa8931428D5B636F7191d3e848f28Ab23C425',
|
|
4084
4115
|
proxyFront: '0x45779134E5091756601Cb5bA389f9C76b914E520',
|
|
4116
|
+
azuroBet: '0x8609D1c8610D7F24d826FB76ea878d240537A8B8',
|
|
4085
4117
|
}),
|
|
4086
4118
|
betToken: {
|
|
4087
4119
|
address: '0x677F7e16C7Dd57be1D4C8aD1244883214953DC47',
|
|
@@ -4103,6 +4135,10 @@ const spicyData = {
|
|
|
4103
4135
|
prematchCore: '0x035AB843C9F6dCB9D9bDeAC18c191dEc6c975fB7',
|
|
4104
4136
|
prematchComboCore: '0xF94a49F0D78eAfeda81c785131eb6419EB18b33A',
|
|
4105
4137
|
proxyFront: '0x67f3228fD58f5A26D93a5dd0c6989b69c95618eB',
|
|
4138
|
+
azuroBet: '0x6FA69dD52B5BF761030d3201B1DbE04039bF0BDe',
|
|
4139
|
+
cashout: '0xB1E54209e224218A03BFd89f830cCE0414a1921E',
|
|
4140
|
+
liveRelayer: '0x699A817E9414698Afc761dCBA83d158894EA7dd4',
|
|
4141
|
+
liveCore: '0xC6B38c80427E4038e91798847b5C5b056C358817',
|
|
4106
4142
|
}),
|
|
4107
4143
|
betToken: {
|
|
4108
4144
|
address: '0x721ef6871f1c4efe730dce047d40d1743b886946',
|
|
@@ -4209,13 +4245,14 @@ const chainsDataByEnv = {
|
|
|
4209
4245
|
potentialPayout
|
|
4210
4246
|
payout
|
|
4211
4247
|
result
|
|
4212
|
-
isRedeemed
|
|
4213
|
-
isRedeemable
|
|
4214
4248
|
odds
|
|
4215
4249
|
settledOdds
|
|
4216
4250
|
createdAt: createdBlockTimestamp
|
|
4217
4251
|
txHash: createdTxHash
|
|
4218
4252
|
affiliate
|
|
4253
|
+
isRedeemed
|
|
4254
|
+
isRedeemable
|
|
4255
|
+
isCashedOut
|
|
4219
4256
|
core {
|
|
4220
4257
|
address
|
|
4221
4258
|
liquidityPool {
|
|
@@ -4269,13 +4306,14 @@ const chainsDataByEnv = {
|
|
|
4269
4306
|
potentialPayout
|
|
4270
4307
|
payout
|
|
4271
4308
|
result
|
|
4272
|
-
isRedeemed
|
|
4273
|
-
isRedeemable
|
|
4274
4309
|
odds
|
|
4275
4310
|
settledOdds
|
|
4276
4311
|
createdAt: createdBlockTimestamp
|
|
4277
4312
|
txHash: createdTxHash
|
|
4278
4313
|
affiliate
|
|
4314
|
+
isRedeemed
|
|
4315
|
+
isRedeemable
|
|
4316
|
+
isCashedOut
|
|
4279
4317
|
core {
|
|
4280
4318
|
address
|
|
4281
4319
|
liquidityPool {
|
|
@@ -4483,7 +4521,16 @@ const chainsDataByEnv = {
|
|
|
4483
4521
|
}
|
|
4484
4522
|
}
|
|
4485
4523
|
}
|
|
4486
|
-
`;var
|
|
4524
|
+
`;var AffiliateMonthly_OrderBy;
|
|
4525
|
+
(function (AffiliateMonthly_OrderBy) {
|
|
4526
|
+
AffiliateMonthly_OrderBy["Affiliate"] = "affiliate";
|
|
4527
|
+
AffiliateMonthly_OrderBy["BetsCount"] = "betsCount";
|
|
4528
|
+
AffiliateMonthly_OrderBy["Id"] = "id";
|
|
4529
|
+
AffiliateMonthly_OrderBy["LastAnyBetCreatedTimestamp"] = "lastAnyBetCreatedTimestamp";
|
|
4530
|
+
AffiliateMonthly_OrderBy["Month"] = "month";
|
|
4531
|
+
AffiliateMonthly_OrderBy["Year"] = "year";
|
|
4532
|
+
})(AffiliateMonthly_OrderBy || (AffiliateMonthly_OrderBy = {}));
|
|
4533
|
+
var AzuroBetContract_OrderBy;
|
|
4487
4534
|
(function (AzuroBetContract_OrderBy) {
|
|
4488
4535
|
AzuroBetContract_OrderBy["Address"] = "address";
|
|
4489
4536
|
AzuroBetContract_OrderBy["Core"] = "core";
|
|
@@ -4530,12 +4577,14 @@ var Bet_OrderBy;
|
|
|
4530
4577
|
Bet_OrderBy["ApproxSettledAt"] = "approxSettledAt";
|
|
4531
4578
|
Bet_OrderBy["BetId"] = "betId";
|
|
4532
4579
|
Bet_OrderBy["Bettor"] = "bettor";
|
|
4580
|
+
Bet_OrderBy["Cashout"] = "cashout";
|
|
4533
4581
|
Bet_OrderBy["Core"] = "core";
|
|
4534
4582
|
Bet_OrderBy["CreatedBlockNumber"] = "createdBlockNumber";
|
|
4535
4583
|
Bet_OrderBy["CreatedBlockTimestamp"] = "createdBlockTimestamp";
|
|
4536
4584
|
Bet_OrderBy["CreatedTxHash"] = "createdTxHash";
|
|
4537
4585
|
Bet_OrderBy["Freebet"] = "freebet";
|
|
4538
4586
|
Bet_OrderBy["Id"] = "id";
|
|
4587
|
+
Bet_OrderBy["IsCashedOut"] = "isCashedOut";
|
|
4539
4588
|
Bet_OrderBy["IsRedeemable"] = "isRedeemable";
|
|
4540
4589
|
Bet_OrderBy["IsRedeemed"] = "isRedeemed";
|
|
4541
4590
|
Bet_OrderBy["Odds"] = "odds";
|
|
@@ -4589,6 +4638,9 @@ var Bettor_OrderBy;
|
|
|
4589
4638
|
Bettor_OrderBy["RawTotalProfit"] = "rawTotalProfit";
|
|
4590
4639
|
Bettor_OrderBy["RawTurnover"] = "rawTurnover";
|
|
4591
4640
|
Bettor_OrderBy["RedeemedBetsCount"] = "redeemedBetsCount";
|
|
4641
|
+
Bettor_OrderBy["RedeemedCanceledBetsCount"] = "redeemedCanceledBetsCount";
|
|
4642
|
+
Bettor_OrderBy["RedeemedLostBetsCount"] = "redeemedLostBetsCount";
|
|
4643
|
+
Bettor_OrderBy["RedeemedWonBetsCount"] = "redeemedWonBetsCount";
|
|
4592
4644
|
Bettor_OrderBy["SettledBetsCount"] = "settledBetsCount";
|
|
4593
4645
|
Bettor_OrderBy["ToPayout"] = "toPayout";
|
|
4594
4646
|
Bettor_OrderBy["TotalPayout"] = "totalPayout";
|
|
@@ -4596,6 +4648,41 @@ var Bettor_OrderBy;
|
|
|
4596
4648
|
Bettor_OrderBy["Turnover"] = "turnover";
|
|
4597
4649
|
Bettor_OrderBy["WonBetsCount"] = "wonBetsCount";
|
|
4598
4650
|
})(Bettor_OrderBy || (Bettor_OrderBy = {}));
|
|
4651
|
+
var Cashout_OrderBy;
|
|
4652
|
+
(function (Cashout_OrderBy) {
|
|
4653
|
+
Cashout_OrderBy["OddsDecimals"] = "_oddsDecimals";
|
|
4654
|
+
Cashout_OrderBy["TokenDecimals"] = "_tokenDecimals";
|
|
4655
|
+
Cashout_OrderBy["UpdatedAt"] = "_updatedAt";
|
|
4656
|
+
Cashout_OrderBy["BetContractAddress"] = "betContractAddress";
|
|
4657
|
+
Cashout_OrderBy["BetId"] = "betId";
|
|
4658
|
+
Cashout_OrderBy["CashoutContractAddress"] = "cashoutContractAddress";
|
|
4659
|
+
Cashout_OrderBy["Core"] = "core";
|
|
4660
|
+
Cashout_OrderBy["CreatedBlockNumber"] = "createdBlockNumber";
|
|
4661
|
+
Cashout_OrderBy["CreatedBlockTimestamp"] = "createdBlockTimestamp";
|
|
4662
|
+
Cashout_OrderBy["CreatedTxHash"] = "createdTxHash";
|
|
4663
|
+
Cashout_OrderBy["Id"] = "id";
|
|
4664
|
+
Cashout_OrderBy["Odds"] = "odds";
|
|
4665
|
+
Cashout_OrderBy["Owner"] = "owner";
|
|
4666
|
+
Cashout_OrderBy["Payout"] = "payout";
|
|
4667
|
+
Cashout_OrderBy["RawOdds"] = "rawOdds";
|
|
4668
|
+
Cashout_OrderBy["RawPayout"] = "rawPayout";
|
|
4669
|
+
})(Cashout_OrderBy || (Cashout_OrderBy = {}));
|
|
4670
|
+
var ConditionLogStatus;
|
|
4671
|
+
(function (ConditionLogStatus) {
|
|
4672
|
+
ConditionLogStatus["Canceled"] = "Canceled";
|
|
4673
|
+
ConditionLogStatus["Created"] = "Created";
|
|
4674
|
+
ConditionLogStatus["Paused"] = "Paused";
|
|
4675
|
+
ConditionLogStatus["Resolved"] = "Resolved";
|
|
4676
|
+
ConditionLogStatus["Unpaused"] = "Unpaused";
|
|
4677
|
+
})(ConditionLogStatus || (ConditionLogStatus = {}));
|
|
4678
|
+
var ConditionLog_OrderBy;
|
|
4679
|
+
(function (ConditionLog_OrderBy) {
|
|
4680
|
+
ConditionLog_OrderBy["ConditionId"] = "conditionId";
|
|
4681
|
+
ConditionLog_OrderBy["CreatedBlockTimestamp"] = "createdBlockTimestamp";
|
|
4682
|
+
ConditionLog_OrderBy["Id"] = "id";
|
|
4683
|
+
ConditionLog_OrderBy["IsLive"] = "isLive";
|
|
4684
|
+
ConditionLog_OrderBy["Status"] = "status";
|
|
4685
|
+
})(ConditionLog_OrderBy || (ConditionLog_OrderBy = {}));
|
|
4599
4686
|
var ConditionStatus$1;
|
|
4600
4687
|
(function (ConditionStatus) {
|
|
4601
4688
|
ConditionStatus["Canceled"] = "Canceled";
|
|
@@ -4605,6 +4692,7 @@ var ConditionStatus$1;
|
|
|
4605
4692
|
})(ConditionStatus$1 || (ConditionStatus$1 = {}));
|
|
4606
4693
|
var Condition_OrderBy$1;
|
|
4607
4694
|
(function (Condition_OrderBy) {
|
|
4695
|
+
Condition_OrderBy["OutcomesKey"] = "_outcomesKey";
|
|
4608
4696
|
Condition_OrderBy["UpdatedAt"] = "_updatedAt";
|
|
4609
4697
|
Condition_OrderBy["WinningOutcomesCount"] = "_winningOutcomesCount";
|
|
4610
4698
|
Condition_OrderBy["ConditionId"] = "conditionId";
|
|
@@ -4614,6 +4702,7 @@ var Condition_OrderBy$1;
|
|
|
4614
4702
|
Condition_OrderBy["CreatedBlockTimestamp"] = "createdBlockTimestamp";
|
|
4615
4703
|
Condition_OrderBy["CreatedTxHash"] = "createdTxHash";
|
|
4616
4704
|
Condition_OrderBy["Game"] = "game";
|
|
4705
|
+
Condition_OrderBy["Hidden"] = "hidden";
|
|
4617
4706
|
Condition_OrderBy["Id"] = "id";
|
|
4618
4707
|
Condition_OrderBy["InternalStartsAt"] = "internalStartsAt";
|
|
4619
4708
|
Condition_OrderBy["IsExpressForbidden"] = "isExpressForbidden";
|
|
@@ -4652,6 +4741,7 @@ var Country_OrderBy$1;
|
|
|
4652
4741
|
var EventName$1;
|
|
4653
4742
|
(function (EventName) {
|
|
4654
4743
|
EventName["AzuroBetTransfer"] = "AzuroBetTransfer";
|
|
4744
|
+
EventName["BetCashedOut"] = "BetCashedOut";
|
|
4655
4745
|
EventName["BetSettled"] = "BetSettled";
|
|
4656
4746
|
EventName["BettorWin"] = "BettorWin";
|
|
4657
4747
|
EventName["ConditionCreated"] = "ConditionCreated";
|
|
@@ -4663,6 +4753,7 @@ var EventName$1;
|
|
|
4663
4753
|
EventName["FreeBetRedeemed"] = "FreeBetRedeemed";
|
|
4664
4754
|
EventName["FreeBetReissued"] = "FreeBetReissued";
|
|
4665
4755
|
EventName["FreeBetTransfer"] = "FreeBetTransfer";
|
|
4756
|
+
EventName["GameCanceled"] = "GameCanceled";
|
|
4666
4757
|
EventName["GameShifted"] = "GameShifted";
|
|
4667
4758
|
EventName["LiquidityAdded"] = "LiquidityAdded";
|
|
4668
4759
|
EventName["LiquidityRemoved"] = "LiquidityRemoved";
|
|
@@ -4753,6 +4844,7 @@ var Game_OrderBy$1;
|
|
|
4753
4844
|
Game_OrderBy["ActiveConditionsEntityIds"] = "_activeConditionsEntityIds";
|
|
4754
4845
|
Game_OrderBy["CanceledConditionsEntityIds"] = "_canceledConditionsEntityIds";
|
|
4755
4846
|
Game_OrderBy["PausedConditionsEntityIds"] = "_pausedConditionsEntityIds";
|
|
4847
|
+
Game_OrderBy["ProviderTitle"] = "_providerTitle";
|
|
4756
4848
|
Game_OrderBy["ResolvedConditionsEntityIds"] = "_resolvedConditionsEntityIds";
|
|
4757
4849
|
Game_OrderBy["UpdatedAt"] = "_updatedAt";
|
|
4758
4850
|
Game_OrderBy["Conditions"] = "conditions";
|
|
@@ -4882,12 +4974,14 @@ var LiveBet_OrderBy;
|
|
|
4882
4974
|
LiveBet_OrderBy["Amount"] = "amount";
|
|
4883
4975
|
LiveBet_OrderBy["BetId"] = "betId";
|
|
4884
4976
|
LiveBet_OrderBy["Bettor"] = "bettor";
|
|
4977
|
+
LiveBet_OrderBy["Cashout"] = "cashout";
|
|
4885
4978
|
LiveBet_OrderBy["Core"] = "core";
|
|
4886
4979
|
LiveBet_OrderBy["CreatedBlockNumber"] = "createdBlockNumber";
|
|
4887
4980
|
LiveBet_OrderBy["CreatedBlockTimestamp"] = "createdBlockTimestamp";
|
|
4888
4981
|
LiveBet_OrderBy["CreatedTxHash"] = "createdTxHash";
|
|
4889
4982
|
LiveBet_OrderBy["Freebet"] = "freebet";
|
|
4890
4983
|
LiveBet_OrderBy["Id"] = "id";
|
|
4984
|
+
LiveBet_OrderBy["IsCashedOut"] = "isCashedOut";
|
|
4891
4985
|
LiveBet_OrderBy["IsRedeemable"] = "isRedeemable";
|
|
4892
4986
|
LiveBet_OrderBy["IsRedeemed"] = "isRedeemed";
|
|
4893
4987
|
LiveBet_OrderBy["Nonce"] = "nonce";
|
|
@@ -4926,6 +5020,7 @@ var LiveCondition_OrderBy;
|
|
|
4926
5020
|
LiveCondition_OrderBy["CreatedBlockTimestamp"] = "createdBlockTimestamp";
|
|
4927
5021
|
LiveCondition_OrderBy["CreatedTxHash"] = "createdTxHash";
|
|
4928
5022
|
LiveCondition_OrderBy["GameId"] = "gameId";
|
|
5023
|
+
LiveCondition_OrderBy["Hidden"] = "hidden";
|
|
4929
5024
|
LiveCondition_OrderBy["Id"] = "id";
|
|
4930
5025
|
LiveCondition_OrderBy["Outcomes"] = "outcomes";
|
|
4931
5026
|
LiveCondition_OrderBy["OutcomesIds"] = "outcomesIds";
|
|
@@ -4991,6 +5086,11 @@ var Outcome_OrderBy$1;
|
|
|
4991
5086
|
Outcome_OrderBy["SortOrder"] = "sortOrder";
|
|
4992
5087
|
Outcome_OrderBy["Title"] = "title";
|
|
4993
5088
|
})(Outcome_OrderBy$1 || (Outcome_OrderBy$1 = {}));
|
|
5089
|
+
var OutcomesKeyConditionRelation_OrderBy;
|
|
5090
|
+
(function (OutcomesKeyConditionRelation_OrderBy) {
|
|
5091
|
+
OutcomesKeyConditionRelation_OrderBy["ConditionEntityId"] = "conditionEntityId";
|
|
5092
|
+
OutcomesKeyConditionRelation_OrderBy["Id"] = "id";
|
|
5093
|
+
})(OutcomesKeyConditionRelation_OrderBy || (OutcomesKeyConditionRelation_OrderBy = {}));
|
|
4994
5094
|
var Participant_OrderBy$1;
|
|
4995
5095
|
(function (Participant_OrderBy) {
|
|
4996
5096
|
Participant_OrderBy["Game"] = "game";
|
|
@@ -5419,9 +5519,7 @@ const getBetStatus = (props) => {
|
|
|
5419
5519
|
if (isPendingResolution) {
|
|
5420
5520
|
return BetStatus.PendingResolution;
|
|
5421
5521
|
}
|
|
5422
|
-
const isLive = isExpress
|
|
5423
|
-
? getExpressIsLive(games)
|
|
5424
|
-
: getGameStatus({ graphStatus: games[0].status, startsAt: +games[0].startsAt, isGameInLive: isLiveBet }) === GameStatus.Live;
|
|
5522
|
+
const isLive = isExpress ? getExpressIsLive(games) : (getGameStatus({ graphStatus: games[0].status, startsAt: +games[0].startsAt, isGameInLive: isLiveBet }) === GameStatus.Live);
|
|
5425
5523
|
if (isLive) {
|
|
5426
5524
|
return BetStatus.Live;
|
|
5427
5525
|
}
|
|
@@ -5904,4 +6002,143 @@ const getDeBridgeOrder = async (orderId) => {
|
|
|
5904
6002
|
}
|
|
5905
6003
|
const data = await response.json();
|
|
5906
6004
|
return data;
|
|
5907
|
-
};
|
|
6005
|
+
};const getPrecalculatedCashouts = async (props) => {
|
|
6006
|
+
const { chainId, conditionIds } = props;
|
|
6007
|
+
const { api, contracts } = chainsData[chainId];
|
|
6008
|
+
if (!contracts.cashout?.address) {
|
|
6009
|
+
throw new Error('provided chainId is not supported for cashout');
|
|
6010
|
+
}
|
|
6011
|
+
const response = await fetch(`${api}/cashout/get-multipliers`, {
|
|
6012
|
+
method: 'POST',
|
|
6013
|
+
headers: {
|
|
6014
|
+
'Accept': 'application/json',
|
|
6015
|
+
'Content-Type': 'application/json',
|
|
6016
|
+
},
|
|
6017
|
+
body: JSON.stringify({
|
|
6018
|
+
conditionIds,
|
|
6019
|
+
}),
|
|
6020
|
+
});
|
|
6021
|
+
if (response.status === 404) {
|
|
6022
|
+
return null;
|
|
6023
|
+
}
|
|
6024
|
+
if (!response.ok) {
|
|
6025
|
+
throw new Error(`Status ${response.status}: ${response.statusText}`);
|
|
6026
|
+
}
|
|
6027
|
+
const { multipliers } = await response.json();
|
|
6028
|
+
return multipliers;
|
|
6029
|
+
};const getCalculatedCashout = async (props) => {
|
|
6030
|
+
const { chainId, account, graphBetId, isLive } = props;
|
|
6031
|
+
const { api, environment, contracts } = chainsData[chainId];
|
|
6032
|
+
if (!contracts.cashout?.address) {
|
|
6033
|
+
throw new Error('provided chainId is not supported for cashout');
|
|
6034
|
+
}
|
|
6035
|
+
const response = await fetch(`${api}/cashout/get-calculation`, {
|
|
6036
|
+
method: 'POST',
|
|
6037
|
+
headers: {
|
|
6038
|
+
'Accept': 'application/json',
|
|
6039
|
+
'Content-Type': 'application/json',
|
|
6040
|
+
},
|
|
6041
|
+
body: JSON.stringify({
|
|
6042
|
+
environment,
|
|
6043
|
+
owner: account,
|
|
6044
|
+
betId: graphBetId,
|
|
6045
|
+
isLive,
|
|
6046
|
+
}),
|
|
6047
|
+
});
|
|
6048
|
+
if (response.status === 404) {
|
|
6049
|
+
return null;
|
|
6050
|
+
}
|
|
6051
|
+
if (!response.ok) {
|
|
6052
|
+
throw new Error(`Status ${response.status}: ${response.statusText}`);
|
|
6053
|
+
}
|
|
6054
|
+
const { cashoutOdds, owner, betId, ...rest } = await response.json();
|
|
6055
|
+
return {
|
|
6056
|
+
multiplier: cashoutOdds,
|
|
6057
|
+
account: owner,
|
|
6058
|
+
tokenId: betId,
|
|
6059
|
+
...rest,
|
|
6060
|
+
};
|
|
6061
|
+
};const getCashoutTypedData = (props) => {
|
|
6062
|
+
const { account, chainId, attention, tokenId, betCoreAddress, multiplier, expiredAt } = props;
|
|
6063
|
+
const { contracts } = chainsData[chainId];
|
|
6064
|
+
if (!contracts.cashout?.address) {
|
|
6065
|
+
throw new Error('provided chainId is not supported for cashout');
|
|
6066
|
+
}
|
|
6067
|
+
const EIP712Domain = {
|
|
6068
|
+
name: CASHOUT_TYPED_DATA_DOMAIN_NAME,
|
|
6069
|
+
version: CASHOUT_TYPED_DATA_DOMAIN_VERSION,
|
|
6070
|
+
chainId,
|
|
6071
|
+
verifyingContract: contracts.cashout.address,
|
|
6072
|
+
};
|
|
6073
|
+
return {
|
|
6074
|
+
account: account,
|
|
6075
|
+
domain: EIP712Domain,
|
|
6076
|
+
primaryType: 'CashOutOrder',
|
|
6077
|
+
types: CASHOUT_DATA_TYPES,
|
|
6078
|
+
message: {
|
|
6079
|
+
attention: attention || 'By signing this transaction, I agree to cash out on \'Azuro SDK Example',
|
|
6080
|
+
chainId: BigInt(chainId),
|
|
6081
|
+
items: [
|
|
6082
|
+
{
|
|
6083
|
+
betId: BigInt(tokenId),
|
|
6084
|
+
bettingContract: betCoreAddress,
|
|
6085
|
+
minOdds: typeof multiplier === 'string' ? (parseUnits(multiplier, ODDS_DECIMALS)) : multiplier,
|
|
6086
|
+
},
|
|
6087
|
+
],
|
|
6088
|
+
expiresAt: BigInt(expiredAt),
|
|
6089
|
+
},
|
|
6090
|
+
};
|
|
6091
|
+
};var CashoutState;
|
|
6092
|
+
(function (CashoutState) {
|
|
6093
|
+
CashoutState["Processing"] = "PROCESSING";
|
|
6094
|
+
CashoutState["Accepted"] = "ACCEPTED";
|
|
6095
|
+
CashoutState["Rejected"] = "REJECTED";
|
|
6096
|
+
CashoutState["Open"] = "OPEN";
|
|
6097
|
+
})(CashoutState || (CashoutState = {}));
|
|
6098
|
+
const createCashout = async (props) => {
|
|
6099
|
+
const { chainId, calculationId, betCoreAddress, attention, signature } = props;
|
|
6100
|
+
const { api, contracts } = chainsData[chainId];
|
|
6101
|
+
if (!contracts.cashout?.address) {
|
|
6102
|
+
throw new Error('provided chainId is not supported for cashout');
|
|
6103
|
+
}
|
|
6104
|
+
const signedCashout = {
|
|
6105
|
+
calculationId,
|
|
6106
|
+
signature: {
|
|
6107
|
+
verifyingContract: contracts.cashout.address,
|
|
6108
|
+
bettingContract: betCoreAddress,
|
|
6109
|
+
attention,
|
|
6110
|
+
chainId,
|
|
6111
|
+
ownerSignature: signature,
|
|
6112
|
+
},
|
|
6113
|
+
};
|
|
6114
|
+
const response = await fetch(`${api}/cashout/create`, {
|
|
6115
|
+
method: 'POST',
|
|
6116
|
+
headers: {
|
|
6117
|
+
'Accept': 'application/json',
|
|
6118
|
+
'Content-Type': 'application/json',
|
|
6119
|
+
},
|
|
6120
|
+
body: JSON.stringify(signedCashout),
|
|
6121
|
+
});
|
|
6122
|
+
if (response.status === 404) {
|
|
6123
|
+
return null;
|
|
6124
|
+
}
|
|
6125
|
+
if (!response.ok) {
|
|
6126
|
+
throw new Error(`Status ${response.status}: ${response.statusText}`);
|
|
6127
|
+
}
|
|
6128
|
+
const data = await response.json();
|
|
6129
|
+
return data;
|
|
6130
|
+
};const getCashout = async ({ chainId, orderId }) => {
|
|
6131
|
+
const { api, contracts } = chainsData[chainId];
|
|
6132
|
+
if (!contracts.cashout?.address) {
|
|
6133
|
+
throw new Error('provided chainId is not supported for cashout');
|
|
6134
|
+
}
|
|
6135
|
+
const response = await fetch(`${api}/cashout/${orderId}`);
|
|
6136
|
+
if (response.status === 404) {
|
|
6137
|
+
return null;
|
|
6138
|
+
}
|
|
6139
|
+
if (!response.ok) {
|
|
6140
|
+
throw new Error(`Status ${response.status}: ${response.statusText}`);
|
|
6141
|
+
}
|
|
6142
|
+
const data = await response.json();
|
|
6143
|
+
return data;
|
|
6144
|
+
};export{BetResult,BetStatus,Bet_OrderBy,BettorFragmentDoc,BettorsDocument,CASHOUT_DATA_TYPES,CASHOUT_TYPED_DATA_DOMAIN_NAME,CASHOUT_TYPED_DATA_DOMAIN_VERSION,CashoutState,ConditionStatus$1 as ConditionStatus,DeBridgeExternalCallStatus,DeBridgeOrderStatus,Environment,FreeBetStatus,GameBetsDocument,GameDocument,GameStatus,Game_OrderBy$1 as Game_OrderBy,GamesDocument,BetStatus$1 as GraphBetStatus,LIVE_BET_DATA_TYPES,LIVE_TYPED_DATA_DOMAIN_NAME,LIVE_TYPED_DATA_DOMAIN_VERSION,LiveBetFragmentDoc,LiveBetState,LiveBetsDocument,LiveConditionDocument,LiveConditionFragmentDoc,Condition_OrderBy as LiveConditionOrderBy,LiveConditionsDocument,GameStatus$1 as LiveGraphGameStatus,MARGIN_DECIMALS,MIN_LIVE_BET_AMOUNT,MainGameInfoFragmentDoc,NavigationDocument,ODDS_DECIMALS,OrderDirection$1 as OrderDirection,PrematchBetFragmentDoc,PrematchBetsDocument,PrematchConditionDocument,PrematchConditionFragmentDoc,Condition_OrderBy$1 as PrematchConditionOrderBy,PrematchConditionsBatchDocument,PrematchConditionsDocument,GameStatus$2 as PrematchGraphGameStatus,SelectionResult$1 as SelectionResult,SportsDocument,SportsNavigationDocument,WaveLevelName,activateWave,calcLiveOdds,calcMindOdds,calcPrematchOdds,chainsData,chainsDataByEnv,createCashout,createDeBridgeBet,createLiveBet,deBridgeChainIdByOriginalChainId,deBridgeTxUrl,deBridgeUrl,environments,FreeBet as freeBetAbi,getApiEndpoint,getBetStatus,getCalculatedCashout,getCashout,getCashoutTypedData,getDeBridgeOrder,getDeBridgeSupportedChains,getDeBridgeSupportedTokens,getFreeBets,getGameStatus,getLiveBet,getLiveBetFee,getLiveBetTypedData,getLiveGraphqlEndpoint,getPrecalculatedCashouts,getPrematchBetDataBytes,getPrematchGraphqlEndpoint,getSocketEndpoint,getWaveLeaderBoard,getWaveLevels,getWavePeriods,getWaveStats,groupByConditionId,groupConditionsByMarket,liveCoreAbi,liveHostAddress,liveSupportedChains,lpAbi,prematchComboCoreAbi,prematchCoreAbi,proxyFrontAbi,setupContracts};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Hex, type Address } from 'viem';
|
|
2
|
+
import { type ChainId } from '../../config';
|
|
3
|
+
export declare enum CashoutState {
|
|
4
|
+
Processing = "PROCESSING",
|
|
5
|
+
Accepted = "ACCEPTED",
|
|
6
|
+
Rejected = "REJECTED",
|
|
7
|
+
Open = "OPEN"
|
|
8
|
+
}
|
|
9
|
+
export type CreateCashoutResponse = {
|
|
10
|
+
id: string;
|
|
11
|
+
state: CashoutState;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
};
|
|
14
|
+
type Props = {
|
|
15
|
+
chainId: ChainId;
|
|
16
|
+
calculationId: string;
|
|
17
|
+
betCoreAddress: Address | string;
|
|
18
|
+
attention: string;
|
|
19
|
+
signature: Hex;
|
|
20
|
+
};
|
|
21
|
+
export declare const createCashout: (props: Props) => Promise<CreateCashoutResponse | null>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Address } from 'viem';
|
|
2
|
+
import { type Environment } from '../../envs';
|
|
3
|
+
import { type ChainId } from '../../config';
|
|
4
|
+
export type GetCalculatedCashout = {
|
|
5
|
+
calculationId: string;
|
|
6
|
+
account: string;
|
|
7
|
+
environment: Environment;
|
|
8
|
+
tokenId: string;
|
|
9
|
+
cashoutAmount: string;
|
|
10
|
+
multiplier: string;
|
|
11
|
+
expiredAt: number;
|
|
12
|
+
approveExpiredAt: number;
|
|
13
|
+
isLive: boolean;
|
|
14
|
+
} | null;
|
|
15
|
+
type Props = {
|
|
16
|
+
chainId: ChainId;
|
|
17
|
+
account: Address;
|
|
18
|
+
graphBetId: string;
|
|
19
|
+
isLive: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const getCalculatedCashout: (props: Props) => Promise<GetCalculatedCashout>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ChainId } from '../../config';
|
|
2
|
+
import { type CreateCashoutResponse } from './createCashout';
|
|
3
|
+
export type GetCashoutResponse = {
|
|
4
|
+
txHash: string;
|
|
5
|
+
} & CreateCashoutResponse;
|
|
6
|
+
type Props = {
|
|
7
|
+
chainId: ChainId;
|
|
8
|
+
orderId: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const getCashout: ({ chainId, orderId }: Props) => Promise<GetCashoutResponse | null>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type SignTypedDataParameters, type Address } from 'viem';
|
|
2
|
+
import { type ChainId, CASHOUT_DATA_TYPES } from '../../config';
|
|
3
|
+
type Props = {
|
|
4
|
+
chainId: ChainId;
|
|
5
|
+
account: Address;
|
|
6
|
+
attention: string;
|
|
7
|
+
tokenId: string | bigint;
|
|
8
|
+
betCoreAddress: Address;
|
|
9
|
+
multiplier: string | bigint;
|
|
10
|
+
expiredAt: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const getCashoutTypedData: (props: Props) => SignTypedDataParameters<typeof CASHOUT_DATA_TYPES>;
|
|
13
|
+
export {};
|