@azuro-org/toolkit 4.0.0 → 4.1.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 CHANGED
@@ -18,4 +18,4 @@ viem@^2.17.3
18
18
  @wagmi/core@^2.11.7
19
19
  ```
20
20
 
21
- Package information can be found in our [Doc](https://gem.azuro.org/toolkit/overview)
21
+ Package information can be found in our [Doc](https://gem.azuro.org/hub/apps/toolkit/overview)
@@ -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
  }>;
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,getSelectionName}from'@azuro-org/dictionaries';var lpAbi = [
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
  }
@@ -5357,18 +5359,20 @@ const getBetStatus = (props) => {
5357
5359
  const coreAddress = condition.core?.address || liveHostAddress;
5358
5360
  const lpAddress = condition.core?.liquidityPool?.address || '';
5359
5361
  const isExpressForbidden = condition.isExpressForbidden ?? true;
5362
+ const customMarketName = condition.title;
5360
5363
  rawOutcomes.forEach((rawOutcome) => {
5361
5364
  const { outcomeId } = rawOutcome;
5362
5365
  const odds = rawOutcome.odds;
5366
+ const customSelectionName = rawOutcome.title;
5363
5367
  const betTypeOdd = dictionaries.outcomes[outcomeId];
5364
5368
  if (!betTypeOdd) {
5365
5369
  console.warn(`betTypeOdd not found for "outcomeId: ${outcomeId}"`);
5366
5370
  return;
5367
5371
  }
5368
5372
  const marketKey = getMarketKey(outcomeId);
5369
- const marketName = getMarketName({ outcomeId });
5373
+ const marketName = customMarketName || getMarketName({ outcomeId });
5374
+ const selectionName = customSelectionName || getSelectionName({ outcomeId, withPoint: true });
5370
5375
  const marketDescription = getMarketDescription({ outcomeId });
5371
- const selectionName = getSelectionName({ outcomeId, withPoint: true });
5372
5376
  const outcome = {
5373
5377
  coreAddress: coreAddress,
5374
5378
  lpAddress: lpAddress,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azuro-org/toolkit",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
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.12",
36
+ "@azuro-org/dictionaries": "^3.0.16",
37
37
  "viem": "^2.17.3",
38
38
  "@wagmi/core": "^2.11.7"
39
39
  },