rango-sdk-basic 0.1.68 → 0.1.69

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,37 +347,47 @@ function assetToString(asset) {
347
347
  return "" + asset.blockchain + (asset.symbol ? '.' + asset.symbol : '') + (asset.address ? '--' + asset.address : '');
348
348
  }
349
349
 
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';
350
+ var isEvmBlockchain = function isEvmBlockchain(blockchainMeta) {
351
+ return blockchainMeta.type === 'EVM';
356
352
  };
357
- var isStarknetBlockchain = function (blockchainMeta) {
358
- return blockchainMeta.type === 'STARKNET';
353
+ var isCosmosBlockchain = function isCosmosBlockchain(blockchainMeta) {
354
+ return blockchainMeta.type === 'COSMOS';
359
355
  };
360
- var isTonBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'TON'; };
361
- var evmBlockchains = function (blockchains) {
362
- return blockchains.filter(isEvmBlockchain);
356
+ var isSolanaBlockchain = function isSolanaBlockchain(blockchainMeta) {
357
+ return blockchainMeta.type === 'SOLANA';
363
358
  };
364
- var solanaBlockchain = function (blockchains) {
365
- return blockchains.filter(isSolanaBlockchain);
359
+ var isTronBlockchain = function isTronBlockchain(blockchainMeta) {
360
+ return blockchainMeta.type === 'TRON';
366
361
  };
367
- var starknetBlockchain = function (blockchains) {
368
- return blockchains.filter(isStarknetBlockchain);
362
+ var isTransferBlockchain = function isTransferBlockchain(blockchainMeta) {
363
+ return blockchainMeta.type === 'TRANSFER';
369
364
  };
370
- var tronBlockchain = function (blockchains) {
371
- return blockchains.filter(isTronBlockchain);
365
+ var isStarknetBlockchain = function isStarknetBlockchain(blockchainMeta) {
366
+ return blockchainMeta.type === 'STARKNET';
372
367
  };
373
- var cosmosBlockchains = function (blockchains) {
374
- return blockchains.filter(isCosmosBlockchain);
368
+ var isTonBlockchain = function isTonBlockchain(blockchainMeta) {
369
+ return blockchainMeta.type === 'TON';
375
370
  };
376
- var transferBlockchains = function (blockchains) {
377
- return blockchains.filter(isTransferBlockchain);
371
+ var evmBlockchains = function evmBlockchains(blockchains) {
372
+ return blockchains.filter(isEvmBlockchain);
378
373
  };
379
- var tonBlockchain = function (blockchains) {
380
- return blockchains.filter(isTonBlockchain);
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);
381
391
  };
382
392
 
383
393
  /**
@@ -385,55 +395,60 @@ var tonBlockchain = function (blockchains) {
385
395
  *
386
396
  */
387
397
  (function (RoutingResultType) {
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";
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";
393
403
  })(exports.RoutingResultType || (exports.RoutingResultType = {}));
394
404
 
395
405
  /**
396
406
  * The type of transaction
397
407
  */
398
408
  (function (TransactionType) {
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";
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";
407
418
  })(exports.TransactionType || (exports.TransactionType = {}));
408
419
  (function (GenericTransactionType) {
409
- GenericTransactionType["EVM"] = "EVM";
410
- GenericTransactionType["TRANSFER"] = "TRANSFER";
411
- GenericTransactionType["COSMOS"] = "COSMOS";
412
- GenericTransactionType["SOLANA"] = "SOLANA";
420
+ GenericTransactionType["EVM"] = "EVM";
421
+ GenericTransactionType["TRANSFER"] = "TRANSFER";
422
+ GenericTransactionType["COSMOS"] = "COSMOS";
423
+ GenericTransactionType["SOLANA"] = "SOLANA";
413
424
  })(exports.GenericTransactionType || (exports.GenericTransactionType = {}));
414
425
  (function (TransactionStatus) {
415
- TransactionStatus["FAILED"] = "failed";
416
- TransactionStatus["RUNNING"] = "running";
417
- TransactionStatus["SUCCESS"] = "success";
426
+ TransactionStatus["FAILED"] = "failed";
427
+ TransactionStatus["RUNNING"] = "running";
428
+ TransactionStatus["SUCCESS"] = "success";
418
429
  })(exports.TransactionStatus || (exports.TransactionStatus = {}));
419
430
 
420
- var isCosmosTransaction = function (transaction) {
421
- return transaction.type === exports.TransactionType.COSMOS;
431
+ var isCosmosTransaction = function isCosmosTransaction(transaction) {
432
+ return transaction.type === exports.TransactionType.COSMOS;
422
433
  };
423
434
 
424
- var isSolanaTransaction = function (transaction) {
425
- return transaction.type === exports.TransactionType.SOLANA;
435
+ var isSolanaTransaction = function isSolanaTransaction(transaction) {
436
+ return transaction.type === exports.TransactionType.SOLANA;
426
437
  };
427
438
 
428
- var isTransferTransaction = function (transaction) { return transaction.type === exports.TransactionType.TRANSFER; };
439
+ var isTransferTransaction = function isTransferTransaction(transaction) {
440
+ return transaction.type === exports.TransactionType.TRANSFER;
441
+ };
429
442
 
430
443
  var TonChainID;
431
444
  (function (TonChainID) {
432
- TonChainID["MAINNET"] = "-239";
433
- TonChainID["TESTNET"] = "-3";
445
+ TonChainID["MAINNET"] = "-239";
446
+ TonChainID["TESTNET"] = "-3";
434
447
  })(TonChainID || (TonChainID = {}));
435
448
 
436
- var isEvmTransaction = function (transaction) { return transaction.type === exports.TransactionType.EVM; };
449
+ var isEvmTransaction = function isEvmTransaction(transaction) {
450
+ return transaction.type === exports.TransactionType.EVM;
451
+ };
437
452
 
438
453
  var RangoClient = /*#__PURE__*/function () {
439
454
  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/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}\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,GAA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ared/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,KA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AArB,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,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,2 +1,2 @@
1
- "use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("uuid-random")),r=t(require("axios"));function n(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function s(t){n(a,o,i,s,c,"next",t)}function c(t){n(a,o,i,s,c,"throw",t)}s(void 0)}))}}function i(){return(i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(null,arguments)}function a(){a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(t){p=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=Object.create((e&&e.prototype instanceof g?e:g).prototype),a=new L(n||[]);return o(i,"_invoke",{value:I(t,r,a)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var l="suspendedStart",d="executing",v="completed",y={};function g(){}function m(){}function w(){}var x={};p(x,s,(function(){return this}));var T=Object.getPrototypeOf,S=T&&T(T(A([])));S&&S!==r&&n.call(S,s)&&(x=S);var b=w.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==typeof p&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(p).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function I(e,r,n){var o=l;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===l)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?v:"suspendedYield",u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return m.prototype=w,o(b,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=p(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,p(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},e.awrap=function(t){return{__await:t}},E(O.prototype),p(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(b),p(b,u,"Generator"),p(b,s,(function(){return this})),p(b,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function s(t){return t.blockchain+(t.symbol?"."+t.symbol:"")+(t.address?"--"+t.address:"")}var c,u,p,h,f,l=function(t){return"EVM"===t.type},d=function(t){return"COSMOS"===t.type},v=function(t){return"SOLANA"===t.type},y=function(t){return"TRON"===t.type},g=function(t){return"TRANSFER"===t.type},m=function(t){return"STARKNET"===t.type},w=function(t){return"TON"===t.type};(c=exports.RoutingResultType||(exports.RoutingResultType={})).OK="OK",c.HIGH_IMPACT="HIGH_IMPACT",c.NO_ROUTE="NO_ROUTE",c.INPUT_LIMIT_ISSUE="INPUT_LIMIT_ISSUE",c.HIGH_IMPACT_FOR_CREATE_TX="HIGH_IMPACT_FOR_CREATE_TX",(u=exports.TransactionType||(exports.TransactionType={})).EVM="EVM",u.TRANSFER="TRANSFER",u.COSMOS="COSMOS",u.SOLANA="SOLANA",u.TRON="TRON",u.STARKNET="STARKNET",u.TON="TON",u.SUI="SUI",(p=exports.GenericTransactionType||(exports.GenericTransactionType={})).EVM="EVM",p.TRANSFER="TRANSFER",p.COSMOS="COSMOS",p.SOLANA="SOLANA",(h=exports.TransactionStatus||(exports.TransactionStatus={})).FAILED="failed",h.RUNNING="running",h.SUCCESS="success",function(t){t.MAINNET="-239",t.TESTNET="-3"}(f||(f={})),exports.RangoClient=function(){function t(t,n,o){void 0===n&&(n=!1),this.apiUrl=o||"https://api.rango.exchange",this.apiKey=t;try{if("undefined"!=typeof window){var i=localStorage.getItem("deviceId");if(i)this.deviceId=i;else{var a=e();localStorage.setItem("deviceId",a),this.deviceId=a}}else this.deviceId=e()}catch(t){this.deviceId=e()}this.httpService=r.create({baseURL:this.apiUrl}),n&&(this.httpService.interceptors.request.use((function(t){return console.log("Starting Request",JSON.stringify(t,null,2)),t})),this.httpService.interceptors.response.use((function(t){return console.log("Response:",JSON.stringify(t,null,2)),t})))}var n=t.prototype;return n.meta=function(){var t=o(a().mark((function t(e,r){var n,o,s,c,u;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=i({},e,{blockchains:null==e||null==(n=e.blockchains)?void 0:n.join(),swappers:null==e||null==(o=e.swappers)?void 0:o.join(),swappersGroups:null==e||null==(s=e.swappersGroups)?void 0:s.join(),transactionTypes:null==e||null==(c=e.transactionTypes)?void 0:c.join()}),t.next=3,this.httpService.get("/basic/meta?apiKey="+this.apiKey,i({params:u},r));case 3:return t.abrupt("return",t.sent.data);case 5:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.chains=function(){var t=o(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/meta/blockchains?apiKey="+this.apiKey,i({},e));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.swappers=function(){var t=o(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/meta/swappers?apiKey="+this.apiKey,i({},e));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.messagingProtocols=function(){var t=o(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/meta/messaging-protocols?apiKey="+this.apiKey,i({},e));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.token=function(){var t=o(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/meta/custom-token?apiKey="+this.apiKey,i({params:e},r));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.quote=function(){var t=o(a().mark((function t(e,r){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i({},e,{from:s(e.from),to:s(e.to),swappers:e.swappers&&e.swappers.length>0?e.swappers.join(","):void 0,swapperGroups:e.swapperGroups&&e.swapperGroups.length>0?e.swapperGroups.join(","):void 0,messagingProtocols:e.messagingProtocols&&e.messagingProtocols.length>0?e.messagingProtocols.join(","):void 0}),t.next=3,this.httpService.get("/basic/quote?apiKey="+this.apiKey,i({params:n,headers:{"X-Rango-Id":this.deviceId}},r));case 3:return t.abrupt("return",t.sent.data);case 5:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.isApproved=function(){var t=o(a().mark((function t(e,r,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/is-approved?apiKey="+this.apiKey,i({params:{requestId:e,txId:r},headers:{"X-Rango-Id":this.deviceId}},n));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r,n){return t.apply(this,arguments)}}(),n.status=function(){var t=o(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/status?apiKey="+this.apiKey,i({params:e,headers:{"X-Rango-Id":this.deviceId}},r));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.swap=function(){var t=o(a().mark((function t(e,r){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i({},e,{from:s(e.from),to:s(e.to),referrerAddress:e.referrerAddress||null,referrerFee:e.referrerFee||null,disableEstimate:e.disableEstimate||!1,swappers:e.swappers&&e.swappers.length>0?e.swappers.join(","):void 0,swapperGroups:e.swapperGroups&&e.swapperGroups.length>0?e.swapperGroups.join(","):void 0,messagingProtocols:e.messagingProtocols&&e.messagingProtocols.length>0?e.messagingProtocols.join(","):void 0}),t.next=3,this.httpService.get("/basic/swap?apiKey="+this.apiKey,i({params:n,headers:{"X-Rango-Id":this.deviceId}},r));case 3:return t.abrupt("return",t.sent.data);case 5:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.reportFailure=function(){var t=o(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/basic/report-tx?apiKey="+this.apiKey,e,i({headers:{"X-Rango-Id":this.deviceId}},r));case 2:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.balance=function(){var t=o(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/balance?apiKey="+this.apiKey,i({params:e,headers:{"X-Rango-Id":this.deviceId}},r));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.tokenBalance=function(){var t=o(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/token-balance?apiKey="+this.apiKey,i({params:e},r));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.connectedAssets=function(){var t=o(a().mark((function t(e,r){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={from:s(e.from)},t.next=3,this.httpService.get("/basic/connected-assets?apiKey="+this.apiKey,i({params:n,headers:{"X-Rango-Id":this.deviceId}},r));case 3:return t.abrupt("return",t.sent.data);case 5:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),t}(),exports.assetToString=s,exports.cosmosBlockchains=function(t){return t.filter(d)},exports.evmBlockchains=function(t){return t.filter(l)},exports.isCosmosBlockchain=d,exports.isCosmosTransaction=function(t){return t.type===exports.TransactionType.COSMOS},exports.isEvmBlockchain=l,exports.isEvmTransaction=function(t){return t.type===exports.TransactionType.EVM},exports.isSolanaBlockchain=v,exports.isSolanaTransaction=function(t){return t.type===exports.TransactionType.SOLANA},exports.isStarknetBlockchain=m,exports.isTonBlockchain=w,exports.isTransferBlockchain=g,exports.isTransferTransaction=function(t){return t.type===exports.TransactionType.TRANSFER},exports.isTronBlockchain=y,exports.solanaBlockchain=function(t){return t.filter(v)},exports.starknetBlockchain=function(t){return t.filter(m)},exports.tonBlockchain=function(t){return t.filter(w)},exports.transferBlockchains=function(t){return t.filter(g)},exports.tronBlockchain=function(t){return t.filter(y)};
1
+ "use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("uuid-random")),r=t(require("axios"));function n(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function s(t){n(a,o,i,s,c,"next",t)}function c(t){n(a,o,i,s,c,"throw",t)}s(void 0)}))}}function i(){return(i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(null,arguments)}function a(){a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(t){p=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=Object.create((e&&e.prototype instanceof g?e:g).prototype),a=new L(n||[]);return o(i,"_invoke",{value:I(t,r,a)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var l="suspendedStart",d="executing",v="completed",y={};function g(){}function m(){}function w(){}var x={};p(x,s,(function(){return this}));var T=Object.getPrototypeOf,S=T&&T(T(A([])));S&&S!==r&&n.call(S,s)&&(x=S);var b=w.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==typeof p&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(p).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function I(e,r,n){var o=l;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=k(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===l)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?v:"suspendedYield",u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return m.prototype=w,o(b,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=p(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,p(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},e.awrap=function(t){return{__await:t}},E(O.prototype),p(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(b),p(b,u,"Generator"),p(b,s,(function(){return this})),p(b,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function s(t){return t.blockchain+(t.symbol?"."+t.symbol:"")+(t.address?"--"+t.address:"")}var c,u,p,h,f,l=function(t){return"EVM"===t.type},d=function(t){return"COSMOS"===t.type},v=function(t){return"SOLANA"===t.type},y=function(t){return"TRON"===t.type},g=function(t){return"TRANSFER"===t.type},m=function(t){return"STARKNET"===t.type},w=function(t){return"TON"===t.type};(c=exports.RoutingResultType||(exports.RoutingResultType={})).OK="OK",c.HIGH_IMPACT="HIGH_IMPACT",c.NO_ROUTE="NO_ROUTE",c.INPUT_LIMIT_ISSUE="INPUT_LIMIT_ISSUE",c.HIGH_IMPACT_FOR_CREATE_TX="HIGH_IMPACT_FOR_CREATE_TX",(u=exports.TransactionType||(exports.TransactionType={})).EVM="EVM",u.TRANSFER="TRANSFER",u.COSMOS="COSMOS",u.SOLANA="SOLANA",u.TRON="TRON",u.STARKNET="STARKNET",u.TON="TON",u.SUI="SUI",u.XRPL="XRPL",(p=exports.GenericTransactionType||(exports.GenericTransactionType={})).EVM="EVM",p.TRANSFER="TRANSFER",p.COSMOS="COSMOS",p.SOLANA="SOLANA",(h=exports.TransactionStatus||(exports.TransactionStatus={})).FAILED="failed",h.RUNNING="running",h.SUCCESS="success",function(t){t.MAINNET="-239",t.TESTNET="-3"}(f||(f={})),exports.RangoClient=function(){function t(t,n,o){void 0===n&&(n=!1),this.apiUrl=o||"https://api.rango.exchange",this.apiKey=t;try{if("undefined"!=typeof window){var i=localStorage.getItem("deviceId");if(i)this.deviceId=i;else{var a=e();localStorage.setItem("deviceId",a),this.deviceId=a}}else this.deviceId=e()}catch(t){this.deviceId=e()}this.httpService=r.create({baseURL:this.apiUrl}),n&&(this.httpService.interceptors.request.use((function(t){return console.log("Starting Request",JSON.stringify(t,null,2)),t})),this.httpService.interceptors.response.use((function(t){return console.log("Response:",JSON.stringify(t,null,2)),t})))}var n=t.prototype;return n.meta=function(){var t=o(a().mark((function t(e,r){var n,o,s,c,u;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=i({},e,{blockchains:null==e||null==(n=e.blockchains)?void 0:n.join(),swappers:null==e||null==(o=e.swappers)?void 0:o.join(),swappersGroups:null==e||null==(s=e.swappersGroups)?void 0:s.join(),transactionTypes:null==e||null==(c=e.transactionTypes)?void 0:c.join()}),t.next=3,this.httpService.get("/basic/meta?apiKey="+this.apiKey,i({params:u},r));case 3:return t.abrupt("return",t.sent.data);case 5:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.chains=function(){var t=o(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/meta/blockchains?apiKey="+this.apiKey,i({},e));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.swappers=function(){var t=o(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/meta/swappers?apiKey="+this.apiKey,i({},e));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.messagingProtocols=function(){var t=o(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/meta/messaging-protocols?apiKey="+this.apiKey,i({},e));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.token=function(){var t=o(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/meta/custom-token?apiKey="+this.apiKey,i({params:e},r));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.quote=function(){var t=o(a().mark((function t(e,r){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i({},e,{from:s(e.from),to:s(e.to),swappers:e.swappers&&e.swappers.length>0?e.swappers.join(","):void 0,swapperGroups:e.swapperGroups&&e.swapperGroups.length>0?e.swapperGroups.join(","):void 0,messagingProtocols:e.messagingProtocols&&e.messagingProtocols.length>0?e.messagingProtocols.join(","):void 0}),t.next=3,this.httpService.get("/basic/quote?apiKey="+this.apiKey,i({params:n,headers:{"X-Rango-Id":this.deviceId}},r));case 3:return t.abrupt("return",t.sent.data);case 5:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.isApproved=function(){var t=o(a().mark((function t(e,r,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/is-approved?apiKey="+this.apiKey,i({params:{requestId:e,txId:r},headers:{"X-Rango-Id":this.deviceId}},n));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r,n){return t.apply(this,arguments)}}(),n.status=function(){var t=o(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/status?apiKey="+this.apiKey,i({params:e,headers:{"X-Rango-Id":this.deviceId}},r));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.swap=function(){var t=o(a().mark((function t(e,r){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i({},e,{from:s(e.from),to:s(e.to),referrerAddress:e.referrerAddress||null,referrerFee:e.referrerFee||null,disableEstimate:e.disableEstimate||!1,swappers:e.swappers&&e.swappers.length>0?e.swappers.join(","):void 0,swapperGroups:e.swapperGroups&&e.swapperGroups.length>0?e.swapperGroups.join(","):void 0,messagingProtocols:e.messagingProtocols&&e.messagingProtocols.length>0?e.messagingProtocols.join(","):void 0}),t.next=3,this.httpService.get("/basic/swap?apiKey="+this.apiKey,i({params:n,headers:{"X-Rango-Id":this.deviceId}},r));case 3:return t.abrupt("return",t.sent.data);case 5:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.reportFailure=function(){var t=o(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/basic/report-tx?apiKey="+this.apiKey,e,i({headers:{"X-Rango-Id":this.deviceId}},r));case 2:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.balance=function(){var t=o(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/balance?apiKey="+this.apiKey,i({params:e,headers:{"X-Rango-Id":this.deviceId}},r));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.tokenBalance=function(){var t=o(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/basic/token-balance?apiKey="+this.apiKey,i({params:e},r));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.connectedAssets=function(){var t=o(a().mark((function t(e,r){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={from:s(e.from)},t.next=3,this.httpService.get("/basic/connected-assets?apiKey="+this.apiKey,i({params:n,headers:{"X-Rango-Id":this.deviceId}},r));case 3:return t.abrupt("return",t.sent.data);case 5:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),t}(),exports.assetToString=s,exports.cosmosBlockchains=function(t){return t.filter(d)},exports.evmBlockchains=function(t){return t.filter(l)},exports.isCosmosBlockchain=d,exports.isCosmosTransaction=function(t){return t.type===exports.TransactionType.COSMOS},exports.isEvmBlockchain=l,exports.isEvmTransaction=function(t){return t.type===exports.TransactionType.EVM},exports.isSolanaBlockchain=v,exports.isSolanaTransaction=function(t){return t.type===exports.TransactionType.SOLANA},exports.isStarknetBlockchain=m,exports.isTonBlockchain=w,exports.isTransferBlockchain=g,exports.isTransferTransaction=function(t){return t.type===exports.TransactionType.TRANSFER},exports.isTronBlockchain=y,exports.solanaBlockchain=function(t){return t.filter(v)},exports.starknetBlockchain=function(t){return t.filter(m)},exports.tonBlockchain=function(t){return t.filter(w)},exports.transferBlockchains=function(t){return t.filter(g)},exports.tronBlockchain=function(t){return t.filter(y)};
2
2
  //# sourceMappingURL=rango-sdk-basic.cjs.production.min.js.map
@@ -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/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}\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"],"mappings":"4jOAGgBA,EAAcC,GAC5B,OAAUA,EAAMC,YAAaD,EAAME,OAAS,IAAMF,EAAME,OAAS,KAC/DF,EAAMG,QAAU,KAAOH,EAAMG,QAAU,QCD/BC,ECDAC,EAeAC,EAyFAC,ECxGAC,ECQCC,EAAkB,SAC7BC,GACwC,MAAwB,QAAxBA,EAAeC,MAE5CC,EAAqB,SAChCF,GAC2C,MAAwB,WAAxBA,EAAeC,MAE/CE,EAAqB,SAChCH,GAC2C,MAAwB,WAAxBA,EAAeC,MAE/CG,EAAmB,SAC9BJ,GACyC,MAAwB,SAAxBA,EAAeC,MAE7CI,EAAuB,SAClCL,GAEA,MAAwB,aAAxBA,EAAeC,MAEJK,EAAuB,SAClCN,GAEA,MAAwB,aAAxBA,EAAeC,MAEJM,EAAkB,SAC7BP,GACwC,MAAwB,QAAxBA,EAAeC,OHnC7CP,EAAAA,4BAAAA,uCAEVA,4BACAA,sBACAA,wCACAA,yDCNUC,EAAAA,0BAAAA,uCAEVA,sBACAA,kBACAA,kBACAA,cACAA,sBACAA,YACAA,aAOUC,EAAAA,iCAAAA,8CAEVA,sBACAA,kBACAA,mBAqFUC,EAAAA,4BAAAA,+CAEVA,oBACAA,oBC3GF,SAAYC,GACVA,iBACAA,eAFF,CAAYA,IAAAA,sCEiCV,SAAAU,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,WAA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AC9G,GAC/B,OAAAA,EAAYyG,OAAO3J,+BAEa,SAACkD,GACjC,OAAAA,EAAYyG,OAAOxJ,0BAWQ,SAAC+C,GAC5B,OAAAA,EAAYyG,OAAOvJ,gCAJc,SAAC8C,GAClC,OAAAA,EAAYyG,OAAOzJ,2BAPS,SAACgD,GAC7B,OAAAA,EAAYyG,OAAO1J"}
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,MAAO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AzG,GAAwB,OAAAJ,IAAAU,eAAAoG,GAAA,cAAAA,EAAAlG,KAAAkG,EAAAjG,MAAA,OAAA,OAAAiG,EAAAjG,OAEIvC,KAAKS,YAAYqC,mCACZ9C,KAAKH,OAAM2C,GACxCL,OAAQoG,GAAwBzG,IACnC,OAHkB,OAAA0G,EAAAzF,gBAAAyF,EAAAxF,KAIEC,MAAI,OAAA,UAAA,OAAAuF,EAAAtF,UAAAoF,YAC1B,OAAA,SAAAG,EAAAC,GAAA,OAAAL,EAAAhF,WAAAC,eAAAjC,EAEYsH,2BAAe,IAAAC,EAAAnH,EAAAC,IAAAC,MAArB,SAAAkH,EACLC,EACAhH,GAAwB,IAAAkD,EAAA,OAAAtD,IAAAU,eAAA2G,GAAA,cAAAA,EAAAzG,KAAAyG,EAAAxG,MAAA,OAIvB,OAFKyC,EAAO,CACXE,KAAM5F,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"}
@@ -341,37 +341,47 @@ function assetToString(asset) {
341
341
  return "" + asset.blockchain + (asset.symbol ? '.' + asset.symbol : '') + (asset.address ? '--' + asset.address : '');
342
342
  }
343
343
 
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';
344
+ var isEvmBlockchain = function isEvmBlockchain(blockchainMeta) {
345
+ return blockchainMeta.type === 'EVM';
350
346
  };
351
- var isStarknetBlockchain = function (blockchainMeta) {
352
- return blockchainMeta.type === 'STARKNET';
347
+ var isCosmosBlockchain = function isCosmosBlockchain(blockchainMeta) {
348
+ return blockchainMeta.type === 'COSMOS';
353
349
  };
354
- var isTonBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'TON'; };
355
- var evmBlockchains = function (blockchains) {
356
- return blockchains.filter(isEvmBlockchain);
350
+ var isSolanaBlockchain = function isSolanaBlockchain(blockchainMeta) {
351
+ return blockchainMeta.type === 'SOLANA';
357
352
  };
358
- var solanaBlockchain = function (blockchains) {
359
- return blockchains.filter(isSolanaBlockchain);
353
+ var isTronBlockchain = function isTronBlockchain(blockchainMeta) {
354
+ return blockchainMeta.type === 'TRON';
360
355
  };
361
- var starknetBlockchain = function (blockchains) {
362
- return blockchains.filter(isStarknetBlockchain);
356
+ var isTransferBlockchain = function isTransferBlockchain(blockchainMeta) {
357
+ return blockchainMeta.type === 'TRANSFER';
363
358
  };
364
- var tronBlockchain = function (blockchains) {
365
- return blockchains.filter(isTronBlockchain);
359
+ var isStarknetBlockchain = function isStarknetBlockchain(blockchainMeta) {
360
+ return blockchainMeta.type === 'STARKNET';
366
361
  };
367
- var cosmosBlockchains = function (blockchains) {
368
- return blockchains.filter(isCosmosBlockchain);
362
+ var isTonBlockchain = function isTonBlockchain(blockchainMeta) {
363
+ return blockchainMeta.type === 'TON';
369
364
  };
370
- var transferBlockchains = function (blockchains) {
371
- return blockchains.filter(isTransferBlockchain);
365
+ var evmBlockchains = function evmBlockchains(blockchains) {
366
+ return blockchains.filter(isEvmBlockchain);
372
367
  };
373
- var tonBlockchain = function (blockchains) {
374
- return blockchains.filter(isTonBlockchain);
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);
375
385
  };
376
386
 
377
387
  /**
@@ -380,11 +390,11 @@ var tonBlockchain = function (blockchains) {
380
390
  */
381
391
  var RoutingResultType;
382
392
  (function (RoutingResultType) {
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";
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";
388
398
  })(RoutingResultType || (RoutingResultType = {}));
389
399
 
390
400
  /**
@@ -392,14 +402,15 @@ var RoutingResultType;
392
402
  */
393
403
  var TransactionType;
394
404
  (function (TransactionType) {
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";
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";
403
414
  })(TransactionType || (TransactionType = {}));
404
415
  /**
405
416
  * The type of transaction
@@ -407,38 +418,42 @@ var TransactionType;
407
418
  */
408
419
  var GenericTransactionType;
409
420
  (function (GenericTransactionType) {
410
- GenericTransactionType["EVM"] = "EVM";
411
- GenericTransactionType["TRANSFER"] = "TRANSFER";
412
- GenericTransactionType["COSMOS"] = "COSMOS";
413
- GenericTransactionType["SOLANA"] = "SOLANA";
421
+ GenericTransactionType["EVM"] = "EVM";
422
+ GenericTransactionType["TRANSFER"] = "TRANSFER";
423
+ GenericTransactionType["COSMOS"] = "COSMOS";
424
+ GenericTransactionType["SOLANA"] = "SOLANA";
414
425
  })(GenericTransactionType || (GenericTransactionType = {}));
415
426
  /**
416
427
  * The status of transaction in tracking
417
428
  */
418
429
  var TransactionStatus;
419
430
  (function (TransactionStatus) {
420
- TransactionStatus["FAILED"] = "failed";
421
- TransactionStatus["RUNNING"] = "running";
422
- TransactionStatus["SUCCESS"] = "success";
431
+ TransactionStatus["FAILED"] = "failed";
432
+ TransactionStatus["RUNNING"] = "running";
433
+ TransactionStatus["SUCCESS"] = "success";
423
434
  })(TransactionStatus || (TransactionStatus = {}));
424
435
 
425
- var isCosmosTransaction = function (transaction) {
426
- return transaction.type === TransactionType.COSMOS;
436
+ var isCosmosTransaction = function isCosmosTransaction(transaction) {
437
+ return transaction.type === TransactionType.COSMOS;
427
438
  };
428
439
 
429
- var isSolanaTransaction = function (transaction) {
430
- return transaction.type === TransactionType.SOLANA;
440
+ var isSolanaTransaction = function isSolanaTransaction(transaction) {
441
+ return transaction.type === TransactionType.SOLANA;
431
442
  };
432
443
 
433
- var isTransferTransaction = function (transaction) { return transaction.type === TransactionType.TRANSFER; };
444
+ var isTransferTransaction = function isTransferTransaction(transaction) {
445
+ return transaction.type === TransactionType.TRANSFER;
446
+ };
434
447
 
435
448
  var TonChainID;
436
449
  (function (TonChainID) {
437
- TonChainID["MAINNET"] = "-239";
438
- TonChainID["TESTNET"] = "-3";
450
+ TonChainID["MAINNET"] = "-239";
451
+ TonChainID["TESTNET"] = "-3";
439
452
  })(TonChainID || (TonChainID = {}));
440
453
 
441
- var isEvmTransaction = function (transaction) { return transaction.type === TransactionType.EVM; };
454
+ var isEvmTransaction = function isEvmTransaction(transaction) {
455
+ return transaction.type === TransactionType.EVM;
456
+ };
442
457
 
443
458
  var RangoClient = /*#__PURE__*/function () {
444
459
  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/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}\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;AAE7E,IAAa,gBAAgB,GAAG,UAC9B,cAA8B,IACW,OAAA,cAAc,CAAC,IAAI,KAAK,MAAM,GAAA,CAAA;AAEzE,IAAa,oBAAoB,GAAG,UAClC,cAA8B;IAE9B,OAAA,cAAc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AA,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;;;;"}
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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D,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.68",
3
+ "version": "0.1.69",
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.85",
46
+ "rango-types": "^0.1.88",
47
47
  "uuid-random": "^1.3.2"
48
48
  },
49
49
  "publishConfig": {