@axelar-network/axelarjs-sdk 0.13.4 → 0.13.5-alpha-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.
Files changed (236) hide show
  1. package/package.json +1 -1
  2. package/dist/artifacts/contracts/deposit-service/DepositReceiver.sol/DepositReceiver.json +0 -31
  3. package/dist/artifacts/contracts/deposit-service/ReceiverImplementation.sol/ReceiverImplementation.json +0 -180
  4. package/dist/src/assets/index.d.ts +0 -3
  5. package/dist/src/assets/index.d.ts.map +0 -1
  6. package/dist/src/assets/index.js +0 -45
  7. package/dist/src/assets/index.js.map +0 -1
  8. package/dist/src/assets/test/loadAssets.spec.d.ts +0 -2
  9. package/dist/src/assets/test/loadAssets.spec.d.ts.map +0 -1
  10. package/dist/src/assets/test/loadAssets.spec.js +0 -40
  11. package/dist/src/assets/test/loadAssets.spec.js.map +0 -1
  12. package/dist/src/assets/types/index.d.ts +0 -35
  13. package/dist/src/assets/types/index.d.ts.map +0 -1
  14. package/dist/src/assets/types/index.js +0 -3
  15. package/dist/src/assets/types/index.js.map +0 -1
  16. package/dist/src/chains/index.d.ts +0 -5
  17. package/dist/src/chains/index.d.ts.map +0 -1
  18. package/dist/src/chains/index.js +0 -84
  19. package/dist/src/chains/index.js.map +0 -1
  20. package/dist/src/chains/supported-chains-list.d.ts +0 -80
  21. package/dist/src/chains/supported-chains-list.d.ts.map +0 -1
  22. package/dist/src/chains/supported-chains-list.js +0 -83
  23. package/dist/src/chains/supported-chains-list.js.map +0 -1
  24. package/dist/src/chains/test/loadChains.spec.d.ts +0 -2
  25. package/dist/src/chains/test/loadChains.spec.d.ts.map +0 -1
  26. package/dist/src/chains/test/loadChains.spec.js +0 -40
  27. package/dist/src/chains/test/loadChains.spec.js.map +0 -1
  28. package/dist/src/chains/types/index.d.ts +0 -76
  29. package/dist/src/chains/types/index.d.ts.map +0 -1
  30. package/dist/src/chains/types/index.js +0 -17
  31. package/dist/src/chains/types/index.js.map +0 -1
  32. package/dist/src/constants/index.d.ts +0 -14
  33. package/dist/src/constants/index.d.ts.map +0 -1
  34. package/dist/src/constants/index.js +0 -67
  35. package/dist/src/constants/index.js.map +0 -1
  36. package/dist/src/index.d.ts +0 -9
  37. package/dist/src/index.d.ts.map +0 -1
  38. package/dist/src/index.js +0 -25
  39. package/dist/src/index.js.map +0 -1
  40. package/dist/src/libs/AxelarAssetTransfer.d.ts +0 -103
  41. package/dist/src/libs/AxelarAssetTransfer.d.ts.map +0 -1
  42. package/dist/src/libs/AxelarAssetTransfer.js +0 -411
  43. package/dist/src/libs/AxelarAssetTransfer.js.map +0 -1
  44. package/dist/src/libs/AxelarGateway.d.ts +0 -35
  45. package/dist/src/libs/AxelarGateway.d.ts.map +0 -1
  46. package/dist/src/libs/AxelarGateway.js +0 -145
  47. package/dist/src/libs/AxelarGateway.js.map +0 -1
  48. package/dist/src/libs/AxelarQueryAPI.d.ts +0 -162
  49. package/dist/src/libs/AxelarQueryAPI.d.ts.map +0 -1
  50. package/dist/src/libs/AxelarQueryAPI.js +0 -434
  51. package/dist/src/libs/AxelarQueryAPI.js.map +0 -1
  52. package/dist/src/libs/AxelarQueryClient/index.d.ts +0 -8
  53. package/dist/src/libs/AxelarQueryClient/index.d.ts.map +0 -1
  54. package/dist/src/libs/AxelarQueryClient/index.js +0 -32
  55. package/dist/src/libs/AxelarQueryClient/index.js.map +0 -1
  56. package/dist/src/libs/AxelarQueryClient/types/index.d.ts +0 -13
  57. package/dist/src/libs/AxelarQueryClient/types/index.d.ts.map +0 -1
  58. package/dist/src/libs/AxelarQueryClient/types/index.js +0 -19
  59. package/dist/src/libs/AxelarQueryClient/types/index.js.map +0 -1
  60. package/dist/src/libs/AxelarSigningClient/const/index.d.ts +0 -3
  61. package/dist/src/libs/AxelarSigningClient/const/index.d.ts.map +0 -1
  62. package/dist/src/libs/AxelarSigningClient/const/index.js +0 -13
  63. package/dist/src/libs/AxelarSigningClient/const/index.js.map +0 -1
  64. package/dist/src/libs/AxelarSigningClient/index.d.ts +0 -21
  65. package/dist/src/libs/AxelarSigningClient/index.d.ts.map +0 -1
  66. package/dist/src/libs/AxelarSigningClient/index.js +0 -80
  67. package/dist/src/libs/AxelarSigningClient/index.js.map +0 -1
  68. package/dist/src/libs/AxelarSigningClient/types/AxelarnetTxTypes.d.ts +0 -3
  69. package/dist/src/libs/AxelarSigningClient/types/AxelarnetTxTypes.d.ts.map +0 -1
  70. package/dist/src/libs/AxelarSigningClient/types/AxelarnetTxTypes.js +0 -28
  71. package/dist/src/libs/AxelarSigningClient/types/AxelarnetTxTypes.js.map +0 -1
  72. package/dist/src/libs/AxelarSigningClient/types/EvmTxTypes.d.ts +0 -3
  73. package/dist/src/libs/AxelarSigningClient/types/EvmTxTypes.d.ts.map +0 -1
  74. package/dist/src/libs/AxelarSigningClient/types/EvmTxTypes.js +0 -38
  75. package/dist/src/libs/AxelarSigningClient/types/EvmTxTypes.js.map +0 -1
  76. package/dist/src/libs/GatewayTx.d.ts +0 -11
  77. package/dist/src/libs/GatewayTx.d.ts.map +0 -1
  78. package/dist/src/libs/GatewayTx.js +0 -22
  79. package/dist/src/libs/GatewayTx.js.map +0 -1
  80. package/dist/src/libs/TransactionRecoveryApi/AxelarDepositRecoveryAPI.d.ts +0 -44
  81. package/dist/src/libs/TransactionRecoveryApi/AxelarDepositRecoveryAPI.d.ts.map +0 -1
  82. package/dist/src/libs/TransactionRecoveryApi/AxelarDepositRecoveryAPI.js +0 -85
  83. package/dist/src/libs/TransactionRecoveryApi/AxelarDepositRecoveryAPI.js.map +0 -1
  84. package/dist/src/libs/TransactionRecoveryApi/AxelarGMPRecoveryAPI.d.ts +0 -122
  85. package/dist/src/libs/TransactionRecoveryApi/AxelarGMPRecoveryAPI.d.ts.map +0 -1
  86. package/dist/src/libs/TransactionRecoveryApi/AxelarGMPRecoveryAPI.js +0 -761
  87. package/dist/src/libs/TransactionRecoveryApi/AxelarGMPRecoveryAPI.js.map +0 -1
  88. package/dist/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.d.ts +0 -144
  89. package/dist/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.d.ts.map +0 -1
  90. package/dist/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.js +0 -422
  91. package/dist/src/libs/TransactionRecoveryApi/AxelarRecoveryApi.js.map +0 -1
  92. package/dist/src/libs/TransactionRecoveryApi/AxelarTransferAPI.d.ts +0 -10
  93. package/dist/src/libs/TransactionRecoveryApi/AxelarTransferAPI.d.ts.map +0 -1
  94. package/dist/src/libs/TransactionRecoveryApi/AxelarTransferAPI.js +0 -62
  95. package/dist/src/libs/TransactionRecoveryApi/AxelarTransferAPI.js.map +0 -1
  96. package/dist/src/libs/TransactionRecoveryApi/client/AxelarRpcClient.d.ts +0 -11
  97. package/dist/src/libs/TransactionRecoveryApi/client/AxelarRpcClient.d.ts.map +0 -1
  98. package/dist/src/libs/TransactionRecoveryApi/client/AxelarRpcClient.js +0 -37
  99. package/dist/src/libs/TransactionRecoveryApi/client/AxelarRpcClient.js.map +0 -1
  100. package/dist/src/libs/TransactionRecoveryApi/client/EVMClient/index.d.ts +0 -13
  101. package/dist/src/libs/TransactionRecoveryApi/client/EVMClient/index.d.ts.map +0 -1
  102. package/dist/src/libs/TransactionRecoveryApi/client/EVMClient/index.js +0 -55
  103. package/dist/src/libs/TransactionRecoveryApi/client/EVMClient/index.js.map +0 -1
  104. package/dist/src/libs/TransactionRecoveryApi/client/helpers/cosmos.d.ts +0 -6
  105. package/dist/src/libs/TransactionRecoveryApi/client/helpers/cosmos.d.ts.map +0 -1
  106. package/dist/src/libs/TransactionRecoveryApi/client/helpers/cosmos.js +0 -38
  107. package/dist/src/libs/TransactionRecoveryApi/client/helpers/cosmos.js.map +0 -1
  108. package/dist/src/libs/TransactionRecoveryApi/client/helpers/retryRpc.d.ts +0 -3
  109. package/dist/src/libs/TransactionRecoveryApi/client/helpers/retryRpc.d.ts.map +0 -1
  110. package/dist/src/libs/TransactionRecoveryApi/client/helpers/retryRpc.js +0 -37
  111. package/dist/src/libs/TransactionRecoveryApi/client/helpers/retryRpc.js.map +0 -1
  112. package/dist/src/libs/TransactionRecoveryApi/constants/chain/index.d.ts +0 -4
  113. package/dist/src/libs/TransactionRecoveryApi/constants/chain/index.d.ts.map +0 -1
  114. package/dist/src/libs/TransactionRecoveryApi/constants/chain/index.js +0 -20
  115. package/dist/src/libs/TransactionRecoveryApi/constants/chain/index.js.map +0 -1
  116. package/dist/src/libs/TransactionRecoveryApi/constants/chain/mainnet.d.ts +0 -5
  117. package/dist/src/libs/TransactionRecoveryApi/constants/chain/mainnet.d.ts.map +0 -1
  118. package/dist/src/libs/TransactionRecoveryApi/constants/chain/mainnet.js +0 -84
  119. package/dist/src/libs/TransactionRecoveryApi/constants/chain/mainnet.js.map +0 -1
  120. package/dist/src/libs/TransactionRecoveryApi/constants/chain/testnet.d.ts +0 -5
  121. package/dist/src/libs/TransactionRecoveryApi/constants/chain/testnet.d.ts.map +0 -1
  122. package/dist/src/libs/TransactionRecoveryApi/constants/chain/testnet.js +0 -84
  123. package/dist/src/libs/TransactionRecoveryApi/constants/chain/testnet.js.map +0 -1
  124. package/dist/src/libs/TransactionRecoveryApi/constants/contract.d.ts +0 -19
  125. package/dist/src/libs/TransactionRecoveryApi/constants/contract.d.ts.map +0 -1
  126. package/dist/src/libs/TransactionRecoveryApi/constants/contract.js +0 -23
  127. package/dist/src/libs/TransactionRecoveryApi/constants/contract.js.map +0 -1
  128. package/dist/src/libs/TransactionRecoveryApi/constants/error.d.ts +0 -74
  129. package/dist/src/libs/TransactionRecoveryApi/constants/error.d.ts.map +0 -1
  130. package/dist/src/libs/TransactionRecoveryApi/constants/error.js +0 -99
  131. package/dist/src/libs/TransactionRecoveryApi/constants/error.js.map +0 -1
  132. package/dist/src/libs/TransactionRecoveryApi/constants/s3.d.ts +0 -7
  133. package/dist/src/libs/TransactionRecoveryApi/constants/s3.d.ts.map +0 -1
  134. package/dist/src/libs/TransactionRecoveryApi/constants/s3.js +0 -8
  135. package/dist/src/libs/TransactionRecoveryApi/constants/s3.js.map +0 -1
  136. package/dist/src/libs/TransactionRecoveryApi/helpers/axelarHelper.d.ts +0 -13
  137. package/dist/src/libs/TransactionRecoveryApi/helpers/axelarHelper.d.ts.map +0 -1
  138. package/dist/src/libs/TransactionRecoveryApi/helpers/axelarHelper.js +0 -207
  139. package/dist/src/libs/TransactionRecoveryApi/helpers/axelarHelper.js.map +0 -1
  140. package/dist/src/libs/TransactionRecoveryApi/helpers/contractCallHelper.d.ts +0 -8
  141. package/dist/src/libs/TransactionRecoveryApi/helpers/contractCallHelper.d.ts.map +0 -1
  142. package/dist/src/libs/TransactionRecoveryApi/helpers/contractCallHelper.js +0 -56
  143. package/dist/src/libs/TransactionRecoveryApi/helpers/contractCallHelper.js.map +0 -1
  144. package/dist/src/libs/TransactionRecoveryApi/helpers/contractEventHelper.d.ts +0 -17
  145. package/dist/src/libs/TransactionRecoveryApi/helpers/contractEventHelper.d.ts.map +0 -1
  146. package/dist/src/libs/TransactionRecoveryApi/helpers/contractEventHelper.js +0 -137
  147. package/dist/src/libs/TransactionRecoveryApi/helpers/contractEventHelper.js.map +0 -1
  148. package/dist/src/libs/TransactionRecoveryApi/helpers/getCommandId.d.ts +0 -4
  149. package/dist/src/libs/TransactionRecoveryApi/helpers/getCommandId.d.ts.map +0 -1
  150. package/dist/src/libs/TransactionRecoveryApi/helpers/getCommandId.js +0 -22
  151. package/dist/src/libs/TransactionRecoveryApi/helpers/getCommandId.js.map +0 -1
  152. package/dist/src/libs/TransactionRecoveryApi/helpers/index.d.ts +0 -6
  153. package/dist/src/libs/TransactionRecoveryApi/helpers/index.d.ts.map +0 -1
  154. package/dist/src/libs/TransactionRecoveryApi/helpers/index.js +0 -22
  155. package/dist/src/libs/TransactionRecoveryApi/helpers/index.js.map +0 -1
  156. package/dist/src/libs/TransactionRecoveryApi/helpers/mappers.d.ts +0 -4
  157. package/dist/src/libs/TransactionRecoveryApi/helpers/mappers.d.ts.map +0 -1
  158. package/dist/src/libs/TransactionRecoveryApi/helpers/mappers.js +0 -24
  159. package/dist/src/libs/TransactionRecoveryApi/helpers/mappers.js.map +0 -1
  160. package/dist/src/libs/TransactionRecoveryApi/helpers/providerHelper.d.ts +0 -3
  161. package/dist/src/libs/TransactionRecoveryApi/helpers/providerHelper.d.ts.map +0 -1
  162. package/dist/src/libs/TransactionRecoveryApi/helpers/providerHelper.js +0 -14
  163. package/dist/src/libs/TransactionRecoveryApi/helpers/providerHelper.js.map +0 -1
  164. package/dist/src/libs/TransactionRecoveryApi/index.d.ts +0 -6
  165. package/dist/src/libs/TransactionRecoveryApi/index.d.ts.map +0 -1
  166. package/dist/src/libs/TransactionRecoveryApi/index.js +0 -22
  167. package/dist/src/libs/TransactionRecoveryApi/index.js.map +0 -1
  168. package/dist/src/libs/TransactionRecoveryApi/interface/index.d.ts +0 -31
  169. package/dist/src/libs/TransactionRecoveryApi/interface/index.d.ts.map +0 -1
  170. package/dist/src/libs/TransactionRecoveryApi/interface/index.js +0 -10
  171. package/dist/src/libs/TransactionRecoveryApi/interface/index.js.map +0 -1
  172. package/dist/src/libs/abi/IAxelarExecutable.d.ts +0 -38
  173. package/dist/src/libs/abi/IAxelarExecutable.d.ts.map +0 -1
  174. package/dist/src/libs/abi/IAxelarExecutable.js +0 -100
  175. package/dist/src/libs/abi/IAxelarExecutable.js.map +0 -1
  176. package/dist/src/libs/abi/erc20Abi.json +0 -222
  177. package/dist/src/libs/index.d.ts +0 -8
  178. package/dist/src/libs/index.d.ts.map +0 -1
  179. package/dist/src/libs/index.js +0 -24
  180. package/dist/src/libs/index.js.map +0 -1
  181. package/dist/src/libs/types/index.d.ts +0 -227
  182. package/dist/src/libs/types/index.d.ts.map +0 -1
  183. package/dist/src/libs/types/index.js +0 -98
  184. package/dist/src/libs/types/index.js.map +0 -1
  185. package/dist/src/services/RestService.d.ts +0 -8
  186. package/dist/src/services/RestService.d.ts.map +0 -1
  187. package/dist/src/services/RestService.js +0 -67
  188. package/dist/src/services/RestService.js.map +0 -1
  189. package/dist/src/services/SocketService.d.ts +0 -13
  190. package/dist/src/services/SocketService.d.ts.map +0 -1
  191. package/dist/src/services/SocketService.js +0 -87
  192. package/dist/src/services/SocketService.js.map +0 -1
  193. package/dist/src/services/index.d.ts +0 -3
  194. package/dist/src/services/index.d.ts.map +0 -1
  195. package/dist/src/services/index.js +0 -19
  196. package/dist/src/services/index.js.map +0 -1
  197. package/dist/src/services/test/RestService.spec.d.ts +0 -2
  198. package/dist/src/services/test/RestService.spec.d.ts.map +0 -1
  199. package/dist/src/services/test/RestService.spec.js +0 -77
  200. package/dist/src/services/test/RestService.spec.js.map +0 -1
  201. package/dist/src/services/types/index.d.ts +0 -24
  202. package/dist/src/services/types/index.d.ts.map +0 -1
  203. package/dist/src/services/types/index.js +0 -10
  204. package/dist/src/services/types/index.js.map +0 -1
  205. package/dist/src/utils/index.d.ts +0 -6
  206. package/dist/src/utils/index.d.ts.map +0 -1
  207. package/dist/src/utils/index.js +0 -22
  208. package/dist/src/utils/index.js.map +0 -1
  209. package/dist/src/utils/retry.d.ts +0 -2
  210. package/dist/src/utils/retry.d.ts.map +0 -1
  211. package/dist/src/utils/retry.js +0 -29
  212. package/dist/src/utils/retry.js.map +0 -1
  213. package/dist/src/utils/sleep.d.ts +0 -2
  214. package/dist/src/utils/sleep.d.ts.map +0 -1
  215. package/dist/src/utils/sleep.js +0 -8
  216. package/dist/src/utils/sleep.js.map +0 -1
  217. package/dist/src/utils/test/validateDestinationAddress.spec.d.ts +0 -2
  218. package/dist/src/utils/test/validateDestinationAddress.spec.d.ts.map +0 -1
  219. package/dist/src/utils/test/validateDestinationAddress.spec.js +0 -135
  220. package/dist/src/utils/test/validateDestinationAddress.spec.js.map +0 -1
  221. package/dist/src/utils/validateChain.d.ts +0 -7
  222. package/dist/src/utils/validateChain.d.ts.map +0 -1
  223. package/dist/src/utils/validateChain.js +0 -52
  224. package/dist/src/utils/validateChain.js.map +0 -1
  225. package/dist/src/utils/validateDestinationAddress.d.ts +0 -4
  226. package/dist/src/utils/validateDestinationAddress.d.ts.map +0 -1
  227. package/dist/src/utils/validateDestinationAddress.js +0 -54
  228. package/dist/src/utils/validateDestinationAddress.js.map +0 -1
  229. package/dist/src/utils/wallet.d.ts +0 -9
  230. package/dist/src/utils/wallet.d.ts.map +0 -1
  231. package/dist/src/utils/wallet.js +0 -33
  232. package/dist/src/utils/wallet.js.map +0 -1
  233. package/dist/vitest.config.d.ts +0 -3
  234. package/dist/vitest.config.d.ts.map +0 -1
  235. package/dist/vitest.config.js +0 -12
  236. package/dist/vitest.config.js.map +0 -1
@@ -1,162 +0,0 @@
1
- import { RestService } from "../services";
2
- import { AxelarQueryAPIConfig, BaseFeeResponse, Environment, EvmChain, GasToken } from "./types";
3
- import { FeeInfoResponse, TransferFeeResponse } from "@axelar-network/axelarjs-types/axelar/nexus/v1beta1/query";
4
- import { BigNumber } from "ethers";
5
- interface TranslatedTransferRateLimitResponse {
6
- incoming: string;
7
- outgoing: string;
8
- limit: string;
9
- }
10
- interface GMPParams {
11
- showDetailedFees: boolean;
12
- transferAmount?: number;
13
- transferAmountInUnits?: string;
14
- destinationContractAddress: string;
15
- sourceContractAddress: string;
16
- tokenSymbol: string;
17
- }
18
- export interface AxelarQueryAPIFeeResponse {
19
- expressFee: string;
20
- baseFee: string;
21
- executionFee: string;
22
- executionFeeWithMultiplier: string;
23
- gasMultiplier: number;
24
- gasLimit: number;
25
- minGasPrice: string;
26
- apiResponse: any;
27
- isExpressSupported: boolean;
28
- }
29
- export declare class AxelarQueryAPI {
30
- readonly environment: Environment;
31
- readonly lcdApi: RestService;
32
- readonly rpcApi: RestService;
33
- readonly axelarGMPServiceApi: RestService;
34
- readonly axelarRpcUrl: string;
35
- readonly axelarLcdUrl: string;
36
- readonly axelarGMPServiceUrl: string;
37
- private allAssets;
38
- private axelarQueryClient;
39
- private chainsList;
40
- constructor(config: AxelarQueryAPIConfig);
41
- private _initializeAssets;
42
- /**
43
- * Gets the fee for a chain and asset
44
- * example testnet query: https://axelartest-lcd.quickapi.com/axelar/nexus/v1beta1/fee?chain=ethereum&asset=uusd
45
- * @param chainId
46
- * @param assetDenom
47
- * @returns
48
- */
49
- getFeeForChainAndAsset(chainId: string, assetDenom: string): Promise<FeeInfoResponse>;
50
- getEVMEvent(sourceChainId: string, srcTxHash: string, srcEventId: number): Promise<import("@axelar-network/axelarjs-types/axelar/evm/v1beta1/query").EventResponse>;
51
- getConfirmationHeight(chain: string): Promise<number>;
52
- /**
53
- * Gest the transfer fee for a given transaction
54
- * example testnet query: "https://axelartest-lcd.quickapi.com/axelar/nexus/v1beta1/transfer_fee?source_chain=ethereum&destination_chain=terra&amount=100000000uusd"
55
- * @param sourceChainId
56
- * @param destinationChainId
57
- * @param assetDenom
58
- * @param amountInDenom
59
- * @returns
60
- */
61
- getTransferFee(sourceChainId: string, destinationChainId: string, assetDenom: string, amountInDenom: number): Promise<TransferFeeResponse>;
62
- /**
63
- * Gets the gas price for a destination chain to be paid to the gas receiver on a source chain
64
- * example testnet query: https://testnet.api.gmp.axelarscan.io/?method=getGasPrice&destinationChain=ethereum&sourceChain=avalanche&sourceTokenAddress=0x43F4600b552089655645f8c16D86A5a9Fa296bc3&sourceTokenSymbol=UST
65
- * @param sourceChainId
66
- * @param destinationChainId
67
- * @param sourceChainTokenSymbol
68
- * @returns
69
- */
70
- getGasInfo(sourceChainId: EvmChain | string, destinationChainId: EvmChain | string, sourceChainTokenSymbol: GasToken | string): Promise<any>;
71
- /**
72
- * Gets the base fee in native token wei for a given source and destination chain combination
73
- * @param sourceChainName
74
- * @param destinationChainName
75
- * @param sourceTokenSymbol (optional)
76
- * @returns base fee in native token in wei, translated into the native gas token of choice
77
- */
78
- getNativeGasBaseFee(sourceChainId: EvmChain | string, destinationChainId: EvmChain | string, sourceTokenSymbol?: GasToken, symbol?: string, destinationContractAddress?: string, sourceContractAddress?: string, amount?: number, amountInUnits?: BigNumber | string): Promise<BaseFeeResponse>;
79
- /**
80
- * Calculate estimated gas amount to pay for the gas receiver contract.
81
- * @param sourceChainId Can be of the EvmChain enum or string. If string, should try to generalize to use the CHAINS constants (e.g. CHAINS.MAINNET.ETHEREUM)
82
- * @param destinationChainId Can be of the EvmChain enum or string. If string, should try to generalize to use the CHAINS constants (e.g. CHAINS.MAINNET.ETHEREUM)
83
- * @param sourceChainTokenSymbol
84
- * @param gasLimit (Optional) An estimated gas amount required to execute `executeWithToken` function. The default value is 700000 which should be sufficient for most transactions.
85
- * @param gasMultiplier (Optional) A multiplier used to create a buffer above the calculated gas fee, to account for potential slippage throughout tx execution, e.g. 1.1 = 10% buffer. supports up to 3 decimal places
86
- * @param minGasPrice (Optional) A minimum value, in wei, for the gas price on the destination chain that is used to override the estimated gas price if it falls below this specified value.
87
- * @param gmpParams (Optional) Additional parameters for GMP transactions, including the ability to see a detailed view of the fee response
88
- * @returns
89
- */
90
- estimateGasFee(sourceChainId: EvmChain | string, destinationChainId: EvmChain | string, sourceChainTokenSymbol: GasToken | string, gasLimit?: number, gasMultiplier?: number, minGasPrice?: string, gmpParams?: GMPParams): Promise<string | AxelarQueryAPIFeeResponse>;
91
- /**
92
- * Get the denom for an asset given its symbol on a chain
93
- * @param symbol
94
- * @param chainName
95
- * @returns
96
- */
97
- getDenomFromSymbol(symbol: string, chainName: string): Promise<string | null>;
98
- /**
99
- * Get the symbol for an asset on a given chain given its denom
100
- * @param denom
101
- * @param chainName
102
- * @returns
103
- */
104
- getSymbolFromDenom(denom: string, chainName: string): Promise<string | null | undefined>;
105
- /**
106
- * Get the asset config for an asset on a given chain given its denom
107
- * @param denom
108
- * @param chainName
109
- * @returns asset config
110
- */
111
- getAssetConfigFromDenom(denom: string, chainName: string): Promise<import("../assets/types").AssetInfoForChain | null>;
112
- /**
113
- * Get the contract address from the chainId and the contractKey
114
- * @param chainId - the chainId of the chain
115
- * @param contractKey - the key of the contract in the config file.
116
- * A valid contractKey can be found here https://github.com/axelarnetwork/chains/blob/790f08350e792e27412ded6721c13ce78267fd72/testnet-config.json#L1951-L1954 e.g. ("gas_service", "deposit_service", "default_refund_collector")
117
- * @returns the contract address
118
- */
119
- getContractAddressFromConfig(chainId: string, contractKey: string): Promise<string>;
120
- /**
121
- * Get a list of active chains.
122
- * @returns an array of active chains
123
- */
124
- getActiveChains(): Promise<string[]>;
125
- /**
126
- * Check if a chain is active.
127
- * @param chainId the chain id to check
128
- * @returns true if the chain is active, false otherwise
129
- */
130
- isChainActive(chainId: EvmChain | string): Promise<boolean>;
131
- /**
132
- * Throw an error if any chain in the list is inactive.
133
- * @param chainIds A list of chainIds to check
134
- */
135
- throwIfInactiveChains(chainIds: EvmChain[] | string[]): Promise<void>;
136
- /**
137
- * Initialize the query client if it hasn't been initialized yet
138
- */
139
- private initQueryClientIfNeeded;
140
- /**
141
- * Check if a chain is active.
142
- * @param fromChainId source chain id
143
- * @param toChainId destination chain id
144
- * @param denom denom of asset (e.g. for USDC, uusdc)
145
- * @param proportionOfTotalLimitPerTransfer (optional) proportion of total limit you would like to limit users, e.g. for 25% of total, use 4
146
- * @returns true if the chain is active, false otherwise
147
- */
148
- getTransferLimit({ fromChainId, toChainId, denom, proportionOfTotalLimitPerTransfer, }: {
149
- fromChainId: string;
150
- toChainId: string;
151
- denom: string;
152
- proportionOfTotalLimitPerTransfer?: number;
153
- }): Promise<string>;
154
- getTransferLimitNexusQuery({ chainId, denom, }: {
155
- denom: string;
156
- chainId: string;
157
- }): Promise<TranslatedTransferRateLimitResponse>;
158
- private getChainInfo;
159
- private _convertAssetDenom;
160
- }
161
- export {};
162
- //# sourceMappingURL=AxelarQueryAPI.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AxelarQueryAPI.d.ts","sourceRoot":"","sources":["../../../src/libs/AxelarQueryAPI.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ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BAAyB,CAAC;IAqD9C;;;;;OAKG;IACU,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAWjE;;;;;OAKG;IACU,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAShE;;;;;OAKG;IACU,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAarE;;;;;;OAMG;IACU,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAShG;;;OAGG;IACU,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAQjD;;;;OAIG;IACU,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMxE;;;OAGG;IACU,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE;IAYlE;;OAEG;IACH,OAAO,CAAC,uBAAuB,CAO7B;IAEF;;;;;;;OAOG;IACU,gBAAgB,CAAC,EAC5B,WAAW,EACX,SAAS,EACT,KAAK,EACL,iCAAqC,GACtC,EAAE;QACD,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,iCAAiC,CAAC,EAAE,MAAM,CAAC;KAC5C,GAAG,OAAO,CAAC,MAAM,CAAC;IAiCb,0BAA0B,CAAC,EAC/B,OAAO,EACP,KAAK,GACN,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,mCAAmC,CAAC;YAkClC,YAAY;YAaZ,kBAAkB;CAQjC"}
@@ -1,434 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.AxelarQueryAPI = void 0;
16
- const utils_1 = require("ethers/lib/utils");
17
- const assets_1 = require("../assets");
18
- const constants_1 = require("../constants");
19
- const services_1 = require("../services");
20
- const contract_1 = require("./TransactionRecoveryApi/constants/contract");
21
- const AxelarQueryClient_1 = require("./AxelarQueryClient");
22
- const cross_fetch_1 = __importDefault(require("cross-fetch"));
23
- const query_1 = require("@axelar-network/axelarjs-types/axelar/nexus/v1beta1/query");
24
- const utils_2 = require("../utils");
25
- const chains_1 = require("../chains");
26
- const s3_1 = __importDefault(require("./TransactionRecoveryApi/constants/s3"));
27
- const ethers_1 = require("ethers");
28
- class AxelarQueryAPI {
29
- constructor(config) {
30
- this.chainsList = [];
31
- /**
32
- * Initialize the query client if it hasn't been initialized yet
33
- */
34
- this.initQueryClientIfNeeded = () => __awaiter(this, void 0, void 0, function* () {
35
- if (!this.axelarQueryClient) {
36
- this.axelarQueryClient = yield AxelarQueryClient_1.AxelarQueryClient.initOrGetAxelarQueryClient({
37
- environment: this.environment,
38
- axelarRpcUrl: this.axelarRpcUrl,
39
- });
40
- }
41
- });
42
- const { axelarLcdUrl, axelarRpcUrl, environment } = config;
43
- const links = (0, constants_1.getConfigs)(environment);
44
- this.axelarRpcUrl = axelarRpcUrl || links.axelarRpcUrl;
45
- this.axelarLcdUrl = axelarLcdUrl || links.axelarLcdUrl;
46
- this.axelarGMPServiceUrl = links.axelarGMPApiUrl;
47
- this.environment = environment;
48
- this.lcdApi = new services_1.RestService(this.axelarLcdUrl);
49
- this.rpcApi = new services_1.RestService(this.axelarRpcUrl);
50
- this.axelarGMPServiceApi = new services_1.RestService(this.axelarGMPServiceUrl);
51
- this._initializeAssets();
52
- }
53
- _initializeAssets() {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- this.allAssets = yield (0, assets_1.loadAssets)({ environment: this.environment });
56
- });
57
- }
58
- /**
59
- * Gets the fee for a chain and asset
60
- * example testnet query: https://axelartest-lcd.quickapi.com/axelar/nexus/v1beta1/fee?chain=ethereum&asset=uusd
61
- * @param chainId
62
- * @param assetDenom
63
- * @returns
64
- */
65
- getFeeForChainAndAsset(chainId, assetDenom) {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- yield (0, utils_2.throwIfInvalidChainIds)([chainId], this.environment);
68
- yield this.initQueryClientIfNeeded();
69
- return this.axelarQueryClient.nexus.FeeInfo({
70
- chain: chainId,
71
- asset: yield this._convertAssetDenom(assetDenom),
72
- });
73
- });
74
- }
75
- getEVMEvent(sourceChainId, srcTxHash, srcEventId) {
76
- return __awaiter(this, void 0, void 0, function* () {
77
- yield (0, utils_2.throwIfInvalidChainIds)([sourceChainId], this.environment);
78
- yield this.initQueryClientIfNeeded();
79
- return this.axelarQueryClient.evm.Event({
80
- chain: sourceChainId,
81
- eventId: `${srcTxHash}-${srcEventId}`,
82
- });
83
- });
84
- }
85
- getConfirmationHeight(chain) {
86
- return __awaiter(this, void 0, void 0, function* () {
87
- yield (0, utils_2.throwIfInvalidChainIds)([chain], this.environment);
88
- yield this.initQueryClientIfNeeded();
89
- const chainInfo = yield this.getChainInfo(chain);
90
- return (chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.confirmLevel) || 0;
91
- });
92
- }
93
- /**
94
- * Gest the transfer fee for a given transaction
95
- * example testnet query: "https://axelartest-lcd.quickapi.com/axelar/nexus/v1beta1/transfer_fee?source_chain=ethereum&destination_chain=terra&amount=100000000uusd"
96
- * @param sourceChainId
97
- * @param destinationChainId
98
- * @param assetDenom
99
- * @param amountInDenom
100
- * @returns
101
- */
102
- getTransferFee(sourceChainId, destinationChainId, assetDenom, amountInDenom) {
103
- return __awaiter(this, void 0, void 0, function* () {
104
- yield (0, utils_2.throwIfInvalidChainIds)([sourceChainId, destinationChainId], this.environment);
105
- yield this.initQueryClientIfNeeded();
106
- return this.axelarQueryClient.nexus.TransferFee({
107
- sourceChain: sourceChainId,
108
- destinationChain: destinationChainId,
109
- amount: `${amountInDenom.toString()}${yield this._convertAssetDenom(assetDenom)}`,
110
- });
111
- });
112
- }
113
- /**
114
- * Gets the gas price for a destination chain to be paid to the gas receiver on a source chain
115
- * example testnet query: https://testnet.api.gmp.axelarscan.io/?method=getGasPrice&destinationChain=ethereum&sourceChain=avalanche&sourceTokenAddress=0x43F4600b552089655645f8c16D86A5a9Fa296bc3&sourceTokenSymbol=UST
116
- * @param sourceChainId
117
- * @param destinationChainId
118
- * @param sourceChainTokenSymbol
119
- * @returns
120
- */
121
- getGasInfo(sourceChainId, destinationChainId, sourceChainTokenSymbol) {
122
- return __awaiter(this, void 0, void 0, function* () {
123
- yield (0, utils_2.throwIfInvalidChainIds)([sourceChainId, destinationChainId], this.environment);
124
- const params = new URLSearchParams({
125
- method: "getGasPrice",
126
- destinationChain: destinationChainId,
127
- sourceChain: sourceChainId,
128
- sourceTokenSymbol: sourceChainTokenSymbol,
129
- });
130
- return this.axelarGMPServiceApi.get(`?${params}`).then((resp) => resp.result);
131
- });
132
- }
133
- /**
134
- * Gets the base fee in native token wei for a given source and destination chain combination
135
- * @param sourceChainName
136
- * @param destinationChainName
137
- * @param sourceTokenSymbol (optional)
138
- * @returns base fee in native token in wei, translated into the native gas token of choice
139
- */
140
- getNativeGasBaseFee(sourceChainId, destinationChainId, sourceTokenSymbol, symbol, destinationContractAddress, sourceContractAddress, amount, amountInUnits) {
141
- return __awaiter(this, void 0, void 0, function* () {
142
- yield (0, utils_2.throwIfInvalidChainIds)([sourceChainId, destinationChainId], this.environment);
143
- yield this.throwIfInactiveChains([sourceChainId, destinationChainId]);
144
- const params = {
145
- method: "getFees",
146
- destinationChain: destinationChainId,
147
- sourceChain: sourceChainId,
148
- };
149
- if (sourceTokenSymbol)
150
- params.sourceTokenSymbol = sourceTokenSymbol;
151
- if (symbol)
152
- params.symbol = symbol;
153
- if (destinationContractAddress)
154
- params.destinationContractAddress = destinationContractAddress;
155
- if (sourceContractAddress)
156
- params.sourceContractAddress = sourceContractAddress;
157
- if (amount) {
158
- params.amount = amount;
159
- }
160
- else if (amountInUnits) {
161
- params.amountInUnits = amountInUnits;
162
- }
163
- return this.axelarGMPServiceApi.post("", params).then((response) => {
164
- const { source_base_fee_string, source_token, destination_native_token, express_fee_string, express_supported, } = response.result;
165
- const { decimals: sourceTokenDecimals } = source_token;
166
- const baseFee = (0, utils_1.parseUnits)(source_base_fee_string, sourceTokenDecimals).toString();
167
- const expressFee = express_fee_string
168
- ? (0, utils_1.parseUnits)(express_fee_string, sourceTokenDecimals).toString()
169
- : "0";
170
- return {
171
- baseFee,
172
- expressFee,
173
- sourceToken: source_token,
174
- destToken: {
175
- gas_price: destination_native_token.gas_price,
176
- gas_price_gwei: parseInt(destination_native_token.gas_price_gwei).toString(),
177
- decimals: destination_native_token.decimals,
178
- },
179
- apiResponse: response,
180
- success: true,
181
- expressSupported: express_supported,
182
- };
183
- });
184
- });
185
- }
186
- /**
187
- * Calculate estimated gas amount to pay for the gas receiver contract.
188
- * @param sourceChainId Can be of the EvmChain enum or string. If string, should try to generalize to use the CHAINS constants (e.g. CHAINS.MAINNET.ETHEREUM)
189
- * @param destinationChainId Can be of the EvmChain enum or string. If string, should try to generalize to use the CHAINS constants (e.g. CHAINS.MAINNET.ETHEREUM)
190
- * @param sourceChainTokenSymbol
191
- * @param gasLimit (Optional) An estimated gas amount required to execute `executeWithToken` function. The default value is 700000 which should be sufficient for most transactions.
192
- * @param gasMultiplier (Optional) A multiplier used to create a buffer above the calculated gas fee, to account for potential slippage throughout tx execution, e.g. 1.1 = 10% buffer. supports up to 3 decimal places
193
- * @param minGasPrice (Optional) A minimum value, in wei, for the gas price on the destination chain that is used to override the estimated gas price if it falls below this specified value.
194
- * @param gmpParams (Optional) Additional parameters for GMP transactions, including the ability to see a detailed view of the fee response
195
- * @returns
196
- */
197
- estimateGasFee(sourceChainId, destinationChainId, sourceChainTokenSymbol, gasLimit = contract_1.DEFAULT_ESTIMATED_GAS, gasMultiplier = 1.1, minGasPrice = "0", gmpParams) {
198
- return __awaiter(this, void 0, void 0, function* () {
199
- yield (0, utils_2.throwIfInvalidChainIds)([sourceChainId, destinationChainId], this.environment);
200
- const response = yield this.getNativeGasBaseFee(sourceChainId, destinationChainId, sourceChainTokenSymbol, gmpParams === null || gmpParams === void 0 ? void 0 : gmpParams.tokenSymbol, gmpParams === null || gmpParams === void 0 ? void 0 : gmpParams.destinationContractAddress, gmpParams === null || gmpParams === void 0 ? void 0 : gmpParams.sourceContractAddress, gmpParams === null || gmpParams === void 0 ? void 0 : gmpParams.transferAmount, gmpParams === null || gmpParams === void 0 ? void 0 : gmpParams.transferAmountInUnits);
201
- const { baseFee, expressFee, sourceToken, destToken, apiResponse, success, expressSupported } = response;
202
- if (!success || !baseFee || !sourceToken) {
203
- throw new Error("Failed to estimate gas fee");
204
- }
205
- const destGasFeeWei = (0, utils_1.parseUnits)((gasLimit * Number(destToken.gas_price)).toFixed(destToken.decimals), destToken.decimals);
206
- const minDestGasFeeWei = ethers_1.BigNumber.from(gasLimit).mul(minGasPrice); //minGasPrice already provided by the user in wei
207
- const srcGasFeeWei = (0, utils_1.parseUnits)((gasLimit * Number(sourceToken.gas_price)).toFixed(sourceToken.decimals), sourceToken.decimals);
208
- const executionFee = destGasFeeWei.gt(minDestGasFeeWei)
209
- ? srcGasFeeWei
210
- : srcGasFeeWei.mul(minDestGasFeeWei).div(destGasFeeWei);
211
- const executionFeeWithMultiplier = gasMultiplier > 1 ? executionFee.mul(gasMultiplier * 10000).div(10000) : executionFee;
212
- return (gmpParams === null || gmpParams === void 0 ? void 0 : gmpParams.showDetailedFees)
213
- ? {
214
- baseFee,
215
- expressFee,
216
- executionFee: executionFee.toString(),
217
- executionFeeWithMultiplier: executionFeeWithMultiplier.toString(),
218
- gasLimit,
219
- gasMultiplier,
220
- minGasPrice: minGasPrice === "0" ? "NA" : minGasPrice,
221
- apiResponse,
222
- isExpressSupported: expressSupported,
223
- }
224
- : executionFeeWithMultiplier.add(baseFee).toString();
225
- });
226
- }
227
- /**
228
- * Get the denom for an asset given its symbol on a chain
229
- * @param symbol
230
- * @param chainName
231
- * @returns
232
- */
233
- getDenomFromSymbol(symbol, chainName) {
234
- return __awaiter(this, void 0, void 0, function* () {
235
- if (!this.allAssets)
236
- yield this._initializeAssets();
237
- const assetConfig = this.allAssets.find((ac) => {
238
- var _a, _b;
239
- return ((_b = (_a = ac.chain_aliases[chainName]) === null || _a === void 0 ? void 0 : _a.assetSymbol) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === (symbol === null || symbol === void 0 ? void 0 : symbol.toLowerCase()) &&
240
- !ac.is_gas_token;
241
- });
242
- if (!assetConfig)
243
- return null;
244
- return assetConfig.common_key[this.environment];
245
- });
246
- }
247
- /**
248
- * Get the symbol for an asset on a given chain given its denom
249
- * @param denom
250
- * @param chainName
251
- * @returns
252
- */
253
- getSymbolFromDenom(denom, chainName) {
254
- return __awaiter(this, void 0, void 0, function* () {
255
- if (!this.allAssets)
256
- yield this._initializeAssets();
257
- const assetConfig = this.allAssets.find((ac) => ac.common_key[this.environment] === denom && !ac.is_gas_token);
258
- if (!assetConfig)
259
- return null;
260
- return assetConfig.chain_aliases[chainName].assetSymbol;
261
- });
262
- }
263
- /**
264
- * Get the asset config for an asset on a given chain given its denom
265
- * @param denom
266
- * @param chainName
267
- * @returns asset config
268
- */
269
- getAssetConfigFromDenom(denom, chainName) {
270
- return __awaiter(this, void 0, void 0, function* () {
271
- if (!this.allAssets)
272
- yield this._initializeAssets();
273
- const assetConfig = this.allAssets.find((ac) => ac.common_key[this.environment] === denom && !ac.is_gas_token);
274
- if (!assetConfig)
275
- return null;
276
- const result = assetConfig.chain_aliases[chainName];
277
- if (!result)
278
- return null;
279
- result.decimals = assetConfig.decimals;
280
- result.common_key = assetConfig.common_key[this.environment];
281
- return result;
282
- });
283
- }
284
- /**
285
- * Get the contract address from the chainId and the contractKey
286
- * @param chainId - the chainId of the chain
287
- * @param contractKey - the key of the contract in the config file.
288
- * A valid contractKey can be found here https://github.com/axelarnetwork/chains/blob/790f08350e792e27412ded6721c13ce78267fd72/testnet-config.json#L1951-L1954 e.g. ("gas_service", "deposit_service", "default_refund_collector")
289
- * @returns the contract address
290
- */
291
- getContractAddressFromConfig(chainId, contractKey) {
292
- return __awaiter(this, void 0, void 0, function* () {
293
- const selectedChain = yield this.getChainInfo(chainId);
294
- if (!selectedChain)
295
- throw `getContractAddressFromConfig() ${chainId} not found`;
296
- return yield (0, cross_fetch_1.default)(s3_1.default[this.environment])
297
- .then((res) => res.json())
298
- .then((body) => body.assets.network[chainId.toLowerCase()][contractKey])
299
- .catch(() => undefined);
300
- });
301
- }
302
- /**
303
- * Get a list of active chains.
304
- * @returns an array of active chains
305
- */
306
- getActiveChains() {
307
- return __awaiter(this, void 0, void 0, function* () {
308
- yield this.initQueryClientIfNeeded();
309
- return this.axelarQueryClient.nexus
310
- .Chains({ status: query_1.ChainStatus.CHAIN_STATUS_ACTIVATED })
311
- .then((resp) => resp.chains);
312
- });
313
- }
314
- /**
315
- * Check if a chain is active.
316
- * @param chainId the chain id to check
317
- * @returns true if the chain is active, false otherwise
318
- */
319
- isChainActive(chainId) {
320
- return __awaiter(this, void 0, void 0, function* () {
321
- return this.getActiveChains()
322
- .then((chains) => chains.map((chain) => chain.toLowerCase()))
323
- .then((chains) => chains.includes(chainId.toLowerCase()));
324
- });
325
- }
326
- /**
327
- * Throw an error if any chain in the list is inactive.
328
- * @param chainIds A list of chainIds to check
329
- */
330
- throwIfInactiveChains(chainIds) {
331
- return __awaiter(this, void 0, void 0, function* () {
332
- const results = yield Promise.all(chainIds.map((chainId) => this.isChainActive(chainId)));
333
- for (let i = 0; i < chainIds.length; i++) {
334
- if (!results[i]) {
335
- throw new Error(`Chain ${chainIds[i]} is not active. Please check the list of active chains using the getActiveChains() method.`);
336
- }
337
- }
338
- });
339
- }
340
- /**
341
- * Check if a chain is active.
342
- * @param fromChainId source chain id
343
- * @param toChainId destination chain id
344
- * @param denom denom of asset (e.g. for USDC, uusdc)
345
- * @param proportionOfTotalLimitPerTransfer (optional) proportion of total limit you would like to limit users, e.g. for 25% of total, use 4
346
- * @returns true if the chain is active, false otherwise
347
- */
348
- getTransferLimit({ fromChainId, toChainId, denom, proportionOfTotalLimitPerTransfer = 4, }) {
349
- return __awaiter(this, void 0, void 0, function* () {
350
- const fromChainNexusResponse = yield this.getTransferLimitNexusQuery({
351
- chainId: fromChainId,
352
- denom,
353
- });
354
- const toChainNexusResponse = yield this.getTransferLimitNexusQuery({
355
- chainId: toChainId,
356
- denom,
357
- });
358
- try {
359
- const { limit: fromChainLimit } = fromChainNexusResponse;
360
- const { limit: toChainLimit } = toChainNexusResponse;
361
- if (!fromChainLimit && !toChainLimit)
362
- throw new Error(`could not fetch transfer limit for transfer from ${fromChainId} to ${toChainId} for ${denom}`);
363
- let min;
364
- if (fromChainLimit && toChainLimit) {
365
- const fromBigNum = ethers_1.BigNumber.from(fromChainLimit);
366
- const toBigNum = ethers_1.BigNumber.from(toChainLimit);
367
- min = fromBigNum.lt(toBigNum) ? fromBigNum : toBigNum;
368
- }
369
- else {
370
- min = ethers_1.BigNumber.from(fromChainLimit || toChainLimit);
371
- }
372
- return min.div(proportionOfTotalLimitPerTransfer).toString();
373
- }
374
- catch (e) {
375
- return "";
376
- }
377
- });
378
- }
379
- getTransferLimitNexusQuery({ chainId, denom, }) {
380
- return __awaiter(this, void 0, void 0, function* () {
381
- // verify chain params
382
- yield (0, utils_2.throwIfInvalidChainIds)([chainId], this.environment);
383
- const chain = this.getChainInfo(chainId);
384
- if (!chain)
385
- throw `Chain ${chainId} not found`;
386
- const api = yield AxelarQueryClient_1.AxelarQueryClient.initOrGetAxelarQueryClient({
387
- environment: this.environment,
388
- });
389
- const asset = yield this._convertAssetDenom(denom);
390
- try {
391
- // the "limit" response to the TransferRateLimit RPC query is of type Uint8Array, so need to decode it
392
- const res = yield api.nexus.TransferRateLimit({ chain: chainId, asset });
393
- const { transferRateLimit } = res;
394
- if (!transferRateLimit ||
395
- !transferRateLimit.limit ||
396
- !transferRateLimit.incoming ||
397
- !transferRateLimit.outgoing)
398
- throw new Error(`did not receive a valid response to ${chainId} / ${denom} transfer query`);
399
- const { limit, incoming, outgoing } = transferRateLimit;
400
- return {
401
- limit: new TextDecoder("utf-8").decode(new Uint8Array(limit)),
402
- outgoing: new TextDecoder("utf-8").decode(new Uint8Array(outgoing)),
403
- incoming: new TextDecoder("utf-8").decode(new Uint8Array(incoming)),
404
- };
405
- }
406
- catch (e) {
407
- return { limit: "", outgoing: "", incoming: "" };
408
- }
409
- });
410
- }
411
- getChainInfo(chainId) {
412
- return __awaiter(this, void 0, void 0, function* () {
413
- if (this.chainsList.length === 0) {
414
- this.chainsList = yield (0, chains_1.loadChains)({
415
- environment: this.environment,
416
- });
417
- }
418
- const chainInfo = this.chainsList.find((chainInfo) => chainInfo.id.toLowerCase() === chainId.toLowerCase());
419
- return chainInfo;
420
- });
421
- }
422
- _convertAssetDenom(denom) {
423
- return __awaiter(this, void 0, void 0, function* () {
424
- if (!this.allAssets)
425
- yield this._initializeAssets();
426
- const assetConfig = this.allAssets.find((asset) => asset.common_key[this.environment] === denom.toLowerCase());
427
- if (!assetConfig)
428
- throw `Asset ${denom} not found`;
429
- return assetConfig.wrapped_erc20 ? assetConfig.wrapped_erc20 : denom;
430
- });
431
- }
432
- }
433
- exports.AxelarQueryAPI = AxelarQueryAPI;
434
- //# sourceMappingURL=AxelarQueryAPI.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AxelarQueryAPI.js","sourceRoot":"","sources":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AI,CAAC,UAAU,GAAG,MAAM,IAAA,mBAAU,EAAC;oBACjC,WAAW,EAAE,IAAI,CAAC,WAAW;iBAC9B,CAAC,CAAC;aACJ;YACD,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CACpC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,WAAW,EAAE,CACpE,CAAC;YAEF,OAAO,SAAS,CAAC;QACnB,CAAC;KAAA;IAEa,kBAAkB,CAAC,KAAa;;YAC5C,IAAI,CAAC,IAAI,CAAC,SAAS;gBAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACpD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CACrC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,KAAK,CAAC,WAAW,EAAE,CACtE,CAAC;YACF,IAAI,CAAC,WAAW;gBAAE,MAAM,SAAS,KAAK,YAAY,CAAC;YACnD,OAAO,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC;QACvE,CAAC;KAAA;CACF;AAhfD,wCAgfC"}
@@ -1,8 +0,0 @@
1
- import { QueryClient } from "@cosmjs/stargate";
2
- import { AxelarQueryClientConfig } from "../types";
3
- import { AxelarQueryService } from "./types/index";
4
- export declare type AxelarQueryClientType = QueryClient & AxelarQueryService;
5
- export declare class AxelarQueryClient extends QueryClient {
6
- static initOrGetAxelarQueryClient(config: AxelarQueryClientConfig): Promise<AxelarQueryClientType>;
7
- }
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/libs/AxelarQueryClient/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAuB,MAAM,eAAe,CAAC;AAExE,oBAAY,qBAAqB,GAAG,WAAW,GAAG,kBAAkB,CAAC;AAIrE,qBAAa,iBAAkB,SAAQ,WAAW;WACnC,0BAA0B,CAAC,MAAM,EAAE,uBAAuB;CAYxE"}