@azuro-org/toolkit 4.4.0 → 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 +4 -4
- 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 +5 -5
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ChainId } from '../../config';
|
|
2
|
+
type GetPrecalculatedCashoutsResponse = {
|
|
3
|
+
multipliers: {
|
|
4
|
+
conditionId: string;
|
|
5
|
+
available: boolean;
|
|
6
|
+
outcomes: {
|
|
7
|
+
outcomeId: number;
|
|
8
|
+
multiplier: string;
|
|
9
|
+
}[];
|
|
10
|
+
}[];
|
|
11
|
+
};
|
|
12
|
+
export type GetPrecalculatedCashouts = GetPrecalculatedCashoutsResponse['multipliers'] | null;
|
|
13
|
+
type Props = {
|
|
14
|
+
chainId: ChainId;
|
|
15
|
+
conditionIds: string[];
|
|
16
|
+
};
|
|
17
|
+
export declare const getPrecalculatedCashouts: (props: Props) => Promise<GetPrecalculatedCashouts>;
|
|
18
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ChainId } from '../config';
|
|
2
2
|
export declare const getPrematchGraphqlEndpoint: (chainId: ChainId) => string;
|
|
3
3
|
export declare const getLiveGraphqlEndpoint: (chainId: ChainId) => "https://thegraph.azuro.org/subgraphs/name/azuro-protocol/azuro-api-live-data-feed-dev" | "https://thegraph.azuro.org/subgraphs/name/azuro-protocol/azuro-api-live-data-feed-preprod" | "https://thegraph.azuro.org/subgraphs/name/azuro-protocol/azuro-api-live-data-feed";
|
|
4
|
-
export declare const getSocketEndpoint: (chainId: ChainId) => "wss://dev-streams.azuro.org/v1/streams
|
|
4
|
+
export declare const getSocketEndpoint: (chainId: ChainId) => "wss://dev-streams.azuro.org/v1/streams" | "wss://preprod-streams.azuro.org/v1/streams" | "wss://streams.azuro.org/v1/streams";
|
|
5
5
|
export declare const getApiEndpoint: (chainId: ChainId) => "https://dev-api.azuro.org/api/v1/public" | "https://preprod-api.azuro.org/api/v1/public" | "https://api.azuro.org/api/v1/public";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type SignTypedDataParameters, type Address } from 'viem';
|
|
2
|
-
import { type ChainId } from '../config';
|
|
2
|
+
import { type ChainId, LIVE_BET_DATA_TYPES } from '../config';
|
|
3
3
|
import { type LiveBet } from '../global';
|
|
4
4
|
type Props = {
|
|
5
5
|
chainId: ChainId;
|
|
6
6
|
account: Address;
|
|
7
7
|
bet: LiveBet;
|
|
8
8
|
};
|
|
9
|
-
export declare const getLiveBetTypedData: ({ account, chainId, bet }: Props) => SignTypedDataParameters
|
|
9
|
+
export declare const getLiveBetTypedData: ({ account, chainId, bet }: Props) => SignTypedDataParameters<typeof LIVE_BET_DATA_TYPES>;
|
|
10
10
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Address } from 'viem';
|
|
1
|
+
import { type Address, erc721Abi } from 'viem';
|
|
2
2
|
import { liveCoreAbi, lpAbi, prematchComboCoreAbi, prematchCoreAbi, proxyFrontAbi } from '../abis';
|
|
3
3
|
export type Contracts = {
|
|
4
4
|
lp: {
|
|
@@ -17,6 +17,13 @@ export type Contracts = {
|
|
|
17
17
|
address: Address;
|
|
18
18
|
abi: typeof proxyFrontAbi;
|
|
19
19
|
};
|
|
20
|
+
azuroBet: {
|
|
21
|
+
address: Address;
|
|
22
|
+
abi: typeof erc721Abi;
|
|
23
|
+
};
|
|
24
|
+
cashout?: {
|
|
25
|
+
address: Address;
|
|
26
|
+
};
|
|
20
27
|
liveRelayer?: {
|
|
21
28
|
address: Address;
|
|
22
29
|
};
|
|
@@ -30,8 +37,10 @@ type Props = {
|
|
|
30
37
|
prematchCore: Address;
|
|
31
38
|
prematchComboCore: Address;
|
|
32
39
|
proxyFront: Address;
|
|
40
|
+
azuroBet: Address;
|
|
41
|
+
cashout?: Address;
|
|
33
42
|
liveRelayer?: Address;
|
|
34
43
|
liveCore?: Address;
|
|
35
44
|
};
|
|
36
|
-
export declare const setupContracts: ({ lp, prematchCore, prematchComboCore, proxyFront, liveRelayer, liveCore }: Props) => Contracts;
|
|
45
|
+
export declare const setupContracts: ({ lp, prematchCore, prematchComboCore, proxyFront, azuroBet, cashout, liveRelayer, liveCore, }: Props) => Contracts;
|
|
37
46
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azuro-org/toolkit",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0-beta.1",
|
|
4
4
|
"description": "Set of helpers to work with Azuro protocol",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://github.com/Azuro-protocol/toolkit#readme",
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@apollo/client": "^3.10
|
|
43
|
-
"@azuro-org/dictionaries": "^3.0.
|
|
44
|
-
"viem": "^2.21.
|
|
45
|
-
"@wagmi/core": "^2.
|
|
42
|
+
"@apollo/client": "^3.11.10",
|
|
43
|
+
"@azuro-org/dictionaries": "^3.0.21",
|
|
44
|
+
"viem": "^2.21.53",
|
|
45
|
+
"@wagmi/core": "^2.15.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@graphql-codegen/cli": "^4.0.1",
|