@allbridge/bridge-core-sdk 3.35.0 → 3.36.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.
Files changed (42) hide show
  1. package/README.md +2 -2
  2. package/dist/browser/index.js +2 -2
  3. package/dist/browser/index.js.map +3 -3
  4. package/dist/cjs/index.js +2 -2
  5. package/dist/cjs/index.js.map +3 -3
  6. package/dist/esm/index.js +2 -2
  7. package/dist/esm/index.js.map +3 -3
  8. package/dist/src/client/core-api/api-client.d.ts +11 -3
  9. package/dist/src/client/core-api/api-client.js +15 -14
  10. package/dist/src/client/core-api/api-client.js.map +1 -1
  11. package/dist/src/client/core-api/core-api-mapper.d.ts +1 -0
  12. package/dist/src/client/core-api/core-api-mapper.js +19 -7
  13. package/dist/src/client/core-api/core-api-mapper.js.map +1 -1
  14. package/dist/src/client/core-api/core-api.model.d.ts +30 -18
  15. package/dist/src/client/core-api/core-api.model.js.map +1 -1
  16. package/dist/src/exceptions/exceptions.d.ts +6 -0
  17. package/dist/src/exceptions/exceptions.js +6 -0
  18. package/dist/src/exceptions/exceptions.js.map +1 -1
  19. package/dist/src/index.d.ts +71 -29
  20. package/dist/src/index.js +5 -2
  21. package/dist/src/index.js.map +1 -1
  22. package/dist/src/models/index.d.ts +1 -1
  23. package/dist/src/models/index.js.map +1 -1
  24. package/dist/src/services/models/index.d.ts +3 -0
  25. package/dist/src/services/models/index.js.map +1 -1
  26. package/dist/src/services/yield/index.d.ts +18 -0
  27. package/dist/src/services/yield/index.js +6 -0
  28. package/dist/src/services/yield/index.js.map +1 -1
  29. package/dist/src/services/yield/models/yield.model.d.ts +33 -0
  30. package/dist/src/services/yield/models/yield.model.js.map +1 -1
  31. package/dist/src/services/yield/raw-yield-transaction-builder.d.ts +9 -0
  32. package/dist/src/services/yield/raw-yield-transaction-builder.js +3 -0
  33. package/dist/src/services/yield/raw-yield-transaction-builder.js.map +1 -1
  34. package/dist/src/services/yield/validations.d.ts +2 -0
  35. package/dist/src/services/yield/validations.js +2 -0
  36. package/dist/src/services/yield/validations.js.map +1 -1
  37. package/dist/src/tokens-info/tokens-info.model.d.ts +4 -0
  38. package/dist/src/tokens-info/tokens-info.model.js.map +1 -1
  39. package/dist/src/version.d.ts +1 -1
  40. package/dist/src/version.js +1 -1
  41. package/dist/src/version.js.map +1 -1
  42. package/package.json +1 -1
@@ -96,6 +96,9 @@ export declare class AllbridgeCoreSdk {
96
96
  * @deprecated Do not use.
97
97
  */
98
98
  pool: LiquidityPoolService;
99
+ /**
100
+ * @deprecated Do not use.
101
+ */
99
102
  yield: YieldService;
100
103
  utils: Utils;
101
104
  private service;
@@ -108,38 +111,57 @@ export declare class AllbridgeCoreSdk {
108
111
  */
109
112
  constructor(nodeUrls: NodeUrlsConfig | NodeRpcUrls, params?: AllbridgeCoreSdkOptions);
110
113
  /**
111
- * Returns {@link ChainDetailsMap} containing a list of supported tokens groped by chain.
112
- *
113
- * @param type - A string value which specifies ChainDetailsMap to retrieve.
114
- * Defaults to 'swap' (tokens to send).
115
- * The 'pool' value (liquidity pools setup) is deprecated. Do not use.
114
+ * Returns {@link ChainDetailsMap} containing a list of tokens for liquidity pools operations grouped by chain.
115
+ * @param type - 'pool'
116
+ * @deprecated Do not use.
116
117
  */
117
- /** @deprecated Do not use. */
118
118
  chainDetailsMap(type: "pool"): Promise<ChainDetailsMap>;
119
+ /**
120
+ * Returns {@link ChainDetailsMap} containing a list of supported tokens grouped by chain.
121
+ * @param type - Optional. 'swap' (tokens to send) is the only supported value and the default.
122
+ */
119
123
  chainDetailsMap(type?: "swap"): Promise<ChainDetailsMap>;
124
+ /**
125
+ * Returns {@link ChainDetailsMap} containing a list of supported tokens grouped by chain.
126
+ * @param type - 'swap' for tokens to send. The 'pool' value (liquidity pools setup) is deprecated. Do not use.
127
+ */
120
128
  chainDetailsMap(type: "swap" | "pool"): Promise<ChainDetailsMap>;
129
+ /**
130
+ * Returns a list of {@link TokenWithChainDetails | tokens} for liquidity pools operations.
131
+ * @param type - 'pool'
132
+ * @deprecated Do not use.
133
+ */
134
+ tokens(type: "pool"): Promise<TokenWithChainDetails[]>;
121
135
  /**
122
136
  * Returns a list of supported {@link TokenWithChainDetails | tokens}.
123
- *
124
- * @param type - A string value which specifies a set of tokens to retrieve.
125
- * Defaults to 'swap' (tokens to send).
126
- * The 'pool' value (liquidity pools operations) is deprecated. Do not use.
137
+ * @param type - Optional. 'swap' (tokens to send) is the only supported value and the default.
127
138
  * @returns A promise that resolves to an array of {@link TokenWithChainDetails}.
128
139
  */
129
- /** @deprecated Do not use. */
130
- tokens(type: "pool"): Promise<TokenWithChainDetails[]>;
131
140
  tokens(type?: "swap"): Promise<TokenWithChainDetails[]>;
141
+ /**
142
+ * Returns a list of supported {@link TokenWithChainDetails | tokens}.
143
+ * @param type - 'swap' for tokens to send. The 'pool' value (liquidity pools operations) is deprecated. Do not use.
144
+ * @returns A promise that resolves to an array of {@link TokenWithChainDetails}.
145
+ */
132
146
  tokens(type: "swap" | "pool"): Promise<TokenWithChainDetails[]>;
133
147
  /**
134
- * Returns a list of supported {@link TokenWithChainDetails | tokens} on the selected chain.
148
+ * Returns a list of {@link TokenWithChainDetails | tokens} for liquidity pools operations on the selected chain.
135
149
  * @param chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., "ETH" for Ethereum). For more details, see: {@link ChainSymbol}.
136
- * @param type - A string value which specifies a set of tokens to retrieve.
137
- * Defaults to 'swap' (tokens to send).
138
- * The 'pool' value (liquidity pools operations) is deprecated. Do not use.
150
+ * @param type - 'pool'
151
+ * @deprecated Do not use.
139
152
  */
140
- /** @deprecated Do not use. */
141
153
  tokensByChain(chainSymbol: string, type: "pool"): Promise<TokenWithChainDetails[]>;
154
+ /**
155
+ * Returns a list of supported {@link TokenWithChainDetails | tokens} on the selected chain.
156
+ * @param chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., "ETH" for Ethereum). For more details, see: {@link ChainSymbol}.
157
+ * @param type - Optional. 'swap' (tokens to send) is the only supported value and the default.
158
+ */
142
159
  tokensByChain(chainSymbol: string, type?: "swap"): Promise<TokenWithChainDetails[]>;
160
+ /**
161
+ * Returns a list of supported {@link TokenWithChainDetails | tokens} on the selected chain.
162
+ * @param chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., "ETH" for Ethereum). For more details, see: {@link ChainSymbol}.
163
+ * @param type - 'swap' for tokens to send. The 'pool' value (liquidity pools operations) is deprecated. Do not use.
164
+ */
143
165
  tokensByChain(chainSymbol: string, type: "swap" | "pool"): Promise<TokenWithChainDetails[]>;
144
166
  /**
145
167
  * Fetches information about tokens transfer by chosen chainSymbol and transaction Id from the Allbridge Core API.
@@ -227,6 +249,15 @@ export declare class AllbridgeCoreSdk {
227
249
  * @deprecated Use {@link getGasFeeOptions} and {@link getAmountToSend}.
228
250
  */
229
251
  getAmountToSendAndGasFeeOptions(amountToBeReceivedFloat: BigSource, sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, messenger: Messenger): Promise<AmountsAndGasFeeOptions>;
252
+ /**
253
+ * Calculates the amount of tokens to be received as a result of transfer through a legacy messenger.
254
+ * @param amountToSendFloat the amount of tokens that will be sent
255
+ * @param sourceChainToken selected token on the source chain
256
+ * @param destinationChainToken selected token on the destination chain
257
+ * @param messenger {@link LegacyMessenger}
258
+ * @deprecated Do not use.
259
+ */
260
+ getAmountToBeReceived(amountToSendFloat: BigSource, sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, messenger: LegacyMessenger): Promise<string>;
230
261
  /**
231
262
  * Calculates the amount of tokens to be received as a result of transfer
232
263
  * after applying the fee of the selected messenger.
@@ -236,8 +267,6 @@ export declare class AllbridgeCoreSdk {
236
267
  * @param messenger selected messenger, see {@link ActiveMessenger}
237
268
  * @throws CCTPDoesNotSupportedError, OFTDoesNotSupportedError or SdkError if the route is not supported by the messenger
238
269
  */
239
- /** @deprecated Do not use. */
240
- getAmountToBeReceived(amountToSendFloat: BigSource, sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, messenger: LegacyMessenger): Promise<string>;
241
270
  getAmountToBeReceived(amountToSendFloat: BigSource, sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, messenger: ActiveMessenger): Promise<string>;
242
271
  /**
243
272
  * Calculates the amount of tokens to be received as a result of transfer based on actual blockchain pool state.
@@ -247,8 +276,8 @@ export declare class AllbridgeCoreSdk {
247
276
  * @param messenger selected messenger
248
277
  * @param sourceProvider Optional. source chain Provider
249
278
  * @param destinationProvider Optional. destination chain Provider
279
+ * @deprecated Do not use.
250
280
  */
251
- /** @deprecated Do not use. */
252
281
  getAmountToBeReceivedFromChain(amountToSendFloat: BigSource, sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, messenger: Messenger, sourceProvider?: Provider, destinationProvider?: Provider): Promise<string>;
253
282
  /**
254
283
  * Calculates the amount of tokens to be received as a result of transfer based on passed pool state.
@@ -258,9 +287,18 @@ export declare class AllbridgeCoreSdk {
258
287
  * @param sourcePool source token pool state
259
288
  * @param destinationPool destination token pool state
260
289
  * @param messenger selected messenger
290
+ * @deprecated Do not use.
261
291
  */
262
- /** @deprecated Do not use. */
263
292
  getAmountToBeReceivedFromPools(amountToSendFloat: BigSource, sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, sourcePool: PoolInfo, destinationPool: PoolInfo, messenger: Exclude<Messenger, Messenger.OFT>): string;
293
+ /**
294
+ * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer through a legacy messenger.
295
+ * @param amountToBeReceivedFloat the amount of tokens that should be received
296
+ * @param sourceChainToken selected token on the source chain
297
+ * @param destinationChainToken selected token on the destination chain
298
+ * @param messenger {@link LegacyMessenger}
299
+ * @deprecated Do not use.
300
+ */
301
+ getAmountToSend(amountToBeReceivedFloat: BigSource, sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, messenger: LegacyMessenger): Promise<string>;
264
302
  /**
265
303
  * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer
266
304
  * after applying the fee of the selected messenger.
@@ -270,8 +308,6 @@ export declare class AllbridgeCoreSdk {
270
308
  * @param messenger selected messenger, see {@link ActiveMessenger}
271
309
  * @throws CCTPDoesNotSupportedError, OFTDoesNotSupportedError or SdkError if the route is not supported by the messenger
272
310
  */
273
- /** @deprecated Do not use. */
274
- getAmountToSend(amountToBeReceivedFloat: BigSource, sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, messenger: LegacyMessenger): Promise<string>;
275
311
  getAmountToSend(amountToBeReceivedFloat: BigSource, sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, messenger: ActiveMessenger): Promise<string>;
276
312
  /**
277
313
  * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer based on actual blockchain pool state.
@@ -281,8 +317,8 @@ export declare class AllbridgeCoreSdk {
281
317
  * @param messenger selected messenger
282
318
  * @param sourceProvider Optional. source chain Provider
283
319
  * @param destinationProvider Optional. destination chain Provider
320
+ * @deprecated Do not use.
284
321
  */
285
- /** @deprecated Do not use. */
286
322
  getAmountToSendFromChain(amountToBeReceivedFloat: BigSource, sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, messenger: Messenger, sourceProvider?: Provider, destinationProvider?: Provider): Promise<string>;
287
323
  /**
288
324
  * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer based on passed pool state.
@@ -292,8 +328,8 @@ export declare class AllbridgeCoreSdk {
292
328
  * @param sourcePool source token pool state
293
329
  * @param destinationPool destination token pool state
294
330
  * @param messenger selected messenger
331
+ * @deprecated Do not use.
295
332
  */
296
- /** @deprecated Do not use. */
297
333
  getAmountToSendFromPools(amountToBeReceivedFloat: BigSource, sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, sourcePool: PoolInfo, destinationPool: PoolInfo, messenger: Exclude<Messenger, Messenger.OFT>): string;
298
334
  /**
299
335
  * Fetches possible ways to pay the transfer gas fee.
@@ -334,6 +370,14 @@ export declare class AllbridgeCoreSdk {
334
370
  * @returns aprPercentageView
335
371
  */
336
372
  aprInPercents(apr: string): string;
373
+ /**
374
+ * Get possible limit of extra gas amount for a legacy messenger.
375
+ * @param sourceChainToken selected token on the source chain
376
+ * @param destinationChainToken selected token on the destination chain
377
+ * @param messenger {@link LegacyMessenger}
378
+ * @deprecated Do not use.
379
+ */
380
+ getExtraGasMaxLimits(sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, messenger: LegacyMessenger): Promise<ExtraGasMaxLimitResponse>;
337
381
  /**
338
382
  * Get possible limit of extra gas amount.
339
383
  * For {@link Messenger.X_RESERVE} extra gas is not supported and zero limits are returned.
@@ -342,8 +386,6 @@ export declare class AllbridgeCoreSdk {
342
386
  * @param messenger selected messenger, see {@link ActiveMessenger}
343
387
  * @returns {@link ExtraGasMaxLimitResponse}
344
388
  */
345
- /** @deprecated Do not use. */
346
- getExtraGasMaxLimits(sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, messenger: LegacyMessenger): Promise<ExtraGasMaxLimitResponse>;
347
389
  getExtraGasMaxLimits(sourceChainToken: TokenWithChainDetails, destinationChainToken: TokenWithChainDetails, messenger: ActiveMessenger): Promise<ExtraGasMaxLimitResponse>;
348
390
  /**
349
391
  * @deprecated Do not use.
@@ -361,14 +403,14 @@ export declare class AllbridgeCoreSdk {
361
403
  */
362
404
  getAmountFromVUsd(vUsdAmount: string, destToken: TokenWithChainDetails): Promise<AmountFormatted>;
363
405
  /**
364
- * @deprecated Use {@link getSendAmountDetails}
406
+ * @deprecated Do not use.
365
407
  * @param amountInTokenPrecision
366
408
  * @param sourceToken
367
409
  * @param destToken
368
410
  */
369
411
  swapAndBridgeFeeCalculation(amountInTokenPrecision: string, sourceToken: TokenWithChainDetails, destToken: TokenWithChainDetails): Promise<SwapAndBridgeCalculationData>;
370
412
  /**
371
- * @deprecated Use {@link getAmountToBeReceived} and then {@link getSendAmountDetails}
413
+ * @deprecated Do not use.
372
414
  * @param amountInTokenPrecision
373
415
  * @param sourceToken
374
416
  * @param destToken
package/dist/src/index.js CHANGED
@@ -17,6 +17,9 @@ export class AllbridgeCoreSdk {
17
17
  * @deprecated Do not use.
18
18
  */
19
19
  pool;
20
+ /**
21
+ * @deprecated Do not use.
22
+ */
20
23
  yield;
21
24
  utils;
22
25
  service;
@@ -281,7 +284,7 @@ export class AllbridgeCoreSdk {
281
284
  return this.service.getAmountFromVUsd(vUsdAmount, destToken);
282
285
  }
283
286
  /**
284
- * @deprecated Use {@link getSendAmountDetails}
287
+ * @deprecated Do not use.
285
288
  * @param amountInTokenPrecision
286
289
  * @param sourceToken
287
290
  * @param destToken
@@ -290,7 +293,7 @@ export class AllbridgeCoreSdk {
290
293
  return this.service.swapAndBridgeFeeCalculation(amountInTokenPrecision, sourceToken, destToken);
291
294
  }
292
295
  /**
293
- * @deprecated Use {@link getAmountToBeReceived} and then {@link getSendAmountDetails}
296
+ * @deprecated Do not use.
294
297
  * @param amountInTokenPrecision
295
298
  * @param sourceToken
296
299
  * @param destToken
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAeL,SAAS,GAQV,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGxE,OAAO,EAAE,YAAY,EAAS,MAAM,SAAS,CAAC;AAE9C,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AA2FzB;;GAEG;AACH,SAAS,gBAAgB,CAAC,QAAsC;IAC9D,OAAO,cAAc,IAAI,QAAQ,CAAC;AACpC,CAAC;AAED,MAAM,OAAO,gBAAgB;IAClB,MAAM,CAA0B;IAEzC,MAAM,CAAgB;IACtB;;OAEG;IACH,IAAI,CAAuB;IAC3B,K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C,qBAA4C,EAC5C,SAAoB;QAEpB,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,qBAAqB,EAAE,SAAS,CAAC,CAAC;IAC/F,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,iBAAiB,CACrB,MAAc,EACd,YAA0B,EAC1B,WAAkC;QAElC,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,iBAAiB,CAAC,UAAkB,EAAE,SAAgC;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,2BAA2B,CAC/B,sBAA8B,EAC9B,WAAkC,EAClC,SAAgC;QAEhC,OAAO,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,sBAAsB,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IAClG,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,kCAAkC,CACtC,sBAA8B,EAC9B,WAAkC,EAClC,SAAgC;QAEhC,OAAO,IAAI,CAAC,OAAO,CAAC,kCAAkC,CAAC,sBAAsB,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IACzG,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,oBAAoB,CACxB,MAAc,EACd,YAA0B,EAC1B,WAAkC,EAClC,SAAgC;QAEhC,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IACzF,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/unified-signatures -- overloads intentionally expose route-specific deprecation metadata */\nimport { BigSource } from \"big.js\";\nimport { AdditionalBasicChainProperties } from \"./chains/models\";\nimport { mainnet } from \"./configs\";\nimport {\n ActiveMessenger,\n AmountFormat,\n AmountFormatted,\n AmountsAndGasFeeOptions,\n BridgeService,\n ChainDetailsMap,\n CheckAddressResponse,\n ExtraGasMaxLimitResponse,\n GasBalanceResponse,\n GasFeeOptions,\n GetNativeTokenBalanceParams,\n GetTokenBalanceParams,\n LiquidityPoolService,\n LegacyMessenger,\n Messenger,\n PendingStatusInfoResponse,\n PoolInfo,\n Provider,\n SendAmountDetails,\n SwapAndBridgeCalculationData,\n TokenWithChainDetails,\n TransferStatusResponse,\n} from \"./models\";\nimport { AllbridgeCoreSdkService, NodeRpcUrlsConfig } from \"./services\";\nimport { CctpParams } from \"./services/bridge/sol\";\nimport { YieldService } from \"./services/yield\";\nimport { DefaultUtils, Utils } from \"./utils\";\n\nexport * from \"./configs\";\nexport * from \"./models\";\n\nexport interface AllbridgeCoreSdkOptions {\n coreApiUrl: string;\n /**\n * A set of query parameters to be added to all requests to the Core API.\n */\n coreApiQueryParams?: Record<string, string>;\n /**\n * A set of headers to be added to all requests to the Core API.\n */\n coreApiHeaders?: Record<string, string>;\n /**\n * A function that returns headers to be added to a single Core API request.\n * It is evaluated right before each request\n */\n coreApiHeadersProvider?: () => Promise<Record<string, string> | undefined>;\n /**\n * Jupiter Swap Api</br>\n * Default: https://lite-api.jup.ag/swap/v1</br>\n * {@link https://dev.jup.ag/docs/swap-api/}\n */\n jupiterUrl: string;\n /**\n * Jupiter Api Key Header</br>\n * {@link https://dev.jup.ag/docs/api-setup}\n */\n jupiterApiKeyHeader?: string;\n /**\n * Jupiter v6 'maxAccounts' parameter</br>\n * Rough estimate of the max accounts to be used for the quote, so that you can compose with your own accounts</br>\n * {@link https://station.jup.ag/docs/apis/swap-api#using-maxaccounts}\n */\n jupiterMaxAccounts?: number;\n /**\n * @deprecated Do not use.\n */\n wormholeMessengerProgramId?: string;\n solanaLookUpTable: string;\n sorobanNetworkPassphrase: string;\n /**\n * Optional. Will be used in methods</br>\n * {@link LiquidityPoolService.getPoolInfoFromChain} and {@link LiquidityPoolService.getAmountToBeWithdrawn}</br>\n * to fetch information from the blockchain with fewer HTTP requests using JSON-RPC API\n * @deprecated Do not use.\n */\n tronJsonRpc?: string;\n /**\n * Solana CCTP / CCTP V2 program ids and CCTP domains, see {@link CctpParams}.\n * Required for transfers with {@link Messenger.CCTP} and {@link Messenger.CCTP_V2} from Solana.\n */\n cctpParams: CctpParams;\n /**\n * The number of seconds that pool information taken from the chain will be cached.\n *\n * @type {number}\n * @deprecated Do not use.\n */\n cachePoolInfoChainSec?: number;\n\n /**\n * @internal\n * Optional additional properties to merge with the default properties.\n */\n additionalChainsProperties?: Record<string, AdditionalBasicChainProperties>;\n\n suiIsTestnet?: boolean;\n\n stxIsTestnet?: boolean;\n stxHeroApiKey?: string;\n}\n\n/**\n * Type representing RPC node URLs for different blockchain chains.</br>\n * Provide node RPC URL for chain connection you intend to communicate with</br>\n * - required for SOL, TRX chains</br>\n * - optional for EVM chains -- you can interact by passing a {@link Provider} that will be used to communicate with the chain</br>\n * @typedef {Record<string, string>} NodeRpcUrls\n * @property {string} chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @property {string} rpcUrl - The RPC node URL for the specified chain.\n */\nexport type NodeRpcUrls = Record<string, string>;\n\n/**\n * @deprecated Use {@link NodeRpcUrls}\n */\nexport interface NodeUrlsConfig {\n solanaRpcUrl: string;\n tronRpcUrl: string;\n}\n\n/**\n * @deprecated Use {@link NodeRpcUrls}\n */\nfunction isNodeUrlsConfig(nodeUrls: NodeUrlsConfig | NodeRpcUrls): nodeUrls is NodeUrlsConfig {\n return \"solanaRpcUrl\" in nodeUrls;\n}\n\nexport class AllbridgeCoreSdk {\n readonly params: AllbridgeCoreSdkOptions;\n\n bridge: BridgeService;\n /**\n * @deprecated Do not use.\n */\n pool: LiquidityPoolService;\n yield: YieldService;\n utils: Utils;\n\n private service: AllbridgeCoreSdkService;\n\n /**\n * Initializes the SDK object.\n * @param nodeUrls node rpc urls for full functionality\n * @param params\n * Optional.\n * If not defined, the default {@link mainnet} parameters are used.\n */\n constructor(nodeUrls: NodeUrlsConfig | NodeRpcUrls, params: AllbridgeCoreSdkOptions = mainnet) {\n let nodeRpcUrlsConfig: NodeRpcUrlsConfig;\n if (isNodeUrlsConfig(nodeUrls)) {\n nodeRpcUrlsConfig = new NodeRpcUrlsConfig({ SOL: nodeUrls.solanaRpcUrl, TRX: nodeUrls.tronRpcUrl });\n } else {\n nodeRpcUrlsConfig = new NodeRpcUrlsConfig(nodeUrls);\n }\n this.service = new AllbridgeCoreSdkService(nodeRpcUrlsConfig, params);\n this.bridge = this.service.bridge;\n this.pool = this.service.pool;\n this.yield = this.service.yield;\n this.utils = new DefaultUtils(this.service);\n this.params = params;\n }\n\n /**\n * Returns {@link ChainDetailsMap} containing a list of supported tokens groped by chain.\n *\n * @param type - A string value which specifies ChainDetailsMap to retrieve.\n * Defaults to 'swap' (tokens to send).\n * The 'pool' value (liquidity pools setup) is deprecated. Do not use.\n */\n /** @deprecated Do not use. */\n chainDetailsMap(type: \"pool\"): Promise<ChainDetailsMap>;\n chainDetailsMap(type?: \"swap\"): Promise<ChainDetailsMap>;\n chainDetailsMap(type: \"swap\" | \"pool\"): Promise<ChainDetailsMap>;\n async chainDetailsMap(type: \"swap\" | \"pool\" = \"swap\"): Promise<ChainDetailsMap> {\n return this.service.chainDetailsMap(type);\n }\n\n /**\n * Returns a list of supported {@link TokenWithChainDetails | tokens}.\n *\n * @param type - A string value which specifies a set of tokens to retrieve.\n * Defaults to 'swap' (tokens to send).\n * The 'pool' value (liquidity pools operations) is deprecated. Do not use.\n * @returns A promise that resolves to an array of {@link TokenWithChainDetails}.\n */\n /** @deprecated Do not use. */\n tokens(type: \"pool\"): Promise<TokenWithChainDetails[]>;\n tokens(type?: \"swap\"): Promise<TokenWithChainDetails[]>;\n tokens(type: \"swap\" | \"pool\"): Promise<TokenWithChainDetails[]>;\n async tokens(type: \"swap\" | \"pool\" = \"swap\"): Promise<TokenWithChainDetails[]> {\n return this.service.tokens(type);\n }\n\n /**\n * Returns a list of supported {@link TokenWithChainDetails | tokens} on the selected chain.\n * @param chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @param type - A string value which specifies a set of tokens to retrieve.\n * Defaults to 'swap' (tokens to send).\n * The 'pool' value (liquidity pools operations) is deprecated. Do not use.\n */\n /** @deprecated Do not use. */\n tokensByChain(chainSymbol: string, type: \"pool\"): Promise<TokenWithChainDetails[]>;\n tokensByChain(chainSymbol: string, type?: \"swap\"): Promise<TokenWithChainDetails[]>;\n tokensByChain(chainSymbol: string, type: \"swap\" | \"pool\"): Promise<TokenWithChainDetails[]>;\n async tokensByChain(chainSymbol: string, type: \"swap\" | \"pool\" = \"swap\"): Promise<TokenWithChainDetails[]> {\n return this.service.tokensByChain(chainSymbol, type);\n }\n\n /**\n * Fetches information about tokens transfer by chosen chainSymbol and transaction Id from the Allbridge Core API.\n * @param chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @param txId\n */\n async getTransferStatus(chainSymbol: string, txId: string): Promise<TransferStatusResponse> {\n return this.service.getTransferStatus(chainSymbol, txId);\n }\n\n /**\n * Get gas balance\n * @param chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @param address\n */\n async getGasBalance(chainSymbol: string, address: string): Promise<GasBalanceResponse> {\n return this.service.getGasBalance(chainSymbol, address);\n }\n\n /**\n * Check address and show gas balance\n * @deprecated\n * @param _chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @param _recipientAddress\n * @param _tokenAddress\n */\n async checkAddress(\n _chainSymbol: string,\n _recipientAddress: string,\n _tokenAddress?: string\n ): Promise<CheckAddressResponse> {\n return await this.service.checkAddress();\n }\n\n /**\n * Returns information about pending transactions for the same destination chain and the amount of tokens can be received as a result of transfer considering pending transactions.\n * @deprecated Do not use.\n * @param amount the amount of tokens that will be sent\n * @param amountFormat amount format\n * @param sourceToken selected token transfer from\n * @param destToken selected token transfer to\n * @returns range of possible amount based on already pending transactions\n */\n async getPendingStatusInfo(\n amount: string,\n amountFormat: AmountFormat,\n sourceToken: TokenWithChainDetails,\n destToken: TokenWithChainDetails\n ): Promise<PendingStatusInfoResponse> {\n return this.service.getPendingStatusInfo(amount, amountFormat, sourceToken, destToken);\n }\n\n /**\n * Get token balance\n * @param params\n * @param provider\n * @returns Token balance\n */\n async getTokenBalance(params: GetTokenBalanceParams, provider?: Provider): Promise<string> {\n return this.service.getTokenBalance(params, provider);\n }\n\n /**\n * Get native (gas) token balance\n * @param params\n * @param provider\n * @returns Token balance\n */\n async getNativeTokenBalance(params: GetNativeTokenBalanceParams, provider?: Provider): Promise<AmountFormatted> {\n return this.service.getNativeTokenBalance(params, provider);\n }\n\n /**\n * @deprecated\n * Calculates the percentage of fee from the initial amount that is charged when swapping from the selected source chain.\n * (Does not include fee related to the destination chain. Does not include gas fee)\n * @param amountFloat initial amount of tokens to swap\n * @param sourceChainToken selected token on the source chain\n * @returns fee percent\n */\n async calculateFeePercentOnSourceChain(\n amountFloat: BigSource,\n sourceChainToken: TokenWithChainDetails\n ): Promise<number> {\n return this.service.calculateFeePercentOnSourceChain(amountFloat, sourceChainToken);\n }\n\n /**\n * @deprecated\n * Calculates the percentage of fee that is charged when swapping to the selected destination chain. The destination chain fee percent applies to the amount after the source chain fee.\n * (Does not include fee related to the source chain. Does not include gas fee)\n * @see {@link calculateFeePercentOnSourceChain}\n * @param amountFloat initial amount of tokens to swap\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @returns fee percent\n */\n async calculateFeePercentOnDestinationChain(\n amountFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails\n ): Promise<number> {\n return this.service.calculateFeePercentOnDestinationChain(amountFloat, sourceChainToken, destinationChainToken);\n }\n\n /**\n * Calculates the amount of tokens to be received as a result of transfer\n * and fetches {@link GasFeeOptions} which contains available ways to pay the gas fee.\n * @param amountToSendFloat the amount of tokens that will be sent\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger\n *\n * @deprecated Use {@link getGasFeeOptions} and {@link getAmountToBeReceived}.\n */\n async getAmountToBeReceivedAndGasFeeOptions(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger\n ): Promise<AmountsAndGasFeeOptions> {\n return this.service.getAmountToBeReceivedAndGasFeeOptions(\n amountToSendFloat,\n sourceChainToken,\n destinationChainToken,\n messenger\n );\n }\n\n /**\n * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer.\n * and fetches {@link GasFeeOptions} which contains available ways to pay the gas fee.\n * @param amountToBeReceivedFloat the amount of tokens that should be received\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger\n *\n * @deprecated Use {@link getGasFeeOptions} and {@link getAmountToSend}.\n */\n async getAmountToSendAndGasFeeOptions(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger\n ): Promise<AmountsAndGasFeeOptions> {\n return this.service.getAmountToSendAndGasFeeOptions(\n amountToBeReceivedFloat,\n sourceChainToken,\n destinationChainToken,\n messenger\n );\n }\n\n /**\n * Calculates the amount of tokens to be received as a result of transfer\n * after applying the fee of the selected messenger.\n * @param amountToSendFloat the amount of tokens that will be sent\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger selected messenger, see {@link ActiveMessenger}\n * @throws CCTPDoesNotSupportedError, OFTDoesNotSupportedError or SdkError if the route is not supported by the messenger\n */\n /** @deprecated Do not use. */\n getAmountToBeReceived(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: LegacyMessenger\n ): Promise<string>;\n getAmountToBeReceived(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: ActiveMessenger\n ): Promise<string>;\n async getAmountToBeReceived(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n /**\n * The Messengers for different routes.\n */\n messenger: Messenger\n ): Promise<string> {\n return this.service.getAmountToBeReceived(amountToSendFloat, sourceChainToken, destinationChainToken, messenger);\n }\n\n /**\n * Calculates the amount of tokens to be received as a result of transfer based on actual blockchain pool state.\n * @param amountToSendFloat the amount of tokens that will be sent\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger selected messenger\n * @param sourceProvider Optional. source chain Provider\n * @param destinationProvider Optional. destination chain Provider\n */\n /** @deprecated Do not use. */\n getAmountToBeReceivedFromChain(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger,\n sourceProvider?: Provider,\n destinationProvider?: Provider\n ): Promise<string>;\n async getAmountToBeReceivedFromChain(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n /**\n * The Messengers for different routes.\n */\n messenger: Messenger,\n sourceProvider?: Provider,\n destinationProvider?: Provider\n ): Promise<string> {\n return this.service.getAmountToBeReceivedFromChain(\n amountToSendFloat,\n sourceChainToken,\n destinationChainToken,\n messenger,\n sourceProvider,\n destinationProvider\n );\n }\n\n /**\n * Calculates the amount of tokens to be received as a result of transfer based on passed pool state.\n * @param amountToSendFloat the amount of tokens that will be sent\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param sourcePool source token pool state\n * @param destinationPool destination token pool state\n * @param messenger selected messenger\n */\n /** @deprecated Do not use. */\n getAmountToBeReceivedFromPools(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n sourcePool: PoolInfo,\n destinationPool: PoolInfo,\n messenger: Exclude<Messenger, Messenger.OFT>\n ): string;\n getAmountToBeReceivedFromPools(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n sourcePool: PoolInfo,\n destinationPool: PoolInfo,\n messenger: Exclude<Messenger, Messenger.OFT>\n ): string {\n switch (messenger) {\n case Messenger.ALLBRIDGE:\n case Messenger.WORMHOLE:\n return this.service.getAmountToBeReceivedComputeWithPools(\n amountToSendFloat,\n sourceChainToken,\n destinationChainToken,\n sourcePool,\n destinationPool\n );\n case Messenger.CCTP:\n case Messenger.CCTP_V2:\n return this.service.getAmountToBeReceivedComputeCctp(\n amountToSendFloat,\n sourceChainToken,\n destinationChainToken,\n messenger\n );\n case Messenger.X_RESERVE:\n return this.service.getAmountToBeReceivedComputeXReserve(\n amountToSendFloat,\n sourceChainToken,\n destinationChainToken\n );\n }\n }\n\n /**\n * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer\n * after applying the fee of the selected messenger.\n * @param amountToBeReceivedFloat the amount of tokens that should be received\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger selected messenger, see {@link ActiveMessenger}\n * @throws CCTPDoesNotSupportedError, OFTDoesNotSupportedError or SdkError if the route is not supported by the messenger\n */\n /** @deprecated Do not use. */\n getAmountToSend(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: LegacyMessenger\n ): Promise<string>;\n getAmountToSend(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: ActiveMessenger\n ): Promise<string>;\n async getAmountToSend(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n /**\n * The Messengers for different routes.\n */\n messenger: Messenger\n ): Promise<string> {\n return this.service.getAmountToSend(amountToBeReceivedFloat, sourceChainToken, destinationChainToken, messenger);\n }\n\n /**\n * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer based on actual blockchain pool state.\n * @param amountToBeReceivedFloat the amount of tokens that should be received\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger selected messenger\n * @param sourceProvider Optional. source chain Provider\n * @param destinationProvider Optional. destination chain Provider\n */\n /** @deprecated Do not use. */\n getAmountToSendFromChain(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger,\n sourceProvider?: Provider,\n destinationProvider?: Provider\n ): Promise<string>;\n async getAmountToSendFromChain(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n /**\n * The Messengers for different routes.\n */\n messenger: Messenger,\n sourceProvider?: Provider,\n destinationProvider?: Provider\n ): Promise<string> {\n return this.service.getAmountToSendFromChain(\n amountToBeReceivedFloat,\n sourceChainToken,\n destinationChainToken,\n messenger,\n sourceProvider,\n destinationProvider\n );\n }\n\n /**\n * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer based on passed pool state.\n * @param amountToBeReceivedFloat the amount of tokens that should be received\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param sourcePool source token pool state\n * @param destinationPool destination token pool state\n * @param messenger selected messenger\n */\n /** @deprecated Do not use. */\n getAmountToSendFromPools(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n sourcePool: PoolInfo,\n destinationPool: PoolInfo,\n messenger: Exclude<Messenger, Messenger.OFT>\n ): string;\n getAmountToSendFromPools(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n sourcePool: PoolInfo,\n destinationPool: PoolInfo,\n messenger: Exclude<Messenger, Messenger.OFT>\n ): string {\n switch (messenger) {\n case Messenger.ALLBRIDGE:\n case Messenger.WORMHOLE:\n return this.service.getAmountToSendComputeWithPools(\n amountToBeReceivedFloat,\n sourceChainToken,\n destinationChainToken,\n sourcePool,\n destinationPool\n );\n case Messenger.CCTP:\n case Messenger.CCTP_V2:\n return this.service.getAmountToSendComputeCctp(\n amountToBeReceivedFloat,\n sourceChainToken,\n destinationChainToken,\n messenger\n );\n case Messenger.X_RESERVE:\n return this.service.getAmountToSendComputeXReserve(\n amountToBeReceivedFloat,\n sourceChainToken,\n destinationChainToken\n );\n }\n }\n\n /**\n * Fetches possible ways to pay the transfer gas fee.\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger selected messenger, see {@link ActiveMessenger}\n * @returns {@link GasFeeOptions}\n */\n async getGasFeeOptions(\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger\n ): Promise<GasFeeOptions> {\n return this.service.getGasFeeOptions(sourceChainToken, destinationChainToken, messenger);\n }\n\n /**\n * Gets the average time in ms to complete a transfer for given tokens and messenger.\n * @param sourceChainToken selected token on the source chain.\n * @param destinationChainToken selected token on the destination chain.\n * @param messenger selected messenger, see {@link ActiveMessenger}\n * @returns Average transfer time in milliseconds or null if a given combination of tokens and messenger is not supported.\n */\n getAverageTransferTime(\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger\n ): number | null {\n return this.service.getAverageTransferTime(sourceChainToken, destinationChainToken, messenger);\n }\n\n /**\n * Gets information about the poolInfo by token\n * @deprecated Do not use.\n * @param token\n * @returns poolInfo\n */\n async getPoolInfoByToken(token: TokenWithChainDetails): Promise<PoolInfo> {\n return this.service.getPoolInfoByToken(token);\n }\n\n /**\n * Forces refresh of cached information about the state of liquidity pools.\n * Outdated cache leads to calculated amounts being less accurate.\n * The cache is invalidated at regular intervals, but it can be forced to be refreshed by calling this method.+\n *\n * @deprecated Do not use.\n * @param tokens if present, the corresponding liquidity pools will be updated\n */\n async refreshPoolInfo(tokens?: TokenWithChainDetails | TokenWithChainDetails[]): Promise<void> {\n return this.service.refreshPoolInfo(tokens);\n }\n\n /**\n * Convert APR to percentage view\n * @deprecated Do not use.\n * @param apr\n * @returns aprPercentageView\n */\n aprInPercents(apr: string): string {\n return this.service.aprInPercents(apr);\n }\n\n /**\n * Get possible limit of extra gas amount.\n * For {@link Messenger.X_RESERVE} extra gas is not supported and zero limits are returned.\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger selected messenger, see {@link ActiveMessenger}\n * @returns {@link ExtraGasMaxLimitResponse}\n */\n /** @deprecated Do not use. */\n getExtraGasMaxLimits(\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: LegacyMessenger\n ): Promise<ExtraGasMaxLimitResponse>;\n getExtraGasMaxLimits(\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: ActiveMessenger\n ): Promise<ExtraGasMaxLimitResponse>;\n async getExtraGasMaxLimits(\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger\n ): Promise<ExtraGasMaxLimitResponse> {\n return this.service.getExtraGasMaxLimits(sourceChainToken, destinationChainToken, messenger);\n }\n\n /**\n * @deprecated Do not use.\n * @param amount - amount\n * @param amountFormat - AmountFormat\n * @param sourceToken - selected token on the source chain\n * @return virtual amount\n */\n async getVUsdFromAmount(\n amount: string,\n amountFormat: AmountFormat,\n sourceToken: TokenWithChainDetails\n ): Promise<AmountFormatted> {\n return this.service.getVUsdFromAmount(amount, amountFormat, sourceToken);\n }\n\n /**\n * @deprecated Do not use.\n * @param vUsdAmount - amount of vUsd, int format\n * @param destToken selected token on the destination chain\n * @return amount of destToken\n */\n async getAmountFromVUsd(vUsdAmount: string, destToken: TokenWithChainDetails): Promise<AmountFormatted> {\n return this.service.getAmountFromVUsd(vUsdAmount, destToken);\n }\n\n /**\n * @deprecated Use {@link getSendAmountDetails}\n * @param amountInTokenPrecision\n * @param sourceToken\n * @param destToken\n */\n async swapAndBridgeFeeCalculation(\n amountInTokenPrecision: string,\n sourceToken: TokenWithChainDetails,\n destToken: TokenWithChainDetails\n ): Promise<SwapAndBridgeCalculationData> {\n return this.service.swapAndBridgeFeeCalculation(amountInTokenPrecision, sourceToken, destToken);\n }\n\n /**\n * @deprecated Use {@link getAmountToBeReceived} and then {@link getSendAmountDetails}\n * @param amountInTokenPrecision\n * @param sourceToken\n * @param destToken\n */\n async swapAndBridgeFeeCalculationReverse(\n amountInTokenPrecision: string,\n sourceToken: TokenWithChainDetails,\n destToken: TokenWithChainDetails\n ): Promise<SwapAndBridgeCalculationData> {\n return this.service.swapAndBridgeFeeCalculationReverse(amountInTokenPrecision, sourceToken, destToken);\n }\n\n /**\n * Show amount changes (fee and amount adjustment) during send through pools on source and destination chains\n * @deprecated Do not use.\n */\n async getSendAmountDetails(\n amount: string,\n amountFormat: AmountFormat,\n sourceToken: TokenWithChainDetails,\n destToken: TokenWithChainDetails\n ): Promise<SendAmountDetails> {\n return this.service.getSendAmountDetails(amount, amountFormat, sourceToken, destToken);\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAeL,SAAS,GAQV,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGxE,OAAO,EAAE,YAAY,EAAS,MAAM,SAAS,CAAC;AAE9C,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;A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AM,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IACzF,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/unified-signatures -- overloads intentionally expose route-specific deprecation metadata */\nimport { BigSource } from \"big.js\";\nimport { AdditionalBasicChainProperties } from \"./chains/models\";\nimport { mainnet } from \"./configs\";\nimport {\n ActiveMessenger,\n AmountFormat,\n AmountFormatted,\n AmountsAndGasFeeOptions,\n BridgeService,\n ChainDetailsMap,\n CheckAddressResponse,\n ExtraGasMaxLimitResponse,\n GasBalanceResponse,\n GasFeeOptions,\n GetNativeTokenBalanceParams,\n GetTokenBalanceParams,\n LiquidityPoolService,\n LegacyMessenger,\n Messenger,\n PendingStatusInfoResponse,\n PoolInfo,\n Provider,\n SendAmountDetails,\n SwapAndBridgeCalculationData,\n TokenWithChainDetails,\n TransferStatusResponse,\n} from \"./models\";\nimport { AllbridgeCoreSdkService, NodeRpcUrlsConfig } from \"./services\";\nimport { CctpParams } from \"./services/bridge/sol\";\nimport { YieldService } from \"./services/yield\";\nimport { DefaultUtils, Utils } from \"./utils\";\n\nexport * from \"./configs\";\nexport * from \"./models\";\n\nexport interface AllbridgeCoreSdkOptions {\n coreApiUrl: string;\n /**\n * A set of query parameters to be added to all requests to the Core API.\n */\n coreApiQueryParams?: Record<string, string>;\n /**\n * A set of headers to be added to all requests to the Core API.\n */\n coreApiHeaders?: Record<string, string>;\n /**\n * A function that returns headers to be added to a single Core API request.\n * It is evaluated right before each request\n */\n coreApiHeadersProvider?: () => Promise<Record<string, string> | undefined>;\n /**\n * Jupiter Swap Api</br>\n * Default: https://lite-api.jup.ag/swap/v1</br>\n * {@link https://dev.jup.ag/docs/swap-api/}\n */\n jupiterUrl: string;\n /**\n * Jupiter Api Key Header</br>\n * {@link https://dev.jup.ag/docs/api-setup}\n */\n jupiterApiKeyHeader?: string;\n /**\n * Jupiter v6 'maxAccounts' parameter</br>\n * Rough estimate of the max accounts to be used for the quote, so that you can compose with your own accounts</br>\n * {@link https://station.jup.ag/docs/apis/swap-api#using-maxaccounts}\n */\n jupiterMaxAccounts?: number;\n /**\n * @deprecated Do not use.\n */\n wormholeMessengerProgramId?: string;\n solanaLookUpTable: string;\n sorobanNetworkPassphrase: string;\n /**\n * Optional. Will be used in methods</br>\n * {@link LiquidityPoolService.getPoolInfoFromChain} and {@link LiquidityPoolService.getAmountToBeWithdrawn}</br>\n * to fetch information from the blockchain with fewer HTTP requests using JSON-RPC API\n * @deprecated Do not use.\n */\n tronJsonRpc?: string;\n /**\n * Solana CCTP / CCTP V2 program ids and CCTP domains, see {@link CctpParams}.\n * Required for transfers with {@link Messenger.CCTP} and {@link Messenger.CCTP_V2} from Solana.\n */\n cctpParams: CctpParams;\n /**\n * The number of seconds that pool information taken from the chain will be cached.\n *\n * @type {number}\n * @deprecated Do not use.\n */\n cachePoolInfoChainSec?: number;\n\n /**\n * @internal\n * Optional additional properties to merge with the default properties.\n */\n additionalChainsProperties?: Record<string, AdditionalBasicChainProperties>;\n\n suiIsTestnet?: boolean;\n\n stxIsTestnet?: boolean;\n stxHeroApiKey?: string;\n}\n\n/**\n * Type representing RPC node URLs for different blockchain chains.</br>\n * Provide node RPC URL for chain connection you intend to communicate with</br>\n * - required for SOL, TRX chains</br>\n * - optional for EVM chains -- you can interact by passing a {@link Provider} that will be used to communicate with the chain</br>\n * @typedef {Record<string, string>} NodeRpcUrls\n * @property {string} chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @property {string} rpcUrl - The RPC node URL for the specified chain.\n */\nexport type NodeRpcUrls = Record<string, string>;\n\n/**\n * @deprecated Use {@link NodeRpcUrls}\n */\nexport interface NodeUrlsConfig {\n solanaRpcUrl: string;\n tronRpcUrl: string;\n}\n\n/**\n * @deprecated Use {@link NodeRpcUrls}\n */\nfunction isNodeUrlsConfig(nodeUrls: NodeUrlsConfig | NodeRpcUrls): nodeUrls is NodeUrlsConfig {\n return \"solanaRpcUrl\" in nodeUrls;\n}\n\nexport class AllbridgeCoreSdk {\n readonly params: AllbridgeCoreSdkOptions;\n\n bridge: BridgeService;\n /**\n * @deprecated Do not use.\n */\n pool: LiquidityPoolService;\n /**\n * @deprecated Do not use.\n */\n yield: YieldService;\n utils: Utils;\n\n private service: AllbridgeCoreSdkService;\n\n /**\n * Initializes the SDK object.\n * @param nodeUrls node rpc urls for full functionality\n * @param params\n * Optional.\n * If not defined, the default {@link mainnet} parameters are used.\n */\n constructor(nodeUrls: NodeUrlsConfig | NodeRpcUrls, params: AllbridgeCoreSdkOptions = mainnet) {\n let nodeRpcUrlsConfig: NodeRpcUrlsConfig;\n if (isNodeUrlsConfig(nodeUrls)) {\n nodeRpcUrlsConfig = new NodeRpcUrlsConfig({ SOL: nodeUrls.solanaRpcUrl, TRX: nodeUrls.tronRpcUrl });\n } else {\n nodeRpcUrlsConfig = new NodeRpcUrlsConfig(nodeUrls);\n }\n this.service = new AllbridgeCoreSdkService(nodeRpcUrlsConfig, params);\n this.bridge = this.service.bridge;\n this.pool = this.service.pool;\n this.yield = this.service.yield;\n this.utils = new DefaultUtils(this.service);\n this.params = params;\n }\n\n /**\n * Returns {@link ChainDetailsMap} containing a list of tokens for liquidity pools operations grouped by chain.\n * @param type - 'pool'\n * @deprecated Do not use.\n */\n chainDetailsMap(type: \"pool\"): Promise<ChainDetailsMap>;\n /**\n * Returns {@link ChainDetailsMap} containing a list of supported tokens grouped by chain.\n * @param type - Optional. 'swap' (tokens to send) is the only supported value and the default.\n */\n chainDetailsMap(type?: \"swap\"): Promise<ChainDetailsMap>;\n /**\n * Returns {@link ChainDetailsMap} containing a list of supported tokens grouped by chain.\n * @param type - 'swap' for tokens to send. The 'pool' value (liquidity pools setup) is deprecated. Do not use.\n */\n chainDetailsMap(type: \"swap\" | \"pool\"): Promise<ChainDetailsMap>;\n async chainDetailsMap(type: \"swap\" | \"pool\" = \"swap\"): Promise<ChainDetailsMap> {\n return this.service.chainDetailsMap(type);\n }\n\n /**\n * Returns a list of {@link TokenWithChainDetails | tokens} for liquidity pools operations.\n * @param type - 'pool'\n * @deprecated Do not use.\n */\n tokens(type: \"pool\"): Promise<TokenWithChainDetails[]>;\n /**\n * Returns a list of supported {@link TokenWithChainDetails | tokens}.\n * @param type - Optional. 'swap' (tokens to send) is the only supported value and the default.\n * @returns A promise that resolves to an array of {@link TokenWithChainDetails}.\n */\n tokens(type?: \"swap\"): Promise<TokenWithChainDetails[]>;\n /**\n * Returns a list of supported {@link TokenWithChainDetails | tokens}.\n * @param type - 'swap' for tokens to send. The 'pool' value (liquidity pools operations) is deprecated. Do not use.\n * @returns A promise that resolves to an array of {@link TokenWithChainDetails}.\n */\n tokens(type: \"swap\" | \"pool\"): Promise<TokenWithChainDetails[]>;\n async tokens(type: \"swap\" | \"pool\" = \"swap\"): Promise<TokenWithChainDetails[]> {\n return this.service.tokens(type);\n }\n\n /**\n * Returns a list of {@link TokenWithChainDetails | tokens} for liquidity pools operations on the selected chain.\n * @param chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @param type - 'pool'\n * @deprecated Do not use.\n */\n tokensByChain(chainSymbol: string, type: \"pool\"): Promise<TokenWithChainDetails[]>;\n /**\n * Returns a list of supported {@link TokenWithChainDetails | tokens} on the selected chain.\n * @param chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @param type - Optional. 'swap' (tokens to send) is the only supported value and the default.\n */\n tokensByChain(chainSymbol: string, type?: \"swap\"): Promise<TokenWithChainDetails[]>;\n /**\n * Returns a list of supported {@link TokenWithChainDetails | tokens} on the selected chain.\n * @param chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @param type - 'swap' for tokens to send. The 'pool' value (liquidity pools operations) is deprecated. Do not use.\n */\n tokensByChain(chainSymbol: string, type: \"swap\" | \"pool\"): Promise<TokenWithChainDetails[]>;\n async tokensByChain(chainSymbol: string, type: \"swap\" | \"pool\" = \"swap\"): Promise<TokenWithChainDetails[]> {\n return this.service.tokensByChain(chainSymbol, type);\n }\n\n /**\n * Fetches information about tokens transfer by chosen chainSymbol and transaction Id from the Allbridge Core API.\n * @param chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @param txId\n */\n async getTransferStatus(chainSymbol: string, txId: string): Promise<TransferStatusResponse> {\n return this.service.getTransferStatus(chainSymbol, txId);\n }\n\n /**\n * Get gas balance\n * @param chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @param address\n */\n async getGasBalance(chainSymbol: string, address: string): Promise<GasBalanceResponse> {\n return this.service.getGasBalance(chainSymbol, address);\n }\n\n /**\n * Check address and show gas balance\n * @deprecated\n * @param _chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @param _recipientAddress\n * @param _tokenAddress\n */\n async checkAddress(\n _chainSymbol: string,\n _recipientAddress: string,\n _tokenAddress?: string\n ): Promise<CheckAddressResponse> {\n return await this.service.checkAddress();\n }\n\n /**\n * Returns information about pending transactions for the same destination chain and the amount of tokens can be received as a result of transfer considering pending transactions.\n * @deprecated Do not use.\n * @param amount the amount of tokens that will be sent\n * @param amountFormat amount format\n * @param sourceToken selected token transfer from\n * @param destToken selected token transfer to\n * @returns range of possible amount based on already pending transactions\n */\n async getPendingStatusInfo(\n amount: string,\n amountFormat: AmountFormat,\n sourceToken: TokenWithChainDetails,\n destToken: TokenWithChainDetails\n ): Promise<PendingStatusInfoResponse> {\n return this.service.getPendingStatusInfo(amount, amountFormat, sourceToken, destToken);\n }\n\n /**\n * Get token balance\n * @param params\n * @param provider\n * @returns Token balance\n */\n async getTokenBalance(params: GetTokenBalanceParams, provider?: Provider): Promise<string> {\n return this.service.getTokenBalance(params, provider);\n }\n\n /**\n * Get native (gas) token balance\n * @param params\n * @param provider\n * @returns Token balance\n */\n async getNativeTokenBalance(params: GetNativeTokenBalanceParams, provider?: Provider): Promise<AmountFormatted> {\n return this.service.getNativeTokenBalance(params, provider);\n }\n\n /**\n * @deprecated\n * Calculates the percentage of fee from the initial amount that is charged when swapping from the selected source chain.\n * (Does not include fee related to the destination chain. Does not include gas fee)\n * @param amountFloat initial amount of tokens to swap\n * @param sourceChainToken selected token on the source chain\n * @returns fee percent\n */\n async calculateFeePercentOnSourceChain(\n amountFloat: BigSource,\n sourceChainToken: TokenWithChainDetails\n ): Promise<number> {\n return this.service.calculateFeePercentOnSourceChain(amountFloat, sourceChainToken);\n }\n\n /**\n * @deprecated\n * Calculates the percentage of fee that is charged when swapping to the selected destination chain. The destination chain fee percent applies to the amount after the source chain fee.\n * (Does not include fee related to the source chain. Does not include gas fee)\n * @see {@link calculateFeePercentOnSourceChain}\n * @param amountFloat initial amount of tokens to swap\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @returns fee percent\n */\n async calculateFeePercentOnDestinationChain(\n amountFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails\n ): Promise<number> {\n return this.service.calculateFeePercentOnDestinationChain(amountFloat, sourceChainToken, destinationChainToken);\n }\n\n /**\n * Calculates the amount of tokens to be received as a result of transfer\n * and fetches {@link GasFeeOptions} which contains available ways to pay the gas fee.\n * @param amountToSendFloat the amount of tokens that will be sent\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger\n *\n * @deprecated Use {@link getGasFeeOptions} and {@link getAmountToBeReceived}.\n */\n async getAmountToBeReceivedAndGasFeeOptions(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger\n ): Promise<AmountsAndGasFeeOptions> {\n return this.service.getAmountToBeReceivedAndGasFeeOptions(\n amountToSendFloat,\n sourceChainToken,\n destinationChainToken,\n messenger\n );\n }\n\n /**\n * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer.\n * and fetches {@link GasFeeOptions} which contains available ways to pay the gas fee.\n * @param amountToBeReceivedFloat the amount of tokens that should be received\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger\n *\n * @deprecated Use {@link getGasFeeOptions} and {@link getAmountToSend}.\n */\n async getAmountToSendAndGasFeeOptions(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger\n ): Promise<AmountsAndGasFeeOptions> {\n return this.service.getAmountToSendAndGasFeeOptions(\n amountToBeReceivedFloat,\n sourceChainToken,\n destinationChainToken,\n messenger\n );\n }\n\n /**\n * Calculates the amount of tokens to be received as a result of transfer through a legacy messenger.\n * @param amountToSendFloat the amount of tokens that will be sent\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger {@link LegacyMessenger}\n * @deprecated Do not use.\n */\n getAmountToBeReceived(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: LegacyMessenger\n ): Promise<string>;\n /**\n * Calculates the amount of tokens to be received as a result of transfer\n * after applying the fee of the selected messenger.\n * @param amountToSendFloat the amount of tokens that will be sent\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger selected messenger, see {@link ActiveMessenger}\n * @throws CCTPDoesNotSupportedError, OFTDoesNotSupportedError or SdkError if the route is not supported by the messenger\n */\n getAmountToBeReceived(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: ActiveMessenger\n ): Promise<string>;\n async getAmountToBeReceived(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n /**\n * The Messengers for different routes.\n */\n messenger: Messenger\n ): Promise<string> {\n return this.service.getAmountToBeReceived(amountToSendFloat, sourceChainToken, destinationChainToken, messenger);\n }\n\n /**\n * Calculates the amount of tokens to be received as a result of transfer based on actual blockchain pool state.\n * @param amountToSendFloat the amount of tokens that will be sent\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger selected messenger\n * @param sourceProvider Optional. source chain Provider\n * @param destinationProvider Optional. destination chain Provider\n * @deprecated Do not use.\n */\n getAmountToBeReceivedFromChain(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger,\n sourceProvider?: Provider,\n destinationProvider?: Provider\n ): Promise<string>;\n async getAmountToBeReceivedFromChain(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n /**\n * The Messengers for different routes.\n */\n messenger: Messenger,\n sourceProvider?: Provider,\n destinationProvider?: Provider\n ): Promise<string> {\n return this.service.getAmountToBeReceivedFromChain(\n amountToSendFloat,\n sourceChainToken,\n destinationChainToken,\n messenger,\n sourceProvider,\n destinationProvider\n );\n }\n\n /**\n * Calculates the amount of tokens to be received as a result of transfer based on passed pool state.\n * @param amountToSendFloat the amount of tokens that will be sent\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param sourcePool source token pool state\n * @param destinationPool destination token pool state\n * @param messenger selected messenger\n * @deprecated Do not use.\n */\n getAmountToBeReceivedFromPools(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n sourcePool: PoolInfo,\n destinationPool: PoolInfo,\n messenger: Exclude<Messenger, Messenger.OFT>\n ): string;\n getAmountToBeReceivedFromPools(\n amountToSendFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n sourcePool: PoolInfo,\n destinationPool: PoolInfo,\n messenger: Exclude<Messenger, Messenger.OFT>\n ): string {\n switch (messenger) {\n case Messenger.ALLBRIDGE:\n case Messenger.WORMHOLE:\n return this.service.getAmountToBeReceivedComputeWithPools(\n amountToSendFloat,\n sourceChainToken,\n destinationChainToken,\n sourcePool,\n destinationPool\n );\n case Messenger.CCTP:\n case Messenger.CCTP_V2:\n return this.service.getAmountToBeReceivedComputeCctp(\n amountToSendFloat,\n sourceChainToken,\n destinationChainToken,\n messenger\n );\n case Messenger.X_RESERVE:\n return this.service.getAmountToBeReceivedComputeXReserve(\n amountToSendFloat,\n sourceChainToken,\n destinationChainToken\n );\n }\n }\n\n /**\n * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer through a legacy messenger.\n * @param amountToBeReceivedFloat the amount of tokens that should be received\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger {@link LegacyMessenger}\n * @deprecated Do not use.\n */\n getAmountToSend(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: LegacyMessenger\n ): Promise<string>;\n /**\n * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer\n * after applying the fee of the selected messenger.\n * @param amountToBeReceivedFloat the amount of tokens that should be received\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger selected messenger, see {@link ActiveMessenger}\n * @throws CCTPDoesNotSupportedError, OFTDoesNotSupportedError or SdkError if the route is not supported by the messenger\n */\n getAmountToSend(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: ActiveMessenger\n ): Promise<string>;\n async getAmountToSend(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n /**\n * The Messengers for different routes.\n */\n messenger: Messenger\n ): Promise<string> {\n return this.service.getAmountToSend(amountToBeReceivedFloat, sourceChainToken, destinationChainToken, messenger);\n }\n\n /**\n * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer based on actual blockchain pool state.\n * @param amountToBeReceivedFloat the amount of tokens that should be received\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger selected messenger\n * @param sourceProvider Optional. source chain Provider\n * @param destinationProvider Optional. destination chain Provider\n * @deprecated Do not use.\n */\n getAmountToSendFromChain(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger,\n sourceProvider?: Provider,\n destinationProvider?: Provider\n ): Promise<string>;\n async getAmountToSendFromChain(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n /**\n * The Messengers for different routes.\n */\n messenger: Messenger,\n sourceProvider?: Provider,\n destinationProvider?: Provider\n ): Promise<string> {\n return this.service.getAmountToSendFromChain(\n amountToBeReceivedFloat,\n sourceChainToken,\n destinationChainToken,\n messenger,\n sourceProvider,\n destinationProvider\n );\n }\n\n /**\n * Calculates the amount of tokens to send based on requested tokens amount be received as a result of transfer based on passed pool state.\n * @param amountToBeReceivedFloat the amount of tokens that should be received\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param sourcePool source token pool state\n * @param destinationPool destination token pool state\n * @param messenger selected messenger\n * @deprecated Do not use.\n */\n getAmountToSendFromPools(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n sourcePool: PoolInfo,\n destinationPool: PoolInfo,\n messenger: Exclude<Messenger, Messenger.OFT>\n ): string;\n getAmountToSendFromPools(\n amountToBeReceivedFloat: BigSource,\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n sourcePool: PoolInfo,\n destinationPool: PoolInfo,\n messenger: Exclude<Messenger, Messenger.OFT>\n ): string {\n switch (messenger) {\n case Messenger.ALLBRIDGE:\n case Messenger.WORMHOLE:\n return this.service.getAmountToSendComputeWithPools(\n amountToBeReceivedFloat,\n sourceChainToken,\n destinationChainToken,\n sourcePool,\n destinationPool\n );\n case Messenger.CCTP:\n case Messenger.CCTP_V2:\n return this.service.getAmountToSendComputeCctp(\n amountToBeReceivedFloat,\n sourceChainToken,\n destinationChainToken,\n messenger\n );\n case Messenger.X_RESERVE:\n return this.service.getAmountToSendComputeXReserve(\n amountToBeReceivedFloat,\n sourceChainToken,\n destinationChainToken\n );\n }\n }\n\n /**\n * Fetches possible ways to pay the transfer gas fee.\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger selected messenger, see {@link ActiveMessenger}\n * @returns {@link GasFeeOptions}\n */\n async getGasFeeOptions(\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger\n ): Promise<GasFeeOptions> {\n return this.service.getGasFeeOptions(sourceChainToken, destinationChainToken, messenger);\n }\n\n /**\n * Gets the average time in ms to complete a transfer for given tokens and messenger.\n * @param sourceChainToken selected token on the source chain.\n * @param destinationChainToken selected token on the destination chain.\n * @param messenger selected messenger, see {@link ActiveMessenger}\n * @returns Average transfer time in milliseconds or null if a given combination of tokens and messenger is not supported.\n */\n getAverageTransferTime(\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger\n ): number | null {\n return this.service.getAverageTransferTime(sourceChainToken, destinationChainToken, messenger);\n }\n\n /**\n * Gets information about the poolInfo by token\n * @deprecated Do not use.\n * @param token\n * @returns poolInfo\n */\n async getPoolInfoByToken(token: TokenWithChainDetails): Promise<PoolInfo> {\n return this.service.getPoolInfoByToken(token);\n }\n\n /**\n * Forces refresh of cached information about the state of liquidity pools.\n * Outdated cache leads to calculated amounts being less accurate.\n * The cache is invalidated at regular intervals, but it can be forced to be refreshed by calling this method.+\n *\n * @deprecated Do not use.\n * @param tokens if present, the corresponding liquidity pools will be updated\n */\n async refreshPoolInfo(tokens?: TokenWithChainDetails | TokenWithChainDetails[]): Promise<void> {\n return this.service.refreshPoolInfo(tokens);\n }\n\n /**\n * Convert APR to percentage view\n * @deprecated Do not use.\n * @param apr\n * @returns aprPercentageView\n */\n aprInPercents(apr: string): string {\n return this.service.aprInPercents(apr);\n }\n\n /**\n * Get possible limit of extra gas amount for a legacy messenger.\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger {@link LegacyMessenger}\n * @deprecated Do not use.\n */\n getExtraGasMaxLimits(\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: LegacyMessenger\n ): Promise<ExtraGasMaxLimitResponse>;\n /**\n * Get possible limit of extra gas amount.\n * For {@link Messenger.X_RESERVE} extra gas is not supported and zero limits are returned.\n * @param sourceChainToken selected token on the source chain\n * @param destinationChainToken selected token on the destination chain\n * @param messenger selected messenger, see {@link ActiveMessenger}\n * @returns {@link ExtraGasMaxLimitResponse}\n */\n getExtraGasMaxLimits(\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: ActiveMessenger\n ): Promise<ExtraGasMaxLimitResponse>;\n async getExtraGasMaxLimits(\n sourceChainToken: TokenWithChainDetails,\n destinationChainToken: TokenWithChainDetails,\n messenger: Messenger\n ): Promise<ExtraGasMaxLimitResponse> {\n return this.service.getExtraGasMaxLimits(sourceChainToken, destinationChainToken, messenger);\n }\n\n /**\n * @deprecated Do not use.\n * @param amount - amount\n * @param amountFormat - AmountFormat\n * @param sourceToken - selected token on the source chain\n * @return virtual amount\n */\n async getVUsdFromAmount(\n amount: string,\n amountFormat: AmountFormat,\n sourceToken: TokenWithChainDetails\n ): Promise<AmountFormatted> {\n return this.service.getVUsdFromAmount(amount, amountFormat, sourceToken);\n }\n\n /**\n * @deprecated Do not use.\n * @param vUsdAmount - amount of vUsd, int format\n * @param destToken selected token on the destination chain\n * @return amount of destToken\n */\n async getAmountFromVUsd(vUsdAmount: string, destToken: TokenWithChainDetails): Promise<AmountFormatted> {\n return this.service.getAmountFromVUsd(vUsdAmount, destToken);\n }\n\n /**\n * @deprecated Do not use.\n * @param amountInTokenPrecision\n * @param sourceToken\n * @param destToken\n */\n async swapAndBridgeFeeCalculation(\n amountInTokenPrecision: string,\n sourceToken: TokenWithChainDetails,\n destToken: TokenWithChainDetails\n ): Promise<SwapAndBridgeCalculationData> {\n return this.service.swapAndBridgeFeeCalculation(amountInTokenPrecision, sourceToken, destToken);\n }\n\n /**\n * @deprecated Do not use.\n * @param amountInTokenPrecision\n * @param sourceToken\n * @param destToken\n */\n async swapAndBridgeFeeCalculationReverse(\n amountInTokenPrecision: string,\n sourceToken: TokenWithChainDetails,\n destToken: TokenWithChainDetails\n ): Promise<SwapAndBridgeCalculationData> {\n return this.service.swapAndBridgeFeeCalculationReverse(amountInTokenPrecision, sourceToken, destToken);\n }\n\n /**\n * Show amount changes (fee and amount adjustment) during send through pools on source and destination chains\n * @deprecated Do not use.\n */\n async getSendAmountDetails(\n amount: string,\n amountFormat: AmountFormat,\n sourceToken: TokenWithChainDetails,\n destToken: TokenWithChainDetails\n ): Promise<SendAmountDetails> {\n return this.service.getSendAmountDetails(amount, amountFormat, sourceToken, destToken);\n }\n}\n"]}
@@ -13,7 +13,7 @@ export { TokenWithChainDetailsYield, CYDToken, YieldGetAllowanceParams, YieldChe
13
13
  export { RawYieldTransactionBuilder } from "../services/yield/raw-yield-transaction-builder";
14
14
  export { SwapAndBridgeCalculationData, SwapFromVUsdCalcResult, SwapToVUsdCalcResult, } from "../utils/calculation/swap-and-bridge-fee-calc";
15
15
  export { SendAmountDetails, AmountImpact } from "../utils/calculation/swap-and-bridge-details";
16
- export { PoolInfo, TokenCoreFields, TokenWithChainDetails, TransferTime, TxCostAmount, SuiAddresses, MessengerTransferTime, ChainDetailsMap, ChainDetailsWithTokens, } from "../tokens-info";
16
+ export { AbrPayerAvailability, AbrPayerChainInfo, PoolInfo, TokenCoreFields, XReserveTokenInfo, TokenWithChainDetails, TransferTime, TxCostAmount, SuiAddresses, MessengerTransferTime, ChainDetailsMap, ChainDetailsWithTokens, } from "../tokens-info";
17
17
  export { Utils } from "../utils";
18
18
  export { SrbUtils, TrustLineParams } from "../utils/srb";
19
19
  export { SolUtils } from "../utils/sol";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAGL,SAAS,EAKT,aAAa,GACd,MAAM,mCAAmC,CAAC;AAY3C,cAAc,0BAA0B,CAAC;AAEzC,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAmCzF,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAG/D,MAAM,CAAN,IAAY,gBAeX;AAfD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,mDAA+B,CAAA;IAE/B;;OAEG;IACH,kDAA8B,CAAA;IAE9B;;OAEG;IACH,oCAAgB,CAAA;AAClB,CAAC,EAfW,gBAAgB,KAAhB,gBAAgB,QAe3B;AAwCD;;;;GAIG;AACH,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB;;OAEG;IACH,2BAAW,CAAA;IACX;;OAEG;IACH,+BAAe,CAAA;AACjB,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB","sourcesContent":["export {\n ApproveParams as BridgeApproveParams,\n BaseSendParams,\n CheckAllowanceParams,\n GetAllowanceParams,\n GetTokenBalanceParams,\n SendParams,\n SwapParams,\n GetNativeTokenBalanceParams,\n} from \"../services/bridge/models/bridge.model\";\nexport { BridgeService } from \"../services/bridge/index\";\nexport { CctpParams, CctpDomains } from \"../services/bridge/sol\";\nexport { LiquidityPoolService } from \"../services/liquidity-pool/index\";\nexport {\n ActiveMessenger,\n LegacyMessenger,\n Messenger,\n TransferStatusResponse,\n BridgeTransaction,\n GasBalanceResponse,\n CheckAddressResponse,\n AddressStatus,\n} from \"../client/core-api/core-api.model\";\nexport { RawBridgeTransactionBuilder } from \"../services/bridge/raw-bridge-transaction-builder\";\nexport { RawPoolTransactionBuilder } from \"../services/liquidity-pool/raw-pool-transaction-builder\";\nexport {\n UserBalanceInfo,\n UserBalanceInfoDTO,\n LiquidityPoolsParams,\n LiquidityPoolsParamsWithAmount,\n ApproveParams as LiquidityPoolsApproveParams,\n CheckAllowanceParams as LiquidityPoolsCheckAllowanceParams,\n GetAllowanceParams as LiquidityPoolsGetAllowanceParams,\n} from \"../services/liquidity-pool/models/pool.model\";\nexport * from \"../services/models/index\";\nexport { YieldService } from \"../services/yield/index\";\nexport { assertYieldIsSupported, isYieldSupported } from \"../services/yield/validations\";\nexport {\n TokenWithChainDetailsYield,\n CYDToken,\n YieldGetAllowanceParams,\n YieldCheckAllowanceParams,\n YieldBalanceParams,\n YieldGetEstimatedAmountOnDepositParams,\n YieldGetWithdrawProportionAmountParams,\n YieldWithdrawAmount,\n YieldApproveParams,\n YieldDepositParams,\n YieldWithdrawParams,\n} from \"../services/yield/models/yield.model\";\nexport { RawYieldTransactionBuilder } from \"../services/yield/raw-yield-transaction-builder\";\nexport {\n SwapAndBridgeCalculationData,\n SwapFromVUsdCalcResult,\n SwapToVUsdCalcResult,\n} from \"../utils/calculation/swap-and-bridge-fee-calc\";\nexport { SendAmountDetails, AmountImpact } from \"../utils/calculation/swap-and-bridge-details\";\nexport {\n PoolInfo,\n TokenCoreFields,\n TokenWithChainDetails,\n TransferTime,\n TxCostAmount,\n SuiAddresses,\n MessengerTransferTime,\n ChainDetailsMap,\n ChainDetailsWithTokens,\n} from \"../tokens-info\";\nexport { Utils } from \"../utils\";\nexport { SrbUtils, TrustLineParams } from \"../utils/srb\";\nexport { SolUtils } from \"../utils/sol\";\nexport * from \"../exceptions\";\nexport { ChainSymbol, ChainType } from \"../chains/chain.enums\";\nexport { AdditionalBasicChainProperties, BasicChainProperties } from \"../chains/models\";\n\nexport enum FeePaymentMethod {\n /**\n * The fee is paid in the native currency of the source chain.\n */\n WITH_NATIVE_CURRENCY = \"native\",\n\n /**\n * The fee is paid with the stablecoin token.\n */\n WITH_STABLECOIN = \"stablecoin\",\n\n /**\n * The fee is paid with the ABR token.\n */\n WITH_ABR = \"abr\",\n}\n\n/**\n * @deprecated Do not use.\n */\nexport interface AmountsAndGasFeeOptions {\n /**\n * The floating point amount of tokens to be sent (not including gas fee).\n */\n amountToSendFloat: string;\n\n /**\n * The floating point amount of tokens to be received.\n */\n amountToBeReceivedFloat: string;\n\n /**\n * Available ways to pay the transfer gas fee and gas fee amount.\n */\n gasFeeOptions: GasFeeOptions;\n}\n\ntype GasFeeOptionsType = {\n [key in FeePaymentMethod]?: AmountFormatted;\n};\n\n/**\n * Describes available options of paying the gas fee and the amount to pay when using the corresponding method.\n *\n * For {@link FeePaymentMethod.WITH_NATIVE_CURRENCY} value contains the amount in the smallest denomination of the source chain currency\n *\n * For {@link FeePaymentMethod.WITH_STABLECOIN} value contains the amount in the smallest denomination of the source token\n */\nexport interface GasFeeOptions extends GasFeeOptionsType {\n [FeePaymentMethod.WITH_NATIVE_CURRENCY]: AmountFormatted;\n [FeePaymentMethod.WITH_STABLECOIN]?: AmountFormatted;\n [FeePaymentMethod.WITH_ABR]?: AmountFormatted;\n adminFeeShareWithExtras?: string;\n}\n\n/**\n * Define the type of amount data<p/>\n * Example:<p/>\n * \"1500000\" USDC {@link AmountFormat.INT} = \"1.5\" USDC {@link AmountFormat.FLOAT}, if USDC.decimals = 6\n */\nexport enum AmountFormat {\n /**\n * denominated in the smallest unit of the source token\n */\n INT = \"int\",\n /**\n * denominated in the unit of the source token\n */\n FLOAT = \"float\",\n}\n\n/**\n * Describes the same amount in two variation formats.\n *\n * For {@link AmountFormat.INT} value contains the amount in the smallest denomination\n *\n * For {@link AmountFormat.FLOAT} value contains the amount in tokens denomination\n */\nexport type AmountFormatted = {\n [key in AmountFormat]: string;\n};\n\n/**\n * Describes MAX extra gas value can to be passed when using the corresponding method.\n *\n * For {@link FeePaymentMethod.WITH_NATIVE_CURRENCY} value contains {@link ExtraGasMaxLimit} the amount of the source chain currency\n *\n * For {@link FeePaymentMethod.WITH_STABLECOIN} value contains {@link ExtraGasMaxLimit} the amount of the source token\n */\nexport type ExtraGasMaxLimits = {\n [key in FeePaymentMethod]?: ExtraGasMaxLimit;\n};\n\n/**\n * Describes the same MAX extra gas amount.\n */\nexport type ExtraGasMaxLimit = AmountFormatted;\n\n/**\n * Provide extra gas information\n */\nexport interface ExtraGasMaxLimitResponse {\n /**\n * See {@link ExtraGasMaxLimits}\n */\n extraGasMax: ExtraGasMaxLimits;\n /**\n * Information due to destination chain\n */\n destinationChain: {\n /**\n * gasAmountMax maximum amount you can receive as extra gas on dest chain\n */\n gasAmountMax: ExtraGasMaxLimit;\n /**\n * cost of swap tx on chain\n */\n swap: AmountFormatted;\n /**\n * cost of send tx on chain\n */\n transfer: AmountFormatted;\n };\n /**\n * Exchange rate\n */\n exchangeRate: string;\n /**\n * Exchange rate\n */\n abrExchangeRate?: string;\n /**\n * Source native token price\n */\n sourceNativeTokenPrice: string;\n}\n\n/**\n * Provide pending status information\n * @deprecated Do not use.\n */\nexport interface PendingStatusInfoResponse {\n /**\n * Number of pending transactions\n */\n pendingTxs: number;\n /**\n * Total amount of pending transactions\n */\n pendingAmount: AmountFormatted;\n /**\n * The amount of tokens can be received as a result of transfer considering pending transactions\n */\n estimatedAmount: { min: AmountFormatted; max: AmountFormatted };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAGL,SAAS,EAKT,aAAa,GACd,MAAM,mCAAmC,CAAC;AAY3C,cAAc,0BAA0B,CAAC;AAEzC,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAsCzF,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAG/D,MAAM,CAAN,IAAY,gBAeX;AAfD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,mDAA+B,CAAA;IAE/B;;OAEG;IACH,kDAA8B,CAAA;IAE9B;;OAEG;IACH,oCAAgB,CAAA;AAClB,CAAC,EAfW,gBAAgB,KAAhB,gBAAgB,QAe3B;AAwCD;;;;GAIG;AACH,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB;;OAEG;IACH,2BAAW,CAAA;IACX;;OAEG;IACH,+BAAe,CAAA;AACjB,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB","sourcesContent":["export {\n ApproveParams as BridgeApproveParams,\n BaseSendParams,\n CheckAllowanceParams,\n GetAllowanceParams,\n GetTokenBalanceParams,\n SendParams,\n SwapParams,\n GetNativeTokenBalanceParams,\n} from \"../services/bridge/models/bridge.model\";\nexport { BridgeService } from \"../services/bridge/index\";\nexport { CctpParams, CctpDomains } from \"../services/bridge/sol\";\nexport { LiquidityPoolService } from \"../services/liquidity-pool/index\";\nexport {\n ActiveMessenger,\n LegacyMessenger,\n Messenger,\n TransferStatusResponse,\n BridgeTransaction,\n GasBalanceResponse,\n CheckAddressResponse,\n AddressStatus,\n} from \"../client/core-api/core-api.model\";\nexport { RawBridgeTransactionBuilder } from \"../services/bridge/raw-bridge-transaction-builder\";\nexport { RawPoolTransactionBuilder } from \"../services/liquidity-pool/raw-pool-transaction-builder\";\nexport {\n UserBalanceInfo,\n UserBalanceInfoDTO,\n LiquidityPoolsParams,\n LiquidityPoolsParamsWithAmount,\n ApproveParams as LiquidityPoolsApproveParams,\n CheckAllowanceParams as LiquidityPoolsCheckAllowanceParams,\n GetAllowanceParams as LiquidityPoolsGetAllowanceParams,\n} from \"../services/liquidity-pool/models/pool.model\";\nexport * from \"../services/models/index\";\nexport { YieldService } from \"../services/yield/index\";\nexport { assertYieldIsSupported, isYieldSupported } from \"../services/yield/validations\";\nexport {\n TokenWithChainDetailsYield,\n CYDToken,\n YieldGetAllowanceParams,\n YieldCheckAllowanceParams,\n YieldBalanceParams,\n YieldGetEstimatedAmountOnDepositParams,\n YieldGetWithdrawProportionAmountParams,\n YieldWithdrawAmount,\n YieldApproveParams,\n YieldDepositParams,\n YieldWithdrawParams,\n} from \"../services/yield/models/yield.model\";\nexport { RawYieldTransactionBuilder } from \"../services/yield/raw-yield-transaction-builder\";\nexport {\n SwapAndBridgeCalculationData,\n SwapFromVUsdCalcResult,\n SwapToVUsdCalcResult,\n} from \"../utils/calculation/swap-and-bridge-fee-calc\";\nexport { SendAmountDetails, AmountImpact } from \"../utils/calculation/swap-and-bridge-details\";\nexport {\n AbrPayerAvailability,\n AbrPayerChainInfo,\n PoolInfo,\n TokenCoreFields,\n XReserveTokenInfo,\n TokenWithChainDetails,\n TransferTime,\n TxCostAmount,\n SuiAddresses,\n MessengerTransferTime,\n ChainDetailsMap,\n ChainDetailsWithTokens,\n} from \"../tokens-info\";\nexport { Utils } from \"../utils\";\nexport { SrbUtils, TrustLineParams } from \"../utils/srb\";\nexport { SolUtils } from \"../utils/sol\";\nexport * from \"../exceptions\";\nexport { ChainSymbol, ChainType } from \"../chains/chain.enums\";\nexport { AdditionalBasicChainProperties, BasicChainProperties } from \"../chains/models\";\n\nexport enum FeePaymentMethod {\n /**\n * The fee is paid in the native currency of the source chain.\n */\n WITH_NATIVE_CURRENCY = \"native\",\n\n /**\n * The fee is paid with the stablecoin token.\n */\n WITH_STABLECOIN = \"stablecoin\",\n\n /**\n * The fee is paid with the ABR token.\n */\n WITH_ABR = \"abr\",\n}\n\n/**\n * @deprecated Do not use.\n */\nexport interface AmountsAndGasFeeOptions {\n /**\n * The floating point amount of tokens to be sent (not including gas fee).\n */\n amountToSendFloat: string;\n\n /**\n * The floating point amount of tokens to be received.\n */\n amountToBeReceivedFloat: string;\n\n /**\n * Available ways to pay the transfer gas fee and gas fee amount.\n */\n gasFeeOptions: GasFeeOptions;\n}\n\ntype GasFeeOptionsType = {\n [key in FeePaymentMethod]?: AmountFormatted;\n};\n\n/**\n * Describes available options of paying the gas fee and the amount to pay when using the corresponding method.\n *\n * For {@link FeePaymentMethod.WITH_NATIVE_CURRENCY} value contains the amount in the smallest denomination of the source chain currency\n *\n * For {@link FeePaymentMethod.WITH_STABLECOIN} value contains the amount in the smallest denomination of the source token\n */\nexport interface GasFeeOptions extends GasFeeOptionsType {\n [FeePaymentMethod.WITH_NATIVE_CURRENCY]: AmountFormatted;\n [FeePaymentMethod.WITH_STABLECOIN]?: AmountFormatted;\n [FeePaymentMethod.WITH_ABR]?: AmountFormatted;\n adminFeeShareWithExtras?: string;\n}\n\n/**\n * Define the type of amount data<p/>\n * Example:<p/>\n * \"1500000\" USDC {@link AmountFormat.INT} = \"1.5\" USDC {@link AmountFormat.FLOAT}, if USDC.decimals = 6\n */\nexport enum AmountFormat {\n /**\n * denominated in the smallest unit of the source token\n */\n INT = \"int\",\n /**\n * denominated in the unit of the source token\n */\n FLOAT = \"float\",\n}\n\n/**\n * Describes the same amount in two variation formats.\n *\n * For {@link AmountFormat.INT} value contains the amount in the smallest denomination\n *\n * For {@link AmountFormat.FLOAT} value contains the amount in tokens denomination\n */\nexport type AmountFormatted = {\n [key in AmountFormat]: string;\n};\n\n/**\n * Describes MAX extra gas value can to be passed when using the corresponding method.\n *\n * For {@link FeePaymentMethod.WITH_NATIVE_CURRENCY} value contains {@link ExtraGasMaxLimit} the amount of the source chain currency\n *\n * For {@link FeePaymentMethod.WITH_STABLECOIN} value contains {@link ExtraGasMaxLimit} the amount of the source token\n */\nexport type ExtraGasMaxLimits = {\n [key in FeePaymentMethod]?: ExtraGasMaxLimit;\n};\n\n/**\n * Describes the same MAX extra gas amount.\n */\nexport type ExtraGasMaxLimit = AmountFormatted;\n\n/**\n * Provide extra gas information\n */\nexport interface ExtraGasMaxLimitResponse {\n /**\n * See {@link ExtraGasMaxLimits}\n */\n extraGasMax: ExtraGasMaxLimits;\n /**\n * Information due to destination chain\n */\n destinationChain: {\n /**\n * gasAmountMax maximum amount you can receive as extra gas on dest chain\n */\n gasAmountMax: ExtraGasMaxLimit;\n /**\n * cost of swap tx on chain\n */\n swap: AmountFormatted;\n /**\n * cost of send tx on chain\n */\n transfer: AmountFormatted;\n };\n /**\n * Exchange rate\n */\n exchangeRate: string;\n /**\n * Exchange rate\n */\n abrExchangeRate?: string;\n /**\n * Source native token price\n */\n sourceNativeTokenPrice: string;\n}\n\n/**\n * Provide pending status information\n * @deprecated Do not use.\n */\nexport interface PendingStatusInfoResponse {\n /**\n * Number of pending transactions\n */\n pendingTxs: number;\n /**\n * Total amount of pending transactions\n */\n pendingAmount: AmountFormatted;\n /**\n * The amount of tokens can be received as a result of transfer considering pending transactions\n */\n estimatedAmount: { min: AmountFormatted; max: AmountFormatted };\n}\n"]}
@@ -58,6 +58,9 @@ export type RawTransaction = RawTronTransaction | RawEvmTransaction | RawSoroban
58
58
  export type RawEvmTransaction = EssentialWeb3Transaction;
59
59
  export type RawTronTransaction = Types.Transaction;
60
60
  export type RawSorobanTransaction = string;
61
+ /**
62
+ * @deprecated Do not use.
63
+ */
61
64
  export type RawPoolSolanaTransaction = SolanaWeb3Transaction;
62
65
  export type RawBridgeSolanaTransaction = VersionedTransaction;
63
66
  export type RawSuiTransaction = string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/models/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgE,eAAe,EAAE,MAAM,OAAO,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\nimport { Transaction as SolanaWeb3Transaction, VersionedTransaction } from \"@solana/web3.js\";\nimport { Algodv2 } from \"algosdk\";\nimport { TronWeb, Types } from \"tronweb\";\nimport { SolanaTxFee } from \"./sol\";\n\nexport { SolanaTxFee, PricePerUnitInMicroLamports, ExtraFeeInLamports, SolanaAutoTxFee } from \"./sol\";\n\nexport interface SolanaTxFeeParams {\n /**\n * Transaction fee configuration.\n * If omitted, automatic fee calculation is used.\n */\n fee?: SolanaTxFee;\n\n /**\n * Covers transaction fees (including Accounts creation) by swapping stablecoin into the required native token.\n * Applicable only for {@link Messenger.ALLBRIDGE}.\n * @deprecated Do not use.\n */\n payTxFeeWithStablecoinSwap?: boolean;\n}\n\n/**\n * Blockchain fee params for tx\n */\nexport interface TxFeeParams {\n solana?: SolanaTxFee | SolanaTxFeeParams;\n}\n\n/**\n * The `EssentialWeb3` interface provides the minimum set of Web3 functionalities\n * required by the SDK. It allows any web3-like provider to be used, as long as it\n * matches the signature of these essential methods and properties. This prevents\n * tight coupling to a specific version of the `web3` library.\n */\nexport interface EssentialWeb3 {\n eth: {\n getBalance: (address: string) => Promise<any>;\n estimateGas: (tx: any) => Promise<any>;\n sendTransaction: (tx: any) => Promise<any>;\n Contract: new (abi: any, address?: string) => any;\n BatchRequest: new () => any;\n };\n}\n\n/**\n * The provider is type that combines connection implementations for different chains.<br/>\n * TIP: None provider in the Solana blockchain case.\n */\nexport type Provider = EssentialWeb3 | TronWeb | Algodv2;\n\n/**\n * The `EssentialWeb3Transaction` interface provides the minimum set of Web3 Transaction\n * returned by the SDK. It allows any web3-like provider to be used, as long as it\n * matches the signature of these essential interface. This prevents\n * tight coupling to a specific version of the `web3` library.\n */\nexport interface EssentialWeb3Transaction {\n from?: string;\n to?: string;\n value?: string;\n data?: string;\n}\n\nexport type RawTransaction =\n | RawTronTransaction\n | RawEvmTransaction\n | RawSorobanTransaction\n | RawAlgTransaction\n | RawStxTransaction\n | RawSuiTransaction\n | RawBridgeSolanaTransaction\n | RawPoolSolanaTransaction;\nexport type RawEvmTransaction = EssentialWeb3Transaction;\nexport type RawTronTransaction = Types.Transaction;\nexport type RawSorobanTransaction = string;\nexport type RawPoolSolanaTransaction = SolanaWeb3Transaction;\nexport type RawBridgeSolanaTransaction = VersionedTransaction;\nexport type RawSuiTransaction = string;\nexport type RawAlgTransaction = string[];\nexport type RawStxTransaction = string;\n\nexport interface SmartContractMethodParameter {\n type: string;\n value: string | number | Buffer;\n}\n\nexport interface TransactionResponse {\n txId: string;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/models/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgE,eAAe,EAAE,MAAM,OAAO,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\nimport { Transaction as SolanaWeb3Transaction, VersionedTransaction } from \"@solana/web3.js\";\nimport { Algodv2 } from \"algosdk\";\nimport { TronWeb, Types } from \"tronweb\";\nimport { SolanaTxFee } from \"./sol\";\n\nexport { SolanaTxFee, PricePerUnitInMicroLamports, ExtraFeeInLamports, SolanaAutoTxFee } from \"./sol\";\n\nexport interface SolanaTxFeeParams {\n /**\n * Transaction fee configuration.\n * If omitted, automatic fee calculation is used.\n */\n fee?: SolanaTxFee;\n\n /**\n * Covers transaction fees (including Accounts creation) by swapping stablecoin into the required native token.\n * Applicable only for {@link Messenger.ALLBRIDGE}.\n * @deprecated Do not use.\n */\n payTxFeeWithStablecoinSwap?: boolean;\n}\n\n/**\n * Blockchain fee params for tx\n */\nexport interface TxFeeParams {\n solana?: SolanaTxFee | SolanaTxFeeParams;\n}\n\n/**\n * The `EssentialWeb3` interface provides the minimum set of Web3 functionalities\n * required by the SDK. It allows any web3-like provider to be used, as long as it\n * matches the signature of these essential methods and properties. This prevents\n * tight coupling to a specific version of the `web3` library.\n */\nexport interface EssentialWeb3 {\n eth: {\n getBalance: (address: string) => Promise<any>;\n estimateGas: (tx: any) => Promise<any>;\n sendTransaction: (tx: any) => Promise<any>;\n Contract: new (abi: any, address?: string) => any;\n BatchRequest: new () => any;\n };\n}\n\n/**\n * The provider is type that combines connection implementations for different chains.<br/>\n * TIP: None provider in the Solana blockchain case.\n */\nexport type Provider = EssentialWeb3 | TronWeb | Algodv2;\n\n/**\n * The `EssentialWeb3Transaction` interface provides the minimum set of Web3 Transaction\n * returned by the SDK. It allows any web3-like provider to be used, as long as it\n * matches the signature of these essential interface. This prevents\n * tight coupling to a specific version of the `web3` library.\n */\nexport interface EssentialWeb3Transaction {\n from?: string;\n to?: string;\n value?: string;\n data?: string;\n}\n\nexport type RawTransaction =\n | RawTronTransaction\n | RawEvmTransaction\n | RawSorobanTransaction\n | RawAlgTransaction\n | RawStxTransaction\n | RawSuiTransaction\n | RawBridgeSolanaTransaction\n | RawPoolSolanaTransaction;\nexport type RawEvmTransaction = EssentialWeb3Transaction;\nexport type RawTronTransaction = Types.Transaction;\nexport type RawSorobanTransaction = string;\n/**\n * @deprecated Do not use.\n */\nexport type RawPoolSolanaTransaction = SolanaWeb3Transaction;\nexport type RawBridgeSolanaTransaction = VersionedTransaction;\nexport type RawSuiTransaction = string;\nexport type RawAlgTransaction = string[];\nexport type RawStxTransaction = string;\n\nexport interface SmartContractMethodParameter {\n type: string;\n value: string | number | Buffer;\n}\n\nexport interface TransactionResponse {\n txId: string;\n}\n"]}
@@ -6,10 +6,17 @@ import { Provider } from "../models";
6
6
  import { TokenService } from "../token";
7
7
  import { ChainYieldService, CYDToken, YieldBalanceParams, YieldCheckAllowanceParams, YieldGetAllowanceParams, YieldGetEstimatedAmountOnDepositParams, YieldGetWithdrawProportionAmountParams, YieldWithdrawAmount } from "./models";
8
8
  import { RawYieldTransactionBuilder } from "./raw-yield-transaction-builder";
9
+ /**
10
+ * @deprecated Do not use.
11
+ */
9
12
  export interface YieldService {
13
+ /**
14
+ * @deprecated Do not use.
15
+ */
10
16
  rawTxBuilder: RawYieldTransactionBuilder;
11
17
  /**
12
18
  * Returns a list of supported {@link CYDToken}.
19
+ * @deprecated Do not use.
13
20
  */
14
21
  getCYDTokens(): Promise<CYDToken[]>;
15
22
  /**
@@ -17,6 +24,7 @@ export interface YieldService {
17
24
  * @param provider - will be used to access the network
18
25
  * @param params See {@link YieldGetAllowanceParams}
19
26
  * @returns the amount of approved tokens
27
+ * @deprecated Do not use.
20
28
  */
21
29
  getAllowance(params: YieldGetAllowanceParams, provider?: Provider): Promise<string>;
22
30
  /**
@@ -24,6 +32,7 @@ export interface YieldService {
24
32
  * @param params See {@link YieldCheckAllowanceParams}
25
33
  * @param provider - will be used to access the network
26
34
  * @returns true if the amount of approved tokens is enough to make a transfer
35
+ * @deprecated Do not use.
27
36
  */
28
37
  checkAllowance(params: YieldCheckAllowanceParams, provider?: Provider): Promise<boolean>;
29
38
  /**
@@ -31,6 +40,7 @@ export interface YieldService {
31
40
  * @param params
32
41
  * @param provider
33
42
  * @returns Token balance
43
+ * @deprecated Do not use.
34
44
  */
35
45
  balanceOf(params: YieldBalanceParams, provider?: Provider): Promise<string>;
36
46
  /**
@@ -38,6 +48,7 @@ export interface YieldService {
38
48
  * @param params - will be used to access the network
39
49
  * @param provider - will be used to access the network
40
50
  * @returns amount
51
+ * @deprecated Do not use.
41
52
  */
42
53
  getEstimatedAmountOnDeposit(params: YieldGetEstimatedAmountOnDepositParams, provider?: Provider): Promise<string>;
43
54
  /**
@@ -45,9 +56,13 @@ export interface YieldService {
45
56
  * @param params
46
57
  * @param provider - will be used to access the network
47
58
  * @returns amounts
59
+ * @deprecated Do not use.
48
60
  */
49
61
  getWithdrawAmounts(params: YieldGetWithdrawProportionAmountParams, provider?: Provider): Promise<YieldWithdrawAmount[]>;
50
62
  }
63
+ /**
64
+ * @deprecated Do not use.
65
+ */
51
66
  export declare class DefaultYieldService implements YieldService {
52
67
  private api;
53
68
  private nodeRpcUrlsConfig;
@@ -62,4 +77,7 @@ export declare class DefaultYieldService implements YieldService {
62
77
  getEstimatedAmountOnDeposit(params: YieldGetEstimatedAmountOnDepositParams, provider?: Provider): Promise<string>;
63
78
  getWithdrawAmounts(params: YieldGetWithdrawProportionAmountParams, provider?: Provider): Promise<YieldWithdrawAmount[]>;
64
79
  }
80
+ /**
81
+ * @deprecated Do not use.
82
+ */
65
83
  export declare function getChainYieldService(chainSymbol: string, api: AllbridgeCoreClient, nodeRpcUrlsConfig: NodeRpcUrlsConfig, ownerAddress: string, provider?: Provider): ChainYieldService;
@@ -10,6 +10,9 @@ import { EvmYieldService } from "./evm";
10
10
  import { DefaultRawYieldTransactionBuilder } from "./raw-yield-transaction-builder";
11
11
  import { TronYieldService } from "./trx";
12
12
  import { isYieldSupported } from "./validations";
13
+ /**
14
+ * @deprecated Do not use.
15
+ */
13
16
  export class DefaultYieldService {
14
17
  api;
15
18
  nodeRpcUrlsConfig;
@@ -92,6 +95,9 @@ export class DefaultYieldService {
92
95
  }));
93
96
  }
94
97
  }
98
+ /**
99
+ * @deprecated Do not use.
100
+ */
95
101
  export function getChainYieldService(chainSymbol, api, nodeRpcUrlsConfig, ownerAddress, provider) {
96
102
  switch (Chains.getChainProperty(chainSymbol).chainType) {
97
103
  case ChainType.EVM: {