@azuro-org/toolkit 4.4.1 → 4.5.0-beta.2
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/live/types.d.ts +10 -0
- 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 +706 -0
- package/dist/global.d.ts +23 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +266 -16
- 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/getProviderFromId.d.ts +1 -0
- package/dist/utils/setupContracts.d.ts +11 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -13,9 +13,9 @@ npm i --save @azuro-org/toolkit
|
|
|
13
13
|
|
|
14
14
|
```
|
|
15
15
|
@apollo/client@^3.11.10
|
|
16
|
-
@azuro-org/dictionaries@^3.0.
|
|
17
|
-
viem@^2.21.
|
|
18
|
-
@wagmi/core@^2.
|
|
16
|
+
@azuro-org/dictionaries@^3.0.21
|
|
17
|
+
viem@^2.21.53
|
|
18
|
+
@wagmi/core@^2.15.2
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Package information can be found in our [Doc](https://gem.azuro.org/hub/apps/toolkit/overview)
|
package/dist/config.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { type Chain } from 'viem/chains';
|
|
2
|
-
import { type Address } from 'viem';
|
|
3
1
|
import { Environment } from './envs';
|
|
4
|
-
import { type
|
|
2
|
+
import { type ChainData } from './global';
|
|
5
3
|
export declare const ODDS_DECIMALS = 12;
|
|
6
4
|
export declare const MARGIN_DECIMALS = 12;
|
|
7
5
|
export declare const MIN_LIVE_BET_AMOUNT = 1;
|
|
@@ -43,29 +41,37 @@ export declare const LIVE_BET_DATA_TYPES: {
|
|
|
43
41
|
};
|
|
44
42
|
export declare const LIVE_TYPED_DATA_DOMAIN_NAME = "Live Betting";
|
|
45
43
|
export declare const LIVE_TYPED_DATA_DOMAIN_VERSION = "1.0.0";
|
|
44
|
+
export declare const CASHOUT_DATA_TYPES: {
|
|
45
|
+
readonly CashOutItem: readonly [{
|
|
46
|
+
readonly name: "betId";
|
|
47
|
+
readonly type: "uint256";
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "bettingContract";
|
|
50
|
+
readonly type: "address";
|
|
51
|
+
}, {
|
|
52
|
+
readonly name: "minOdds";
|
|
53
|
+
readonly type: "uint64";
|
|
54
|
+
}];
|
|
55
|
+
readonly CashOutOrder: readonly [{
|
|
56
|
+
readonly name: "attention";
|
|
57
|
+
readonly type: "string";
|
|
58
|
+
}, {
|
|
59
|
+
readonly name: "chainId";
|
|
60
|
+
readonly type: "uint256";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "items";
|
|
63
|
+
readonly type: "CashOutItem[]";
|
|
64
|
+
}, {
|
|
65
|
+
readonly name: "expiresAt";
|
|
66
|
+
readonly type: "uint64";
|
|
67
|
+
}];
|
|
68
|
+
};
|
|
69
|
+
export declare const CASHOUT_TYPED_DATA_DOMAIN_NAME = "Cash Out";
|
|
70
|
+
export declare const CASHOUT_TYPED_DATA_DOMAIN_VERSION = "1.0.0";
|
|
46
71
|
export declare const deBridgeUrl = "https://api.dln.trade/v1.0";
|
|
47
72
|
export declare const deBridgeTxUrl = "https://stats-api.dln.trade/api";
|
|
48
73
|
export declare const liveHostAddress = "0x67Fca88E2f5F2C33b86bFa4EccfCb8dCD6a56D17";
|
|
49
74
|
export declare const liveSupportedChains: ChainId[];
|
|
50
|
-
type BetToken = {
|
|
51
|
-
address: Address;
|
|
52
|
-
symbol: string;
|
|
53
|
-
decimals: number;
|
|
54
|
-
};
|
|
55
|
-
export type ChainData = {
|
|
56
|
-
chain: Omit<Chain, 'id'> & {
|
|
57
|
-
id: ChainId;
|
|
58
|
-
};
|
|
59
|
-
graphql: {
|
|
60
|
-
prematch: string;
|
|
61
|
-
live: string;
|
|
62
|
-
};
|
|
63
|
-
socket: string;
|
|
64
|
-
api: string;
|
|
65
|
-
environment: Environment;
|
|
66
|
-
contracts: Contracts;
|
|
67
|
-
betToken: BetToken;
|
|
68
|
-
};
|
|
69
75
|
export declare const chainsData: {
|
|
70
76
|
100: ChainData;
|
|
71
77
|
137: ChainData;
|
|
@@ -75,4 +81,3 @@ export declare const chainsData: {
|
|
|
75
81
|
};
|
|
76
82
|
export declare const chainsDataByEnv: Record<Environment, ChainData>;
|
|
77
83
|
export type ChainId = keyof typeof chainsData;
|
|
78
|
-
export {};
|
|
@@ -57,7 +57,15 @@ export type Scalars = {
|
|
|
57
57
|
input: any;
|
|
58
58
|
output: any;
|
|
59
59
|
};
|
|
60
|
+
Timestamp: {
|
|
61
|
+
input: any;
|
|
62
|
+
output: any;
|
|
63
|
+
};
|
|
60
64
|
};
|
|
65
|
+
export declare enum Aggregation_Interval {
|
|
66
|
+
Day = "day",
|
|
67
|
+
Hour = "hour"
|
|
68
|
+
}
|
|
61
69
|
export type BlockChangedFilter = {
|
|
62
70
|
number_gte: Scalars['Int']['input'];
|
|
63
71
|
};
|
|
@@ -1875,6 +1883,8 @@ export type _Block_ = {
|
|
|
1875
1883
|
hash?: Maybe<Scalars['Bytes']['output']>;
|
|
1876
1884
|
/** The block number */
|
|
1877
1885
|
number: Scalars['Int']['output'];
|
|
1886
|
+
/** The hash of the parent block */
|
|
1887
|
+
parentHash?: Maybe<Scalars['Bytes']['output']>;
|
|
1878
1888
|
/** Integer representation of the timestamp stored in blocks for the chain */
|
|
1879
1889
|
timestamp?: Maybe<Scalars['Int']['output']>;
|
|
1880
1890
|
};
|
|
@@ -7,11 +7,12 @@ export type LiveBetFragment = {
|
|
|
7
7
|
potentialPayout: string;
|
|
8
8
|
payout?: string | null;
|
|
9
9
|
result?: Types.BetResult | null;
|
|
10
|
-
isRedeemed: boolean;
|
|
11
|
-
isRedeemable: boolean;
|
|
12
10
|
odds: string;
|
|
13
11
|
settledOdds?: string | null;
|
|
14
12
|
affiliate?: string | null;
|
|
13
|
+
isRedeemed: boolean;
|
|
14
|
+
isRedeemable: boolean;
|
|
15
|
+
isCashedOut: boolean;
|
|
15
16
|
tokenId: string;
|
|
16
17
|
createdAt: string;
|
|
17
18
|
txHash: string;
|
|
@@ -7,11 +7,12 @@ export type PrematchBetFragment = {
|
|
|
7
7
|
potentialPayout: string;
|
|
8
8
|
payout?: string | null;
|
|
9
9
|
result?: Types.BetResult | null;
|
|
10
|
-
isRedeemed: boolean;
|
|
11
|
-
isRedeemable: boolean;
|
|
12
10
|
odds: string;
|
|
13
11
|
settledOdds?: string | null;
|
|
14
12
|
affiliate?: string | null;
|
|
13
|
+
isRedeemed: boolean;
|
|
14
|
+
isRedeemable: boolean;
|
|
15
|
+
isCashedOut: boolean;
|
|
15
16
|
tokenId: string;
|
|
16
17
|
createdAt: string;
|
|
17
18
|
txHash: string;
|
|
@@ -17,11 +17,12 @@ export type LiveBetsQuery = {
|
|
|
17
17
|
potentialPayout: string;
|
|
18
18
|
payout?: string | null;
|
|
19
19
|
result?: Types.BetResult | null;
|
|
20
|
-
isRedeemed: boolean;
|
|
21
|
-
isRedeemable: boolean;
|
|
22
20
|
odds: string;
|
|
23
21
|
settledOdds?: string | null;
|
|
24
22
|
affiliate?: string | null;
|
|
23
|
+
isRedeemed: boolean;
|
|
24
|
+
isRedeemable: boolean;
|
|
25
|
+
isCashedOut: boolean;
|
|
25
26
|
tokenId: string;
|
|
26
27
|
createdAt: string;
|
|
27
28
|
txHash: string;
|
|
@@ -17,11 +17,12 @@ export type PrematchBetsQuery = {
|
|
|
17
17
|
potentialPayout: string;
|
|
18
18
|
payout?: string | null;
|
|
19
19
|
result?: Types.BetResult | null;
|
|
20
|
-
isRedeemed: boolean;
|
|
21
|
-
isRedeemable: boolean;
|
|
22
20
|
odds: string;
|
|
23
21
|
settledOdds?: string | null;
|
|
24
22
|
affiliate?: string | null;
|
|
23
|
+
isRedeemed: boolean;
|
|
24
|
+
isRedeemable: boolean;
|
|
25
|
+
isCashedOut: boolean;
|
|
25
26
|
tokenId: string;
|
|
26
27
|
createdAt: string;
|
|
27
28
|
txHash: string;
|