@azuro-org/toolkit 4.3.0 → 4.3.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/dist/index.d.ts CHANGED
@@ -20,6 +20,6 @@ export { getWavePeriods, type WavePeriodsResponse } from './utils/wave/getWavePe
20
20
  export { getWaveLeaderBoard, type WaveLeaderBoardItem } from './utils/wave/getWaveLeaderBoard';
21
21
  export { activateWave } from './utils/wave/activateWave';
22
22
  export { createDeBridgeBet, type DeBridgeCreateTxResponse } from './utils/deBridge/createDeBridgeBet';
23
- export { getDeBridgeSupportedChains } from './utils/deBridge/getDeBridgeSupportedChains';
24
- export { getDeBridgeSupportedTokens } from './utils/deBridge/getDeBridgeSupportedTokens';
23
+ export { getDeBridgeSupportedChains, deBridgeChainIdByOriginalChainId, type DeBridgeSupportedChains } from './utils/deBridge/getDeBridgeSupportedChains';
24
+ export { getDeBridgeSupportedTokens, type DeBridgeSupportedTokens } from './utils/deBridge/getDeBridgeSupportedTokens';
25
25
  export { getDeBridgeOrder, DeBridgeOrderStatus, DeBridgeExternalCallStatus } from './utils/deBridge/getDeBridgeOrder';
package/dist/index.js CHANGED
@@ -5678,6 +5678,23 @@ const getWaveLevels = async ({ waveId, chainId } = { waveId: 'active', chainId:
5678
5678
  const api = getApiEndpoint(chainId);
5679
5679
  const response = await fetch(`${api}/waves/${waveId}/participants/${account?.toLowerCase()}/activate`);
5680
5680
  await response.json();
5681
+ };const deBridgeChainIdByOriginalChainId = {
5682
+ 245022934: 100000001, // Neon
5683
+ 100: 100000002, // Gnosis
5684
+ 1890: 100000003, // LightLink
5685
+ 1088: 100000004, // Metis
5686
+ 7171: 100000005, // Bitrock
5687
+ };
5688
+ const getDeBridgeSupportedChains = async () => {
5689
+ const response = await fetch(`${deBridgeUrl}/supported-chains-info`);
5690
+ if (response.status === 404) {
5691
+ return null;
5692
+ }
5693
+ if (!response.ok) {
5694
+ throw new Error(`Status ${response.status}: ${response.statusText}`);
5695
+ }
5696
+ const { chains } = await response.json();
5697
+ return chains;
5681
5698
  };const DE_BRIDGE_DEFAULT_DEADLINE = 300; // 5 min
5682
5699
  const createDeBridgeBet = async (props) => {
5683
5700
  const { account, betAmount, dstChainId, selections, totalOdds, slippage, srcChainId, srcChainTokenIn, affiliate, referralCode, deadline, } = props;
@@ -5690,10 +5707,10 @@ const createDeBridgeBet = async (props) => {
5690
5707
  const rawMinOdds = parseUnits(fixedMinOdds, ODDS_DECIMALS);
5691
5708
  const rawDeadline = BigInt(Math.floor(Date.now() / 1000) + (deadline || DE_BRIDGE_DEFAULT_DEADLINE));
5692
5709
  const params = new URLSearchParams({
5693
- dstChainId: String(dstChainId),
5710
+ dstChainId: String(deBridgeChainIdByOriginalChainId[dstChainId] || dstChainId),
5694
5711
  srcChainOrderAuthorityAddress: account,
5695
5712
  prependOperatingExpenses: 'false',
5696
- srcChainId: String(srcChainId),
5713
+ srcChainId: String(deBridgeChainIdByOriginalChainId[srcChainId] || srcChainId),
5697
5714
  srcChainTokenIn,
5698
5715
  srcChainTokenInAmount: 'auto',
5699
5716
  dstChainTokenOut: betToken.address,
@@ -5732,16 +5749,6 @@ const createDeBridgeBet = async (props) => {
5732
5749
  }
5733
5750
  const data = await response.json();
5734
5751
  return data;
5735
- };const getDeBridgeSupportedChains = async () => {
5736
- const response = await fetch(`${deBridgeUrl}/supported-chains-info`);
5737
- if (response.status === 404) {
5738
- return null;
5739
- }
5740
- if (!response.ok) {
5741
- throw new Error(`Status ${response.status}: ${response.statusText}`);
5742
- }
5743
- const { chains } = await response.json();
5744
- return chains;
5745
5752
  };const getDeBridgeSupportedTokens = async (chainId) => {
5746
5753
  const response = await fetch(`${deBridgeUrl}/token-list?chainId=${chainId}`);
5747
5754
  if (response.status === 404) {
@@ -5783,4 +5790,4 @@ const getDeBridgeOrder = async (orderId) => {
5783
5790
  }
5784
5791
  const data = await response.json();
5785
5792
  return data;
5786
- };export{BetResult,BetStatus,Bet_OrderBy,BettorFragmentDoc,BettorsDocument,ConditionStatus$1 as ConditionStatus,DeBridgeExternalCallStatus,DeBridgeOrderStatus,Environment,FreeBetStatus,GameBetsDocument,GameDocument,GameStatus,Game_OrderBy$1 as Game_OrderBy,GamesDocument,BetStatus$1 as GraphBetStatus,LiveBetFragmentDoc,LiveBetsDocument,LiveConditionDocument,LiveConditionFragmentDoc,LiveConditionsDocument,GameStatus$1 as LiveGraphGameStatus,MARGIN_DECIMALS,MIN_LIVE_BET_AMOUNT,MainGameInfoFragmentDoc,NavigationDocument,ODDS_DECIMALS,OrderDirection$1 as OrderDirection,PrematchBetFragmentDoc,PrematchBetsDocument,PrematchConditionDocument,PrematchConditionFragmentDoc,PrematchConditionsBatchDocument,PrematchConditionsDocument,GameStatus$2 as PrematchGraphGameStatus,SelectionResult$1 as SelectionResult,SportsDocument,SportsNavigationDocument,WaveLevelName,activateWave,calcLiveOdds,calcMindOdds,calcPrematchOdds,chainsData,chainsDataByEnv,createDeBridgeBet,deBridgeTxUrl,deBridgeUrl,environments,FreeBet as freeBetAbi,getApiEndpoint,getBetStatus,getDeBridgeOrder,getDeBridgeSupportedChains,getDeBridgeSupportedTokens,getFreeBets,getGameStatus,getLiveBetFee,getLiveGraphqlEndpoint,getPrematchBetDataBytes,getPrematchGraphqlEndpoint,getSocketEndpoint,getWaveLeaderBoard,getWaveLevels,getWavePeriods,getWaveStats,groupByConditionId,groupConditionsByMarket,liveCoreAbi,liveHostAddress,liveSupportedChains,lpAbi,prematchComboCoreAbi,prematchCoreAbi,proxyFrontAbi,setupContracts};
5793
+ };export{BetResult,BetStatus,Bet_OrderBy,BettorFragmentDoc,BettorsDocument,ConditionStatus$1 as ConditionStatus,DeBridgeExternalCallStatus,DeBridgeOrderStatus,Environment,FreeBetStatus,GameBetsDocument,GameDocument,GameStatus,Game_OrderBy$1 as Game_OrderBy,GamesDocument,BetStatus$1 as GraphBetStatus,LiveBetFragmentDoc,LiveBetsDocument,LiveConditionDocument,LiveConditionFragmentDoc,LiveConditionsDocument,GameStatus$1 as LiveGraphGameStatus,MARGIN_DECIMALS,MIN_LIVE_BET_AMOUNT,MainGameInfoFragmentDoc,NavigationDocument,ODDS_DECIMALS,OrderDirection$1 as OrderDirection,PrematchBetFragmentDoc,PrematchBetsDocument,PrematchConditionDocument,PrematchConditionFragmentDoc,PrematchConditionsBatchDocument,PrematchConditionsDocument,GameStatus$2 as PrematchGraphGameStatus,SelectionResult$1 as SelectionResult,SportsDocument,SportsNavigationDocument,WaveLevelName,activateWave,calcLiveOdds,calcMindOdds,calcPrematchOdds,chainsData,chainsDataByEnv,createDeBridgeBet,deBridgeChainIdByOriginalChainId,deBridgeTxUrl,deBridgeUrl,environments,FreeBet as freeBetAbi,getApiEndpoint,getBetStatus,getDeBridgeOrder,getDeBridgeSupportedChains,getDeBridgeSupportedTokens,getFreeBets,getGameStatus,getLiveBetFee,getLiveGraphqlEndpoint,getPrematchBetDataBytes,getPrematchGraphqlEndpoint,getSocketEndpoint,getWaveLeaderBoard,getWaveLevels,getWavePeriods,getWaveStats,groupByConditionId,groupConditionsByMarket,liveCoreAbi,liveHostAddress,liveSupportedChains,lpAbi,prematchComboCoreAbi,prematchCoreAbi,proxyFrontAbi,setupContracts};
@@ -1,4 +1,11 @@
1
- export declare const getDeBridgeSupportedChains: () => Promise<{
2
- chainId: number;
3
- chainName: string;
4
- }[] | null>;
1
+ type SupportedChainsResponse = {
2
+ chains: {
3
+ chainId: number;
4
+ originalChainId: number;
5
+ chainName: string;
6
+ }[];
7
+ };
8
+ export declare const deBridgeChainIdByOriginalChainId: Record<number, number>;
9
+ export type DeBridgeSupportedChains = SupportedChainsResponse['chains'] | null;
10
+ export declare const getDeBridgeSupportedChains: () => Promise<DeBridgeSupportedChains>;
11
+ export {};
@@ -1,8 +1,13 @@
1
- export declare const getDeBridgeSupportedTokens: (chainId: number) => Promise<Record<string, {
2
- address: string;
3
- symbol: string;
4
- decimals: number;
5
- name: string;
6
- logoURI: string;
7
- tags: Array<string>;
8
- }> | null>;
1
+ type SupportedTokensResponse = {
2
+ tokens: Record<string, {
3
+ address: string;
4
+ symbol: string;
5
+ decimals: number;
6
+ name: string;
7
+ logoURI: string;
8
+ tags: Array<string>;
9
+ }>;
10
+ };
11
+ export type DeBridgeSupportedTokens = SupportedTokensResponse['tokens'] | null;
12
+ export declare const getDeBridgeSupportedTokens: (chainId: number) => Promise<DeBridgeSupportedTokens>;
13
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azuro-org/toolkit",
3
- "version": "4.3.0",
3
+ "version": "4.3.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",