rango-sdk-basic 0.1.69 → 0.1.71

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.
@@ -347,47 +347,37 @@ function assetToString(asset) {
347
347
  return "" + asset.blockchain + (asset.symbol ? '.' + asset.symbol : '') + (asset.address ? '--' + asset.address : '');
348
348
  }
349
349
 
350
- var isEvmBlockchain = function isEvmBlockchain(blockchainMeta) {
351
- return blockchainMeta.type === 'EVM';
350
+ var isEvmBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'EVM'; };
351
+ var isCosmosBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'COSMOS'; };
352
+ var isSolanaBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'SOLANA'; };
353
+ var isTronBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'TRON'; };
354
+ var isTransferBlockchain = function (blockchainMeta) {
355
+ return blockchainMeta.type === 'TRANSFER';
352
356
  };
353
- var isCosmosBlockchain = function isCosmosBlockchain(blockchainMeta) {
354
- return blockchainMeta.type === 'COSMOS';
357
+ var isStarknetBlockchain = function (blockchainMeta) {
358
+ return blockchainMeta.type === 'STARKNET';
355
359
  };
356
- var isSolanaBlockchain = function isSolanaBlockchain(blockchainMeta) {
357
- return blockchainMeta.type === 'SOLANA';
360
+ var isTonBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'TON'; };
361
+ var evmBlockchains = function (blockchains) {
362
+ return blockchains.filter(isEvmBlockchain);
358
363
  };
359
- var isTronBlockchain = function isTronBlockchain(blockchainMeta) {
360
- return blockchainMeta.type === 'TRON';
364
+ var solanaBlockchain = function (blockchains) {
365
+ return blockchains.filter(isSolanaBlockchain);
361
366
  };
362
- var isTransferBlockchain = function isTransferBlockchain(blockchainMeta) {
363
- return blockchainMeta.type === 'TRANSFER';
367
+ var starknetBlockchain = function (blockchains) {
368
+ return blockchains.filter(isStarknetBlockchain);
364
369
  };
365
- var isStarknetBlockchain = function isStarknetBlockchain(blockchainMeta) {
366
- return blockchainMeta.type === 'STARKNET';
370
+ var tronBlockchain = function (blockchains) {
371
+ return blockchains.filter(isTronBlockchain);
367
372
  };
368
- var isTonBlockchain = function isTonBlockchain(blockchainMeta) {
369
- return blockchainMeta.type === 'TON';
373
+ var cosmosBlockchains = function (blockchains) {
374
+ return blockchains.filter(isCosmosBlockchain);
370
375
  };
371
- var evmBlockchains = function evmBlockchains(blockchains) {
372
- return blockchains.filter(isEvmBlockchain);
376
+ var transferBlockchains = function (blockchains) {
377
+ return blockchains.filter(isTransferBlockchain);
373
378
  };
374
- var solanaBlockchain = function solanaBlockchain(blockchains) {
375
- return blockchains.filter(isSolanaBlockchain);
376
- };
377
- var starknetBlockchain = function starknetBlockchain(blockchains) {
378
- return blockchains.filter(isStarknetBlockchain);
379
- };
380
- var tronBlockchain = function tronBlockchain(blockchains) {
381
- return blockchains.filter(isTronBlockchain);
382
- };
383
- var cosmosBlockchains = function cosmosBlockchains(blockchains) {
384
- return blockchains.filter(isCosmosBlockchain);
385
- };
386
- var transferBlockchains = function transferBlockchains(blockchains) {
387
- return blockchains.filter(isTransferBlockchain);
388
- };
389
- var tonBlockchain = function tonBlockchain(blockchains) {
390
- return blockchains.filter(isTonBlockchain);
379
+ var tonBlockchain = function (blockchains) {
380
+ return blockchains.filter(isTonBlockchain);
391
381
  };
392
382
 
393
383
  /**
@@ -395,60 +385,56 @@ var tonBlockchain = function tonBlockchain(blockchains) {
395
385
  *
396
386
  */
397
387
  (function (RoutingResultType) {
398
- RoutingResultType["OK"] = "OK";
399
- RoutingResultType["HIGH_IMPACT"] = "HIGH_IMPACT";
400
- RoutingResultType["NO_ROUTE"] = "NO_ROUTE";
401
- RoutingResultType["INPUT_LIMIT_ISSUE"] = "INPUT_LIMIT_ISSUE";
402
- RoutingResultType["HIGH_IMPACT_FOR_CREATE_TX"] = "HIGH_IMPACT_FOR_CREATE_TX";
388
+ RoutingResultType["OK"] = "OK";
389
+ RoutingResultType["HIGH_IMPACT"] = "HIGH_IMPACT";
390
+ RoutingResultType["NO_ROUTE"] = "NO_ROUTE";
391
+ RoutingResultType["INPUT_LIMIT_ISSUE"] = "INPUT_LIMIT_ISSUE";
392
+ RoutingResultType["HIGH_IMPACT_FOR_CREATE_TX"] = "HIGH_IMPACT_FOR_CREATE_TX";
403
393
  })(exports.RoutingResultType || (exports.RoutingResultType = {}));
404
394
 
405
395
  /**
406
396
  * The type of transaction
407
397
  */
408
398
  (function (TransactionType) {
409
- TransactionType["EVM"] = "EVM";
410
- TransactionType["TRANSFER"] = "TRANSFER";
411
- TransactionType["COSMOS"] = "COSMOS";
412
- TransactionType["SOLANA"] = "SOLANA";
413
- TransactionType["TRON"] = "TRON";
414
- TransactionType["STARKNET"] = "STARKNET";
415
- TransactionType["TON"] = "TON";
416
- TransactionType["SUI"] = "SUI";
417
- TransactionType["XRPL"] = "XRPL";
399
+ TransactionType["EVM"] = "EVM";
400
+ TransactionType["TRANSFER"] = "TRANSFER";
401
+ TransactionType["COSMOS"] = "COSMOS";
402
+ TransactionType["SOLANA"] = "SOLANA";
403
+ TransactionType["TRON"] = "TRON";
404
+ TransactionType["STARKNET"] = "STARKNET";
405
+ TransactionType["TON"] = "TON";
406
+ TransactionType["SUI"] = "SUI";
407
+ TransactionType["XRPL"] = "XRPL";
418
408
  })(exports.TransactionType || (exports.TransactionType = {}));
419
409
  (function (GenericTransactionType) {
420
- GenericTransactionType["EVM"] = "EVM";
421
- GenericTransactionType["TRANSFER"] = "TRANSFER";
422
- GenericTransactionType["COSMOS"] = "COSMOS";
423
- GenericTransactionType["SOLANA"] = "SOLANA";
410
+ GenericTransactionType["EVM"] = "EVM";
411
+ GenericTransactionType["TRANSFER"] = "TRANSFER";
412
+ GenericTransactionType["COSMOS"] = "COSMOS";
413
+ GenericTransactionType["SOLANA"] = "SOLANA";
424
414
  })(exports.GenericTransactionType || (exports.GenericTransactionType = {}));
425
415
  (function (TransactionStatus) {
426
- TransactionStatus["FAILED"] = "failed";
427
- TransactionStatus["RUNNING"] = "running";
428
- TransactionStatus["SUCCESS"] = "success";
416
+ TransactionStatus["FAILED"] = "failed";
417
+ TransactionStatus["RUNNING"] = "running";
418
+ TransactionStatus["SUCCESS"] = "success";
429
419
  })(exports.TransactionStatus || (exports.TransactionStatus = {}));
430
420
 
431
- var isCosmosTransaction = function isCosmosTransaction(transaction) {
432
- return transaction.type === exports.TransactionType.COSMOS;
421
+ var isCosmosTransaction = function (transaction) {
422
+ return transaction.type === exports.TransactionType.COSMOS;
433
423
  };
434
424
 
435
- var isSolanaTransaction = function isSolanaTransaction(transaction) {
436
- return transaction.type === exports.TransactionType.SOLANA;
425
+ var isSolanaTransaction = function (transaction) {
426
+ return transaction.type === exports.TransactionType.SOLANA;
437
427
  };
438
428
 
439
- var isTransferTransaction = function isTransferTransaction(transaction) {
440
- return transaction.type === exports.TransactionType.TRANSFER;
441
- };
429
+ var isTransferTransaction = function (transaction) { return transaction.type === exports.TransactionType.TRANSFER; };
442
430
 
443
431
  var TonChainID;
444
432
  (function (TonChainID) {
445
- TonChainID["MAINNET"] = "-239";
446
- TonChainID["TESTNET"] = "-3";
433
+ TonChainID["MAINNET"] = "-239";
434
+ TonChainID["TESTNET"] = "-3";
447
435
  })(TonChainID || (TonChainID = {}));
448
436
 
449
- var isEvmTransaction = function isEvmTransaction(transaction) {
450
- return transaction.type === exports.TransactionType.EVM;
451
- };
437
+ var isEvmTransaction = function (transaction) { return transaction.type === exports.TransactionType.EVM; };
452
438
 
453
439
  var RangoClient = /*#__PURE__*/function () {
454
440
  function RangoClient(apiKey, debug, apiUrl) {
@@ -1 +1 @@
1
- {"version":3,"file":"rango-sdk-basic.cjs.development.js","sources":["../src/types/api/common.ts","../../../node_modules/rango-types/src/api/shared/type-gaurds.ts","../../../node_modules/rango-types/src/api/shared/routing.ts","../../../node_modules/rango-types/src/api/shared/transactions.ts","../../../node_modules/rango-types/src/api/shared/txs/ton.ts","../src/services/client.ts"],"sourcesContent":["import { RequestedAsset } from 'rango-types/lib/api/basic'\nexport * from 'rango-types/lib/api/basic/common'\n\nexport function assetToString(asset: RequestedAsset): string {\n return `${asset.blockchain}${asset.symbol ? '.' + asset.symbol : ''}${\n asset.address ? '--' + asset.address : ''\n }`\n}\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n} from './meta.js'\n\nexport const isEvmBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is EvmBlockchainMeta => blockchainMeta.type === 'EVM'\n\nexport const isCosmosBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is CosmosBlockchainMeta => blockchainMeta.type === 'COSMOS'\n\nexport const isSolanaBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is SolanaBlockchainMeta => blockchainMeta.type === 'SOLANA'\n\nexport const isTronBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TronBlockchainMeta => blockchainMeta.type === 'TRON'\n\nexport const isTransferBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TransferBlockchainMeta =>\n blockchainMeta.type === 'TRANSFER'\n\nexport const isStarknetBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is StarkNetBlockchainMeta =>\n blockchainMeta.type === 'STARKNET'\n\nexport const isTonBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TonBlockchainMeta => blockchainMeta.type === 'TON'\n\nexport const evmBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isEvmBlockchain)\n\nexport const solanaBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isSolanaBlockchain)\n\nexport const starknetBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isStarknetBlockchain)\n\nexport const tronBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTronBlockchain)\n\nexport const cosmosBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isCosmosBlockchain)\n\nexport const transferBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTransferBlockchain)\n\nexport const tonBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTonBlockchain)\n","/**\n * Routing Result Type\n *\n */\nexport enum RoutingResultType {\n OK = 'OK',\n HIGH_IMPACT = 'HIGH_IMPACT',\n NO_ROUTE = 'NO_ROUTE',\n INPUT_LIMIT_ISSUE = 'INPUT_LIMIT_ISSUE',\n HIGH_IMPACT_FOR_CREATE_TX = 'HIGH_IMPACT_FOR_CREATE_TX',\n}\n","/**\n * The type of transaction\n */\nexport enum TransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n TRON = 'TRON',\n STARKNET = 'STARKNET',\n TON = 'TON',\n SUI = 'SUI',\n XRPL = 'XRPL',\n}\n\n/**\n * The type of transaction\n * @deprecated use TransactionType instead\n */\nexport enum GenericTransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n}\n\n/**\n * A transaction's url that can be displayed to advanced user to track the progress\n *\n * @property {string} url - Url of the transaction in blockchain explorer. example: https://etherscan.io/tx/0xa1a3...\n * @property {string | null} description - A custom display name to help user distinguish the transactions from each\n * other. Example: Inbound, Outbound, Bridge, or null\n *\n */\nexport type SwapExplorerUrl = {\n description: string | null\n url: string\n}\n\n/**\n * APIErrorCode\n *\n * Error code of a swap failure\n *\n */\nexport type APIErrorCode =\n | 'TX_FAIL'\n | 'TX_EXPIRED'\n | 'FETCH_TX_FAILED'\n | 'USER_REJECT'\n | 'USER_CANCEL'\n | 'USER_CANCELED_TX'\n | 'CALL_WALLET_FAILED'\n | 'SEND_TX_FAILED'\n | 'CALL_OR_SEND_FAILED'\n | 'TX_FAILED_IN_BLOCKCHAIN'\n | 'CLIENT_UNEXPECTED_BEHAVIOUR'\n | 'INSUFFICIENT_APPROVE'\n\n/**\n * The function checks if a given string value is a valid API error code.\n * @param {string} value - a string that represents a possible API error code.\n * @returns A boolean value is being returned, indicating whether the input `value` is of type\n * `APIErrorCode` or not.\n */\nexport function isAPIErrorCode(value: string): value is APIErrorCode {\n return [\n 'TX_FAIL',\n 'TX_EXPIRED',\n 'FETCH_TX_FAILED',\n 'USER_REJECT',\n 'USER_CANCEL',\n 'USER_CANCELED_TX',\n 'CALL_WALLET_FAILED',\n 'SEND_TX_FAILED',\n 'CALL_OR_SEND_FAILED',\n 'TX_FAILED_IN_BLOCKCHAIN',\n 'CLIENT_UNEXPECTED_BEHAVIOUR',\n 'INSUFFICIENT_APPROVE',\n ].includes(value)\n}\n\n/**\n * ReportTransactionRequest\n *\n * It should be used when an error happened in client and we want to inform server that transaction failed,\n * E.g. user rejected the transaction dialog or and an RPC error raised during signing tx by user.\n *\n * @property {string} requestId - The requestId from best route endpoint\n * @property {APIErrorCode} eventType - Type of the event that happened, example: USER_REJECT\n * @property {number} [step] - Step number in which failure happened\n * @property {string} [reason] - Reason or message for the error\n * @property {[key: string]: string} [data] - @deprecated A list of key-value for extra details\n * @property {wallet?: string, errorCode? string} [tags] - A list of key-value for pre-defined tags\n *\n */\nexport type ReportTransactionRequest = {\n requestId: string\n eventType: APIErrorCode\n step?: number\n reason?: string\n data?: { [key: string]: string }\n tags?: { wallet?: string; errorCode?: string }\n}\n\n/**\n * The status of transaction in tracking\n */\nexport enum TransactionStatus {\n FAILED = 'failed',\n RUNNING = 'running',\n SUCCESS = 'success',\n}\n\n/**\n * Response body of check-approval\n * You could stop check approval if:\n * 1- approved successfully\n * => isApproved = true\n * 2- approval transaction failed\n * => isApproved = false && txStatus === 'failed'\n * 3- approval transaction succeeded but currentApprovedAmount is still less than requiredApprovedAmount\n * (e.g. user changed transaction data and enter another approve amount in MetaMask)\n * => isApproved = false && txStatus == 'success'\n *\n * @property {boolean} isApproved - A flag which indicates that the approve tx is done or not\n * @property {TransactionStatus | null} txStatus - Status of approve transaction in blockchain,\n * if isArppoved is false and txStatus is failed, it seems that approve transaction failed in blockchain\n * @property {string | null} requiredApprovedAmount - required amount to be approved by user\n * @property {string | null} currentApprovedAmount - current approved amount by user\n *\n */\nexport type CheckApprovalResponse = {\n isApproved: boolean\n txStatus: TransactionStatus | null\n requiredApprovedAmount: string | null\n currentApprovedAmount: string | null\n}\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport enum TonChainID {\n MAINNET = '-239',\n TESTNET = '-3',\n}\n\n/**\n * @property {string} address - Receiver's address\n * @property {string} amount - Amount to send in nanoTon\n * @property {string} [stateInit] - Contract specific data to add to the transaction\n * @property {string} [payload] - Contract specific data to add to the transaction\n */\nexport interface TonMessage {\n address: string\n amount: string\n stateInit?: string\n payload?: string\n}\n\n/**\n * This type of transaction is used for all Ton transactions\n *\n * @property {TransactionType} type - This field equals to TON for all Ton transactions\n * @property {number} validUntil - Sending transaction deadline in unix epoch seconds\n * @property {TonChainID} [network] - The network (mainnet or testnet) where DApp intends to send the transaction. If not set, the transaction is sent to the network currently set in the wallet, but this is not safe and DApp should always strive to set the network. If the network parameter is set, but the wallet has a different network set, the wallet should show an alert and DO NOT ALLOW TO SEND this transaction\n * @property {string} [from] - The sender address in '<wc>:<hex>' format from which DApp intends to send the transaction. Current account.address by default\n * @property {TonMessage[]} messages - Messages to send: min is 1, max is 4\n */\nexport interface TonTransaction extends BaseTransaction {\n type: TransactionType.TON\n validUntil: number\n network?: TonChainID\n from?: string\n messages: TonMessage[]\n}\n\nexport const isTonTransaction = (transaction: {\n type: TransactionType\n}): transaction is TonTransaction => transaction.type === TransactionType.TON\n","import uuid from 'uuid-random'\n\nimport {\n MetaRequest,\n MetaResponse,\n QuoteRequest,\n QuoteResponse,\n CheckApprovalResponse,\n StatusRequest,\n StatusResponse,\n SwapRequest,\n SwapResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n assetToString,\n BlockchainMeta,\n RequestOptions,\n MessagingProtocolsResponse,\n SwapperMetaExtended,\n ConnectedAssetsResponse,\n ConnectedAssetsRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceRequest,\n TokenBalanceResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddress = { blockchain: string; address: string }\n\nexport class RangoClient {\n private readonly deviceId: string\n private readonly apiKey: string\n private readonly apiUrl: string\n private readonly httpService: AxiosInstance\n\n constructor(apiKey: string, debug = false, apiUrl?: string) {\n this.apiUrl = apiUrl || 'https://api.rango.exchange'\n this.apiKey = apiKey\n try {\n if (typeof window !== 'undefined') {\n const deviceId = localStorage.getItem('deviceId')\n if (deviceId) {\n this.deviceId = deviceId\n } else {\n const generatedId = uuid()\n localStorage.setItem('deviceId', generatedId)\n this.deviceId = generatedId\n }\n } else {\n this.deviceId = uuid()\n }\n } catch (e) {\n this.deviceId = uuid()\n }\n this.httpService = axios.create({\n baseURL: this.apiUrl,\n })\n if (debug) {\n this.httpService.interceptors.request.use((request) => {\n console.log('Starting Request', JSON.stringify(request, null, 2))\n return request\n })\n this.httpService.interceptors.response.use((response) => {\n console.log('Response:', JSON.stringify(response, null, 2))\n return response\n })\n }\n }\n\n public async meta(\n metaRequest?: MetaRequest,\n options?: RequestOptions\n ): Promise<MetaResponse> {\n const params = {\n ...metaRequest,\n blockchains: metaRequest?.blockchains?.join(),\n swappers: metaRequest?.swappers?.join(),\n swappersGroups: metaRequest?.swappersGroups?.join(),\n transactionTypes: metaRequest?.transactionTypes?.join(),\n }\n const axiosResponse = await this.httpService.get<MetaResponse>(\n `/basic/meta?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async chains(options?: RequestOptions): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/basic/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async swappers(options?: RequestOptions): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/basic/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async messagingProtocols(\n options?: RequestOptions\n ): Promise<MessagingProtocolsResponse> {\n const axiosResponse =\n await this.httpService.get<MessagingProtocolsResponse>(\n `/basic/meta/messaging-protocols?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n\n public async token(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/basic/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async quote(\n quoteRequest: QuoteRequest,\n options?: RequestOptions\n ): Promise<QuoteResponse> {\n const body = {\n ...quoteRequest,\n from: assetToString(quoteRequest.from),\n to: assetToString(quoteRequest.to),\n swappers:\n !!quoteRequest.swappers && quoteRequest.swappers.length > 0\n ? quoteRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!quoteRequest.swapperGroups && quoteRequest.swapperGroups.length > 0\n ? quoteRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!quoteRequest.messagingProtocols &&\n quoteRequest.messagingProtocols.length > 0\n ? quoteRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<QuoteResponse>(\n `/basic/quote?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async isApproved(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/basic/is-approved?apiKey=${this.apiKey}`,\n {\n params: { requestId, txId },\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async status(\n statusRequest: StatusRequest,\n options?: RequestOptions\n ): Promise<StatusResponse> {\n const axiosResponse = await this.httpService.get<StatusResponse>(\n `/basic/status?apiKey=${this.apiKey}`,\n {\n params: statusRequest,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async swap(\n swapRequest: SwapRequest,\n options?: RequestOptions\n ): Promise<SwapResponse> {\n const body = {\n ...swapRequest,\n from: assetToString(swapRequest.from),\n to: assetToString(swapRequest.to),\n referrerAddress: swapRequest.referrerAddress || null,\n referrerFee: swapRequest.referrerFee || null,\n disableEstimate: swapRequest.disableEstimate || false,\n swappers:\n !!swapRequest.swappers && swapRequest.swappers.length > 0\n ? swapRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!swapRequest.swapperGroups && swapRequest.swapperGroups.length > 0\n ? swapRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!swapRequest.messagingProtocols &&\n swapRequest.messagingProtocols.length > 0\n ? swapRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<SwapResponse>(\n `/basic/swap?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async reportFailure(\n requestBody: ReportTransactionRequest,\n options?: RequestOptions\n ): Promise<void> {\n await this.httpService.post(\n `/basic/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n }\n\n public async balance(\n walletAddress: WalletAddress,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/basic/balance?apiKey=${this.apiKey}`,\n {\n params: walletAddress,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async tokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/basic/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async connectedAssets(\n connectedAssetsRequest: ConnectedAssetsRequest,\n options?: RequestOptions\n ): Promise<ConnectedAssetsResponse> {\n const body = {\n from: assetToString(connectedAssetsRequest.from),\n }\n\n const axiosResponse = await this.httpService.get<ConnectedAssetsResponse>(\n `/basic/connected-assets?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n}\n"],"names":["assetToString","asset","blockchain","symbol","address","isEvmBlockchain","blockchainMeta","RangoClient","apiKey","debug","apiUrl","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","interceptors","request","use","console","log","JSON","stringify","response","_proto","prototype","meta","_meta","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","axiosResponse","wrap","_callee$","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","sent","abrupt","data","stop","_x","_x2","apply","arguments","chains","_chains","_callee2","_callee2$","_context2","_x3","_swappers","_callee3","_callee3$","_context3","_x4","messagingProtocols","_messagingProtocols","_callee4","_callee4$","_context4","_x5","token","_token","_callee5","customTokenRequest","_callee5$","_context5","_x6","_x7","quote","_quote","_callee6","quoteRequest","body","_callee6$","_context6","from","to","length","undefined","swapperGroups","headers","_x8","_x9","isApproved","_isApproved","_callee7","requestId","txId","_callee7$","_context7","_x10","_x11","_x12","status","_status","_callee8","statusRequest","_callee8$","_context8","_x13","_x14","swap","_swap","_callee9","swapRequest","_callee9$","_context9","referrerAddress","referrerFee","disableEstimate","_x15","_x16","reportFailure","_reportFailure","_callee10","requestBody","_callee10$","_context10","post","_x17","_x18","balance","_balance","_callee11","walletAddress","_callee11$","_context11","_x19","_x20","tokenBalance","_tokenBalance","_callee12","tokenBalanceRequest","_callee12$","_context12","_x21","_x22","connectedAssets","_connectedAssets","_callee13","connectedAssetsRequest","_callee13$","_context13","_x23","_x24"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAGgBA,aAAaA,CAACC,KAAqB;EACjD,YAAUA,KAAK,CAACC,UAAU,IAAGD,KAAK,CAACE,MAAM,GAAG,GAAG,GAAGF,KAAK,CAACE,MAAM,GAAG,EAAE,KACjEF,KAAK,CAACG,OAAO,GAAG,IAAI,GAAGH,KAAK,CAACG,OAAO,GAAG,EACzC;AACF;;mBCkC8B,2BAAAC;;;qDAIUC;;;AAGtC;;;AAKF;;;yDAI0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzD1C;;;;AAIA,AAAA;gCAAY;;;;;;;ACJZ;;;AAGA,AAAA;;;;;;;;;;;AAYA,AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACmBA;;;;;;ICRaC,WAAW;EAMtB,SAAAA,YAAYC,MAAc,EAAEC,KAAK,EAAUC,MAAe;QAA9BD,KAAK;MAALA,KAAK,GAAG,KAAK;;IACvC,IAAI,CAACC,MAAM,GAAGA,MAAM,IAAI,4BAA4B;IACpD,IAAI,CAACF,MAAM,GAAGA,MAAM;IACpB,IAAI;MACF,IAAI,OAAOG,MAAM,KAAK,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H,IAAA,GAAAoH,UAAA,CAAAnH,IAAA;UAAA;YAElB6C,IAAI,GAAG;cACXG,IAAI,EAAEnG,aAAa,CAACoK,sBAAsB,CAACjE,IAAI;aAChD;YAAAmE,UAAA,CAAAnH,IAAA;YAAA,OAE2B,IAAI,CAAChC,WAAW,CAACuC,GAAG,qCACZ,IAAI,CAAClD,MAAM,EAAA4C,QAAA;cAE3CP,MAAM,EAAEmD,IAAI;cACZQ,OAAO,EAAE;gBAAE,YAAY,EAAE,IAAI,CAAC5F;;eAC3B4B,OAAO,CACX,CACF;UAAA;YAPKM,aAAa,GAAAwH,UAAA,CAAA3G,IAAA;YAAA,OAAA2G,UAAA,CAAA1G,MAAA,WAQZd,aAAa,CAACe,IAAI;UAAA;UAAA;YAAA,OAAAyG,UAAA,CAAAxG,IAAA;;SAAAqG,SAAA;KAC1B;IAAA,SAAAF,gBAAAM,IAAA,EAAAC,IAAA;MAAA,OAAAN,gBAAA,CAAAjG,KAAA,OAAAC,SAAA;;IAAA,OAAA+F,eAAA;;EAAA,OAAA1J,WAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"rango-sdk-basic.cjs.development.js","sources":["../src/types/api/common.ts","../node_modules/rango-types/src/api/shared/type-gaurds.ts","../node_modules/rango-types/src/api/shared/routing.ts","../node_modules/rango-types/src/api/shared/transactions.ts","../node_modules/rango-types/src/api/shared/txs/cosmos.ts","../node_modules/rango-types/src/api/shared/txs/solana.ts","../node_modules/rango-types/src/api/shared/txs/transfer.ts","../node_modules/rango-types/src/api/shared/txs/ton.ts","../node_modules/rango-types/src/api/basic/txs/evm.ts","../src/services/client.ts"],"sourcesContent":["import { RequestedAsset } from 'rango-types/lib/api/basic'\nexport * from 'rango-types/lib/api/basic/common'\n\nexport function assetToString(asset: RequestedAsset): string {\n return `${asset.blockchain}${asset.symbol ? '.' + asset.symbol : ''}${\n asset.address ? '--' + asset.address : ''\n }`\n}\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n} from './meta.js'\n\nexport const isEvmBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is EvmBlockchainMeta => blockchainMeta.type === 'EVM'\n\nexport const isCosmosBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is CosmosBlockchainMeta => blockchainMeta.type === 'COSMOS'\n\nexport const isSolanaBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is SolanaBlockchainMeta => blockchainMeta.type === 'SOLANA'\n\nexport const isTronBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TronBlockchainMeta => blockchainMeta.type === 'TRON'\n\nexport const isTransferBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TransferBlockchainMeta =>\n blockchainMeta.type === 'TRANSFER'\n\nexport const isStarknetBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is StarkNetBlockchainMeta =>\n blockchainMeta.type === 'STARKNET'\n\nexport const isTonBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TonBlockchainMeta => blockchainMeta.type === 'TON'\n\nexport const evmBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isEvmBlockchain)\n\nexport const solanaBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isSolanaBlockchain)\n\nexport const starknetBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isStarknetBlockchain)\n\nexport const tronBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTronBlockchain)\n\nexport const cosmosBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isCosmosBlockchain)\n\nexport const transferBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTransferBlockchain)\n\nexport const tonBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTonBlockchain)\n","/**\n * Routing Result Type\n *\n */\nexport enum RoutingResultType {\n OK = 'OK',\n HIGH_IMPACT = 'HIGH_IMPACT',\n NO_ROUTE = 'NO_ROUTE',\n INPUT_LIMIT_ISSUE = 'INPUT_LIMIT_ISSUE',\n HIGH_IMPACT_FOR_CREATE_TX = 'HIGH_IMPACT_FOR_CREATE_TX',\n}\n","/**\n * The type of transaction\n */\nexport enum TransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n TRON = 'TRON',\n STARKNET = 'STARKNET',\n TON = 'TON',\n SUI = 'SUI',\n XRPL = 'XRPL',\n}\n\n/**\n * The type of transaction\n * @deprecated use TransactionType instead\n */\nexport enum GenericTransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n}\n\n/**\n * A transaction's url that can be displayed to advanced user to track the progress\n *\n * @property {string} url - Url of the transaction in blockchain explorer. example: https://etherscan.io/tx/0xa1a3...\n * @property {string | null} description - A custom display name to help user distinguish the transactions from each\n * other. Example: Inbound, Outbound, Bridge, or null\n *\n */\nexport type SwapExplorerUrl = {\n description: string | null\n url: string\n}\n\n/**\n * APIErrorCode\n *\n * Error code of a swap failure\n *\n */\nexport type APIErrorCode =\n | 'TX_FAIL'\n | 'TX_EXPIRED'\n | 'FETCH_TX_FAILED'\n | 'USER_REJECT'\n | 'USER_CANCEL'\n | 'USER_CANCELED_TX'\n | 'CALL_WALLET_FAILED'\n | 'SEND_TX_FAILED'\n | 'CALL_OR_SEND_FAILED'\n | 'TX_FAILED_IN_BLOCKCHAIN'\n | 'CLIENT_UNEXPECTED_BEHAVIOUR'\n | 'INSUFFICIENT_APPROVE'\n\n/**\n * The function checks if a given string value is a valid API error code.\n * @param {string} value - a string that represents a possible API error code.\n * @returns A boolean value is being returned, indicating whether the input `value` is of type\n * `APIErrorCode` or not.\n */\nexport function isAPIErrorCode(value: string): value is APIErrorCode {\n return [\n 'TX_FAIL',\n 'TX_EXPIRED',\n 'FETCH_TX_FAILED',\n 'USER_REJECT',\n 'USER_CANCEL',\n 'USER_CANCELED_TX',\n 'CALL_WALLET_FAILED',\n 'SEND_TX_FAILED',\n 'CALL_OR_SEND_FAILED',\n 'TX_FAILED_IN_BLOCKCHAIN',\n 'CLIENT_UNEXPECTED_BEHAVIOUR',\n 'INSUFFICIENT_APPROVE',\n ].includes(value)\n}\n\n/**\n * ReportTransactionRequest\n *\n * It should be used when an error happened in client and we want to inform server that transaction failed,\n * E.g. user rejected the transaction dialog or and an RPC error raised during signing tx by user.\n *\n * @property {string} requestId - The requestId from best route endpoint\n * @property {APIErrorCode} eventType - Type of the event that happened, example: USER_REJECT\n * @property {number} [step] - Step number in which failure happened\n * @property {string} [reason] - Reason or message for the error\n * @property {[key: string]: string} [data] - @deprecated A list of key-value for extra details\n * @property {wallet?: string, errorCode? string} [tags] - A list of key-value for pre-defined tags\n *\n */\nexport type ReportTransactionRequest = {\n requestId: string\n eventType: APIErrorCode\n step?: number\n reason?: string\n data?: { [key: string]: string }\n tags?: { wallet?: string; errorCode?: string }\n}\n\n/**\n * The status of transaction in tracking\n */\nexport enum TransactionStatus {\n FAILED = 'failed',\n RUNNING = 'running',\n SUCCESS = 'success',\n}\n\n/**\n * Response body of check-approval\n * You could stop check approval if:\n * 1- approved successfully\n * => isApproved = true\n * 2- approval transaction failed\n * => isApproved = false && txStatus === 'failed'\n * 3- approval transaction succeeded but currentApprovedAmount is still less than requiredApprovedAmount\n * (e.g. user changed transaction data and enter another approve amount in MetaMask)\n * => isApproved = false && txStatus == 'success'\n *\n * @property {boolean} isApproved - A flag which indicates that the approve tx is done or not\n * @property {TransactionStatus | null} txStatus - Status of approve transaction in blockchain,\n * if isArppoved is false and txStatus is failed, it seems that approve transaction failed in blockchain\n * @property {string | null} requiredApprovedAmount - required amount to be approved by user\n * @property {string | null} currentApprovedAmount - current approved amount by user\n *\n */\nexport type CheckApprovalResponse = {\n isApproved: boolean\n txStatus: TransactionStatus | null\n requiredApprovedAmount: string | null\n currentApprovedAmount: string | null\n}\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * CosmosCoin\n */\nexport type CosmosCoin = {\n amount: string\n denom: string\n}\n\n/**\n * CosmosProtoMsg\n */\nexport type CosmosProtoMsg = {\n type_url: string\n value: number[]\n}\n\n/**\n * CosmosFee representing fee for cosmos transaction\n */\nexport type CosmosFee = {\n gas: string\n amount: CosmosCoin[]\n}\n\n/**\n * Main transaction object for COSMOS type transactions\n */\nexport type CosmosMessage = {\n signType: 'AMINO' | 'DIRECT'\n sequence: string | null\n source: number | null\n account_number: number | null\n rpcUrl: string\n chainId: string | null\n msgs: any[] // TODO\n protoMsgs: CosmosProtoMsg[]\n memo: string | null\n fee: CosmosFee | null\n}\n/**\n * An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages (e.g. XDefi)\n *\n * @property {AssetWithTicker} asset - The asset to be transferred\n * @property {string} amount - The machine-readable amount to transfer, example: 1000000000000000000\n * @property {number} decimals - The decimals for this asset, example: 18\n * @property {string | null} memo - Memo of transaction, could be null\n * @property {string} method - The transaction method, example: transfer, deposit\n * @property {string} recipient - The recipient address of transaction\n *\n */\nexport type CosmosRawTransferData = {\n amount: string\n asset: AssetWithTicker\n decimals: number\n memo: string | null\n method: string\n recipient: string\n}\n\n/**\n * A Cosmos transaction, child of GenericTransaction\n *\n * @property {TransactionType} type - This fields equals to COSMOS for all CosmosTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} fromWalletAddress - Address of wallet that this transaction should be executed in, same as the create transaction request's input\n * @property {CosmosMessage} data - Transaction data\n * @property {CosmosRawTransferData | null} rawTransfer - An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages\n *\n */\nexport interface CosmosTransaction extends BaseTransaction {\n type: TransactionType.COSMOS\n fromWalletAddress: string\n data: CosmosMessage\n rawTransfer: CosmosRawTransferData | null\n}\n\nexport const isCosmosTransaction = (transaction: {\n type: TransactionType\n}): transaction is CosmosTransaction =>\n transaction.type === TransactionType.COSMOS\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * Account metadata used to define instructions\n */\nexport type SolanaInstructionKey = {\n pubkey: string\n isSigner: boolean\n isWritable: boolean\n}\n\n/**\n * Transaction Instruction class\n */\nexport type SolanaInstruction = {\n keys: SolanaInstructionKey[]\n programId: string\n data: number[]\n}\n\n/**\n * Pair of signature and corresponding public key\n */\nexport type SolanaSignature = {\n signature: number[]\n publicKey: string\n}\n\n/**\n * This type of transaction is used for all solana transactions\n *\n * @property {TransactionType} type - This fields equals to SOLANA for all SolanaTransactions\n * @property {'LEGACY' | 'VERSIONED'} txType - Type of the solana transaction\n * @property {string} blockChain, equals to SOLANA\n * @property {string} from, Source wallet address\n * @property {string} identifier, Transaction hash used in case of retry\n * @property {string | null} recentBlockhash, A recent blockhash\n * @property {SolanaSignature[]} signatures, Signatures for the transaction\n * @property {number[] | null} serializedMessage, The byte array of the transaction\n * @property {SolanaInstruction[]} instructions, The instructions to atomically execute\n *\n */\nexport interface SolanaTransaction extends BaseTransaction {\n type: TransactionType.SOLANA\n txType: 'LEGACY' | 'VERSIONED'\n from: string\n identifier: string\n recentBlockhash: string | null\n signatures: SolanaSignature[]\n serializedMessage: number[] | null\n instructions: SolanaInstruction[]\n}\n\nexport const isSolanaTransaction = (transaction: {\n type: TransactionType\n}): transaction is SolanaTransaction =>\n transaction.type === TransactionType.SOLANA\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type InputToSign = { address: string, signingIndexes: number[] }\n/**\n * @property {unsignedPsbtBase64} unsignedPsbtBase64 - Base 64 representation of the Unsigned PSBT\n * @property {InputToSign[]} inputsToSign - Inputs to be signed\n */\nexport type PSBT = {\n unsignedPsbtBase64: string\n inputsToSign: InputToSign[]\n}\n/**\n * TransferTransaction. This type of transaction is used for UTXO blockchains including BTC, LTC, BCH\n *\n * @property {TransactionType} type - This fields equals to TRANSFER for all TransferTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} method - The method that should be passed to wallet. examples: deposit, transfer\n * @property {AssetWithTicker} asset\n * @property {string} amount - The machine-readable amount of transaction, example: 1000000000000000000\n * @property {number} decimals - The decimals of the asset\n * @property {string} fromWalletAddress - The source wallet address that can sign this transaction\n * @property {string} recipientAddress - The destination wallet address that the fund should be sent to\n * @property {string | null} memo - The memo of transaction, can be null\n * @property {PSBT | null} psbt - PSBT object containing base 64 representation of the Unsigned PSBT along with the inputs to be signed\n *\n */\nexport interface Transfer extends BaseTransaction {\n type: TransactionType.TRANSFER\n method: string\n asset: AssetWithTicker\n amount: string\n decimals: number\n fromWalletAddress: string\n recipientAddress: string\n memo: string | null\n psbt: PSBT | null\n}\n\nexport const isTransferTransaction = (transaction: {\n type: TransactionType\n}): transaction is Transfer => transaction.type === TransactionType.TRANSFER\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport enum TonChainID {\n MAINNET = '-239',\n TESTNET = '-3',\n}\n\n/**\n * @property {string} address - Receiver's address\n * @property {string} amount - Amount to send in nanoTon\n * @property {string} [stateInit] - Contract specific data to add to the transaction\n * @property {string} [payload] - Contract specific data to add to the transaction\n */\nexport interface TonMessage {\n address: string\n amount: string\n stateInit?: string\n payload?: string\n}\n\n/**\n * This type of transaction is used for all Ton transactions\n *\n * @property {TransactionType} type - This field equals to TON for all Ton transactions\n * @property {number} validUntil - Sending transaction deadline in unix epoch seconds\n * @property {TonChainID} [network] - The network (mainnet or testnet) where DApp intends to send the transaction. If not set, the transaction is sent to the network currently set in the wallet, but this is not safe and DApp should always strive to set the network. If the network parameter is set, but the wallet has a different network set, the wallet should show an alert and DO NOT ALLOW TO SEND this transaction\n * @property {string} [from] - The sender address in '<wc>:<hex>' format from which DApp intends to send the transaction. Current account.address by default\n * @property {TonMessage[]} messages - Messages to send: min is 1, max is 4\n */\nexport interface TonTransaction extends BaseTransaction {\n type: TransactionType.TON\n validUntil: number\n network?: TonChainID\n from?: string\n messages: TonMessage[]\n}\n\nexport const isTonTransaction = (transaction: {\n type: TransactionType\n}): transaction is TonTransaction => transaction.type === TransactionType.TON\n","import { BlockchainMetaBase } from '../meta.js'\nimport { TransactionType } from '../transactions.js'\n\n\n\n/**\n * Blockchain info for basic API EVM transaction\n */\nexport type EvmTransactionBlockchain = Pick<\n BlockchainMetaBase, 'name' | 'defaultDecimals' | 'addressPatterns' | 'feeAssets' | 'type' | 'chainId'\n>\n\n/**\n * The transaction object for all EVM-based blockchains, including Ethereum, BSC, Polygon, Harmony, etc\n *\n * @property {TransactionType} type - This fields equals to EVM for all EVMTransactions\n * @property {EvmTransactionBlockchain} blockChain - The blockchain info that this transaction is going to run in\n * @property {string | null} from - The source wallet address, it can be null\n * @property {string} approveTo - Address of source token erc20 contract for increasing approve amount\n * @property {string | null} approveData - The data of approve transaction\n * @property {string} txTo - Address of dex/bridge smart contract that is going to be called\n * @property {string | null} txData - The data of main transaction, it can be null in case of native token transfer\n * @property {string | null} value - The amount of transaction in case of native token transfer\n * @property {string | null} gasPrice - The suggested gas price for this transaction\n * @property {string | null} gasLimit - The suggested gas limit for this transaction\n * @property {string | null} maxPriorityFeePerGas - Suggested max priority fee per gas for this transaction\n * @property {string | null} maxFeePerGas - Suggested max fee per gas for this transaction\n *\n */\nexport interface EvmTransaction {\n type: TransactionType.EVM\n blockChain: EvmTransactionBlockchain\n from: string | null\n approveTo: string | null\n approveData: string | null\n txTo: string\n txData: string | null\n value: string | null\n gasLimit: string | null\n gasPrice: string | null\n maxPriorityFeePerGas: string | null\n maxFeePerGas: string | null\n}\n\nexport const isEvmTransaction = (transaction: {\n type: TransactionType\n}): transaction is EvmTransaction => transaction.type === TransactionType.EVM\n","import uuid from 'uuid-random'\n\nimport {\n MetaRequest,\n MetaResponse,\n QuoteRequest,\n QuoteResponse,\n CheckApprovalResponse,\n StatusRequest,\n StatusResponse,\n SwapRequest,\n SwapResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n assetToString,\n BlockchainMeta,\n RequestOptions,\n MessagingProtocolsResponse,\n SwapperMetaExtended,\n ConnectedAssetsResponse,\n ConnectedAssetsRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceRequest,\n TokenBalanceResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddress = { blockchain: string; address: string }\n\nexport class RangoClient {\n private readonly deviceId: string\n private readonly apiKey: string\n private readonly apiUrl: string\n private readonly httpService: AxiosInstance\n\n constructor(apiKey: string, debug = false, apiUrl?: string) {\n this.apiUrl = apiUrl || 'https://api.rango.exchange'\n this.apiKey = apiKey\n try {\n if (typeof window !== 'undefined') {\n const deviceId = localStorage.getItem('deviceId')\n if (deviceId) {\n this.deviceId = deviceId\n } else {\n const generatedId = uuid()\n localStorage.setItem('deviceId', generatedId)\n this.deviceId = generatedId\n }\n } else {\n this.deviceId = uuid()\n }\n } catch (e) {\n this.deviceId = uuid()\n }\n this.httpService = axios.create({\n baseURL: this.apiUrl,\n })\n if (debug) {\n this.httpService.interceptors.request.use((request) => {\n console.log('Starting Request', JSON.stringify(request, null, 2))\n return request\n })\n this.httpService.interceptors.response.use((response) => {\n console.log('Response:', JSON.stringify(response, null, 2))\n return response\n })\n }\n }\n\n public async meta(\n metaRequest?: MetaRequest,\n options?: RequestOptions\n ): Promise<MetaResponse> {\n const params = {\n ...metaRequest,\n blockchains: metaRequest?.blockchains?.join(),\n swappers: metaRequest?.swappers?.join(),\n swappersGroups: metaRequest?.swappersGroups?.join(),\n transactionTypes: metaRequest?.transactionTypes?.join(),\n }\n const axiosResponse = await this.httpService.get<MetaResponse>(\n `/basic/meta?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async chains(options?: RequestOptions): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/basic/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async swappers(options?: RequestOptions): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/basic/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async messagingProtocols(\n options?: RequestOptions\n ): Promise<MessagingProtocolsResponse> {\n const axiosResponse =\n await this.httpService.get<MessagingProtocolsResponse>(\n `/basic/meta/messaging-protocols?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n\n public async token(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/basic/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async quote(\n quoteRequest: QuoteRequest,\n options?: RequestOptions\n ): Promise<QuoteResponse> {\n const body = {\n ...quoteRequest,\n from: assetToString(quoteRequest.from),\n to: assetToString(quoteRequest.to),\n swappers:\n !!quoteRequest.swappers && quoteRequest.swappers.length > 0\n ? quoteRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!quoteRequest.swapperGroups && quoteRequest.swapperGroups.length > 0\n ? quoteRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!quoteRequest.messagingProtocols &&\n quoteRequest.messagingProtocols.length > 0\n ? quoteRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<QuoteResponse>(\n `/basic/quote?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async isApproved(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/basic/is-approved?apiKey=${this.apiKey}`,\n {\n params: { requestId, txId },\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async status(\n statusRequest: StatusRequest,\n options?: RequestOptions\n ): Promise<StatusResponse> {\n const axiosResponse = await this.httpService.get<StatusResponse>(\n `/basic/status?apiKey=${this.apiKey}`,\n {\n params: statusRequest,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async swap(\n swapRequest: SwapRequest,\n options?: RequestOptions\n ): Promise<SwapResponse> {\n const body = {\n ...swapRequest,\n from: assetToString(swapRequest.from),\n to: assetToString(swapRequest.to),\n referrerAddress: swapRequest.referrerAddress || null,\n referrerFee: swapRequest.referrerFee || null,\n disableEstimate: swapRequest.disableEstimate || false,\n swappers:\n !!swapRequest.swappers && swapRequest.swappers.length > 0\n ? swapRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!swapRequest.swapperGroups && swapRequest.swapperGroups.length > 0\n ? swapRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!swapRequest.messagingProtocols &&\n swapRequest.messagingProtocols.length > 0\n ? swapRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<SwapResponse>(\n `/basic/swap?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async reportFailure(\n requestBody: ReportTransactionRequest,\n options?: RequestOptions\n ): Promise<void> {\n await this.httpService.post(\n `/basic/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n }\n\n public async balance(\n walletAddress: WalletAddress,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/basic/balance?apiKey=${this.apiKey}`,\n {\n params: walletAddress,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async tokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/basic/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async connectedAssets(\n connectedAssetsRequest: ConnectedAssetsRequest,\n options?: RequestOptions\n ): Promise<ConnectedAssetsResponse> {\n const body = {\n from: assetToString(connectedAssetsRequest.from),\n }\n\n const axiosResponse = await this.httpService.get<ConnectedAssetsResponse>(\n `/basic/connected-assets?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n}\n"],"names":["assetToString","asset","blockchain","symbol","address","RoutingResultType","TransactionType","GenericTransactionType","TransactionStatus","RangoClient","apiKey","debug","apiUrl","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","interceptors","request","use","console","log","JSON","stringify","response","_proto","prototype","meta","_meta","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","axiosResponse","wrap","_callee$","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","sent","abrupt","data","stop","_x","_x2","apply","arguments","chains","_chains","_callee2","_callee2$","_context2","_x3","_swappers","_callee3","_callee3$","_context3","_x4","messagingProtocols","_messagingProtocols","_callee4","_callee4$","_context4","_x5","token","_token","_callee5","customTokenRequest","_callee5$","_context5","_x6","_x7","quote","_quote","_callee6","quoteRequest","body","_callee6$","_context6","from","to","length","undefined","swapperGroups","headers","_x8","_x9","isApproved","_isApproved","_callee7","requestId","txId","_callee7$","_context7","_x10","_x11","_x12","status","_status","_callee8","statusRequest","_callee8$","_context8","_x13","_x14","swap","_swap","_callee9","swapRequest","_callee9$","_context9","referrerAddress","referrerFee","disableEstimate","_x15","_x16","reportFailure","_reportFailure","_callee10","requestBody","_callee10$","_context10","post","_x17","_x18","balance","_balance","_callee11","walletAddress","_callee11$","_context11","_x19","_x20","tokenBalance","_tokenBalance","_callee12","tokenBalanceRequest","_callee12$","_context12","_x21","_x22","connectedAssets","_connectedAssets","_callee13","connectedAssetsRequest","_callee13$","_context13","_x23","_x24"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAGgBA,aAAaA,CAACC,KAAqB;EACjD,YAAUA,KAAK,CAACC,UAAU,IAAGD,KAAK,CAACE,MAAM,GAAG,GAAG,GAAGF,KAAK,CAACE,MAAM,GAAG,EAAE,KACjEF,KAAK,CAACG,OAAO,GAAG,IAAI,GAAGH,KAAK,CAACG,OAAO,GAAG,EACzC;AACF;;ICIa,eAAe,GAAG,UAC7B,cAA8B,IACU,OAAA,cAAc,CAAC,IAAI,KAAK,KAAK,GAAA,CAAA;AAEvE,IAAa,kBAAkB,GAAG,UAChC,cAA8B,IACa,OAAA,cAAc,CAAC,IAAI,KAAK,QAAQ,GAAA,CAAA;AAE7E,IAAa,kBAAkB,GAAG,UAChC,cAA8B,IACa,OAAA,cAAc,CAAC,IAAI,KAAK,QAAQ,GAAA,CAAA;A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C,gBAAA,gBAAA/H,iBAAA,eAAAC,mBAAA,GAAAC,IAAA,CAArB,SAAA8H,UACLC,sBAA8C,EAC9C5H,OAAwB;MAAA,IAAAwD,IAAA,EAAAlD,aAAA;MAAA,OAAAV,mBAAA,GAAAW,IAAA,UAAAsH,WAAAC,UAAA;QAAA,kBAAAA,UAAA,CAAApH,IAAA,GAAAoH,UAAA,CAAAnH,IAAA;UAAA;YAElB6C,IAAI,GAAG;cACXG,IAAI,EAAErG,aAAa,CAACsK,sBAAsB,CAACjE,IAAI;aAChD;YAAAmE,UAAA,CAAAnH,IAAA;YAAA,OAE2B,IAAI,CAAChC,WAAW,CAACuC,GAAG,qCACZ,IAAI,CAAClD,MAAM,EAAA4C,QAAA;cAE3CP,MAAM,EAAEmD,IAAI;cACZQ,OAAO,EAAE;gBAAE,YAAY,EAAE,IAAI,CAAC5F;;eAC3B4B,OAAO,CACX,CACF;UAAA;YAPKM,aAAa,GAAAwH,UAAA,CAAA3G,IAAA;YAAA,OAAA2G,UAAA,CAAA1G,MAAA,WAQZd,aAAa,CAACe,IAAI;UAAA;UAAA;YAAA,OAAAyG,UAAA,CAAAxG,IAAA;;SAAAqG,SAAA;KAC1B;IAAA,SAAAF,gBAAAM,IAAA,EAAAC,IAAA;MAAA,OAAAN,gBAAA,CAAAjG,KAAA,OAAAC,SAAA;;IAAA,OAAA+F,eAAA;;EAAA,OAAA1J,WAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"rango-sdk-basic.cjs.production.min.js","sources":["../src/types/api/common.ts","../../../node_modules/rango-types/src/api/shared/type-gaurds.ts","../src/services/client.ts"],"sourcesContent":["import { RequestedAsset } from 'rango-types/lib/api/basic'\nexport * from 'rango-types/lib/api/basic/common'\n\nexport function assetToString(asset: RequestedAsset): string {\n return `${asset.blockchain}${asset.symbol ? '.' + asset.symbol : ''}${\n asset.address ? '--' + asset.address : ''\n }`\n}\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n} from './meta.js'\n\nexport const isEvmBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is EvmBlockchainMeta => blockchainMeta.type === 'EVM'\n\nexport const isCosmosBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is CosmosBlockchainMeta => blockchainMeta.type === 'COSMOS'\n\nexport const isSolanaBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is SolanaBlockchainMeta => blockchainMeta.type === 'SOLANA'\n\nexport const isTronBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TronBlockchainMeta => blockchainMeta.type === 'TRON'\n\nexport const isTransferBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TransferBlockchainMeta =>\n blockchainMeta.type === 'TRANSFER'\n\nexport const isStarknetBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is StarkNetBlockchainMeta =>\n blockchainMeta.type === 'STARKNET'\n\nexport const isTonBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TonBlockchainMeta => blockchainMeta.type === 'TON'\n\nexport const evmBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isEvmBlockchain)\n\nexport const solanaBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isSolanaBlockchain)\n\nexport const starknetBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isStarknetBlockchain)\n\nexport const tronBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTronBlockchain)\n\nexport const cosmosBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isCosmosBlockchain)\n\nexport const transferBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTransferBlockchain)\n\nexport const tonBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTonBlockchain)\n","import uuid from 'uuid-random'\n\nimport {\n MetaRequest,\n MetaResponse,\n QuoteRequest,\n QuoteResponse,\n CheckApprovalResponse,\n StatusRequest,\n StatusResponse,\n SwapRequest,\n SwapResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n assetToString,\n BlockchainMeta,\n RequestOptions,\n MessagingProtocolsResponse,\n SwapperMetaExtended,\n ConnectedAssetsResponse,\n ConnectedAssetsRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceRequest,\n TokenBalanceResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddress = { blockchain: string; address: string }\n\nexport class RangoClient {\n private readonly deviceId: string\n private readonly apiKey: string\n private readonly apiUrl: string\n private readonly httpService: AxiosInstance\n\n constructor(apiKey: string, debug = false, apiUrl?: string) {\n this.apiUrl = apiUrl || 'https://api.rango.exchange'\n this.apiKey = apiKey\n try {\n if (typeof window !== 'undefined') {\n const deviceId = localStorage.getItem('deviceId')\n if (deviceId) {\n this.deviceId = deviceId\n } else {\n const generatedId = uuid()\n localStorage.setItem('deviceId', generatedId)\n this.deviceId = generatedId\n }\n } else {\n this.deviceId = uuid()\n }\n } catch (e) {\n this.deviceId = uuid()\n }\n this.httpService = axios.create({\n baseURL: this.apiUrl,\n })\n if (debug) {\n this.httpService.interceptors.request.use((request) => {\n console.log('Starting Request', JSON.stringify(request, null, 2))\n return request\n })\n this.httpService.interceptors.response.use((response) => {\n console.log('Response:', JSON.stringify(response, null, 2))\n return response\n })\n }\n }\n\n public async meta(\n metaRequest?: MetaRequest,\n options?: RequestOptions\n ): Promise<MetaResponse> {\n const params = {\n ...metaRequest,\n blockchains: metaRequest?.blockchains?.join(),\n swappers: metaRequest?.swappers?.join(),\n swappersGroups: metaRequest?.swappersGroups?.join(),\n transactionTypes: metaRequest?.transactionTypes?.join(),\n }\n const axiosResponse = await this.httpService.get<MetaResponse>(\n `/basic/meta?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async chains(options?: RequestOptions): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/basic/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async swappers(options?: RequestOptions): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/basic/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async messagingProtocols(\n options?: RequestOptions\n ): Promise<MessagingProtocolsResponse> {\n const axiosResponse =\n await this.httpService.get<MessagingProtocolsResponse>(\n `/basic/meta/messaging-protocols?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n\n public async token(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/basic/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async quote(\n quoteRequest: QuoteRequest,\n options?: RequestOptions\n ): Promise<QuoteResponse> {\n const body = {\n ...quoteRequest,\n from: assetToString(quoteRequest.from),\n to: assetToString(quoteRequest.to),\n swappers:\n !!quoteRequest.swappers && quoteRequest.swappers.length > 0\n ? quoteRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!quoteRequest.swapperGroups && quoteRequest.swapperGroups.length > 0\n ? quoteRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!quoteRequest.messagingProtocols &&\n quoteRequest.messagingProtocols.length > 0\n ? quoteRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<QuoteResponse>(\n `/basic/quote?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async isApproved(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/basic/is-approved?apiKey=${this.apiKey}`,\n {\n params: { requestId, txId },\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async status(\n statusRequest: StatusRequest,\n options?: RequestOptions\n ): Promise<StatusResponse> {\n const axiosResponse = await this.httpService.get<StatusResponse>(\n `/basic/status?apiKey=${this.apiKey}`,\n {\n params: statusRequest,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async swap(\n swapRequest: SwapRequest,\n options?: RequestOptions\n ): Promise<SwapResponse> {\n const body = {\n ...swapRequest,\n from: assetToString(swapRequest.from),\n to: assetToString(swapRequest.to),\n referrerAddress: swapRequest.referrerAddress || null,\n referrerFee: swapRequest.referrerFee || null,\n disableEstimate: swapRequest.disableEstimate || false,\n swappers:\n !!swapRequest.swappers && swapRequest.swappers.length > 0\n ? swapRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!swapRequest.swapperGroups && swapRequest.swapperGroups.length > 0\n ? swapRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!swapRequest.messagingProtocols &&\n swapRequest.messagingProtocols.length > 0\n ? swapRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<SwapResponse>(\n `/basic/swap?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async reportFailure(\n requestBody: ReportTransactionRequest,\n options?: RequestOptions\n ): Promise<void> {\n await this.httpService.post(\n `/basic/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n }\n\n public async balance(\n walletAddress: WalletAddress,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/basic/balance?apiKey=${this.apiKey}`,\n {\n params: walletAddress,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async tokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/basic/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async connectedAssets(\n connectedAssetsRequest: ConnectedAssetsRequest,\n options?: RequestOptions\n ): Promise<ConnectedAssetsResponse> {\n const body = {\n from: assetToString(connectedAssetsRequest.from),\n }\n\n const axiosResponse = await this.httpService.get<ConnectedAssetsResponse>(\n `/basic/connected-assets?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n}\n"],"names":["assetToString","asset","blockchain","symbol","address","blockchainMeta","RangoClient","apiKey","debug","apiUrl","this","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","interceptors","request","use","console","log","JSON","stringify","response","_proto","prototype","meta","_meta","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","wrap","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","abrupt","sent","data","stop","_x","_x2","apply","arguments","chains","_chains","_callee2","_context2","_x3","_swappers","_callee3","_context3","_x4","messagingProtocols","_messagingProtocols","_callee4","_context4","_x5","token","_token","_callee5","customTokenRequest","_context5","_x6","_x7","quote","_quote","_callee6","quoteRequest","body","_context6","from","to","length","undefined","swapperGroups","headers","X-Rango-Id","_x8","_x9","isApproved","_isApproved","_callee7","requestId","txId","_context7","_x10","_x11","_x12","status","_status","_callee8","statusRequest","_context8","_x13","_x14","swap","_swap","_callee9","swapRequest","_context9","referrerAddress","referrerFee","disableEstimate","_x15","_x16","reportFailure","_reportFailure","_callee10","requestBody","_context10","post","_x17","_x18","balance","_balance","_callee11","walletAddress","_context11","_x19","_x20","tokenBalance","_tokenBalance","_callee12","tokenBalanceRequest","_context12","_x21","_x22","connectedAssets","_connectedAssets","_callee13","connectedAssetsRequest","_context13","_x23","_x24"],"mappings":"4jOAGgBA,EAAcC,GAC5B,OAAUA,EAAMC,YAAaD,EAAME,OAAS,IAAMF,EAAME,OAAS,KAC/DF,EAAMG,QAAU,KAAOH,EAAMG,QAAU,iECwCHC,mHAYEA,o2BCrBxC,SAAAC,EAAYC,EAAgBC,EAAeC,YAAfD,IAAAA,GAAQ,GAClCE,KAAKD,OAASA,GAAU,6BACxBC,KAAKH,OAASA,EACd,IACE,GAAsB,oBAAXI,OAAwB,CACjC,IAAMC,EAAWC,aAAaC,QAAQ,YACtC,GAAIF,EACFF,KAAKE,SAAWA,MACX,CACL,IAAMG,EAAcC,IACpBH,aAAaI,QAAQ,WAAYF,GACjCL,KAAKE,SAAWG,QAGlBL,KAAKE,SAAWI,IAElB,MAAOE,GACPR,KAAKE,SAAWI,IAElBN,KAAKS,YAAcC,EAAMC,OAAO,CAC9BC,QAASZ,KAAKD,SAEZD,IACFE,KAAKS,YAAYI,aAAaC,QAAQC,KAAI,SAACD,GAEzC,OADAE,QAAQC,IAAI,mBAAoBC,KAAKC,UAAUL,EAAS,KAAM,IACvDA,KAETd,KAAKS,YAAYI,aAAaO,SAASL,KAAI,SAACK,GAE1C,OADAJ,QAAQC,IAAI,YAAaC,KAAKC,UAAUC,EAAU,KAAM,IACjDA,MAGZ,IAAAC,EAAAzB,EAAA0B,UA2NA,OA3NAD,EAEYE,gBAAI,IAAAC,EAAAC,EAAAC,IAAAC,MAAV,SAAAC,EACLC,EACAC,GAAwB,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAA,OAAAT,IAAAU,eAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAA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M5F,EAAcwJ,EAAuB5D,OAC5C6D,EAAAxG,OAE2BvC,KAAKS,YAAYqC,sCACT9C,KAAKH,OAAM2C,GAE3CL,OAAQ6C,EACRO,QAAS,CAAEC,aAAcxF,KAAKE,WAC3B4B,IAEN,OAPkB,OAAAiH,EAAAhG,gBAAAgG,EAAA/F,KAQEC,MAAI,OAAA,UAAA,OAAA8F,EAAA7F,UAAA2F,YAC1B,OAAA,SAAAG,EAAAC,GAAA,OAAAL,EAAAvF,WAAAC,eAAA1D"}
1
+ {"version":3,"file":"rango-sdk-basic.cjs.production.min.js","sources":["../src/types/api/common.ts","../node_modules/rango-types/src/api/shared/routing.ts","../node_modules/rango-types/src/api/shared/transactions.ts","../node_modules/rango-types/src/api/shared/txs/ton.ts","../node_modules/rango-types/src/api/shared/type-gaurds.ts","../src/services/client.ts","../node_modules/rango-types/src/api/shared/txs/cosmos.ts","../node_modules/rango-types/src/api/basic/txs/evm.ts","../node_modules/rango-types/src/api/shared/txs/solana.ts","../node_modules/rango-types/src/api/shared/txs/transfer.ts"],"sourcesContent":["import { RequestedAsset } from 'rango-types/lib/api/basic'\nexport * from 'rango-types/lib/api/basic/common'\n\nexport function assetToString(asset: RequestedAsset): string {\n return `${asset.blockchain}${asset.symbol ? '.' + asset.symbol : ''}${\n asset.address ? '--' + asset.address : ''\n }`\n}\n","/**\n * Routing Result Type\n *\n */\nexport enum RoutingResultType {\n OK = 'OK',\n HIGH_IMPACT = 'HIGH_IMPACT',\n NO_ROUTE = 'NO_ROUTE',\n INPUT_LIMIT_ISSUE = 'INPUT_LIMIT_ISSUE',\n HIGH_IMPACT_FOR_CREATE_TX = 'HIGH_IMPACT_FOR_CREATE_TX',\n}\n","/**\n * The type of transaction\n */\nexport enum TransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n TRON = 'TRON',\n STARKNET = 'STARKNET',\n TON = 'TON',\n SUI = 'SUI',\n XRPL = 'XRPL',\n}\n\n/**\n * The type of transaction\n * @deprecated use TransactionType instead\n */\nexport enum GenericTransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n}\n\n/**\n * A transaction's url that can be displayed to advanced user to track the progress\n *\n * @property {string} url - Url of the transaction in blockchain explorer. example: https://etherscan.io/tx/0xa1a3...\n * @property {string | null} description - A custom display name to help user distinguish the transactions from each\n * other. Example: Inbound, Outbound, Bridge, or null\n *\n */\nexport type SwapExplorerUrl = {\n description: string | null\n url: string\n}\n\n/**\n * APIErrorCode\n *\n * Error code of a swap failure\n *\n */\nexport type APIErrorCode =\n | 'TX_FAIL'\n | 'TX_EXPIRED'\n | 'FETCH_TX_FAILED'\n | 'USER_REJECT'\n | 'USER_CANCEL'\n | 'USER_CANCELED_TX'\n | 'CALL_WALLET_FAILED'\n | 'SEND_TX_FAILED'\n | 'CALL_OR_SEND_FAILED'\n | 'TX_FAILED_IN_BLOCKCHAIN'\n | 'CLIENT_UNEXPECTED_BEHAVIOUR'\n | 'INSUFFICIENT_APPROVE'\n\n/**\n * The function checks if a given string value is a valid API error code.\n * @param {string} value - a string that represents a possible API error code.\n * @returns A boolean value is being returned, indicating whether the input `value` is of type\n * `APIErrorCode` or not.\n */\nexport function isAPIErrorCode(value: string): value is APIErrorCode {\n return [\n 'TX_FAIL',\n 'TX_EXPIRED',\n 'FETCH_TX_FAILED',\n 'USER_REJECT',\n 'USER_CANCEL',\n 'USER_CANCELED_TX',\n 'CALL_WALLET_FAILED',\n 'SEND_TX_FAILED',\n 'CALL_OR_SEND_FAILED',\n 'TX_FAILED_IN_BLOCKCHAIN',\n 'CLIENT_UNEXPECTED_BEHAVIOUR',\n 'INSUFFICIENT_APPROVE',\n ].includes(value)\n}\n\n/**\n * ReportTransactionRequest\n *\n * It should be used when an error happened in client and we want to inform server that transaction failed,\n * E.g. user rejected the transaction dialog or and an RPC error raised during signing tx by user.\n *\n * @property {string} requestId - The requestId from best route endpoint\n * @property {APIErrorCode} eventType - Type of the event that happened, example: USER_REJECT\n * @property {number} [step] - Step number in which failure happened\n * @property {string} [reason] - Reason or message for the error\n * @property {[key: string]: string} [data] - @deprecated A list of key-value for extra details\n * @property {wallet?: string, errorCode? string} [tags] - A list of key-value for pre-defined tags\n *\n */\nexport type ReportTransactionRequest = {\n requestId: string\n eventType: APIErrorCode\n step?: number\n reason?: string\n data?: { [key: string]: string }\n tags?: { wallet?: string; errorCode?: string }\n}\n\n/**\n * The status of transaction in tracking\n */\nexport enum TransactionStatus {\n FAILED = 'failed',\n RUNNING = 'running',\n SUCCESS = 'success',\n}\n\n/**\n * Response body of check-approval\n * You could stop check approval if:\n * 1- approved successfully\n * => isApproved = true\n * 2- approval transaction failed\n * => isApproved = false && txStatus === 'failed'\n * 3- approval transaction succeeded but currentApprovedAmount is still less than requiredApprovedAmount\n * (e.g. user changed transaction data and enter another approve amount in MetaMask)\n * => isApproved = false && txStatus == 'success'\n *\n * @property {boolean} isApproved - A flag which indicates that the approve tx is done or not\n * @property {TransactionStatus | null} txStatus - Status of approve transaction in blockchain,\n * if isArppoved is false and txStatus is failed, it seems that approve transaction failed in blockchain\n * @property {string | null} requiredApprovedAmount - required amount to be approved by user\n * @property {string | null} currentApprovedAmount - current approved amount by user\n *\n */\nexport type CheckApprovalResponse = {\n isApproved: boolean\n txStatus: TransactionStatus | null\n requiredApprovedAmount: string | null\n currentApprovedAmount: string | null\n}\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport enum TonChainID {\n MAINNET = '-239',\n TESTNET = '-3',\n}\n\n/**\n * @property {string} address - Receiver's address\n * @property {string} amount - Amount to send in nanoTon\n * @property {string} [stateInit] - Contract specific data to add to the transaction\n * @property {string} [payload] - Contract specific data to add to the transaction\n */\nexport interface TonMessage {\n address: string\n amount: string\n stateInit?: string\n payload?: string\n}\n\n/**\n * This type of transaction is used for all Ton transactions\n *\n * @property {TransactionType} type - This field equals to TON for all Ton transactions\n * @property {number} validUntil - Sending transaction deadline in unix epoch seconds\n * @property {TonChainID} [network] - The network (mainnet or testnet) where DApp intends to send the transaction. If not set, the transaction is sent to the network currently set in the wallet, but this is not safe and DApp should always strive to set the network. If the network parameter is set, but the wallet has a different network set, the wallet should show an alert and DO NOT ALLOW TO SEND this transaction\n * @property {string} [from] - The sender address in '<wc>:<hex>' format from which DApp intends to send the transaction. Current account.address by default\n * @property {TonMessage[]} messages - Messages to send: min is 1, max is 4\n */\nexport interface TonTransaction extends BaseTransaction {\n type: TransactionType.TON\n validUntil: number\n network?: TonChainID\n from?: string\n messages: TonMessage[]\n}\n\nexport const isTonTransaction = (transaction: {\n type: TransactionType\n}): transaction is TonTransaction => transaction.type === TransactionType.TON\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n} from './meta.js'\n\nexport const isEvmBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is EvmBlockchainMeta => blockchainMeta.type === 'EVM'\n\nexport const isCosmosBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is CosmosBlockchainMeta => blockchainMeta.type === 'COSMOS'\n\nexport const isSolanaBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is SolanaBlockchainMeta => blockchainMeta.type === 'SOLANA'\n\nexport const isTronBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TronBlockchainMeta => blockchainMeta.type === 'TRON'\n\nexport const isTransferBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TransferBlockchainMeta =>\n blockchainMeta.type === 'TRANSFER'\n\nexport const isStarknetBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is StarkNetBlockchainMeta =>\n blockchainMeta.type === 'STARKNET'\n\nexport const isTonBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TonBlockchainMeta => blockchainMeta.type === 'TON'\n\nexport const evmBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isEvmBlockchain)\n\nexport const solanaBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isSolanaBlockchain)\n\nexport const starknetBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isStarknetBlockchain)\n\nexport const tronBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTronBlockchain)\n\nexport const cosmosBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isCosmosBlockchain)\n\nexport const transferBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTransferBlockchain)\n\nexport const tonBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTonBlockchain)\n","import uuid from 'uuid-random'\n\nimport {\n MetaRequest,\n MetaResponse,\n QuoteRequest,\n QuoteResponse,\n CheckApprovalResponse,\n StatusRequest,\n StatusResponse,\n SwapRequest,\n SwapResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n assetToString,\n BlockchainMeta,\n RequestOptions,\n MessagingProtocolsResponse,\n SwapperMetaExtended,\n ConnectedAssetsResponse,\n ConnectedAssetsRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceRequest,\n TokenBalanceResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddress = { blockchain: string; address: string }\n\nexport class RangoClient {\n private readonly deviceId: string\n private readonly apiKey: string\n private readonly apiUrl: string\n private readonly httpService: AxiosInstance\n\n constructor(apiKey: string, debug = false, apiUrl?: string) {\n this.apiUrl = apiUrl || 'https://api.rango.exchange'\n this.apiKey = apiKey\n try {\n if (typeof window !== 'undefined') {\n const deviceId = localStorage.getItem('deviceId')\n if (deviceId) {\n this.deviceId = deviceId\n } else {\n const generatedId = uuid()\n localStorage.setItem('deviceId', generatedId)\n this.deviceId = generatedId\n }\n } else {\n this.deviceId = uuid()\n }\n } catch (e) {\n this.deviceId = uuid()\n }\n this.httpService = axios.create({\n baseURL: this.apiUrl,\n })\n if (debug) {\n this.httpService.interceptors.request.use((request) => {\n console.log('Starting Request', JSON.stringify(request, null, 2))\n return request\n })\n this.httpService.interceptors.response.use((response) => {\n console.log('Response:', JSON.stringify(response, null, 2))\n return response\n })\n }\n }\n\n public async meta(\n metaRequest?: MetaRequest,\n options?: RequestOptions\n ): Promise<MetaResponse> {\n const params = {\n ...metaRequest,\n blockchains: metaRequest?.blockchains?.join(),\n swappers: metaRequest?.swappers?.join(),\n swappersGroups: metaRequest?.swappersGroups?.join(),\n transactionTypes: metaRequest?.transactionTypes?.join(),\n }\n const axiosResponse = await this.httpService.get<MetaResponse>(\n `/basic/meta?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async chains(options?: RequestOptions): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/basic/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async swappers(options?: RequestOptions): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/basic/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async messagingProtocols(\n options?: RequestOptions\n ): Promise<MessagingProtocolsResponse> {\n const axiosResponse =\n await this.httpService.get<MessagingProtocolsResponse>(\n `/basic/meta/messaging-protocols?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n\n public async token(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/basic/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async quote(\n quoteRequest: QuoteRequest,\n options?: RequestOptions\n ): Promise<QuoteResponse> {\n const body = {\n ...quoteRequest,\n from: assetToString(quoteRequest.from),\n to: assetToString(quoteRequest.to),\n swappers:\n !!quoteRequest.swappers && quoteRequest.swappers.length > 0\n ? quoteRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!quoteRequest.swapperGroups && quoteRequest.swapperGroups.length > 0\n ? quoteRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!quoteRequest.messagingProtocols &&\n quoteRequest.messagingProtocols.length > 0\n ? quoteRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<QuoteResponse>(\n `/basic/quote?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async isApproved(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/basic/is-approved?apiKey=${this.apiKey}`,\n {\n params: { requestId, txId },\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async status(\n statusRequest: StatusRequest,\n options?: RequestOptions\n ): Promise<StatusResponse> {\n const axiosResponse = await this.httpService.get<StatusResponse>(\n `/basic/status?apiKey=${this.apiKey}`,\n {\n params: statusRequest,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async swap(\n swapRequest: SwapRequest,\n options?: RequestOptions\n ): Promise<SwapResponse> {\n const body = {\n ...swapRequest,\n from: assetToString(swapRequest.from),\n to: assetToString(swapRequest.to),\n referrerAddress: swapRequest.referrerAddress || null,\n referrerFee: swapRequest.referrerFee || null,\n disableEstimate: swapRequest.disableEstimate || false,\n swappers:\n !!swapRequest.swappers && swapRequest.swappers.length > 0\n ? swapRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!swapRequest.swapperGroups && swapRequest.swapperGroups.length > 0\n ? swapRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!swapRequest.messagingProtocols &&\n swapRequest.messagingProtocols.length > 0\n ? swapRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<SwapResponse>(\n `/basic/swap?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async reportFailure(\n requestBody: ReportTransactionRequest,\n options?: RequestOptions\n ): Promise<void> {\n await this.httpService.post(\n `/basic/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n }\n\n public async balance(\n walletAddress: WalletAddress,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/basic/balance?apiKey=${this.apiKey}`,\n {\n params: walletAddress,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async tokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/basic/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async connectedAssets(\n connectedAssetsRequest: ConnectedAssetsRequest,\n options?: RequestOptions\n ): Promise<ConnectedAssetsResponse> {\n const body = {\n from: assetToString(connectedAssetsRequest.from),\n }\n\n const axiosResponse = await this.httpService.get<ConnectedAssetsResponse>(\n `/basic/connected-assets?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n}\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * CosmosCoin\n */\nexport type CosmosCoin = {\n amount: string\n denom: string\n}\n\n/**\n * CosmosProtoMsg\n */\nexport type CosmosProtoMsg = {\n type_url: string\n value: number[]\n}\n\n/**\n * CosmosFee representing fee for cosmos transaction\n */\nexport type CosmosFee = {\n gas: string\n amount: CosmosCoin[]\n}\n\n/**\n * Main transaction object for COSMOS type transactions\n */\nexport type CosmosMessage = {\n signType: 'AMINO' | 'DIRECT'\n sequence: string | null\n source: number | null\n account_number: number | null\n rpcUrl: string\n chainId: string | null\n msgs: any[] // TODO\n protoMsgs: CosmosProtoMsg[]\n memo: string | null\n fee: CosmosFee | null\n}\n/**\n * An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages (e.g. XDefi)\n *\n * @property {AssetWithTicker} asset - The asset to be transferred\n * @property {string} amount - The machine-readable amount to transfer, example: 1000000000000000000\n * @property {number} decimals - The decimals for this asset, example: 18\n * @property {string | null} memo - Memo of transaction, could be null\n * @property {string} method - The transaction method, example: transfer, deposit\n * @property {string} recipient - The recipient address of transaction\n *\n */\nexport type CosmosRawTransferData = {\n amount: string\n asset: AssetWithTicker\n decimals: number\n memo: string | null\n method: string\n recipient: string\n}\n\n/**\n * A Cosmos transaction, child of GenericTransaction\n *\n * @property {TransactionType} type - This fields equals to COSMOS for all CosmosTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} fromWalletAddress - Address of wallet that this transaction should be executed in, same as the create transaction request's input\n * @property {CosmosMessage} data - Transaction data\n * @property {CosmosRawTransferData | null} rawTransfer - An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages\n *\n */\nexport interface CosmosTransaction extends BaseTransaction {\n type: TransactionType.COSMOS\n fromWalletAddress: string\n data: CosmosMessage\n rawTransfer: CosmosRawTransferData | null\n}\n\nexport const isCosmosTransaction = (transaction: {\n type: TransactionType\n}): transaction is CosmosTransaction =>\n transaction.type === TransactionType.COSMOS\n","import { BlockchainMetaBase } from '../meta.js'\nimport { TransactionType } from '../transactions.js'\n\n\n\n/**\n * Blockchain info for basic API EVM transaction\n */\nexport type EvmTransactionBlockchain = Pick<\n BlockchainMetaBase, 'name' | 'defaultDecimals' | 'addressPatterns' | 'feeAssets' | 'type' | 'chainId'\n>\n\n/**\n * The transaction object for all EVM-based blockchains, including Ethereum, BSC, Polygon, Harmony, etc\n *\n * @property {TransactionType} type - This fields equals to EVM for all EVMTransactions\n * @property {EvmTransactionBlockchain} blockChain - The blockchain info that this transaction is going to run in\n * @property {string | null} from - The source wallet address, it can be null\n * @property {string} approveTo - Address of source token erc20 contract for increasing approve amount\n * @property {string | null} approveData - The data of approve transaction\n * @property {string} txTo - Address of dex/bridge smart contract that is going to be called\n * @property {string | null} txData - The data of main transaction, it can be null in case of native token transfer\n * @property {string | null} value - The amount of transaction in case of native token transfer\n * @property {string | null} gasPrice - The suggested gas price for this transaction\n * @property {string | null} gasLimit - The suggested gas limit for this transaction\n * @property {string | null} maxPriorityFeePerGas - Suggested max priority fee per gas for this transaction\n * @property {string | null} maxFeePerGas - Suggested max fee per gas for this transaction\n *\n */\nexport interface EvmTransaction {\n type: TransactionType.EVM\n blockChain: EvmTransactionBlockchain\n from: string | null\n approveTo: string | null\n approveData: string | null\n txTo: string\n txData: string | null\n value: string | null\n gasLimit: string | null\n gasPrice: string | null\n maxPriorityFeePerGas: string | null\n maxFeePerGas: string | null\n}\n\nexport const isEvmTransaction = (transaction: {\n type: TransactionType\n}): transaction is EvmTransaction => transaction.type === TransactionType.EVM\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * Account metadata used to define instructions\n */\nexport type SolanaInstructionKey = {\n pubkey: string\n isSigner: boolean\n isWritable: boolean\n}\n\n/**\n * Transaction Instruction class\n */\nexport type SolanaInstruction = {\n keys: SolanaInstructionKey[]\n programId: string\n data: number[]\n}\n\n/**\n * Pair of signature and corresponding public key\n */\nexport type SolanaSignature = {\n signature: number[]\n publicKey: string\n}\n\n/**\n * This type of transaction is used for all solana transactions\n *\n * @property {TransactionType} type - This fields equals to SOLANA for all SolanaTransactions\n * @property {'LEGACY' | 'VERSIONED'} txType - Type of the solana transaction\n * @property {string} blockChain, equals to SOLANA\n * @property {string} from, Source wallet address\n * @property {string} identifier, Transaction hash used in case of retry\n * @property {string | null} recentBlockhash, A recent blockhash\n * @property {SolanaSignature[]} signatures, Signatures for the transaction\n * @property {number[] | null} serializedMessage, The byte array of the transaction\n * @property {SolanaInstruction[]} instructions, The instructions to atomically execute\n *\n */\nexport interface SolanaTransaction extends BaseTransaction {\n type: TransactionType.SOLANA\n txType: 'LEGACY' | 'VERSIONED'\n from: string\n identifier: string\n recentBlockhash: string | null\n signatures: SolanaSignature[]\n serializedMessage: number[] | null\n instructions: SolanaInstruction[]\n}\n\nexport const isSolanaTransaction = (transaction: {\n type: TransactionType\n}): transaction is SolanaTransaction =>\n transaction.type === TransactionType.SOLANA\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type InputToSign = { address: string, signingIndexes: number[] }\n/**\n * @property {unsignedPsbtBase64} unsignedPsbtBase64 - Base 64 representation of the Unsigned PSBT\n * @property {InputToSign[]} inputsToSign - Inputs to be signed\n */\nexport type PSBT = {\n unsignedPsbtBase64: string\n inputsToSign: InputToSign[]\n}\n/**\n * TransferTransaction. This type of transaction is used for UTXO blockchains including BTC, LTC, BCH\n *\n * @property {TransactionType} type - This fields equals to TRANSFER for all TransferTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} method - The method that should be passed to wallet. examples: deposit, transfer\n * @property {AssetWithTicker} asset\n * @property {string} amount - The machine-readable amount of transaction, example: 1000000000000000000\n * @property {number} decimals - The decimals of the asset\n * @property {string} fromWalletAddress - The source wallet address that can sign this transaction\n * @property {string} recipientAddress - The destination wallet address that the fund should be sent to\n * @property {string | null} memo - The memo of transaction, can be null\n * @property {PSBT | null} psbt - PSBT object containing base 64 representation of the Unsigned PSBT along with the inputs to be signed\n *\n */\nexport interface Transfer extends BaseTransaction {\n type: TransactionType.TRANSFER\n method: string\n asset: AssetWithTicker\n amount: string\n decimals: number\n fromWalletAddress: string\n recipientAddress: string\n memo: string | null\n psbt: PSBT | null\n}\n\nexport const isTransferTransaction = (transaction: {\n type: TransactionType\n}): transaction is Transfer => transaction.type === TransactionType.TRANSFER\n"],"names":["assetToString","asset","blockchain","symbol","address","RoutingResultType","TransactionType","GenericTransactionType","TransactionStatus","TonChainID","isEvmBlockchain","blockchainMeta","type","isCosmosBlockchain","isSolanaBlockchain","isTronBlockchain","isTransferBlockchain","isStarknetBlockchain","isTonBlockchain","RangoClient","apiKey","debug","apiUrl","this","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","interceptors","request","use","console","log","JSON","stringify","response","_proto","prototype","meta","_meta","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","wrap","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","abrupt","sent","data","stop","_x","_x2","apply","arguments","chains","_chains","_callee2","_context2","_x3","_swappers","_callee3","_context3","_x4","messagingProtocols","_messagingProtocols","_callee4","_context4","_x5","token","_token","_callee5","customTokenRequest","_context5","_x6","_x7","quote","_quote","_callee6","quoteRequest","body","_context6","from","to","length","undefined","swapperGroups","headers","X-Rango-Id","_x8","_x9","isApproved","_isApproved","_callee7","requestId","txId","_context7","_x10","_x11","_x12","status","_status","_callee8","statusRequest","_context8","_x13","_x14","swap","_swap","_callee9","swapRequest","_context9","referrerAddress","referrerFee","disableEstimate","_x15","_x16","reportFailure","_reportFailure","_callee10","requestBody","_context10","post","_x17","_x18","balance","_balance","_callee11","walletAddress","_context11","_x19","_x20","tokenBalance","_tokenBalance","_callee12","tokenBalanceRequest","_context12","_x21","_x22","connectedAssets","_connectedAssets","_callee13","connectedAssetsRequest","_context13","_x23","_x24","filter","transaction","COSMOS","EVM","SOLANA","TRANSFER"],"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OAAOzJ,2BAPS,SAACgD,GAC7B,OAAAA,EAAYyG,OAAO1J"}
@@ -341,47 +341,37 @@ function assetToString(asset) {
341
341
  return "" + asset.blockchain + (asset.symbol ? '.' + asset.symbol : '') + (asset.address ? '--' + asset.address : '');
342
342
  }
343
343
 
344
- var isEvmBlockchain = function isEvmBlockchain(blockchainMeta) {
345
- return blockchainMeta.type === 'EVM';
344
+ var isEvmBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'EVM'; };
345
+ var isCosmosBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'COSMOS'; };
346
+ var isSolanaBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'SOLANA'; };
347
+ var isTronBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'TRON'; };
348
+ var isTransferBlockchain = function (blockchainMeta) {
349
+ return blockchainMeta.type === 'TRANSFER';
346
350
  };
347
- var isCosmosBlockchain = function isCosmosBlockchain(blockchainMeta) {
348
- return blockchainMeta.type === 'COSMOS';
351
+ var isStarknetBlockchain = function (blockchainMeta) {
352
+ return blockchainMeta.type === 'STARKNET';
349
353
  };
350
- var isSolanaBlockchain = function isSolanaBlockchain(blockchainMeta) {
351
- return blockchainMeta.type === 'SOLANA';
354
+ var isTonBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'TON'; };
355
+ var evmBlockchains = function (blockchains) {
356
+ return blockchains.filter(isEvmBlockchain);
352
357
  };
353
- var isTronBlockchain = function isTronBlockchain(blockchainMeta) {
354
- return blockchainMeta.type === 'TRON';
358
+ var solanaBlockchain = function (blockchains) {
359
+ return blockchains.filter(isSolanaBlockchain);
355
360
  };
356
- var isTransferBlockchain = function isTransferBlockchain(blockchainMeta) {
357
- return blockchainMeta.type === 'TRANSFER';
361
+ var starknetBlockchain = function (blockchains) {
362
+ return blockchains.filter(isStarknetBlockchain);
358
363
  };
359
- var isStarknetBlockchain = function isStarknetBlockchain(blockchainMeta) {
360
- return blockchainMeta.type === 'STARKNET';
364
+ var tronBlockchain = function (blockchains) {
365
+ return blockchains.filter(isTronBlockchain);
361
366
  };
362
- var isTonBlockchain = function isTonBlockchain(blockchainMeta) {
363
- return blockchainMeta.type === 'TON';
367
+ var cosmosBlockchains = function (blockchains) {
368
+ return blockchains.filter(isCosmosBlockchain);
364
369
  };
365
- var evmBlockchains = function evmBlockchains(blockchains) {
366
- return blockchains.filter(isEvmBlockchain);
370
+ var transferBlockchains = function (blockchains) {
371
+ return blockchains.filter(isTransferBlockchain);
367
372
  };
368
- var solanaBlockchain = function solanaBlockchain(blockchains) {
369
- return blockchains.filter(isSolanaBlockchain);
370
- };
371
- var starknetBlockchain = function starknetBlockchain(blockchains) {
372
- return blockchains.filter(isStarknetBlockchain);
373
- };
374
- var tronBlockchain = function tronBlockchain(blockchains) {
375
- return blockchains.filter(isTronBlockchain);
376
- };
377
- var cosmosBlockchains = function cosmosBlockchains(blockchains) {
378
- return blockchains.filter(isCosmosBlockchain);
379
- };
380
- var transferBlockchains = function transferBlockchains(blockchains) {
381
- return blockchains.filter(isTransferBlockchain);
382
- };
383
- var tonBlockchain = function tonBlockchain(blockchains) {
384
- return blockchains.filter(isTonBlockchain);
373
+ var tonBlockchain = function (blockchains) {
374
+ return blockchains.filter(isTonBlockchain);
385
375
  };
386
376
 
387
377
  /**
@@ -390,11 +380,11 @@ var tonBlockchain = function tonBlockchain(blockchains) {
390
380
  */
391
381
  var RoutingResultType;
392
382
  (function (RoutingResultType) {
393
- RoutingResultType["OK"] = "OK";
394
- RoutingResultType["HIGH_IMPACT"] = "HIGH_IMPACT";
395
- RoutingResultType["NO_ROUTE"] = "NO_ROUTE";
396
- RoutingResultType["INPUT_LIMIT_ISSUE"] = "INPUT_LIMIT_ISSUE";
397
- RoutingResultType["HIGH_IMPACT_FOR_CREATE_TX"] = "HIGH_IMPACT_FOR_CREATE_TX";
383
+ RoutingResultType["OK"] = "OK";
384
+ RoutingResultType["HIGH_IMPACT"] = "HIGH_IMPACT";
385
+ RoutingResultType["NO_ROUTE"] = "NO_ROUTE";
386
+ RoutingResultType["INPUT_LIMIT_ISSUE"] = "INPUT_LIMIT_ISSUE";
387
+ RoutingResultType["HIGH_IMPACT_FOR_CREATE_TX"] = "HIGH_IMPACT_FOR_CREATE_TX";
398
388
  })(RoutingResultType || (RoutingResultType = {}));
399
389
 
400
390
  /**
@@ -402,15 +392,15 @@ var RoutingResultType;
402
392
  */
403
393
  var TransactionType;
404
394
  (function (TransactionType) {
405
- TransactionType["EVM"] = "EVM";
406
- TransactionType["TRANSFER"] = "TRANSFER";
407
- TransactionType["COSMOS"] = "COSMOS";
408
- TransactionType["SOLANA"] = "SOLANA";
409
- TransactionType["TRON"] = "TRON";
410
- TransactionType["STARKNET"] = "STARKNET";
411
- TransactionType["TON"] = "TON";
412
- TransactionType["SUI"] = "SUI";
413
- TransactionType["XRPL"] = "XRPL";
395
+ TransactionType["EVM"] = "EVM";
396
+ TransactionType["TRANSFER"] = "TRANSFER";
397
+ TransactionType["COSMOS"] = "COSMOS";
398
+ TransactionType["SOLANA"] = "SOLANA";
399
+ TransactionType["TRON"] = "TRON";
400
+ TransactionType["STARKNET"] = "STARKNET";
401
+ TransactionType["TON"] = "TON";
402
+ TransactionType["SUI"] = "SUI";
403
+ TransactionType["XRPL"] = "XRPL";
414
404
  })(TransactionType || (TransactionType = {}));
415
405
  /**
416
406
  * The type of transaction
@@ -418,42 +408,38 @@ var TransactionType;
418
408
  */
419
409
  var GenericTransactionType;
420
410
  (function (GenericTransactionType) {
421
- GenericTransactionType["EVM"] = "EVM";
422
- GenericTransactionType["TRANSFER"] = "TRANSFER";
423
- GenericTransactionType["COSMOS"] = "COSMOS";
424
- GenericTransactionType["SOLANA"] = "SOLANA";
411
+ GenericTransactionType["EVM"] = "EVM";
412
+ GenericTransactionType["TRANSFER"] = "TRANSFER";
413
+ GenericTransactionType["COSMOS"] = "COSMOS";
414
+ GenericTransactionType["SOLANA"] = "SOLANA";
425
415
  })(GenericTransactionType || (GenericTransactionType = {}));
426
416
  /**
427
417
  * The status of transaction in tracking
428
418
  */
429
419
  var TransactionStatus;
430
420
  (function (TransactionStatus) {
431
- TransactionStatus["FAILED"] = "failed";
432
- TransactionStatus["RUNNING"] = "running";
433
- TransactionStatus["SUCCESS"] = "success";
421
+ TransactionStatus["FAILED"] = "failed";
422
+ TransactionStatus["RUNNING"] = "running";
423
+ TransactionStatus["SUCCESS"] = "success";
434
424
  })(TransactionStatus || (TransactionStatus = {}));
435
425
 
436
- var isCosmosTransaction = function isCosmosTransaction(transaction) {
437
- return transaction.type === TransactionType.COSMOS;
426
+ var isCosmosTransaction = function (transaction) {
427
+ return transaction.type === TransactionType.COSMOS;
438
428
  };
439
429
 
440
- var isSolanaTransaction = function isSolanaTransaction(transaction) {
441
- return transaction.type === TransactionType.SOLANA;
430
+ var isSolanaTransaction = function (transaction) {
431
+ return transaction.type === TransactionType.SOLANA;
442
432
  };
443
433
 
444
- var isTransferTransaction = function isTransferTransaction(transaction) {
445
- return transaction.type === TransactionType.TRANSFER;
446
- };
434
+ var isTransferTransaction = function (transaction) { return transaction.type === TransactionType.TRANSFER; };
447
435
 
448
436
  var TonChainID;
449
437
  (function (TonChainID) {
450
- TonChainID["MAINNET"] = "-239";
451
- TonChainID["TESTNET"] = "-3";
438
+ TonChainID["MAINNET"] = "-239";
439
+ TonChainID["TESTNET"] = "-3";
452
440
  })(TonChainID || (TonChainID = {}));
453
441
 
454
- var isEvmTransaction = function isEvmTransaction(transaction) {
455
- return transaction.type === TransactionType.EVM;
456
- };
442
+ var isEvmTransaction = function (transaction) { return transaction.type === TransactionType.EVM; };
457
443
 
458
444
  var RangoClient = /*#__PURE__*/function () {
459
445
  function RangoClient(apiKey, debug, apiUrl) {
@@ -1 +1 @@
1
- {"version":3,"file":"rango-sdk-basic.esm.js","sources":["../src/types/api/common.ts","../../../node_modules/rango-types/src/api/shared/type-gaurds.ts","../../../node_modules/rango-types/src/api/shared/routing.ts","../../../node_modules/rango-types/src/api/shared/transactions.ts","../../../node_modules/rango-types/src/api/shared/txs/ton.ts","../src/services/client.ts"],"sourcesContent":["import { RequestedAsset } from 'rango-types/lib/api/basic'\nexport * from 'rango-types/lib/api/basic/common'\n\nexport function assetToString(asset: RequestedAsset): string {\n return `${asset.blockchain}${asset.symbol ? '.' + asset.symbol : ''}${\n asset.address ? '--' + asset.address : ''\n }`\n}\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n} from './meta.js'\n\nexport const isEvmBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is EvmBlockchainMeta => blockchainMeta.type === 'EVM'\n\nexport const isCosmosBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is CosmosBlockchainMeta => blockchainMeta.type === 'COSMOS'\n\nexport const isSolanaBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is SolanaBlockchainMeta => blockchainMeta.type === 'SOLANA'\n\nexport const isTronBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TronBlockchainMeta => blockchainMeta.type === 'TRON'\n\nexport const isTransferBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TransferBlockchainMeta =>\n blockchainMeta.type === 'TRANSFER'\n\nexport const isStarknetBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is StarkNetBlockchainMeta =>\n blockchainMeta.type === 'STARKNET'\n\nexport const isTonBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TonBlockchainMeta => blockchainMeta.type === 'TON'\n\nexport const evmBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isEvmBlockchain)\n\nexport const solanaBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isSolanaBlockchain)\n\nexport const starknetBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isStarknetBlockchain)\n\nexport const tronBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTronBlockchain)\n\nexport const cosmosBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isCosmosBlockchain)\n\nexport const transferBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTransferBlockchain)\n\nexport const tonBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTonBlockchain)\n","/**\n * Routing Result Type\n *\n */\nexport enum RoutingResultType {\n OK = 'OK',\n HIGH_IMPACT = 'HIGH_IMPACT',\n NO_ROUTE = 'NO_ROUTE',\n INPUT_LIMIT_ISSUE = 'INPUT_LIMIT_ISSUE',\n HIGH_IMPACT_FOR_CREATE_TX = 'HIGH_IMPACT_FOR_CREATE_TX',\n}\n","/**\n * The type of transaction\n */\nexport enum TransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n TRON = 'TRON',\n STARKNET = 'STARKNET',\n TON = 'TON',\n SUI = 'SUI',\n XRPL = 'XRPL',\n}\n\n/**\n * The type of transaction\n * @deprecated use TransactionType instead\n */\nexport enum GenericTransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n}\n\n/**\n * A transaction's url that can be displayed to advanced user to track the progress\n *\n * @property {string} url - Url of the transaction in blockchain explorer. example: https://etherscan.io/tx/0xa1a3...\n * @property {string | null} description - A custom display name to help user distinguish the transactions from each\n * other. Example: Inbound, Outbound, Bridge, or null\n *\n */\nexport type SwapExplorerUrl = {\n description: string | null\n url: string\n}\n\n/**\n * APIErrorCode\n *\n * Error code of a swap failure\n *\n */\nexport type APIErrorCode =\n | 'TX_FAIL'\n | 'TX_EXPIRED'\n | 'FETCH_TX_FAILED'\n | 'USER_REJECT'\n | 'USER_CANCEL'\n | 'USER_CANCELED_TX'\n | 'CALL_WALLET_FAILED'\n | 'SEND_TX_FAILED'\n | 'CALL_OR_SEND_FAILED'\n | 'TX_FAILED_IN_BLOCKCHAIN'\n | 'CLIENT_UNEXPECTED_BEHAVIOUR'\n | 'INSUFFICIENT_APPROVE'\n\n/**\n * The function checks if a given string value is a valid API error code.\n * @param {string} value - a string that represents a possible API error code.\n * @returns A boolean value is being returned, indicating whether the input `value` is of type\n * `APIErrorCode` or not.\n */\nexport function isAPIErrorCode(value: string): value is APIErrorCode {\n return [\n 'TX_FAIL',\n 'TX_EXPIRED',\n 'FETCH_TX_FAILED',\n 'USER_REJECT',\n 'USER_CANCEL',\n 'USER_CANCELED_TX',\n 'CALL_WALLET_FAILED',\n 'SEND_TX_FAILED',\n 'CALL_OR_SEND_FAILED',\n 'TX_FAILED_IN_BLOCKCHAIN',\n 'CLIENT_UNEXPECTED_BEHAVIOUR',\n 'INSUFFICIENT_APPROVE',\n ].includes(value)\n}\n\n/**\n * ReportTransactionRequest\n *\n * It should be used when an error happened in client and we want to inform server that transaction failed,\n * E.g. user rejected the transaction dialog or and an RPC error raised during signing tx by user.\n *\n * @property {string} requestId - The requestId from best route endpoint\n * @property {APIErrorCode} eventType - Type of the event that happened, example: USER_REJECT\n * @property {number} [step] - Step number in which failure happened\n * @property {string} [reason] - Reason or message for the error\n * @property {[key: string]: string} [data] - @deprecated A list of key-value for extra details\n * @property {wallet?: string, errorCode? string} [tags] - A list of key-value for pre-defined tags\n *\n */\nexport type ReportTransactionRequest = {\n requestId: string\n eventType: APIErrorCode\n step?: number\n reason?: string\n data?: { [key: string]: string }\n tags?: { wallet?: string; errorCode?: string }\n}\n\n/**\n * The status of transaction in tracking\n */\nexport enum TransactionStatus {\n FAILED = 'failed',\n RUNNING = 'running',\n SUCCESS = 'success',\n}\n\n/**\n * Response body of check-approval\n * You could stop check approval if:\n * 1- approved successfully\n * => isApproved = true\n * 2- approval transaction failed\n * => isApproved = false && txStatus === 'failed'\n * 3- approval transaction succeeded but currentApprovedAmount is still less than requiredApprovedAmount\n * (e.g. user changed transaction data and enter another approve amount in MetaMask)\n * => isApproved = false && txStatus == 'success'\n *\n * @property {boolean} isApproved - A flag which indicates that the approve tx is done or not\n * @property {TransactionStatus | null} txStatus - Status of approve transaction in blockchain,\n * if isArppoved is false and txStatus is failed, it seems that approve transaction failed in blockchain\n * @property {string | null} requiredApprovedAmount - required amount to be approved by user\n * @property {string | null} currentApprovedAmount - current approved amount by user\n *\n */\nexport type CheckApprovalResponse = {\n isApproved: boolean\n txStatus: TransactionStatus | null\n requiredApprovedAmount: string | null\n currentApprovedAmount: string | null\n}\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport enum TonChainID {\n MAINNET = '-239',\n TESTNET = '-3',\n}\n\n/**\n * @property {string} address - Receiver's address\n * @property {string} amount - Amount to send in nanoTon\n * @property {string} [stateInit] - Contract specific data to add to the transaction\n * @property {string} [payload] - Contract specific data to add to the transaction\n */\nexport interface TonMessage {\n address: string\n amount: string\n stateInit?: string\n payload?: string\n}\n\n/**\n * This type of transaction is used for all Ton transactions\n *\n * @property {TransactionType} type - This field equals to TON for all Ton transactions\n * @property {number} validUntil - Sending transaction deadline in unix epoch seconds\n * @property {TonChainID} [network] - The network (mainnet or testnet) where DApp intends to send the transaction. If not set, the transaction is sent to the network currently set in the wallet, but this is not safe and DApp should always strive to set the network. If the network parameter is set, but the wallet has a different network set, the wallet should show an alert and DO NOT ALLOW TO SEND this transaction\n * @property {string} [from] - The sender address in '<wc>:<hex>' format from which DApp intends to send the transaction. Current account.address by default\n * @property {TonMessage[]} messages - Messages to send: min is 1, max is 4\n */\nexport interface TonTransaction extends BaseTransaction {\n type: TransactionType.TON\n validUntil: number\n network?: TonChainID\n from?: string\n messages: TonMessage[]\n}\n\nexport const isTonTransaction = (transaction: {\n type: TransactionType\n}): transaction is TonTransaction => transaction.type === TransactionType.TON\n","import uuid from 'uuid-random'\n\nimport {\n MetaRequest,\n MetaResponse,\n QuoteRequest,\n QuoteResponse,\n CheckApprovalResponse,\n StatusRequest,\n StatusResponse,\n SwapRequest,\n SwapResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n assetToString,\n BlockchainMeta,\n RequestOptions,\n MessagingProtocolsResponse,\n SwapperMetaExtended,\n ConnectedAssetsResponse,\n ConnectedAssetsRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceRequest,\n TokenBalanceResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddress = { blockchain: string; address: string }\n\nexport class RangoClient {\n private readonly deviceId: string\n private readonly apiKey: string\n private readonly apiUrl: string\n private readonly httpService: AxiosInstance\n\n constructor(apiKey: string, debug = false, apiUrl?: string) {\n this.apiUrl = apiUrl || 'https://api.rango.exchange'\n this.apiKey = apiKey\n try {\n if (typeof window !== 'undefined') {\n const deviceId = localStorage.getItem('deviceId')\n if (deviceId) {\n this.deviceId = deviceId\n } else {\n const generatedId = uuid()\n localStorage.setItem('deviceId', generatedId)\n this.deviceId = generatedId\n }\n } else {\n this.deviceId = uuid()\n }\n } catch (e) {\n this.deviceId = uuid()\n }\n this.httpService = axios.create({\n baseURL: this.apiUrl,\n })\n if (debug) {\n this.httpService.interceptors.request.use((request) => {\n console.log('Starting Request', JSON.stringify(request, null, 2))\n return request\n })\n this.httpService.interceptors.response.use((response) => {\n console.log('Response:', JSON.stringify(response, null, 2))\n return response\n })\n }\n }\n\n public async meta(\n metaRequest?: MetaRequest,\n options?: RequestOptions\n ): Promise<MetaResponse> {\n const params = {\n ...metaRequest,\n blockchains: metaRequest?.blockchains?.join(),\n swappers: metaRequest?.swappers?.join(),\n swappersGroups: metaRequest?.swappersGroups?.join(),\n transactionTypes: metaRequest?.transactionTypes?.join(),\n }\n const axiosResponse = await this.httpService.get<MetaResponse>(\n `/basic/meta?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async chains(options?: RequestOptions): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/basic/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async swappers(options?: RequestOptions): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/basic/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async messagingProtocols(\n options?: RequestOptions\n ): Promise<MessagingProtocolsResponse> {\n const axiosResponse =\n await this.httpService.get<MessagingProtocolsResponse>(\n `/basic/meta/messaging-protocols?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n\n public async token(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/basic/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async quote(\n quoteRequest: QuoteRequest,\n options?: RequestOptions\n ): Promise<QuoteResponse> {\n const body = {\n ...quoteRequest,\n from: assetToString(quoteRequest.from),\n to: assetToString(quoteRequest.to),\n swappers:\n !!quoteRequest.swappers && quoteRequest.swappers.length > 0\n ? quoteRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!quoteRequest.swapperGroups && quoteRequest.swapperGroups.length > 0\n ? quoteRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!quoteRequest.messagingProtocols &&\n quoteRequest.messagingProtocols.length > 0\n ? quoteRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<QuoteResponse>(\n `/basic/quote?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async isApproved(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/basic/is-approved?apiKey=${this.apiKey}`,\n {\n params: { requestId, txId },\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async status(\n statusRequest: StatusRequest,\n options?: RequestOptions\n ): Promise<StatusResponse> {\n const axiosResponse = await this.httpService.get<StatusResponse>(\n `/basic/status?apiKey=${this.apiKey}`,\n {\n params: statusRequest,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async swap(\n swapRequest: SwapRequest,\n options?: RequestOptions\n ): Promise<SwapResponse> {\n const body = {\n ...swapRequest,\n from: assetToString(swapRequest.from),\n to: assetToString(swapRequest.to),\n referrerAddress: swapRequest.referrerAddress || null,\n referrerFee: swapRequest.referrerFee || null,\n disableEstimate: swapRequest.disableEstimate || false,\n swappers:\n !!swapRequest.swappers && swapRequest.swappers.length > 0\n ? swapRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!swapRequest.swapperGroups && swapRequest.swapperGroups.length > 0\n ? swapRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!swapRequest.messagingProtocols &&\n swapRequest.messagingProtocols.length > 0\n ? swapRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<SwapResponse>(\n `/basic/swap?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async reportFailure(\n requestBody: ReportTransactionRequest,\n options?: RequestOptions\n ): Promise<void> {\n await this.httpService.post(\n `/basic/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n }\n\n public async balance(\n walletAddress: WalletAddress,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/basic/balance?apiKey=${this.apiKey}`,\n {\n params: walletAddress,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async tokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/basic/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async connectedAssets(\n connectedAssetsRequest: ConnectedAssetsRequest,\n options?: RequestOptions\n ): Promise<ConnectedAssetsResponse> {\n const body = {\n from: assetToString(connectedAssetsRequest.from),\n }\n\n const axiosResponse = await this.httpService.get<ConnectedAssetsResponse>(\n `/basic/connected-assets?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n}\n"],"names":["assetToString","asset","blockchain","symbol","address","isEvmBlockchain","blockchainMeta","RangoClient","apiKey","debug","apiUrl","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","interceptors","request","use","console","log","JSON","stringify","response","_proto","prototype","meta","_meta","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","axiosResponse","wrap","_callee$","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","sent","abrupt","data","stop","_x","_x2","apply","arguments","chains","_chains","_callee2","_callee2$","_context2","_x3","_swappers","_callee3","_callee3$","_context3","_x4","messagingProtocols","_messagingProtocols","_callee4","_callee4$","_context4","_x5","token","_token","_callee5","customTokenRequest","_callee5$","_context5","_x6","_x7","quote","_quote","_callee6","quoteRequest","body","_callee6$","_context6","from","to","length","undefined","swapperGroups","headers","_x8","_x9","isApproved","_isApproved","_callee7","requestId","txId","_callee7$","_context7","_x10","_x11","_x12","status","_status","_callee8","statusRequest","_callee8$","_context8","_x13","_x14","swap","_swap","_callee9","swapRequest","_callee9$","_context9","referrerAddress","referrerFee","disableEstimate","_x15","_x16","reportFailure","_reportFailure","_callee10","requestBody","_callee10$","_context10","post","_x17","_x18","balance","_balance","_callee11","walletAddress","_callee11$","_context11","_x19","_x20","tokenBalance","_tokenBalance","_callee12","tokenBalanceRequest","_callee12$","_context12","_x21","_x22","connectedAssets","_connectedAssets","_callee13","connectedAssetsRequest","_callee13$","_context13","_x23","_x24"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAGgBA,aAAaA,CAACC,KAAqB;EACjD,YAAUA,KAAK,CAACC,UAAU,IAAGD,KAAK,CAACE,MAAM,GAAG,GAAG,GAAGF,KAAK,CAACE,MAAM,GAAG,EAAE,KACjEF,KAAK,CAACG,OAAO,GAAG,IAAI,GAAGH,KAAK,CAACG,OAAO,GAAG,EACzC;AACF;;mBCkC8B,2BAAAC;;;qDAIUC;;;AAGtC;;;AAKF;;;yDAI0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzD1C;;;;AAIA;AAAA;gCAAY;;;;;;;ACJZ;;;AAGA;AAAA;;;;;;;;;;;AAYA;;;;AAIA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACmBA;;;;;;ICRaC,WAAW;EAMtB,SAAAA,YAAYC,MAAc,EAAEC,KAAK,EAAUC,MAAe;QAA9BD,KAAK;MAALA,KAAK,GAAG,KAAK;;IACvC,IAAI,CAACC,MAAM,GAAGA,MAAM,IAAI,4BAA4B;IACpD,IA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AV,mBAAA,GAAAW,IAAA,UAAAsH,WAAAC,UAAA;QAAA,kBAAAA,UAAA,CAAApH,IAAA,GAAAoH,UAAA,CAAAnH,IAAA;UAAA;YAElB6C,IAAI,GAAG;cACXG,IAAI,EAAEnG,aAAa,CAACoK,sBAAsB,CAACjE,IAAI;aAChD;YAAAmE,UAAA,CAAAnH,IAAA;YAAA,OAE2B,IAAI,CAAChC,WAAW,CAACuC,GAAG,qCACZ,IAAI,CAAClD,MAAM,EAAA4C,QAAA;cAE3CP,MAAM,EAAEmD,IAAI;cACZQ,OAAO,EAAE;gBAAE,YAAY,EAAE,IAAI,CAAC5F;;eAC3B4B,OAAO,CACX,CACF;UAAA;YAPKM,aAAa,GAAAwH,UAAA,CAAA3G,IAAA;YAAA,OAAA2G,UAAA,CAAA1G,MAAA,WAQZd,aAAa,CAACe,IAAI;UAAA;UAAA;YAAA,OAAAyG,UAAA,CAAAxG,IAAA;;SAAAqG,SAAA;KAC1B;IAAA,SAAAF,gBAAAM,IAAA,EAAAC,IAAA;MAAA,OAAAN,gBAAA,CAAAjG,KAAA,OAAAC,SAAA;;IAAA,OAAA+F,eAAA;;EAAA,OAAA1J,WAAA;AAAA;;;;"}
1
+ {"version":3,"file":"rango-sdk-basic.esm.js","sources":["../src/types/api/common.ts","../node_modules/rango-types/src/api/shared/type-gaurds.ts","../node_modules/rango-types/src/api/shared/routing.ts","../node_modules/rango-types/src/api/shared/transactions.ts","../node_modules/rango-types/src/api/shared/txs/cosmos.ts","../node_modules/rango-types/src/api/shared/txs/solana.ts","../node_modules/rango-types/src/api/shared/txs/transfer.ts","../node_modules/rango-types/src/api/shared/txs/ton.ts","../node_modules/rango-types/src/api/basic/txs/evm.ts","../src/services/client.ts"],"sourcesContent":["import { RequestedAsset } from 'rango-types/lib/api/basic'\nexport * from 'rango-types/lib/api/basic/common'\n\nexport function assetToString(asset: RequestedAsset): string {\n return `${asset.blockchain}${asset.symbol ? '.' + asset.symbol : ''}${\n asset.address ? '--' + asset.address : ''\n }`\n}\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n} from './meta.js'\n\nexport const isEvmBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is EvmBlockchainMeta => blockchainMeta.type === 'EVM'\n\nexport const isCosmosBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is CosmosBlockchainMeta => blockchainMeta.type === 'COSMOS'\n\nexport const isSolanaBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is SolanaBlockchainMeta => blockchainMeta.type === 'SOLANA'\n\nexport const isTronBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TronBlockchainMeta => blockchainMeta.type === 'TRON'\n\nexport const isTransferBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TransferBlockchainMeta =>\n blockchainMeta.type === 'TRANSFER'\n\nexport const isStarknetBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is StarkNetBlockchainMeta =>\n blockchainMeta.type === 'STARKNET'\n\nexport const isTonBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TonBlockchainMeta => blockchainMeta.type === 'TON'\n\nexport const evmBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isEvmBlockchain)\n\nexport const solanaBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isSolanaBlockchain)\n\nexport const starknetBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isStarknetBlockchain)\n\nexport const tronBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTronBlockchain)\n\nexport const cosmosBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isCosmosBlockchain)\n\nexport const transferBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTransferBlockchain)\n\nexport const tonBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTonBlockchain)\n","/**\n * Routing Result Type\n *\n */\nexport enum RoutingResultType {\n OK = 'OK',\n HIGH_IMPACT = 'HIGH_IMPACT',\n NO_ROUTE = 'NO_ROUTE',\n INPUT_LIMIT_ISSUE = 'INPUT_LIMIT_ISSUE',\n HIGH_IMPACT_FOR_CREATE_TX = 'HIGH_IMPACT_FOR_CREATE_TX',\n}\n","/**\n * The type of transaction\n */\nexport enum TransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n TRON = 'TRON',\n STARKNET = 'STARKNET',\n TON = 'TON',\n SUI = 'SUI',\n XRPL = 'XRPL',\n}\n\n/**\n * The type of transaction\n * @deprecated use TransactionType instead\n */\nexport enum GenericTransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n}\n\n/**\n * A transaction's url that can be displayed to advanced user to track the progress\n *\n * @property {string} url - Url of the transaction in blockchain explorer. example: https://etherscan.io/tx/0xa1a3...\n * @property {string | null} description - A custom display name to help user distinguish the transactions from each\n * other. Example: Inbound, Outbound, Bridge, or null\n *\n */\nexport type SwapExplorerUrl = {\n description: string | null\n url: string\n}\n\n/**\n * APIErrorCode\n *\n * Error code of a swap failure\n *\n */\nexport type APIErrorCode =\n | 'TX_FAIL'\n | 'TX_EXPIRED'\n | 'FETCH_TX_FAILED'\n | 'USER_REJECT'\n | 'USER_CANCEL'\n | 'USER_CANCELED_TX'\n | 'CALL_WALLET_FAILED'\n | 'SEND_TX_FAILED'\n | 'CALL_OR_SEND_FAILED'\n | 'TX_FAILED_IN_BLOCKCHAIN'\n | 'CLIENT_UNEXPECTED_BEHAVIOUR'\n | 'INSUFFICIENT_APPROVE'\n\n/**\n * The function checks if a given string value is a valid API error code.\n * @param {string} value - a string that represents a possible API error code.\n * @returns A boolean value is being returned, indicating whether the input `value` is of type\n * `APIErrorCode` or not.\n */\nexport function isAPIErrorCode(value: string): value is APIErrorCode {\n return [\n 'TX_FAIL',\n 'TX_EXPIRED',\n 'FETCH_TX_FAILED',\n 'USER_REJECT',\n 'USER_CANCEL',\n 'USER_CANCELED_TX',\n 'CALL_WALLET_FAILED',\n 'SEND_TX_FAILED',\n 'CALL_OR_SEND_FAILED',\n 'TX_FAILED_IN_BLOCKCHAIN',\n 'CLIENT_UNEXPECTED_BEHAVIOUR',\n 'INSUFFICIENT_APPROVE',\n ].includes(value)\n}\n\n/**\n * ReportTransactionRequest\n *\n * It should be used when an error happened in client and we want to inform server that transaction failed,\n * E.g. user rejected the transaction dialog or and an RPC error raised during signing tx by user.\n *\n * @property {string} requestId - The requestId from best route endpoint\n * @property {APIErrorCode} eventType - Type of the event that happened, example: USER_REJECT\n * @property {number} [step] - Step number in which failure happened\n * @property {string} [reason] - Reason or message for the error\n * @property {[key: string]: string} [data] - @deprecated A list of key-value for extra details\n * @property {wallet?: string, errorCode? string} [tags] - A list of key-value for pre-defined tags\n *\n */\nexport type ReportTransactionRequest = {\n requestId: string\n eventType: APIErrorCode\n step?: number\n reason?: string\n data?: { [key: string]: string }\n tags?: { wallet?: string; errorCode?: string }\n}\n\n/**\n * The status of transaction in tracking\n */\nexport enum TransactionStatus {\n FAILED = 'failed',\n RUNNING = 'running',\n SUCCESS = 'success',\n}\n\n/**\n * Response body of check-approval\n * You could stop check approval if:\n * 1- approved successfully\n * => isApproved = true\n * 2- approval transaction failed\n * => isApproved = false && txStatus === 'failed'\n * 3- approval transaction succeeded but currentApprovedAmount is still less than requiredApprovedAmount\n * (e.g. user changed transaction data and enter another approve amount in MetaMask)\n * => isApproved = false && txStatus == 'success'\n *\n * @property {boolean} isApproved - A flag which indicates that the approve tx is done or not\n * @property {TransactionStatus | null} txStatus - Status of approve transaction in blockchain,\n * if isArppoved is false and txStatus is failed, it seems that approve transaction failed in blockchain\n * @property {string | null} requiredApprovedAmount - required amount to be approved by user\n * @property {string | null} currentApprovedAmount - current approved amount by user\n *\n */\nexport type CheckApprovalResponse = {\n isApproved: boolean\n txStatus: TransactionStatus | null\n requiredApprovedAmount: string | null\n currentApprovedAmount: string | null\n}\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * CosmosCoin\n */\nexport type CosmosCoin = {\n amount: string\n denom: string\n}\n\n/**\n * CosmosProtoMsg\n */\nexport type CosmosProtoMsg = {\n type_url: string\n value: number[]\n}\n\n/**\n * CosmosFee representing fee for cosmos transaction\n */\nexport type CosmosFee = {\n gas: string\n amount: CosmosCoin[]\n}\n\n/**\n * Main transaction object for COSMOS type transactions\n */\nexport type CosmosMessage = {\n signType: 'AMINO' | 'DIRECT'\n sequence: string | null\n source: number | null\n account_number: number | null\n rpcUrl: string\n chainId: string | null\n msgs: any[] // TODO\n protoMsgs: CosmosProtoMsg[]\n memo: string | null\n fee: CosmosFee | null\n}\n/**\n * An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages (e.g. XDefi)\n *\n * @property {AssetWithTicker} asset - The asset to be transferred\n * @property {string} amount - The machine-readable amount to transfer, example: 1000000000000000000\n * @property {number} decimals - The decimals for this asset, example: 18\n * @property {string | null} memo - Memo of transaction, could be null\n * @property {string} method - The transaction method, example: transfer, deposit\n * @property {string} recipient - The recipient address of transaction\n *\n */\nexport type CosmosRawTransferData = {\n amount: string\n asset: AssetWithTicker\n decimals: number\n memo: string | null\n method: string\n recipient: string\n}\n\n/**\n * A Cosmos transaction, child of GenericTransaction\n *\n * @property {TransactionType} type - This fields equals to COSMOS for all CosmosTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} fromWalletAddress - Address of wallet that this transaction should be executed in, same as the create transaction request's input\n * @property {CosmosMessage} data - Transaction data\n * @property {CosmosRawTransferData | null} rawTransfer - An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages\n *\n */\nexport interface CosmosTransaction extends BaseTransaction {\n type: TransactionType.COSMOS\n fromWalletAddress: string\n data: CosmosMessage\n rawTransfer: CosmosRawTransferData | null\n}\n\nexport const isCosmosTransaction = (transaction: {\n type: TransactionType\n}): transaction is CosmosTransaction =>\n transaction.type === TransactionType.COSMOS\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * Account metadata used to define instructions\n */\nexport type SolanaInstructionKey = {\n pubkey: string\n isSigner: boolean\n isWritable: boolean\n}\n\n/**\n * Transaction Instruction class\n */\nexport type SolanaInstruction = {\n keys: SolanaInstructionKey[]\n programId: string\n data: number[]\n}\n\n/**\n * Pair of signature and corresponding public key\n */\nexport type SolanaSignature = {\n signature: number[]\n publicKey: string\n}\n\n/**\n * This type of transaction is used for all solana transactions\n *\n * @property {TransactionType} type - This fields equals to SOLANA for all SolanaTransactions\n * @property {'LEGACY' | 'VERSIONED'} txType - Type of the solana transaction\n * @property {string} blockChain, equals to SOLANA\n * @property {string} from, Source wallet address\n * @property {string} identifier, Transaction hash used in case of retry\n * @property {string | null} recentBlockhash, A recent blockhash\n * @property {SolanaSignature[]} signatures, Signatures for the transaction\n * @property {number[] | null} serializedMessage, The byte array of the transaction\n * @property {SolanaInstruction[]} instructions, The instructions to atomically execute\n *\n */\nexport interface SolanaTransaction extends BaseTransaction {\n type: TransactionType.SOLANA\n txType: 'LEGACY' | 'VERSIONED'\n from: string\n identifier: string\n recentBlockhash: string | null\n signatures: SolanaSignature[]\n serializedMessage: number[] | null\n instructions: SolanaInstruction[]\n}\n\nexport const isSolanaTransaction = (transaction: {\n type: TransactionType\n}): transaction is SolanaTransaction =>\n transaction.type === TransactionType.SOLANA\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type InputToSign = { address: string, signingIndexes: number[] }\n/**\n * @property {unsignedPsbtBase64} unsignedPsbtBase64 - Base 64 representation of the Unsigned PSBT\n * @property {InputToSign[]} inputsToSign - Inputs to be signed\n */\nexport type PSBT = {\n unsignedPsbtBase64: string\n inputsToSign: InputToSign[]\n}\n/**\n * TransferTransaction. This type of transaction is used for UTXO blockchains including BTC, LTC, BCH\n *\n * @property {TransactionType} type - This fields equals to TRANSFER for all TransferTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} method - The method that should be passed to wallet. examples: deposit, transfer\n * @property {AssetWithTicker} asset\n * @property {string} amount - The machine-readable amount of transaction, example: 1000000000000000000\n * @property {number} decimals - The decimals of the asset\n * @property {string} fromWalletAddress - The source wallet address that can sign this transaction\n * @property {string} recipientAddress - The destination wallet address that the fund should be sent to\n * @property {string | null} memo - The memo of transaction, can be null\n * @property {PSBT | null} psbt - PSBT object containing base 64 representation of the Unsigned PSBT along with the inputs to be signed\n *\n */\nexport interface Transfer extends BaseTransaction {\n type: TransactionType.TRANSFER\n method: string\n asset: AssetWithTicker\n amount: string\n decimals: number\n fromWalletAddress: string\n recipientAddress: string\n memo: string | null\n psbt: PSBT | null\n}\n\nexport const isTransferTransaction = (transaction: {\n type: TransactionType\n}): transaction is Transfer => transaction.type === TransactionType.TRANSFER\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport enum TonChainID {\n MAINNET = '-239',\n TESTNET = '-3',\n}\n\n/**\n * @property {string} address - Receiver's address\n * @property {string} amount - Amount to send in nanoTon\n * @property {string} [stateInit] - Contract specific data to add to the transaction\n * @property {string} [payload] - Contract specific data to add to the transaction\n */\nexport interface TonMessage {\n address: string\n amount: string\n stateInit?: string\n payload?: string\n}\n\n/**\n * This type of transaction is used for all Ton transactions\n *\n * @property {TransactionType} type - This field equals to TON for all Ton transactions\n * @property {number} validUntil - Sending transaction deadline in unix epoch seconds\n * @property {TonChainID} [network] - The network (mainnet or testnet) where DApp intends to send the transaction. If not set, the transaction is sent to the network currently set in the wallet, but this is not safe and DApp should always strive to set the network. If the network parameter is set, but the wallet has a different network set, the wallet should show an alert and DO NOT ALLOW TO SEND this transaction\n * @property {string} [from] - The sender address in '<wc>:<hex>' format from which DApp intends to send the transaction. Current account.address by default\n * @property {TonMessage[]} messages - Messages to send: min is 1, max is 4\n */\nexport interface TonTransaction extends BaseTransaction {\n type: TransactionType.TON\n validUntil: number\n network?: TonChainID\n from?: string\n messages: TonMessage[]\n}\n\nexport const isTonTransaction = (transaction: {\n type: TransactionType\n}): transaction is TonTransaction => transaction.type === TransactionType.TON\n","import { BlockchainMetaBase } from '../meta.js'\nimport { TransactionType } from '../transactions.js'\n\n\n\n/**\n * Blockchain info for basic API EVM transaction\n */\nexport type EvmTransactionBlockchain = Pick<\n BlockchainMetaBase, 'name' | 'defaultDecimals' | 'addressPatterns' | 'feeAssets' | 'type' | 'chainId'\n>\n\n/**\n * The transaction object for all EVM-based blockchains, including Ethereum, BSC, Polygon, Harmony, etc\n *\n * @property {TransactionType} type - This fields equals to EVM for all EVMTransactions\n * @property {EvmTransactionBlockchain} blockChain - The blockchain info that this transaction is going to run in\n * @property {string | null} from - The source wallet address, it can be null\n * @property {string} approveTo - Address of source token erc20 contract for increasing approve amount\n * @property {string | null} approveData - The data of approve transaction\n * @property {string} txTo - Address of dex/bridge smart contract that is going to be called\n * @property {string | null} txData - The data of main transaction, it can be null in case of native token transfer\n * @property {string | null} value - The amount of transaction in case of native token transfer\n * @property {string | null} gasPrice - The suggested gas price for this transaction\n * @property {string | null} gasLimit - The suggested gas limit for this transaction\n * @property {string | null} maxPriorityFeePerGas - Suggested max priority fee per gas for this transaction\n * @property {string | null} maxFeePerGas - Suggested max fee per gas for this transaction\n *\n */\nexport interface EvmTransaction {\n type: TransactionType.EVM\n blockChain: EvmTransactionBlockchain\n from: string | null\n approveTo: string | null\n approveData: string | null\n txTo: string\n txData: string | null\n value: string | null\n gasLimit: string | null\n gasPrice: string | null\n maxPriorityFeePerGas: string | null\n maxFeePerGas: string | null\n}\n\nexport const isEvmTransaction = (transaction: {\n type: TransactionType\n}): transaction is EvmTransaction => transaction.type === TransactionType.EVM\n","import uuid from 'uuid-random'\n\nimport {\n MetaRequest,\n MetaResponse,\n QuoteRequest,\n QuoteResponse,\n CheckApprovalResponse,\n StatusRequest,\n StatusResponse,\n SwapRequest,\n SwapResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n assetToString,\n BlockchainMeta,\n RequestOptions,\n MessagingProtocolsResponse,\n SwapperMetaExtended,\n ConnectedAssetsResponse,\n ConnectedAssetsRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceRequest,\n TokenBalanceResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddress = { blockchain: string; address: string }\n\nexport class RangoClient {\n private readonly deviceId: string\n private readonly apiKey: string\n private readonly apiUrl: string\n private readonly httpService: AxiosInstance\n\n constructor(apiKey: string, debug = false, apiUrl?: string) {\n this.apiUrl = apiUrl || 'https://api.rango.exchange'\n this.apiKey = apiKey\n try {\n if (typeof window !== 'undefined') {\n const deviceId = localStorage.getItem('deviceId')\n if (deviceId) {\n this.deviceId = deviceId\n } else {\n const generatedId = uuid()\n localStorage.setItem('deviceId', generatedId)\n this.deviceId = generatedId\n }\n } else {\n this.deviceId = uuid()\n }\n } catch (e) {\n this.deviceId = uuid()\n }\n this.httpService = axios.create({\n baseURL: this.apiUrl,\n })\n if (debug) {\n this.httpService.interceptors.request.use((request) => {\n console.log('Starting Request', JSON.stringify(request, null, 2))\n return request\n })\n this.httpService.interceptors.response.use((response) => {\n console.log('Response:', JSON.stringify(response, null, 2))\n return response\n })\n }\n }\n\n public async meta(\n metaRequest?: MetaRequest,\n options?: RequestOptions\n ): Promise<MetaResponse> {\n const params = {\n ...metaRequest,\n blockchains: metaRequest?.blockchains?.join(),\n swappers: metaRequest?.swappers?.join(),\n swappersGroups: metaRequest?.swappersGroups?.join(),\n transactionTypes: metaRequest?.transactionTypes?.join(),\n }\n const axiosResponse = await this.httpService.get<MetaResponse>(\n `/basic/meta?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async chains(options?: RequestOptions): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/basic/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async swappers(options?: RequestOptions): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/basic/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async messagingProtocols(\n options?: RequestOptions\n ): Promise<MessagingProtocolsResponse> {\n const axiosResponse =\n await this.httpService.get<MessagingProtocolsResponse>(\n `/basic/meta/messaging-protocols?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n\n public async token(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/basic/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async quote(\n quoteRequest: QuoteRequest,\n options?: RequestOptions\n ): Promise<QuoteResponse> {\n const body = {\n ...quoteRequest,\n from: assetToString(quoteRequest.from),\n to: assetToString(quoteRequest.to),\n swappers:\n !!quoteRequest.swappers && quoteRequest.swappers.length > 0\n ? quoteRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!quoteRequest.swapperGroups && quoteRequest.swapperGroups.length > 0\n ? quoteRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!quoteRequest.messagingProtocols &&\n quoteRequest.messagingProtocols.length > 0\n ? quoteRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<QuoteResponse>(\n `/basic/quote?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async isApproved(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/basic/is-approved?apiKey=${this.apiKey}`,\n {\n params: { requestId, txId },\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async status(\n statusRequest: StatusRequest,\n options?: RequestOptions\n ): Promise<StatusResponse> {\n const axiosResponse = await this.httpService.get<StatusResponse>(\n `/basic/status?apiKey=${this.apiKey}`,\n {\n params: statusRequest,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async swap(\n swapRequest: SwapRequest,\n options?: RequestOptions\n ): Promise<SwapResponse> {\n const body = {\n ...swapRequest,\n from: assetToString(swapRequest.from),\n to: assetToString(swapRequest.to),\n referrerAddress: swapRequest.referrerAddress || null,\n referrerFee: swapRequest.referrerFee || null,\n disableEstimate: swapRequest.disableEstimate || false,\n swappers:\n !!swapRequest.swappers && swapRequest.swappers.length > 0\n ? swapRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!swapRequest.swapperGroups && swapRequest.swapperGroups.length > 0\n ? swapRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!swapRequest.messagingProtocols &&\n swapRequest.messagingProtocols.length > 0\n ? swapRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<SwapResponse>(\n `/basic/swap?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async reportFailure(\n requestBody: ReportTransactionRequest,\n options?: RequestOptions\n ): Promise<void> {\n await this.httpService.post(\n `/basic/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n }\n\n public async balance(\n walletAddress: WalletAddress,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/basic/balance?apiKey=${this.apiKey}`,\n {\n params: walletAddress,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async tokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/basic/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async connectedAssets(\n connectedAssetsRequest: ConnectedAssetsRequest,\n options?: RequestOptions\n ): Promise<ConnectedAssetsResponse> {\n const body = {\n from: assetToString(connectedAssetsRequest.from),\n }\n\n const axiosResponse = await this.httpService.get<ConnectedAssetsResponse>(\n `/basic/connected-assets?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n}\n"],"names":["assetToString","asset","blockchain","symbol","address","RangoClient","apiKey","debug","apiUrl","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","interceptors","request","use","console","log","JSON","stringify","response","_proto","prototype","meta","_meta","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","axiosResponse","wrap","_callee$","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","sent","abrupt","data","stop","_x","_x2","apply","arguments","chains","_chains","_callee2","_callee2$","_context2","_x3","_swappers","_callee3","_callee3$","_context3","_x4","messagingProtocols","_messagingProtocols","_callee4","_callee4$","_context4","_x5","token","_token","_callee5","customTokenRequest","_callee5$","_context5","_x6","_x7","quote","_quote","_callee6","quoteRequest","body","_callee6$","_context6","from","to","length","undefined","swapperGroups","headers","_x8","_x9","isApproved","_isApproved","_callee7","requestId","txId","_callee7$","_context7","_x10","_x11","_x12","status","_status","_callee8","statusRequest","_callee8$","_context8","_x13","_x14","swap","_swap","_callee9","swapRequest","_callee9$","_context9","referrerAddress","referrerFee","disableEstimate","_x15","_x16","reportFailure","_reportFailure","_callee10","requestBody","_callee10$","_context10","post","_x17","_x18","balance","_balance","_callee11","walletAddress","_callee11$","_context11","_x19","_x20","tokenBalance","_tokenBalance","_callee12","tokenBalanceRequest","_callee12$","_context12","_x21","_x22","connectedAssets","_connectedAssets","_callee13","connectedAssetsRequest","_callee13$","_context13","_x23","_x24"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAGgBA,aAAaA,CAACC,KAAqB;EACjD,YAAUA,KAAK,CAACC,UAAU,IAAGD,KAAK,CAACE,MAAM,GAAG,GAAG,GAAGF,KAAK,CAACE,MAAM,GAAG,EAAE,KACjEF,KAAK,CAACG,OAAO,GAAG,IAAI,GAAGH,KAAK,CAACG,OAAO,GAAG,EACzC;AACF;;ICIa,eAAe,GAAG,UAC7B,cAA8B,IACU,OAAA,cAAc,CAAC,IAAI,KAAK,KAAK,GAAA,CAAA;AAEvE,IAAa,kBAAkB,GAAG,UAChC,cAA8B,IACa,OAAA,cAAc,CAAC,IAAI,KAAK,QAAQ,GAAA,CAAA;AAE7E,IAAa,kBAAkB,GAAG,UAChC,cAA8B,IACa,OAAA,cAAc,CAAC,IAAI,KAAK,QAAQ,GAAA,CAAA;A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,OAAAuF,YAAA;;EAAA1H,MAAA,CAEYkI,eAAe;IAAA,IAAAC,gBAAA,gBAAA/H,iBAAA,eAAAC,mBAAA,GAAAC,IAAA,CAArB,SAAA8H,UACLC,sBAA8C,EAC9C5H,OAAwB;MAAA,IAAAwD,IAAA,EAAAlD,aAAA;MAAA,OAAAV,mBAAA,GAAAW,IAAA,UAAAsH,WAAAC,UAAA;QAAA,kBAAAA,UAAA,CAAApH,IAAA,GAAAoH,UAAA,CAAAnH,IAAA;UAAA;YAElB6C,IAAI,GAAG;cACXG,IAAI,EAAEjG,aAAa,CAACkK,sBAAsB,CAACjE,IAAI;aAChD;YAAAmE,UAAA,CAAAnH,IAAA;YAAA,OAE2B,IAAI,CAAChC,WAAW,CAACuC,GAAG,qCACZ,IAAI,CAAClD,MAAM,EAAA4C,QAAA;cAE3CP,MAAM,EAAEmD,IAAI;cACZQ,OAAO,EAAE;gBAAE,YAAY,EAAE,IAAI,CAAC5F;;eAC3B4B,OAAO,CACX,CACF;UAAA;YAPKM,aAAa,GAAAwH,UAAA,CAAA3G,IAAA;YAAA,OAAA2G,UAAA,CAAA1G,MAAA,WAQZd,aAAa,CAACe,IAAI;UAAA;UAAA;YAAA,OAAAyG,UAAA,CAAAxG,IAAA;;SAAAqG,SAAA;KAC1B;IAAA,SAAAF,gBAAAM,IAAA,EAAAC,IAAA;MAAA,OAAAN,gBAAA,CAAAjG,KAAA,OAAAC,SAAA;;IAAA,OAAA+F,eAAA;;EAAA,OAAA1J,WAAA;AAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rango-sdk-basic",
3
- "version": "0.1.69",
3
+ "version": "0.1.71",
4
4
  "description": "Rango Exchange Basic SDK for dApps",
5
5
  "module": "lib/rango-sdk-basic.esm.js",
6
6
  "main": "lib/index.js",
@@ -43,7 +43,7 @@
43
43
  "license": "GPL-3.0",
44
44
  "dependencies": {
45
45
  "axios": "^1.7.4",
46
- "rango-types": "^0.1.88",
46
+ "rango-types": "^0.1.89",
47
47
  "uuid-random": "^1.3.2"
48
48
  },
49
49
  "publishConfig": {