@azuro-org/toolkit 4.0.0 → 4.1.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 +1 -1
- package/dist/docs/prematch/condition.d.ts +2 -0
- package/dist/docs/prematch/conditions.d.ts +2 -0
- package/dist/docs/prematch/fragments/condition.d.ts +2 -0
- package/dist/docs/prematch/fragments/prematchBet.d.ts +2 -0
- package/dist/docs/prematch/prematchBets.d.ts +2 -0
- package/dist/index.js +9 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,9 +10,11 @@ export type PrematchConditionQuery = {
|
|
|
10
10
|
id: string;
|
|
11
11
|
conditionId: string;
|
|
12
12
|
status: Types.ConditionStatus;
|
|
13
|
+
title?: string | null;
|
|
13
14
|
isExpressForbidden: boolean;
|
|
14
15
|
outcomes: Array<{
|
|
15
16
|
__typename?: 'Outcome';
|
|
17
|
+
title?: string | null;
|
|
16
18
|
outcomeId: string;
|
|
17
19
|
odds: string;
|
|
18
20
|
}>;
|
|
@@ -11,9 +11,11 @@ export type PrematchConditionsQuery = {
|
|
|
11
11
|
id: string;
|
|
12
12
|
conditionId: string;
|
|
13
13
|
status: Types.ConditionStatus;
|
|
14
|
+
title?: string | null;
|
|
14
15
|
isExpressForbidden: boolean;
|
|
15
16
|
outcomes: Array<{
|
|
16
17
|
__typename?: 'Outcome';
|
|
18
|
+
title?: string | null;
|
|
17
19
|
outcomeId: string;
|
|
18
20
|
odds: string;
|
|
19
21
|
}>;
|
|
@@ -4,9 +4,11 @@ export type PrematchConditionFragment = {
|
|
|
4
4
|
id: string;
|
|
5
5
|
conditionId: string;
|
|
6
6
|
status: Types.ConditionStatus;
|
|
7
|
+
title?: string | null;
|
|
7
8
|
isExpressForbidden: boolean;
|
|
8
9
|
outcomes: Array<{
|
|
9
10
|
__typename?: 'Outcome';
|
|
11
|
+
title?: string | null;
|
|
10
12
|
outcomeId: string;
|
|
11
13
|
odds: string;
|
|
12
14
|
}>;
|
|
@@ -30,10 +30,12 @@ export type PrematchBetFragment = {
|
|
|
30
30
|
outcome: {
|
|
31
31
|
__typename?: 'Outcome';
|
|
32
32
|
outcomeId: string;
|
|
33
|
+
title?: string | null;
|
|
33
34
|
condition: {
|
|
34
35
|
__typename?: 'Condition';
|
|
35
36
|
conditionId: string;
|
|
36
37
|
status: Types.ConditionStatus;
|
|
38
|
+
title?: string | null;
|
|
37
39
|
game: {
|
|
38
40
|
__typename?: 'Game';
|
|
39
41
|
id: string;
|
|
@@ -40,10 +40,12 @@ export type PrematchBetsQuery = {
|
|
|
40
40
|
outcome: {
|
|
41
41
|
__typename?: 'Outcome';
|
|
42
42
|
outcomeId: string;
|
|
43
|
+
title?: string | null;
|
|
43
44
|
condition: {
|
|
44
45
|
__typename?: 'Condition';
|
|
45
46
|
conditionId: string;
|
|
46
47
|
status: Types.ConditionStatus;
|
|
48
|
+
title?: string | null;
|
|
47
49
|
game: {
|
|
48
50
|
__typename?: 'Game';
|
|
49
51
|
id: string;
|
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 {parseUnits,formatUnits,encodeAbiParameters,parseAbiParameters,encodeFunctionData}from'viem';import {dictionaries,getMarketKey,getMarketName,getMarketDescription
|
|
1
|
+
import {gnosis,polygon,polygonAmoy,chiliz,spicy}from'viem/chains';import {gql}from'@apollo/client';import {readContracts,readContract}from'@wagmi/core';import {parseUnits,formatUnits,encodeAbiParameters,parseAbiParameters,encodeFunctionData}from'viem';import {dictionaries,getMarketKey,getMarketName,getSelectionName,getMarketDescription}from'@azuro-org/dictionaries';var lpAbi = [
|
|
2
2
|
{ 'inputs': [], 'name': 'BetExpired', 'type': 'error',
|
|
3
3
|
},
|
|
4
4
|
{ 'inputs': [
|
|
@@ -4085,8 +4085,10 @@ const chainsData = {
|
|
|
4085
4085
|
id
|
|
4086
4086
|
conditionId
|
|
4087
4087
|
status
|
|
4088
|
+
title
|
|
4088
4089
|
isExpressForbidden
|
|
4089
4090
|
outcomes {
|
|
4091
|
+
title
|
|
4090
4092
|
outcomeId
|
|
4091
4093
|
odds: currentOdds
|
|
4092
4094
|
}
|
|
@@ -4190,9 +4192,11 @@ const chainsData = {
|
|
|
4190
4192
|
result
|
|
4191
4193
|
outcome {
|
|
4192
4194
|
outcomeId
|
|
4195
|
+
title
|
|
4193
4196
|
condition {
|
|
4194
4197
|
conditionId
|
|
4195
4198
|
status
|
|
4199
|
+
title
|
|
4196
4200
|
game {
|
|
4197
4201
|
...MainGameInfo
|
|
4198
4202
|
}
|
|
@@ -5357,18 +5361,20 @@ const getBetStatus = (props) => {
|
|
|
5357
5361
|
const coreAddress = condition.core?.address || liveHostAddress;
|
|
5358
5362
|
const lpAddress = condition.core?.liquidityPool?.address || '';
|
|
5359
5363
|
const isExpressForbidden = condition.isExpressForbidden ?? true;
|
|
5364
|
+
const customMarketName = condition.title;
|
|
5360
5365
|
rawOutcomes.forEach((rawOutcome) => {
|
|
5361
5366
|
const { outcomeId } = rawOutcome;
|
|
5362
5367
|
const odds = rawOutcome.odds;
|
|
5368
|
+
const customSelectionName = rawOutcome.title;
|
|
5363
5369
|
const betTypeOdd = dictionaries.outcomes[outcomeId];
|
|
5364
5370
|
if (!betTypeOdd) {
|
|
5365
5371
|
console.warn(`betTypeOdd not found for "outcomeId: ${outcomeId}"`);
|
|
5366
5372
|
return;
|
|
5367
5373
|
}
|
|
5368
5374
|
const marketKey = getMarketKey(outcomeId);
|
|
5369
|
-
const marketName = getMarketName({ outcomeId });
|
|
5375
|
+
const marketName = customMarketName || getMarketName({ outcomeId });
|
|
5376
|
+
const selectionName = customSelectionName || getSelectionName({ outcomeId, withPoint: true });
|
|
5370
5377
|
const marketDescription = getMarketDescription({ outcomeId });
|
|
5371
|
-
const selectionName = getSelectionName({ outcomeId, withPoint: true });
|
|
5372
5378
|
const outcome = {
|
|
5373
5379
|
coreAddress: coreAddress,
|
|
5374
5380
|
lpAddress: lpAddress,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azuro-org/toolkit",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.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",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"homepage": "https://github.com/Azuro-protocol/toolkit#readme",
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@apollo/client": "^3.10.8",
|
|
36
|
-
"@azuro-org/dictionaries": "^3.0.
|
|
36
|
+
"@azuro-org/dictionaries": "^3.0.16",
|
|
37
37
|
"viem": "^2.17.3",
|
|
38
38
|
"@wagmi/core": "^2.11.7"
|
|
39
39
|
},
|