rango-sdk 0.1.71 → 0.1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rango-sdk.cjs.development.js +6 -0
- package/lib/rango-sdk.cjs.development.js.map +1 -1
- package/lib/rango-sdk.cjs.production.min.js +1 -1
- package/lib/rango-sdk.cjs.production.min.js.map +1 -1
- package/lib/rango-sdk.esm.js +5 -1
- package/lib/rango-sdk.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -796,6 +796,7 @@ var isStarknetBlockchain = function (blockchainMeta) {
|
|
|
796
796
|
return blockchainMeta.type === 'STARKNET';
|
|
797
797
|
};
|
|
798
798
|
var isTonBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'TON'; };
|
|
799
|
+
var isXrplBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'XRPL'; };
|
|
799
800
|
var evmBlockchains = function (blockchains) {
|
|
800
801
|
return blockchains.filter(isEvmBlockchain);
|
|
801
802
|
};
|
|
@@ -817,6 +818,9 @@ var transferBlockchains = function (blockchains) {
|
|
|
817
818
|
var tonBlockchain = function (blockchains) {
|
|
818
819
|
return blockchains.filter(isTonBlockchain);
|
|
819
820
|
};
|
|
821
|
+
var xrplBlockchain = function (blockchains) {
|
|
822
|
+
return blockchains.filter(isXrplBlockchain);
|
|
823
|
+
};
|
|
820
824
|
|
|
821
825
|
/**
|
|
822
826
|
* Routing Result Type
|
|
@@ -892,9 +896,11 @@ exports.isTransferBlockchain = isTransferBlockchain;
|
|
|
892
896
|
exports.isTransferTransaction = isTransferTransaction;
|
|
893
897
|
exports.isTronBlockchain = isTronBlockchain;
|
|
894
898
|
exports.isTronTransaction = isTronTransaction;
|
|
899
|
+
exports.isXrplBlockchain = isXrplBlockchain;
|
|
895
900
|
exports.solanaBlockchain = solanaBlockchain;
|
|
896
901
|
exports.starknetBlockchain = starknetBlockchain;
|
|
897
902
|
exports.tonBlockchain = tonBlockchain;
|
|
898
903
|
exports.transferBlockchains = transferBlockchains;
|
|
899
904
|
exports.tronBlockchain = tronBlockchain;
|
|
905
|
+
exports.xrplBlockchain = xrplBlockchain;
|
|
900
906
|
//# sourceMappingURL=rango-sdk.cjs.development.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rango-sdk.cjs.development.js","sources":["../src/services/client.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/tron.ts","../node_modules/rango-types/src/api/shared/txs/ton.ts","../node_modules/rango-types/src/api/main/txs/evm.ts"],"sourcesContent":["import uuid from 'uuid-random'\nimport {\n MetaRequest,\n MetaResponse,\n BestRouteRequest,\n BestRouteResponse,\n CheckApprovalResponse,\n CheckTxStatusRequest,\n TransactionStatusResponse,\n CreateTransactionRequest,\n CreateTransactionResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n RequestOptions,\n BlockchainMeta,\n CompactMetaResponse,\n CompactToken,\n Token,\n MultiRouteRequest,\n MultiRouteResponse,\n ConfirmRouteResponse,\n ConfirmRouteRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceResponse,\n TokenBalanceRequest,\n SwapperMetaExtended,\n MultipleTokenBalanceRequest,\n MultipleTokenBalanceResponse,\n SearchCustomTokensRequest,\n SearchCustomTokensResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddresses = { 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, 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 }\n\n public async getAllMetadata(\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<CompactMetaResponse>(\n `/meta/compact?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n const reformatTokens = (tokens: CompactToken[]): Token[] =>\n tokens.map((tm) => ({\n blockchain: tm.b,\n symbol: tm.s,\n image: tm.i,\n address: tm.a || null,\n usdPrice: tm.p || null,\n isSecondaryCoin: tm.is || false,\n coinSource: tm.c || null,\n coinSourceUrl: tm.cu || null,\n name: tm.n || null,\n decimals: tm.d,\n isPopular: tm.ip || false,\n supportedSwappers: tm.ss || [],\n }))\n\n const tokens = reformatTokens(axiosResponse.data.tokens)\n const popularTokens = reformatTokens(axiosResponse.data.popularTokens)\n return { ...axiosResponse.data, tokens, popularTokens }\n }\n\n public async getBlockchains(\n options?: RequestOptions\n ): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getSwappers(\n options?: RequestOptions\n ): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getCustomToken(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async searchCustomTokens(\n searchCustomTokensRequest: SearchCustomTokensRequest,\n options?: RequestOptions\n ): Promise<SearchCustomTokensResponse> {\n const axiosResponse =\n await this.httpService.get<SearchCustomTokensResponse>(\n `/meta/token/search?apiKey=${this.apiKey}`,\n { params: searchCustomTokensRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async getBestRoute(\n requestBody: BestRouteRequest,\n options?: RequestOptions\n ): Promise<BestRouteResponse> {\n const axiosResponse = await this.httpService.post<BestRouteResponse>(\n `/routing/best?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async getAllRoutes(\n requestBody: MultiRouteRequest,\n options?: RequestOptions\n ): Promise<MultiRouteResponse> {\n const axiosResponse = await this.httpService.post<MultiRouteResponse>(\n `/routing/bests?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async confirmRoute(\n requestBody: ConfirmRouteRequest,\n options?: RequestOptions\n ): Promise<ConfirmRouteResponse> {\n const axiosResponse = await this.httpService.post<ConfirmRouteResponse>(\n `/routing/confirm?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n // @deprecated use confirmRoute instead\n public async confirmRouteRequest(\n requestBody: ConfirmRouteRequest,\n options?: RequestOptions\n ): Promise<ConfirmRouteResponse> {\n const axiosResponse = await this.httpService.post<ConfirmRouteResponse>(\n `/routing/confirm?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async checkApproval(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/tx/${requestId}/check-approval?apiKey=${this.apiKey}`,\n { params: { txId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async checkStatus(\n requestBody: CheckTxStatusRequest,\n options?: RequestOptions\n ): Promise<TransactionStatusResponse> {\n const axiosResponse =\n await this.httpService.post<TransactionStatusResponse>(\n `/tx/check-status?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async createTransaction(\n requestBody: CreateTransactionRequest,\n options?: RequestOptions\n ): Promise<CreateTransactionResponse> {\n const axiosResponse =\n await this.httpService.post<CreateTransactionResponse>(\n `/tx/create?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\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 `/tx/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n ...options,\n }\n )\n }\n\n public async getWalletsDetails(\n walletAddresses: WalletAddresses,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n let walletAddressesQueryParams = ''\n for (let i = 0; i < walletAddresses.length; i++) {\n const walletAddress = walletAddresses[i]\n walletAddressesQueryParams += `&address=${walletAddress.blockchain}.${walletAddress.address}`\n }\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/wallets/details?apiKey=${this.apiKey}${walletAddressesQueryParams}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getTokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/wallets/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async getMultipleTokenBalance(\n requestBody: MultipleTokenBalanceRequest,\n options?: RequestOptions\n ): Promise<MultipleTokenBalanceResponse> {\n const axiosResponse =\n await this.httpService.post<MultipleTokenBalanceResponse>(\n `/wallets/multiple-token-balance?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\n )\n return axiosResponse.data\n }\n}\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n} from './meta.js'\n\nexport const isEvmBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is EvmBlockchainMeta => blockchainMeta.type === 'EVM'\n\nexport const isCosmosBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is CosmosBlockchainMeta => blockchainMeta.type === 'COSMOS'\n\nexport const isSolanaBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is SolanaBlockchainMeta => blockchainMeta.type === 'SOLANA'\n\nexport const isTronBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TronBlockchainMeta => blockchainMeta.type === 'TRON'\n\nexport const isTransferBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TransferBlockchainMeta =>\n blockchainMeta.type === 'TRANSFER'\n\nexport const isStarknetBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is StarkNetBlockchainMeta =>\n blockchainMeta.type === 'STARKNET'\n\nexport const isTonBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TonBlockchainMeta => blockchainMeta.type === 'TON'\n\nexport const evmBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isEvmBlockchain)\n\nexport const solanaBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isSolanaBlockchain)\n\nexport const starknetBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isStarknetBlockchain)\n\nexport const tronBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTronBlockchain)\n\nexport const cosmosBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isCosmosBlockchain)\n\nexport const transferBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTransferBlockchain)\n\nexport const tonBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTonBlockchain)\n","/**\n * Routing Result Type\n *\n */\nexport enum RoutingResultType {\n OK = 'OK',\n HIGH_IMPACT = 'HIGH_IMPACT',\n NO_ROUTE = 'NO_ROUTE',\n INPUT_LIMIT_ISSUE = 'INPUT_LIMIT_ISSUE',\n HIGH_IMPACT_FOR_CREATE_TX = 'HIGH_IMPACT_FOR_CREATE_TX',\n}\n","/**\n * The type of transaction\n */\nexport enum TransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n TRON = 'TRON',\n STARKNET = 'STARKNET',\n TON = 'TON',\n SUI = 'SUI',\n XRPL = 'XRPL',\n}\n\n/**\n * The type of transaction\n * @deprecated use TransactionType instead\n */\nexport enum GenericTransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n}\n\n/**\n * A transaction's url that can be displayed to advanced user to track the progress\n *\n * @property {string} url - Url of the transaction in blockchain explorer. example: https://etherscan.io/tx/0xa1a3...\n * @property {string | null} description - A custom display name to help user distinguish the transactions from each\n * other. Example: Inbound, Outbound, Bridge, or null\n *\n */\nexport type SwapExplorerUrl = {\n description: string | null\n url: string\n}\n\n/**\n * APIErrorCode\n *\n * Error code of a swap failure\n *\n */\nexport type APIErrorCode =\n | 'TX_FAIL'\n | 'TX_EXPIRED'\n | 'FETCH_TX_FAILED'\n | 'USER_REJECT'\n | 'USER_CANCEL'\n | 'USER_CANCELED_TX'\n | 'CALL_WALLET_FAILED'\n | 'SEND_TX_FAILED'\n | 'CALL_OR_SEND_FAILED'\n | 'TX_FAILED_IN_BLOCKCHAIN'\n | 'CLIENT_UNEXPECTED_BEHAVIOUR'\n | 'INSUFFICIENT_APPROVE'\n\n/**\n * The function checks if a given string value is a valid API error code.\n * @param {string} value - a string that represents a possible API error code.\n * @returns A boolean value is being returned, indicating whether the input `value` is of type\n * `APIErrorCode` or not.\n */\nexport function isAPIErrorCode(value: string): value is APIErrorCode {\n return [\n 'TX_FAIL',\n 'TX_EXPIRED',\n 'FETCH_TX_FAILED',\n 'USER_REJECT',\n 'USER_CANCEL',\n 'USER_CANCELED_TX',\n 'CALL_WALLET_FAILED',\n 'SEND_TX_FAILED',\n 'CALL_OR_SEND_FAILED',\n 'TX_FAILED_IN_BLOCKCHAIN',\n 'CLIENT_UNEXPECTED_BEHAVIOUR',\n 'INSUFFICIENT_APPROVE',\n ].includes(value)\n}\n\n/**\n * ReportTransactionRequest\n *\n * It should be used when an error happened in client and we want to inform server that transaction failed,\n * E.g. user rejected the transaction dialog or and an RPC error raised during signing tx by user.\n *\n * @property {string} requestId - The requestId from best route endpoint\n * @property {APIErrorCode} eventType - Type of the event that happened, example: USER_REJECT\n * @property {number} [step] - Step number in which failure happened\n * @property {string} [reason] - Reason or message for the error\n * @property {[key: string]: string} [data] - @deprecated A list of key-value for extra details\n * @property {wallet?: string, errorCode? string} [tags] - A list of key-value for pre-defined tags\n *\n */\nexport type ReportTransactionRequest = {\n requestId: string\n eventType: APIErrorCode\n step?: number\n reason?: string\n data?: { [key: string]: string }\n tags?: { wallet?: string; errorCode?: string }\n}\n\n/**\n * The status of transaction in tracking\n */\nexport enum TransactionStatus {\n FAILED = 'failed',\n RUNNING = 'running',\n SUCCESS = 'success',\n}\n\n/**\n * Response body of check-approval\n * You could stop check approval if:\n * 1- approved successfully\n * => isApproved = true\n * 2- approval transaction failed\n * => isApproved = false && txStatus === 'failed'\n * 3- approval transaction succeeded but currentApprovedAmount is still less than requiredApprovedAmount\n * (e.g. user changed transaction data and enter another approve amount in MetaMask)\n * => isApproved = false && txStatus == 'success'\n *\n * @property {boolean} isApproved - A flag which indicates that the approve tx is done or not\n * @property {TransactionStatus | null} txStatus - Status of approve transaction in blockchain,\n * if isArppoved is false and txStatus is failed, it seems that approve transaction failed in blockchain\n * @property {string | null} requiredApprovedAmount - required amount to be approved by user\n * @property {string | null} currentApprovedAmount - current approved amount by user\n *\n */\nexport type CheckApprovalResponse = {\n isApproved: boolean\n txStatus: TransactionStatus | null\n requiredApprovedAmount: string | null\n currentApprovedAmount: string | null\n}\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * CosmosCoin\n */\nexport type CosmosCoin = {\n amount: string\n denom: string\n}\n\n/**\n * CosmosProtoMsg\n */\nexport type CosmosProtoMsg = {\n type_url: string\n value: number[]\n}\n\n/**\n * CosmosFee representing fee for cosmos transaction\n */\nexport type CosmosFee = {\n gas: string\n amount: CosmosCoin[]\n}\n\n/**\n * Main transaction object for COSMOS type transactions\n */\nexport type CosmosMessage = {\n signType: 'AMINO' | 'DIRECT'\n sequence: string | null\n source: number | null\n account_number: number | null\n rpcUrl: string\n chainId: string | null\n msgs: any[] // TODO\n protoMsgs: CosmosProtoMsg[]\n memo: string | null\n fee: CosmosFee | null\n}\n/**\n * An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages (e.g. XDefi)\n *\n * @property {AssetWithTicker} asset - The asset to be transferred\n * @property {string} amount - The machine-readable amount to transfer, example: 1000000000000000000\n * @property {number} decimals - The decimals for this asset, example: 18\n * @property {string | null} memo - Memo of transaction, could be null\n * @property {string} method - The transaction method, example: transfer, deposit\n * @property {string} recipient - The recipient address of transaction\n *\n */\nexport type CosmosRawTransferData = {\n amount: string\n asset: AssetWithTicker\n decimals: number\n memo: string | null\n method: string\n recipient: string\n}\n\n/**\n * A Cosmos transaction, child of GenericTransaction\n *\n * @property {TransactionType} type - This fields equals to COSMOS for all CosmosTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} fromWalletAddress - Address of wallet that this transaction should be executed in, same as the create transaction request's input\n * @property {CosmosMessage} data - Transaction data\n * @property {CosmosRawTransferData | null} rawTransfer - An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages\n *\n */\nexport interface CosmosTransaction extends BaseTransaction {\n type: TransactionType.COSMOS\n fromWalletAddress: string\n data: CosmosMessage\n rawTransfer: CosmosRawTransferData | null\n}\n\nexport const isCosmosTransaction = (transaction: {\n type: TransactionType\n}): transaction is CosmosTransaction =>\n transaction.type === TransactionType.COSMOS\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * Account metadata used to define instructions\n */\nexport type SolanaInstructionKey = {\n pubkey: string\n isSigner: boolean\n isWritable: boolean\n}\n\n/**\n * Transaction Instruction class\n */\nexport type SolanaInstruction = {\n keys: SolanaInstructionKey[]\n programId: string\n data: number[]\n}\n\n/**\n * Pair of signature and corresponding public key\n */\nexport type SolanaSignature = {\n signature: number[]\n publicKey: string\n}\n\n/**\n * This type of transaction is used for all solana transactions\n *\n * @property {TransactionType} type - This fields equals to SOLANA for all SolanaTransactions\n * @property {'LEGACY' | 'VERSIONED'} txType - Type of the solana transaction\n * @property {string} blockChain, equals to SOLANA\n * @property {string} from, Source wallet address\n * @property {string} identifier, Transaction hash used in case of retry\n * @property {string | null} recentBlockhash, A recent blockhash\n * @property {SolanaSignature[]} signatures, Signatures for the transaction\n * @property {number[] | null} serializedMessage, The byte array of the transaction\n * @property {SolanaInstruction[]} instructions, The instructions to atomically execute\n *\n */\nexport interface SolanaTransaction extends BaseTransaction {\n type: TransactionType.SOLANA\n txType: 'LEGACY' | 'VERSIONED'\n from: string\n identifier: string\n recentBlockhash: string | null\n signatures: SolanaSignature[]\n serializedMessage: number[] | null\n instructions: SolanaInstruction[]\n}\n\nexport const isSolanaTransaction = (transaction: {\n type: TransactionType\n}): transaction is SolanaTransaction =>\n transaction.type === TransactionType.SOLANA\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type InputToSign = { address: string, signingIndexes: number[] }\n/**\n * @property {unsignedPsbtBase64} unsignedPsbtBase64 - Base 64 representation of the Unsigned PSBT\n * @property {InputToSign[]} inputsToSign - Inputs to be signed\n */\nexport type PSBT = {\n unsignedPsbtBase64: string\n inputsToSign: InputToSign[]\n}\n/**\n * TransferTransaction. This type of transaction is used for UTXO blockchains including BTC, LTC, BCH\n *\n * @property {TransactionType} type - This fields equals to TRANSFER for all TransferTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} method - The method that should be passed to wallet. examples: deposit, transfer\n * @property {AssetWithTicker} asset\n * @property {string} amount - The machine-readable amount of transaction, example: 1000000000000000000\n * @property {number} decimals - The decimals of the asset\n * @property {string} fromWalletAddress - The source wallet address that can sign this transaction\n * @property {string} recipientAddress - The destination wallet address that the fund should be sent to\n * @property {string | null} memo - The memo of transaction, can be null\n * @property {PSBT | null} psbt - PSBT object containing base 64 representation of the Unsigned PSBT along with the inputs to be signed\n *\n */\nexport interface Transfer extends BaseTransaction {\n type: TransactionType.TRANSFER\n method: string\n asset: AssetWithTicker\n amount: string\n decimals: number\n fromWalletAddress: string\n recipientAddress: string\n memo: string | null\n psbt: PSBT | null\n}\n\nexport const isTransferTransaction = (transaction: {\n type: TransactionType\n}): transaction is Transfer => transaction.type === TransactionType.TRANSFER\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type TrxContractParameter = {\n value: unknown\n type_url: string\n}\n\nexport type TrxContractData = {\n parameter: TrxContractParameter\n type: string\n}\n\nexport type TrxRawData = {\n contract: TrxContractData[]\n ref_block_bytes: string\n ref_block_hash: string\n expiration: number\n timestamp: number\n}\n\n/**\n * TronTransaction\n *\n * @property {TransactionType} type - TransactionType.TRON\n * @property {boolean} isApprovalTx - Whether or not the transaction is an approval transaction.\n * @property {TrxRawData | null} raw_data - This is the raw data of the transaction.\n * @property {string | null} raw_data_hex - The raw hex data of the transaction.\n * @property {string} txID - The transaction ID.\n * @property {boolean} visible - boolean\n * @property {object} __payload__\n */\nexport interface TronTransaction extends BaseTransaction {\n type: TransactionType.TRON\n isApprovalTx: boolean\n raw_data: TrxRawData | null\n raw_data_hex: string | null\n txID: string\n visible: boolean\n __payload__: object\n}\n\nexport const isTronTransaction = (transaction: {\n type: TransactionType\n}): transaction is TronTransaction => transaction.type === TransactionType.TRON\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 { BaseTransaction, TransactionType } from '../../shared/index.js'\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 {string} blockChain - The blockchain that this transaction is going to run in\n * @property {boolean} isApprovalTx - Determines that this transaction is an approval transaction or not, if true user\n * should approve the transaction and call create transaction endpoint again to get the original tx. Beware that most\n * of the fields of this object will be passed directly to the wallet without any change.\n * @property {string | null} from - The source wallet address, it can be null\n * @property {string} to - Address of destination wallet or the smart contract or token that is going to be called\n * @property {string | null} data - The data of smart contract call, 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} nonce - The nonce value for transaction\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 extends BaseTransaction {\n type: TransactionType.EVM\n isApprovalTx: boolean\n from: string | null\n to: string\n data: string | null\n value: string | null\n nonce: 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"],"names":["RangoClient","apiKey","apiUrl","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","_proto","prototype","getAllMetadata","_getAllMetadata","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","axiosResponse","reformatTokens","tokens","popularTokens","wrap","_callee$","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","sent","map","tm","blockchain","b","symbol","s","image","i","address","a","usdPrice","p","isSecondaryCoin","is","coinSource","c","coinSourceUrl","cu","name","n","decimals","d","isPopular","ip","supportedSwappers","ss","data","abrupt","stop","_x","_x2","apply","arguments","getBlockchains","_getBlockchains","_callee2","_callee2$","_context2","_x3","getSwappers","_getSwappers","_callee3","_callee3$","_context3","_x4","getCustomToken","_getCustomToken","_callee4","customTokenRequest","_callee4$","_context4","_x5","_x6","searchCustomTokens","_searchCustomTokens","_callee5","searchCustomTokensRequest","_callee5$","_context5","_x7","_x8","getBestRoute","_getBestRoute","_callee6","requestBody","_callee6$","_context6","post","headers","_x9","_x10","getAllRoutes","_getAllRoutes","_callee7","_callee7$","_context7","_x11","_x12","confirmRoute","_confirmRoute","_callee8","_callee8$","_context8","_x13","_x14","confirmRouteRequest","_confirmRouteRequest","_callee9","_callee9$","_context9","_x15","_x16","checkApproval","_checkApproval","_callee10","requestId","txId","_callee10$","_context10","_x17","_x18","_x19","checkStatus","_checkStatus","_callee11","_callee11$","_context11","_x20","_x21","createTransaction","_createTransaction","_callee12","_callee12$","_context12","_x22","_x23","reportFailure","_reportFailure","_callee13","_callee13$","_context13","_x24","_x25","getWalletsDetails","_getWalletsDetails","_callee14","walletAddresses","walletAddressesQueryParams","walletAddress","_callee14$","_context14","length","_x26","_x27","getTokenBalance","_getTokenBalance","_callee15","tokenBalanceRequest","_callee15$","_context15","_x28","_x29","getMultipleTokenBalance","_getMultipleTokenBalance","_callee16","_callee16$","_context16","_x30","_x31","RoutingResultType","TransactionType","GenericTransactionType","TransactionStatus","TonChainID"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCaA,WAAW;EAMtB,SAAAA,YAAYC,MAAc,EAAEC,MAAe;IACzC,IAAI,CAACA,M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;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"rango-sdk.cjs.development.js","sources":["../src/services/client.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/tron.ts","../node_modules/rango-types/src/api/shared/txs/ton.ts","../node_modules/rango-types/src/api/main/txs/evm.ts"],"sourcesContent":["import uuid from 'uuid-random'\nimport {\n MetaRequest,\n MetaResponse,\n BestRouteRequest,\n BestRouteResponse,\n CheckApprovalResponse,\n CheckTxStatusRequest,\n TransactionStatusResponse,\n CreateTransactionRequest,\n CreateTransactionResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n RequestOptions,\n BlockchainMeta,\n CompactMetaResponse,\n CompactToken,\n Token,\n MultiRouteRequest,\n MultiRouteResponse,\n ConfirmRouteResponse,\n ConfirmRouteRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceResponse,\n TokenBalanceRequest,\n SwapperMetaExtended,\n MultipleTokenBalanceRequest,\n MultipleTokenBalanceResponse,\n SearchCustomTokensRequest,\n SearchCustomTokensResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddresses = { 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, 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 }\n\n public async getAllMetadata(\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<CompactMetaResponse>(\n `/meta/compact?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n const reformatTokens = (tokens: CompactToken[]): Token[] =>\n tokens.map((tm) => ({\n blockchain: tm.b,\n symbol: tm.s,\n image: tm.i,\n address: tm.a || null,\n usdPrice: tm.p || null,\n isSecondaryCoin: tm.is || false,\n coinSource: tm.c || null,\n coinSourceUrl: tm.cu || null,\n name: tm.n || null,\n decimals: tm.d,\n isPopular: tm.ip || false,\n supportedSwappers: tm.ss || [],\n }))\n\n const tokens = reformatTokens(axiosResponse.data.tokens)\n const popularTokens = reformatTokens(axiosResponse.data.popularTokens)\n return { ...axiosResponse.data, tokens, popularTokens }\n }\n\n public async getBlockchains(\n options?: RequestOptions\n ): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getSwappers(\n options?: RequestOptions\n ): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getCustomToken(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async searchCustomTokens(\n searchCustomTokensRequest: SearchCustomTokensRequest,\n options?: RequestOptions\n ): Promise<SearchCustomTokensResponse> {\n const axiosResponse =\n await this.httpService.get<SearchCustomTokensResponse>(\n `/meta/token/search?apiKey=${this.apiKey}`,\n { params: searchCustomTokensRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async getBestRoute(\n requestBody: BestRouteRequest,\n options?: RequestOptions\n ): Promise<BestRouteResponse> {\n const axiosResponse = await this.httpService.post<BestRouteResponse>(\n `/routing/best?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async getAllRoutes(\n requestBody: MultiRouteRequest,\n options?: RequestOptions\n ): Promise<MultiRouteResponse> {\n const axiosResponse = await this.httpService.post<MultiRouteResponse>(\n `/routing/bests?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async confirmRoute(\n requestBody: ConfirmRouteRequest,\n options?: RequestOptions\n ): Promise<ConfirmRouteResponse> {\n const axiosResponse = await this.httpService.post<ConfirmRouteResponse>(\n `/routing/confirm?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n // @deprecated use confirmRoute instead\n public async confirmRouteRequest(\n requestBody: ConfirmRouteRequest,\n options?: RequestOptions\n ): Promise<ConfirmRouteResponse> {\n const axiosResponse = await this.httpService.post<ConfirmRouteResponse>(\n `/routing/confirm?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async checkApproval(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/tx/${requestId}/check-approval?apiKey=${this.apiKey}`,\n { params: { txId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async checkStatus(\n requestBody: CheckTxStatusRequest,\n options?: RequestOptions\n ): Promise<TransactionStatusResponse> {\n const axiosResponse =\n await this.httpService.post<TransactionStatusResponse>(\n `/tx/check-status?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async createTransaction(\n requestBody: CreateTransactionRequest,\n options?: RequestOptions\n ): Promise<CreateTransactionResponse> {\n const axiosResponse =\n await this.httpService.post<CreateTransactionResponse>(\n `/tx/create?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\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 `/tx/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n ...options,\n }\n )\n }\n\n public async getWalletsDetails(\n walletAddresses: WalletAddresses,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n let walletAddressesQueryParams = ''\n for (let i = 0; i < walletAddresses.length; i++) {\n const walletAddress = walletAddresses[i]\n walletAddressesQueryParams += `&address=${walletAddress.blockchain}.${walletAddress.address}`\n }\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/wallets/details?apiKey=${this.apiKey}${walletAddressesQueryParams}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getTokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/wallets/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async getMultipleTokenBalance(\n requestBody: MultipleTokenBalanceRequest,\n options?: RequestOptions\n ): Promise<MultipleTokenBalanceResponse> {\n const axiosResponse =\n await this.httpService.post<MultipleTokenBalanceResponse>(\n `/wallets/multiple-token-balance?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\n )\n return axiosResponse.data\n }\n}\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n XrplBlockchainMeta,\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 isXrplBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is XrplBlockchainMeta => blockchainMeta.type === 'XRPL'\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\nexport const xrplBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isXrplBlockchain)\n","/**\n * Routing Result Type\n *\n */\nexport enum RoutingResultType {\n OK = 'OK',\n HIGH_IMPACT = 'HIGH_IMPACT',\n NO_ROUTE = 'NO_ROUTE',\n INPUT_LIMIT_ISSUE = 'INPUT_LIMIT_ISSUE',\n HIGH_IMPACT_FOR_CREATE_TX = 'HIGH_IMPACT_FOR_CREATE_TX',\n}\n","/**\n * The type of transaction\n */\nexport enum TransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n TRON = 'TRON',\n STARKNET = 'STARKNET',\n TON = 'TON',\n SUI = 'SUI',\n XRPL = 'XRPL',\n}\n\n/**\n * The type of transaction\n * @deprecated use TransactionType instead\n */\nexport enum GenericTransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n}\n\n/**\n * A transaction's url that can be displayed to advanced user to track the progress\n *\n * @property {string} url - Url of the transaction in blockchain explorer. example: https://etherscan.io/tx/0xa1a3...\n * @property {string | null} description - A custom display name to help user distinguish the transactions from each\n * other. Example: Inbound, Outbound, Bridge, or null\n *\n */\nexport type SwapExplorerUrl = {\n description: string | null\n url: string\n}\n\n/**\n * APIErrorCode\n *\n * Error code of a swap failure\n *\n */\nexport type APIErrorCode =\n | 'TX_FAIL'\n | 'TX_EXPIRED'\n | 'FETCH_TX_FAILED'\n | 'USER_REJECT'\n | 'USER_CANCEL'\n | 'USER_CANCELED_TX'\n | 'CALL_WALLET_FAILED'\n | 'SEND_TX_FAILED'\n | 'CALL_OR_SEND_FAILED'\n | 'TX_FAILED_IN_BLOCKCHAIN'\n | 'CLIENT_UNEXPECTED_BEHAVIOUR'\n | 'INSUFFICIENT_APPROVE'\n\n/**\n * The function checks if a given string value is a valid API error code.\n * @param {string} value - a string that represents a possible API error code.\n * @returns A boolean value is being returned, indicating whether the input `value` is of type\n * `APIErrorCode` or not.\n */\nexport function isAPIErrorCode(value: string): value is APIErrorCode {\n return [\n 'TX_FAIL',\n 'TX_EXPIRED',\n 'FETCH_TX_FAILED',\n 'USER_REJECT',\n 'USER_CANCEL',\n 'USER_CANCELED_TX',\n 'CALL_WALLET_FAILED',\n 'SEND_TX_FAILED',\n 'CALL_OR_SEND_FAILED',\n 'TX_FAILED_IN_BLOCKCHAIN',\n 'CLIENT_UNEXPECTED_BEHAVIOUR',\n 'INSUFFICIENT_APPROVE',\n ].includes(value)\n}\n\n/**\n * ReportTransactionRequest\n *\n * It should be used when an error happened in client and we want to inform server that transaction failed,\n * E.g. user rejected the transaction dialog or and an RPC error raised during signing tx by user.\n *\n * @property {string} requestId - The requestId from best route endpoint\n * @property {APIErrorCode} eventType - Type of the event that happened, example: USER_REJECT\n * @property {number} [step] - Step number in which failure happened\n * @property {string} [reason] - Reason or message for the error\n * @property {[key: string]: string} [data] - @deprecated A list of key-value for extra details\n * @property {wallet?: string, errorCode? string} [tags] - A list of key-value for pre-defined tags\n *\n */\nexport type ReportTransactionRequest = {\n requestId: string\n eventType: APIErrorCode\n step?: number\n reason?: string\n data?: { [key: string]: string }\n tags?: { wallet?: string; errorCode?: string }\n}\n\n/**\n * The status of transaction in tracking\n */\nexport enum TransactionStatus {\n FAILED = 'failed',\n RUNNING = 'running',\n SUCCESS = 'success',\n}\n\n/**\n * Response body of check-approval\n * You could stop check approval if:\n * 1- approved successfully\n * => isApproved = true\n * 2- approval transaction failed\n * => isApproved = false && txStatus === 'failed'\n * 3- approval transaction succeeded but currentApprovedAmount is still less than requiredApprovedAmount\n * (e.g. user changed transaction data and enter another approve amount in MetaMask)\n * => isApproved = false && txStatus == 'success'\n *\n * @property {boolean} isApproved - A flag which indicates that the approve tx is done or not\n * @property {TransactionStatus | null} txStatus - Status of approve transaction in blockchain,\n * if isArppoved is false and txStatus is failed, it seems that approve transaction failed in blockchain\n * @property {string | null} requiredApprovedAmount - required amount to be approved by user\n * @property {string | null} currentApprovedAmount - current approved amount by user\n *\n */\nexport type CheckApprovalResponse = {\n isApproved: boolean\n txStatus: TransactionStatus | null\n requiredApprovedAmount: string | null\n currentApprovedAmount: string | null\n}\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * CosmosCoin\n */\nexport type CosmosCoin = {\n amount: string\n denom: string\n}\n\n/**\n * CosmosProtoMsg\n */\nexport type CosmosProtoMsg = {\n type_url: string\n value: number[]\n}\n\n/**\n * CosmosFee representing fee for cosmos transaction\n */\nexport type CosmosFee = {\n gas: string\n amount: CosmosCoin[]\n}\n\n/**\n * Main transaction object for COSMOS type transactions\n */\nexport type CosmosMessage = {\n signType: 'AMINO' | 'DIRECT'\n sequence: string | null\n source: number | null\n account_number: number | null\n rpcUrl: string\n chainId: string | null\n msgs: any[] // TODO\n protoMsgs: CosmosProtoMsg[]\n memo: string | null\n fee: CosmosFee | null\n}\n/**\n * An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages (e.g. XDefi)\n *\n * @property {AssetWithTicker} asset - The asset to be transferred\n * @property {string} amount - The machine-readable amount to transfer, example: 1000000000000000000\n * @property {number} decimals - The decimals for this asset, example: 18\n * @property {string | null} memo - Memo of transaction, could be null\n * @property {string} method - The transaction method, example: transfer, deposit\n * @property {string} recipient - The recipient address of transaction\n *\n */\nexport type CosmosRawTransferData = {\n amount: string\n asset: AssetWithTicker\n decimals: number\n memo: string | null\n method: string\n recipient: string\n}\n\n/**\n * A Cosmos transaction, child of GenericTransaction\n *\n * @property {TransactionType} type - This fields equals to COSMOS for all CosmosTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} fromWalletAddress - Address of wallet that this transaction should be executed in, same as the create transaction request's input\n * @property {CosmosMessage} data - Transaction data\n * @property {CosmosRawTransferData | null} rawTransfer - An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages\n *\n */\nexport interface CosmosTransaction extends BaseTransaction {\n type: TransactionType.COSMOS\n fromWalletAddress: string\n data: CosmosMessage\n rawTransfer: CosmosRawTransferData | null\n}\n\nexport const isCosmosTransaction = (transaction: {\n type: TransactionType\n}): transaction is CosmosTransaction =>\n transaction.type === TransactionType.COSMOS\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * Account metadata used to define instructions\n */\nexport type SolanaInstructionKey = {\n pubkey: string\n isSigner: boolean\n isWritable: boolean\n}\n\n/**\n * Transaction Instruction class\n */\nexport type SolanaInstruction = {\n keys: SolanaInstructionKey[]\n programId: string\n data: number[]\n}\n\n/**\n * Pair of signature and corresponding public key\n */\nexport type SolanaSignature = {\n signature: number[]\n publicKey: string\n}\n\n/**\n * This type of transaction is used for all solana transactions\n *\n * @property {TransactionType} type - This fields equals to SOLANA for all SolanaTransactions\n * @property {'LEGACY' | 'VERSIONED'} txType - Type of the solana transaction\n * @property {string} blockChain, equals to SOLANA\n * @property {string} from, Source wallet address\n * @property {string} identifier, Transaction hash used in case of retry\n * @property {string | null} recentBlockhash, A recent blockhash\n * @property {SolanaSignature[]} signatures, Signatures for the transaction\n * @property {number[] | null} serializedMessage, The byte array of the transaction\n * @property {SolanaInstruction[]} instructions, The instructions to atomically execute\n *\n */\nexport interface SolanaTransaction extends BaseTransaction {\n type: TransactionType.SOLANA\n txType: 'LEGACY' | 'VERSIONED'\n from: string\n identifier: string\n recentBlockhash: string | null\n signatures: SolanaSignature[]\n serializedMessage: number[] | null\n instructions: SolanaInstruction[]\n}\n\nexport const isSolanaTransaction = (transaction: {\n type: TransactionType\n}): transaction is SolanaTransaction =>\n transaction.type === TransactionType.SOLANA\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type InputToSign = { address: string, signingIndexes: number[] }\n/**\n * @property {unsignedPsbtBase64} unsignedPsbtBase64 - Base 64 representation of the Unsigned PSBT\n * @property {InputToSign[]} inputsToSign - Inputs to be signed\n */\nexport type PSBT = {\n unsignedPsbtBase64: string\n inputsToSign: InputToSign[]\n}\n/**\n * TransferTransaction. This type of transaction is used for UTXO blockchains including BTC, LTC, BCH\n *\n * @property {TransactionType} type - This fields equals to TRANSFER for all TransferTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} method - The method that should be passed to wallet. examples: deposit, transfer\n * @property {AssetWithTicker} asset\n * @property {string} amount - The machine-readable amount of transaction, example: 1000000000000000000\n * @property {number} decimals - The decimals of the asset\n * @property {string} fromWalletAddress - The source wallet address that can sign this transaction\n * @property {string} recipientAddress - The destination wallet address that the fund should be sent to\n * @property {string | null} memo - The memo of transaction, can be null\n * @property {PSBT | null} psbt - PSBT object containing base 64 representation of the Unsigned PSBT along with the inputs to be signed\n *\n */\nexport interface Transfer extends BaseTransaction {\n type: TransactionType.TRANSFER\n method: string\n asset: AssetWithTicker\n amount: string\n decimals: number\n fromWalletAddress: string\n recipientAddress: string\n memo: string | null\n psbt: PSBT | null\n}\n\nexport const isTransferTransaction = (transaction: {\n type: TransactionType\n}): transaction is Transfer => transaction.type === TransactionType.TRANSFER\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type TrxContractParameter = {\n value: unknown\n type_url: string\n}\n\nexport type TrxContractData = {\n parameter: TrxContractParameter\n type: string\n}\n\nexport type TrxRawData = {\n contract: TrxContractData[]\n ref_block_bytes: string\n ref_block_hash: string\n expiration: number\n timestamp: number\n}\n\n/**\n * TronTransaction\n *\n * @property {TransactionType} type - TransactionType.TRON\n * @property {boolean} isApprovalTx - Whether or not the transaction is an approval transaction.\n * @property {TrxRawData | null} raw_data - This is the raw data of the transaction.\n * @property {string | null} raw_data_hex - The raw hex data of the transaction.\n * @property {string} txID - The transaction ID.\n * @property {boolean} visible - boolean\n * @property {object} __payload__\n */\nexport interface TronTransaction extends BaseTransaction {\n type: TransactionType.TRON\n isApprovalTx: boolean\n raw_data: TrxRawData | null\n raw_data_hex: string | null\n txID: string\n visible: boolean\n __payload__: object\n}\n\nexport const isTronTransaction = (transaction: {\n type: TransactionType\n}): transaction is TronTransaction => transaction.type === TransactionType.TRON\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 { BaseTransaction, TransactionType } from '../../shared/index.js'\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 {string} blockChain - The blockchain that this transaction is going to run in\n * @property {boolean} isApprovalTx - Determines that this transaction is an approval transaction or not, if true user\n * should approve the transaction and call create transaction endpoint again to get the original tx. Beware that most\n * of the fields of this object will be passed directly to the wallet without any change.\n * @property {string | null} from - The source wallet address, it can be null\n * @property {string} to - Address of destination wallet or the smart contract or token that is going to be called\n * @property {string | null} data - The data of smart contract call, 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} nonce - The nonce value for transaction\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 extends BaseTransaction {\n type: TransactionType.EVM\n isApprovalTx: boolean\n from: string | null\n to: string\n data: string | null\n value: string | null\n nonce: 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"],"names":["RangoClient","apiKey","apiUrl","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","_proto","prototype","getAllMetadata","_getAllMetadata","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","axiosResponse","reformatTokens","tokens","popularTokens","wrap","_callee$","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","sent","map","tm","blockchain","b","symbol","s","image","i","address","a","usdPrice","p","isSecondaryCoin","is","coinSource","c","coinSourceUrl","cu","name","n","decimals","d","isPopular","ip","supportedSwappers","ss","data","abrupt","stop","_x","_x2","apply","arguments","getBlockchains","_getBlockchains","_callee2","_callee2$","_context2","_x3","getSwappers","_getSwappers","_callee3","_callee3$","_context3","_x4","getCustomToken","_getCustomToken","_callee4","customTokenRequest","_callee4$","_context4","_x5","_x6","searchCustomTokens","_searchCustomTokens","_callee5","searchCustomTokensRequest","_callee5$","_context5","_x7","_x8","getBestRoute","_getBestRoute","_callee6","requestBody","_callee6$","_context6","post","headers","_x9","_x10","getAllRoutes","_getAllRoutes","_callee7","_callee7$","_context7","_x11","_x12","confirmRoute","_confirmRoute","_callee8","_callee8$","_context8","_x13","_x14","confirmRouteRequest","_confirmRouteRequest","_callee9","_callee9$","_context9","_x15","_x16","checkApproval","_checkApproval","_callee10","requestId","txId","_callee10$","_context10","_x17","_x18","_x19","checkStatus","_checkStatus","_callee11","_callee11$","_context11","_x20","_x21","createTransaction","_createTransaction","_callee12","_callee12$","_context12","_x22","_x23","reportFailure","_reportFailure","_callee13","_callee13$","_context13","_x24","_x25","getWalletsDetails","_getWalletsDetails","_callee14","walletAddresses","walletAddressesQueryParams","walletAddress","_callee14$","_context14","length","_x26","_x27","getTokenBalance","_getTokenBalance","_callee15","tokenBalanceRequest","_callee15$","_context15","_x28","_x29","getMultipleTokenBalance","_getMultipleTokenBalance","_callee16","_callee16$","_context16","_x30","_x31","RoutingResultType","TransactionType","GenericTransactionType","TransactionStatus","TonChainID"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCaA,WAAW;EAMtB,SAAAA,YAAYC,MAAc,EAAE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U,QAGrB;AAgCD,IAAa,gBAAgB,GAAG,UAAC,WAEhC,IAAoC,OAAA,WAAW,CAAC,IAAI,KAAKH,uBAAe,CAAC,GAAG,GAAA;;ICLhE,gBAAgB,GAAG,UAAC,WAEhC,IAAoC,OAAA,WAAW,CAAC,IAAI,KAAKA,uBAAe,CAAC,GAAG,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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,i,a,o){try{var s=t[a](o),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,i)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(i,a){var o=t.apply(e,r);function s(t){n(o,i,a,s,c,"next",t)}function c(t){n(o,i,a,s,c,"throw",t)}s(void 0)}))}}function a(){return(a=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 o(){o=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.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 a=Object.create((e&&e.prototype instanceof x?e:x).prototype),o=new L(n||[]);return i(a,"_invoke",{value:O(t,r,o)}),a}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",y="executing",v="completed",d={};function x(){}function g(){}function m(){}var T={};p(T,s,(function(){return this}));var w=Object.getPrototypeOf,S=w&&w(w(K([])));S&&S!==r&&n.call(S,s)&&(T=S);var k=m.prototype=x.prototype=Object.create(T);function b(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(i,a,o,s){var c=f(t[i],t,a);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,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(p).then((function(t){u.value=t,o(u)}),(function(t){return r("throw",t,o,s)}))}s(c.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function O(e,r,n){var i=l;return function(a,o){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var c=I(s,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===l)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var u=f(e,r,n);if("normal"===u.type){if(i=n.done?v:"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}function I(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=f(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}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 K(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 i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=p(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,p(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},b(E.prototype),p(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new E(h(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},b(k),p(k,u,"Generator"),p(k,s,(function(){return this})),p(k,"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=K,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 i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(o)},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),d},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),d}},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 i=n.arg;N(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:K(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}var s,c,u,p,h,f=function(){function t(t,n){this.apiUrl=n||"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})}var n=t.prototype;return n.getAllMetadata=function(){var t=i(o().mark((function t(e,r){var n,i,s,c,u,p,h,f,l;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=a({},e,{blockchains:null==e||null==(n=e.blockchains)?void 0:n.join(),swappers:null==e||null==(i=e.swappers)?void 0:i.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("/meta/compact?apiKey="+this.apiKey,a({params:u},r));case 3:return h=function(t){return t.map((function(t){return{blockchain:t.b,symbol:t.s,image:t.i,address:t.a||null,usdPrice:t.p||null,isSecondaryCoin:t.is||!1,coinSource:t.c||null,coinSourceUrl:t.cu||null,name:t.n||null,decimals:t.d,isPopular:t.ip||!1,supportedSwappers:t.ss||[]}}))},f=h((p=t.sent).data.tokens),l=h(p.data.popularTokens),t.abrupt("return",a({},p.data,{tokens:f,popularTokens:l}));case 8:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.getBlockchains=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/meta/blockchains?apiKey="+this.apiKey,a({},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.getSwappers=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/meta/swappers?apiKey="+this.apiKey,a({},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.getCustomToken=function(){var t=i(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/meta/custom-token?apiKey="+this.apiKey,a({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.searchCustomTokens=function(){var t=i(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/meta/token/search?apiKey="+this.apiKey,a({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.getBestRoute=function(){var t=i(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/routing/best?apiKey="+this.apiKey,e,a({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.getAllRoutes=function(){var t=i(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/routing/bests?apiKey="+this.apiKey,e,a({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.confirmRoute=function(){var t=i(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/routing/confirm?apiKey="+this.apiKey,e,a({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.confirmRouteRequest=function(){var t=i(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/routing/confirm?apiKey="+this.apiKey,e,a({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.checkApproval=function(){var t=i(o().mark((function t(e,r,n){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/tx/"+e+"/check-approval?apiKey="+this.apiKey,a({params:{txId:r}},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.checkStatus=function(){var t=i(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/tx/check-status?apiKey="+this.apiKey,e,a({},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.createTransaction=function(){var t=i(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/tx/create?apiKey="+this.apiKey,e,a({},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.reportFailure=function(){var t=i(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/tx/report-tx?apiKey="+this.apiKey,e,a({},r));case 2:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.getWalletsDetails=function(){var t=i(o().mark((function t(e,r){var n,i,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n="",i=0;i<e.length;i++)n+="&address="+(s=e[i]).blockchain+"."+s.address;return t.next=4,this.httpService.get("/wallets/details?apiKey="+this.apiKey+n,a({},r));case 4:return t.abrupt("return",t.sent.data);case 6:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.getTokenBalance=function(){var t=i(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/wallets/token-balance?apiKey="+this.apiKey,a({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.getMultipleTokenBalance=function(){var t=i(o().mark((function t(e,r){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/wallets/multiple-token-balance?apiKey="+this.apiKey,e,a({},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)}}(),t}(),l=function(t){return"EVM"===t.type},y=function(t){return"COSMOS"===t.type},v=function(t){return"SOLANA"===t.type},d=function(t){return"TRON"===t.type},x=function(t){return"TRANSFER"===t.type},g=function(t){return"STARKNET"===t.type},m=function(t){return"TON"===t.type};(s=exports.RoutingResultType||(exports.RoutingResultType={})).OK="OK",s.HIGH_IMPACT="HIGH_IMPACT",s.NO_ROUTE="NO_ROUTE",s.INPUT_LIMIT_ISSUE="INPUT_LIMIT_ISSUE",s.HIGH_IMPACT_FOR_CREATE_TX="HIGH_IMPACT_FOR_CREATE_TX",(c=exports.TransactionType||(exports.TransactionType={})).EVM="EVM",c.TRANSFER="TRANSFER",c.COSMOS="COSMOS",c.SOLANA="SOLANA",c.TRON="TRON",c.STARKNET="STARKNET",c.TON="TON",c.SUI="SUI",c.XRPL="XRPL",(u=exports.GenericTransactionType||(exports.GenericTransactionType={})).EVM="EVM",u.TRANSFER="TRANSFER",u.COSMOS="COSMOS",u.SOLANA="SOLANA",(p=exports.TransactionStatus||(exports.TransactionStatus={})).FAILED="failed",p.RUNNING="running",p.SUCCESS="success",(h=exports.TonChainID||(exports.TonChainID={})).MAINNET="-239",h.TESTNET="-3",exports.RangoClient=f,exports.cosmosBlockchains=function(t){return t.filter(y)},exports.evmBlockchains=function(t){return t.filter(l)},exports.isCosmosBlockchain=y,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=g,exports.isTonBlockchain=m,exports.isTonTransaction=function(t){return t.type===exports.TransactionType.TON},exports.isTransferBlockchain=x,exports.isTransferTransaction=function(t){return t.type===exports.TransactionType.TRANSFER},exports.isTronBlockchain=d,exports.isTronTransaction=function(t){return t.type===exports.TransactionType.TRON},exports.solanaBlockchain=function(t){return t.filter(v)},exports.starknetBlockchain=function(t){return t.filter(g)},exports.tonBlockchain=function(t){return t.filter(m)},exports.transferBlockchains=function(t){return t.filter(x)},exports.tronBlockchain=function(t){return t.filter(d)};
|
|
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,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,i)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function s(t){n(a,i,o,s,c,"next",t)}function c(t){n(a,i,o,s,c,"throw",t)}s(void 0)}))}}function o(){return(o=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,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.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 o=Object.create((e&&e.prototype instanceof x?e:x).prototype),a=new N(n||[]);return i(o,"_invoke",{value:O(t,r,a)}),o}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",y="executing",v="completed",d={};function x(){}function g(){}function m(){}var T={};p(T,s,(function(){return this}));var w=Object.getPrototypeOf,S=w&&w(w(K([])));S&&S!==r&&n.call(S,s)&&(T=S);var k=m.prototype=x.prototype=Object.create(T);function b(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(i,o,a,s){var c=f(t[i],t,o);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 o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function O(e,r,n){var i=l;return function(o,a){if(i===y)throw Error("Generator is already running");if(i===v){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=R(s,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===l)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var u=f(e,r,n);if("normal"===u.type){if(i=n.done?v:"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}function R(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,R(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var a=o.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,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function I(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function K(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 i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=p(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,p(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},b(E.prototype),p(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new E(h(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(k),p(k,u,"Generator"),p(k,s,(function(){return this})),p(k,"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=K,N.prototype={constructor:N,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(L),!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 i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("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 i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):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),d},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),L(r),d}},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 i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:K(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}var s,c,u,p,h,f=function(){function t(t,n){this.apiUrl=n||"https://api.rango.exchange",this.apiKey=t;try{if("undefined"!=typeof window){var i=localStorage.getItem("deviceId");if(i)this.deviceId=i;else{var o=e();localStorage.setItem("deviceId",o),this.deviceId=o}}else this.deviceId=e()}catch(t){this.deviceId=e()}this.httpService=r.create({baseURL:this.apiUrl})}var n=t.prototype;return n.getAllMetadata=function(){var t=i(a().mark((function t(e,r){var n,i,s,c,u,p,h,f,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=o({},e,{blockchains:null==e||null==(n=e.blockchains)?void 0:n.join(),swappers:null==e||null==(i=e.swappers)?void 0:i.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("/meta/compact?apiKey="+this.apiKey,o({params:u},r));case 3:return h=function(t){return t.map((function(t){return{blockchain:t.b,symbol:t.s,image:t.i,address:t.a||null,usdPrice:t.p||null,isSecondaryCoin:t.is||!1,coinSource:t.c||null,coinSourceUrl:t.cu||null,name:t.n||null,decimals:t.d,isPopular:t.ip||!1,supportedSwappers:t.ss||[]}}))},f=h((p=t.sent).data.tokens),l=h(p.data.popularTokens),t.abrupt("return",o({},p.data,{tokens:f,popularTokens:l}));case 8:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.getBlockchains=function(){var t=i(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("/meta/blockchains?apiKey="+this.apiKey,o({},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.getSwappers=function(){var t=i(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("/meta/swappers?apiKey="+this.apiKey,o({},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.getCustomToken=function(){var t=i(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("/meta/custom-token?apiKey="+this.apiKey,o({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.searchCustomTokens=function(){var t=i(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("/meta/token/search?apiKey="+this.apiKey,o({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.getBestRoute=function(){var t=i(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("/routing/best?apiKey="+this.apiKey,e,o({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.getAllRoutes=function(){var t=i(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("/routing/bests?apiKey="+this.apiKey,e,o({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.confirmRoute=function(){var t=i(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("/routing/confirm?apiKey="+this.apiKey,e,o({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.confirmRouteRequest=function(){var t=i(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("/routing/confirm?apiKey="+this.apiKey,e,o({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.checkApproval=function(){var t=i(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("/tx/"+e+"/check-approval?apiKey="+this.apiKey,o({params:{txId:r}},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.checkStatus=function(){var t=i(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("/tx/check-status?apiKey="+this.apiKey,e,o({},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.createTransaction=function(){var t=i(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("/tx/create?apiKey="+this.apiKey,e,o({},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.reportFailure=function(){var t=i(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("/tx/report-tx?apiKey="+this.apiKey,e,o({},r));case 2:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.getWalletsDetails=function(){var t=i(a().mark((function t(e,r){var n,i,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n="",i=0;i<e.length;i++)n+="&address="+(s=e[i]).blockchain+"."+s.address;return t.next=4,this.httpService.get("/wallets/details?apiKey="+this.apiKey+n,o({},r));case 4:return t.abrupt("return",t.sent.data);case 6:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.getTokenBalance=function(){var t=i(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("/wallets/token-balance?apiKey="+this.apiKey,o({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.getMultipleTokenBalance=function(){var t=i(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("/wallets/multiple-token-balance?apiKey="+this.apiKey,e,o({},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)}}(),t}(),l=function(t){return"EVM"===t.type},y=function(t){return"COSMOS"===t.type},v=function(t){return"SOLANA"===t.type},d=function(t){return"TRON"===t.type},x=function(t){return"TRANSFER"===t.type},g=function(t){return"STARKNET"===t.type},m=function(t){return"TON"===t.type},T=function(t){return"XRPL"===t.type};(s=exports.RoutingResultType||(exports.RoutingResultType={})).OK="OK",s.HIGH_IMPACT="HIGH_IMPACT",s.NO_ROUTE="NO_ROUTE",s.INPUT_LIMIT_ISSUE="INPUT_LIMIT_ISSUE",s.HIGH_IMPACT_FOR_CREATE_TX="HIGH_IMPACT_FOR_CREATE_TX",(c=exports.TransactionType||(exports.TransactionType={})).EVM="EVM",c.TRANSFER="TRANSFER",c.COSMOS="COSMOS",c.SOLANA="SOLANA",c.TRON="TRON",c.STARKNET="STARKNET",c.TON="TON",c.SUI="SUI",c.XRPL="XRPL",(u=exports.GenericTransactionType||(exports.GenericTransactionType={})).EVM="EVM",u.TRANSFER="TRANSFER",u.COSMOS="COSMOS",u.SOLANA="SOLANA",(p=exports.TransactionStatus||(exports.TransactionStatus={})).FAILED="failed",p.RUNNING="running",p.SUCCESS="success",(h=exports.TonChainID||(exports.TonChainID={})).MAINNET="-239",h.TESTNET="-3",exports.RangoClient=f,exports.cosmosBlockchains=function(t){return t.filter(y)},exports.evmBlockchains=function(t){return t.filter(l)},exports.isCosmosBlockchain=y,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=g,exports.isTonBlockchain=m,exports.isTonTransaction=function(t){return t.type===exports.TransactionType.TON},exports.isTransferBlockchain=x,exports.isTransferTransaction=function(t){return t.type===exports.TransactionType.TRANSFER},exports.isTronBlockchain=d,exports.isTronTransaction=function(t){return t.type===exports.TransactionType.TRON},exports.isXrplBlockchain=T,exports.solanaBlockchain=function(t){return t.filter(v)},exports.starknetBlockchain=function(t){return t.filter(g)},exports.tonBlockchain=function(t){return t.filter(m)},exports.transferBlockchains=function(t){return t.filter(x)},exports.tronBlockchain=function(t){return t.filter(d)},exports.xrplBlockchain=function(t){return t.filter(T)};
|
|
2
2
|
//# sourceMappingURL=rango-sdk.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rango-sdk.cjs.production.min.js","sources":["../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","../node_modules/rango-types/src/api/shared/type-gaurds.ts","../node_modules/rango-types/src/api/shared/txs/cosmos.ts","../node_modules/rango-types/src/api/main/txs/evm.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/tron.ts"],"sourcesContent":["/**\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'\nimport {\n MetaRequest,\n MetaResponse,\n BestRouteRequest,\n BestRouteResponse,\n CheckApprovalResponse,\n CheckTxStatusRequest,\n TransactionStatusResponse,\n CreateTransactionRequest,\n CreateTransactionResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n RequestOptions,\n BlockchainMeta,\n CompactMetaResponse,\n CompactToken,\n Token,\n MultiRouteRequest,\n MultiRouteResponse,\n ConfirmRouteResponse,\n ConfirmRouteRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceResponse,\n TokenBalanceRequest,\n SwapperMetaExtended,\n MultipleTokenBalanceRequest,\n MultipleTokenBalanceResponse,\n SearchCustomTokensRequest,\n SearchCustomTokensResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddresses = { 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, 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 }\n\n public async getAllMetadata(\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<CompactMetaResponse>(\n `/meta/compact?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n const reformatTokens = (tokens: CompactToken[]): Token[] =>\n tokens.map((tm) => ({\n blockchain: tm.b,\n symbol: tm.s,\n image: tm.i,\n address: tm.a || null,\n usdPrice: tm.p || null,\n isSecondaryCoin: tm.is || false,\n coinSource: tm.c || null,\n coinSourceUrl: tm.cu || null,\n name: tm.n || null,\n decimals: tm.d,\n isPopular: tm.ip || false,\n supportedSwappers: tm.ss || [],\n }))\n\n const tokens = reformatTokens(axiosResponse.data.tokens)\n const popularTokens = reformatTokens(axiosResponse.data.popularTokens)\n return { ...axiosResponse.data, tokens, popularTokens }\n }\n\n public async getBlockchains(\n options?: RequestOptions\n ): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getSwappers(\n options?: RequestOptions\n ): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getCustomToken(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async searchCustomTokens(\n searchCustomTokensRequest: SearchCustomTokensRequest,\n options?: RequestOptions\n ): Promise<SearchCustomTokensResponse> {\n const axiosResponse =\n await this.httpService.get<SearchCustomTokensResponse>(\n `/meta/token/search?apiKey=${this.apiKey}`,\n { params: searchCustomTokensRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async getBestRoute(\n requestBody: BestRouteRequest,\n options?: RequestOptions\n ): Promise<BestRouteResponse> {\n const axiosResponse = await this.httpService.post<BestRouteResponse>(\n `/routing/best?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async getAllRoutes(\n requestBody: MultiRouteRequest,\n options?: RequestOptions\n ): Promise<MultiRouteResponse> {\n const axiosResponse = await this.httpService.post<MultiRouteResponse>(\n `/routing/bests?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async confirmRoute(\n requestBody: ConfirmRouteRequest,\n options?: RequestOptions\n ): Promise<ConfirmRouteResponse> {\n const axiosResponse = await this.httpService.post<ConfirmRouteResponse>(\n `/routing/confirm?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n // @deprecated use confirmRoute instead\n public async confirmRouteRequest(\n requestBody: ConfirmRouteRequest,\n options?: RequestOptions\n ): Promise<ConfirmRouteResponse> {\n const axiosResponse = await this.httpService.post<ConfirmRouteResponse>(\n `/routing/confirm?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async checkApproval(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/tx/${requestId}/check-approval?apiKey=${this.apiKey}`,\n { params: { txId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async checkStatus(\n requestBody: CheckTxStatusRequest,\n options?: RequestOptions\n ): Promise<TransactionStatusResponse> {\n const axiosResponse =\n await this.httpService.post<TransactionStatusResponse>(\n `/tx/check-status?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async createTransaction(\n requestBody: CreateTransactionRequest,\n options?: RequestOptions\n ): Promise<CreateTransactionResponse> {\n const axiosResponse =\n await this.httpService.post<CreateTransactionResponse>(\n `/tx/create?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\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 `/tx/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n ...options,\n }\n )\n }\n\n public async getWalletsDetails(\n walletAddresses: WalletAddresses,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n let walletAddressesQueryParams = ''\n for (let i = 0; i < walletAddresses.length; i++) {\n const walletAddress = walletAddresses[i]\n walletAddressesQueryParams += `&address=${walletAddress.blockchain}.${walletAddress.address}`\n }\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/wallets/details?apiKey=${this.apiKey}${walletAddressesQueryParams}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getTokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/wallets/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async getMultipleTokenBalance(\n requestBody: MultipleTokenBalanceRequest,\n options?: RequestOptions\n ): Promise<MultipleTokenBalanceResponse> {\n const axiosResponse =\n await this.httpService.post<MultipleTokenBalanceResponse>(\n `/wallets/multiple-token-balance?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\n )\n return axiosResponse.data\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 { 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 { BaseTransaction, TransactionType } from '../../shared/index.js'\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 {string} blockChain - The blockchain that this transaction is going to run in\n * @property {boolean} isApprovalTx - Determines that this transaction is an approval transaction or not, if true user\n * should approve the transaction and call create transaction endpoint again to get the original tx. Beware that most\n * of the fields of this object will be passed directly to the wallet without any change.\n * @property {string | null} from - The source wallet address, it can be null\n * @property {string} to - Address of destination wallet or the smart contract or token that is going to be called\n * @property {string | null} data - The data of smart contract call, 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} nonce - The nonce value for transaction\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 extends BaseTransaction {\n type: TransactionType.EVM\n isApprovalTx: boolean\n from: string | null\n to: string\n data: string | null\n value: string | null\n nonce: 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","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type TrxContractParameter = {\n value: unknown\n type_url: string\n}\n\nexport type TrxContractData = {\n parameter: TrxContractParameter\n type: string\n}\n\nexport type TrxRawData = {\n contract: TrxContractData[]\n ref_block_bytes: string\n ref_block_hash: string\n expiration: number\n timestamp: number\n}\n\n/**\n * TronTransaction\n *\n * @property {TransactionType} type - TransactionType.TRON\n * @property {boolean} isApprovalTx - Whether or not the transaction is an approval transaction.\n * @property {TrxRawData | null} raw_data - This is the raw data of the transaction.\n * @property {string | null} raw_data_hex - The raw hex data of the transaction.\n * @property {string} txID - The transaction ID.\n * @property {boolean} visible - boolean\n * @property {object} __payload__\n */\nexport interface TronTransaction extends BaseTransaction {\n type: TransactionType.TRON\n isApprovalTx: boolean\n raw_data: TrxRawData | null\n raw_data_hex: string | null\n txID: string\n visible: boolean\n __payload__: object\n}\n\nexport const isTronTransaction = (transaction: {\n type: TransactionType\n}): transaction is TronTransaction => transaction.type === TransactionType.TRON\n"],"names":["RoutingResultType","TransactionType","GenericTransactionType","TransactionStatus","TonChainID","RangoClient","apiKey","apiUrl","this","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","_proto","prototype","getAllMetadata","_getAllMetadata","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","axiosResponse","reformatTokens","tokens","popularTokens","wrap","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","map","tm","blockchain","b","symbol","s","image","i","address","a","usdPrice","p","isSecondaryCoin","is","coinSource","c","coinSourceUrl","cu","name","n","decimals","d","isPopular","ip","supportedSwappers","ss","sent","data","abrupt","stop","_x","_x2","apply","arguments","getBlockchains","_getBlockchains","_callee2","_context2","_x3","getSwappers","_getSwappers","_callee3","_context3","_x4","getCustomToken","_getCustomToken","_callee4","customTokenRequest","_context4","_x5","_x6","searchCustomTokens","_searchCustomTokens","_callee5","searchCustomTokensRequest","_context5","_x7","_x8","getBestRoute","_getBestRoute","_callee6","requestBody","_context6","post","headers","X-Rango-Id","_x9","_x10","getAllRoutes","_getAllRoutes","_callee7","_context7","_x11","_x12","confirmRoute","_confirmRoute","_callee8","_context8","_x13","_x14","confirmRouteRequest","_confirmRouteRequest","_callee9","_context9","_x15","_x16","checkApproval","_checkApproval","_callee10","requestId","txId","_context10","_x17","_x18","_x19","checkStatus","_checkStatus","_callee11","_context11","_x20","_x21","createTransaction","_createTransaction","_callee12","_context12","_x22","_x23","reportFailure","_reportFailure","_callee13","_context13","_x24","_x25","getWalletsDetails","_getWalletsDetails","_callee14","walletAddresses","walletAddressesQueryParams","walletAddress","_context14","length","_x26","_x27","getTokenBalance","_getTokenBalance","_callee15","tokenBalanceRequest","_context15","_x28","_x29","getMultipleTokenBalance","_getMultipleTokenBalance","_callee16","_context16","_x30","_x31","isEvmBlockchain","blockchainMeta","type","isCosmosBlockchain","isSolanaBlockchain","isTronBlockchain","isTransferBlockchain","isStarknetBlockchain","isTonBlockchain","filter","transaction","COSMOS","EVM","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UC,EAAAA,qBAAAA,uCAEVA,+DEgD+B,SAACyC,GAChC,OAAAA,EAAYuJ,OAAON,2BAbS,SAACjJ,GAC7B,OAAAA,EAAYuJ,OAAOT,6DCsCc,SAACU,GAGlC,OAAAA,EAAYR,OAAS5L,wBAAgBqM,2DChDP,SAACD,GAEI,OAAAA,EAAYR,OAAS5L,wBAAgBsM,8DCiBvC,SAACF,GAGlC,OAAAA,EAAYR,OAAS5L,wBAAgBuM,0FLnBP,SAACH,GAEI,OAAAA,EAAYR,OAAS5L,wBAAgBwM,kEMArC,SAACJ,GAEP,OAAAA,EAAYR,OAAS5L,wBAAgByM,+DCAnC,SAACL,GAEI,OAAAA,EAAYR,OAAS5L,wBAAgB0M,+BLA3C,SAAC9J,GAC/B,OAAAA,EAAYuJ,OAAOL,+BAEa,SAAClJ,GACjC,OAAAA,EAAYuJ,OAAOF,0BAWQ,SAACrJ,GAC5B,OAAAA,EAAYuJ,OAAOD,gCAJc,SAACtJ,GAClC,OAAAA,EAAYuJ,OAAOH,2BAPS,SAACpJ,GAC7B,OAAAA,EAAYuJ,OAAOJ"}
|
|
1
|
+
{"version":3,"file":"rango-sdk.cjs.production.min.js","sources":["../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","../node_modules/rango-types/src/api/shared/type-gaurds.ts","../node_modules/rango-types/src/api/shared/txs/cosmos.ts","../node_modules/rango-types/src/api/main/txs/evm.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/tron.ts"],"sourcesContent":["/**\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'\nimport {\n MetaRequest,\n MetaResponse,\n BestRouteRequest,\n BestRouteResponse,\n CheckApprovalResponse,\n CheckTxStatusRequest,\n TransactionStatusResponse,\n CreateTransactionRequest,\n CreateTransactionResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n RequestOptions,\n BlockchainMeta,\n CompactMetaResponse,\n CompactToken,\n Token,\n MultiRouteRequest,\n MultiRouteResponse,\n ConfirmRouteResponse,\n ConfirmRouteRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceResponse,\n TokenBalanceRequest,\n SwapperMetaExtended,\n MultipleTokenBalanceRequest,\n MultipleTokenBalanceResponse,\n SearchCustomTokensRequest,\n SearchCustomTokensResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddresses = { 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, 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 }\n\n public async getAllMetadata(\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<CompactMetaResponse>(\n `/meta/compact?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n const reformatTokens = (tokens: CompactToken[]): Token[] =>\n tokens.map((tm) => ({\n blockchain: tm.b,\n symbol: tm.s,\n image: tm.i,\n address: tm.a || null,\n usdPrice: tm.p || null,\n isSecondaryCoin: tm.is || false,\n coinSource: tm.c || null,\n coinSourceUrl: tm.cu || null,\n name: tm.n || null,\n decimals: tm.d,\n isPopular: tm.ip || false,\n supportedSwappers: tm.ss || [],\n }))\n\n const tokens = reformatTokens(axiosResponse.data.tokens)\n const popularTokens = reformatTokens(axiosResponse.data.popularTokens)\n return { ...axiosResponse.data, tokens, popularTokens }\n }\n\n public async getBlockchains(\n options?: RequestOptions\n ): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getSwappers(\n options?: RequestOptions\n ): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getCustomToken(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async searchCustomTokens(\n searchCustomTokensRequest: SearchCustomTokensRequest,\n options?: RequestOptions\n ): Promise<SearchCustomTokensResponse> {\n const axiosResponse =\n await this.httpService.get<SearchCustomTokensResponse>(\n `/meta/token/search?apiKey=${this.apiKey}`,\n { params: searchCustomTokensRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async getBestRoute(\n requestBody: BestRouteRequest,\n options?: RequestOptions\n ): Promise<BestRouteResponse> {\n const axiosResponse = await this.httpService.post<BestRouteResponse>(\n `/routing/best?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async getAllRoutes(\n requestBody: MultiRouteRequest,\n options?: RequestOptions\n ): Promise<MultiRouteResponse> {\n const axiosResponse = await this.httpService.post<MultiRouteResponse>(\n `/routing/bests?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async confirmRoute(\n requestBody: ConfirmRouteRequest,\n options?: RequestOptions\n ): Promise<ConfirmRouteResponse> {\n const axiosResponse = await this.httpService.post<ConfirmRouteResponse>(\n `/routing/confirm?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n // @deprecated use confirmRoute instead\n public async confirmRouteRequest(\n requestBody: ConfirmRouteRequest,\n options?: RequestOptions\n ): Promise<ConfirmRouteResponse> {\n const axiosResponse = await this.httpService.post<ConfirmRouteResponse>(\n `/routing/confirm?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async checkApproval(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/tx/${requestId}/check-approval?apiKey=${this.apiKey}`,\n { params: { txId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async checkStatus(\n requestBody: CheckTxStatusRequest,\n options?: RequestOptions\n ): Promise<TransactionStatusResponse> {\n const axiosResponse =\n await this.httpService.post<TransactionStatusResponse>(\n `/tx/check-status?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async createTransaction(\n requestBody: CreateTransactionRequest,\n options?: RequestOptions\n ): Promise<CreateTransactionResponse> {\n const axiosResponse =\n await this.httpService.post<CreateTransactionResponse>(\n `/tx/create?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\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 `/tx/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n ...options,\n }\n )\n }\n\n public async getWalletsDetails(\n walletAddresses: WalletAddresses,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n let walletAddressesQueryParams = ''\n for (let i = 0; i < walletAddresses.length; i++) {\n const walletAddress = walletAddresses[i]\n walletAddressesQueryParams += `&address=${walletAddress.blockchain}.${walletAddress.address}`\n }\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/wallets/details?apiKey=${this.apiKey}${walletAddressesQueryParams}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getTokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/wallets/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async getMultipleTokenBalance(\n requestBody: MultipleTokenBalanceRequest,\n options?: RequestOptions\n ): Promise<MultipleTokenBalanceResponse> {\n const axiosResponse =\n await this.httpService.post<MultipleTokenBalanceResponse>(\n `/wallets/multiple-token-balance?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\n )\n return axiosResponse.data\n }\n}\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n XrplBlockchainMeta,\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 isXrplBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is XrplBlockchainMeta => blockchainMeta.type === 'XRPL'\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\nexport const xrplBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isXrplBlockchain)\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 { BaseTransaction, TransactionType } from '../../shared/index.js'\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 {string} blockChain - The blockchain that this transaction is going to run in\n * @property {boolean} isApprovalTx - Determines that this transaction is an approval transaction or not, if true user\n * should approve the transaction and call create transaction endpoint again to get the original tx. Beware that most\n * of the fields of this object will be passed directly to the wallet without any change.\n * @property {string | null} from - The source wallet address, it can be null\n * @property {string} to - Address of destination wallet or the smart contract or token that is going to be called\n * @property {string | null} data - The data of smart contract call, 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} nonce - The nonce value for transaction\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 extends BaseTransaction {\n type: TransactionType.EVM\n isApprovalTx: boolean\n from: string | null\n to: string\n data: string | null\n value: string | null\n nonce: 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","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type TrxContractParameter = {\n value: unknown\n type_url: string\n}\n\nexport type TrxContractData = {\n parameter: TrxContractParameter\n type: string\n}\n\nexport type TrxRawData = {\n contract: TrxContractData[]\n ref_block_bytes: string\n ref_block_hash: string\n expiration: number\n timestamp: number\n}\n\n/**\n * TronTransaction\n *\n * @property {TransactionType} type - TransactionType.TRON\n * @property {boolean} isApprovalTx - Whether or not the transaction is an approval transaction.\n * @property {TrxRawData | null} raw_data - This is the raw data of the transaction.\n * @property {string | null} raw_data_hex - The raw hex data of the transaction.\n * @property {string} txID - The transaction ID.\n * @property {boolean} visible - boolean\n * @property {object} __payload__\n */\nexport interface TronTransaction extends BaseTransaction {\n type: TransactionType.TRON\n isApprovalTx: boolean\n raw_data: TrxRawData | null\n raw_data_hex: string | null\n txID: string\n visible: boolean\n __payload__: object\n}\n\nexport const isTronTransaction = (transaction: {\n type: TransactionType\n}): transaction is TronTransaction => transaction.type === TransactionType.TRON\n"],"names":["RoutingResultType","TransactionType","GenericTransactionType","TransactionStatus","TonChainID","RangoClient","apiKey","apiUrl","this","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","_proto","prototype","getAllMetadata","_getAllMetadata","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","axiosResponse","reformatTokens","tokens","popularTokens","wrap","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","map","tm","blockchain","b","symbol","s","image","i","address","a","usdPrice","p","isSecondaryCoin","is","coinSource","c","coinSourceUrl","cu","name","n","decimals","d","isPopular","ip","supportedSwappers","ss","sent","data","abrupt","stop","_x","_x2","apply","arguments","getBlockchains","_getBlockchains","_callee2","_context2","_x3","getSwappers","_getSwappers","_callee3","_context3","_x4","getCustomToken","_getCustomToken","_callee4","customTokenRequest","_context4","_x5","_x6","searchCustomTokens","_searchCustomTokens","_callee5","searchCustomTokensRequest","_context5","_x7","_x8","getBestRoute","_getBestRoute","_callee6","requestBody","_context6","post","headers","X-Rango-Id","_x9","_x10","getAllRoutes","_getAllRoutes","_callee7","_context7","_x11","_x12","confirmRoute","_confirmRoute","_callee8","_context8","_x13","_x14","confirmRouteRequest","_confirmRouteRequest","_callee9","_context9","_x15","_x16","checkApproval","_checkApproval","_callee10","requestId","txId","_context10","_x17","_x18","_x19","checkStatus","_checkStatus","_callee11","_context11","_x20","_x21","createTransaction","_createTransaction","_callee12","_context12","_x22","_x23","reportFailure","_reportFailure","_callee13","_context13","_x24","_x25","getWalletsDetails","_getWalletsDetails","_callee14","walletAddresses","walletAddressesQueryParams","walletAddress","_context14","length","_x26","_x27","getTokenBalance","_getTokenBalance","_callee15","tokenBalanceRequest","_context15","_x28","_x29","getMultipleTokenBalance","_getMultipleTokenBalance","_callee16","_context16","_x30","_x31","isEvmBlockchain","blockchainMeta","type","isCosmosBlockchain","isSolanaBlockchain","isTronBlockchain","isTransferBlockchain","isStarknetBlockchain","isTonBlockchain","isXrplBlockchain","filter","transaction","COSMOS","EVM","SOLANA","TON","TRANSFER","TRON"],"mappings":"ujOAIYA,ECDAC,EAgBAC,EAyFAC,ECzGAC,ECiCCC,aAMX,SAAAA,EAAYC,EAAgBC,GAC1BC,KAAKD,OAASA,GAAU,6BACxBC,KAAKF,OAASA,EACd,IACE,GAAsB,oBAAXG,OAAwB,CACjC,IAAMC,EAAWC,aAAaC,QAAQ,YACtC,GAAIF,EACFF,KAAKE,SAAWA,MACX,CACL,IAAMG,EAAcC,IACpBH,aAAaI,QAAQ,WAAYF,GACjCL,KAAKE,SAAWG,QAGlBL,KAAKE,SAAWI,IAElB,MAAOE,GACPR,KAAKE,SAAWI,IAElBN,KAAKS,YAAcC,EAAMC,OAAO,CAC9BC,QAASZ,KAAKD,SAEjB,IAAAc,EAAAhB,EAAAiB,UA8NA,OA9NAD,EAEYE,0BAAc,IAAAC,EAAAC,EAAAC,IAAAC,MAApB,SAAAC,EACLC,EACAC,GAAwB,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAA,OAAAb,IAAAc,eAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,OAOiC,OALnDR,EAAMS,KACPf,GACHgB,kBAAahB,UAAWE,EAAXF,EAAagB,oBAAbd,EAA0Be,OACvCC,eAAUlB,UAAWG,EAAXH,EAAakB,iBAAbf,EAAuBc,OACjCE,qBAAgBnB,UAAWI,EAAXJ,EAAamB,uBAAbf,EAA6Ba,OAC7CG,uBAAkBpB,UAAWK,EAAXL,EAAaoB,yBAAbf,EAA+BY,SAAML,EAAAE,OAE7BnC,KAAKS,YAAYiC,4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,MAE5CO,EAAmB,SAC9BR,GACyC,MAAwB,SAAxBA,EAAeC,OJxC9C7L,EAAAA,4BAAAA,uCAEVA,4BACAA,sBACAA,wCACAA,yDCNUC,EAAAA,0BAAAA,uCAEVA,sBACAA,kBACAA,kBACAA,cACAA,sBACAA,YACAA,YACAA,eAOUC,EAAAA,iCAAAA,8CAEVA,sBACAA,kBACAA,mBAqFUC,EAAAA,4BAAAA,+CAEVA,oBACAA,qBC5GUC,EAAAA,qBAAAA,uCAEVA,+DEqD+B,SAACyC,GAChC,OAAAA,EAAYwJ,OAAOP,2BAbS,SAACjJ,GAC7B,OAAAA,EAAYwJ,OAAOV,6DCiCc,SAACW,GAGlC,OAAAA,EAAYT,OAAS5L,wBAAgBsM,2DChDP,SAACD,GAEI,OAAAA,EAAYT,OAAS5L,wBAAgBuM,8DCiBvC,SAACF,GAGlC,OAAAA,EAAYT,OAAS5L,wBAAgBwM,0FLnBP,SAACH,GAEI,OAAAA,EAAYT,OAAS5L,wBAAgByM,kEMArC,SAACJ,GAEP,OAAAA,EAAYT,OAAS5L,wBAAgB0M,+DCAnC,SAACL,GAEI,OAAAA,EAAYT,OAAS5L,wBAAgB2M,0DLK3C,SAAC/J,GAC/B,OAAAA,EAAYwJ,OAAON,+BAEa,SAAClJ,GACjC,OAAAA,EAAYwJ,OAAOH,0BAWQ,SAACrJ,GAC5B,OAAAA,EAAYwJ,OAAOF,gCAJc,SAACtJ,GAClC,OAAAA,EAAYwJ,OAAOJ,2BAPS,SAACpJ,GAC7B,OAAAA,EAAYwJ,OAAOL,2BAWS,SAACnJ,GAC7B,OAAAA,EAAYwJ,OAAOD"}
|
package/lib/rango-sdk.esm.js
CHANGED
|
@@ -790,6 +790,7 @@ var isStarknetBlockchain = function (blockchainMeta) {
|
|
|
790
790
|
return blockchainMeta.type === 'STARKNET';
|
|
791
791
|
};
|
|
792
792
|
var isTonBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'TON'; };
|
|
793
|
+
var isXrplBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'XRPL'; };
|
|
793
794
|
var evmBlockchains = function (blockchains) {
|
|
794
795
|
return blockchains.filter(isEvmBlockchain);
|
|
795
796
|
};
|
|
@@ -811,6 +812,9 @@ var transferBlockchains = function (blockchains) {
|
|
|
811
812
|
var tonBlockchain = function (blockchains) {
|
|
812
813
|
return blockchains.filter(isTonBlockchain);
|
|
813
814
|
};
|
|
815
|
+
var xrplBlockchain = function (blockchains) {
|
|
816
|
+
return blockchains.filter(isXrplBlockchain);
|
|
817
|
+
};
|
|
814
818
|
|
|
815
819
|
/**
|
|
816
820
|
* Routing Result Type
|
|
@@ -882,5 +886,5 @@ var isTonTransaction = function (transaction) { return transaction.type === Tran
|
|
|
882
886
|
|
|
883
887
|
var isEvmTransaction = function (transaction) { return transaction.type === TransactionType.EVM; };
|
|
884
888
|
|
|
885
|
-
export { GenericTransactionType, RangoClient, RoutingResultType, TonChainID, TransactionStatus, TransactionType, cosmosBlockchains, evmBlockchains, isCosmosBlockchain, isCosmosTransaction, isEvmBlockchain, isEvmTransaction, isSolanaBlockchain, isSolanaTransaction, isStarknetBlockchain, isTonBlockchain, isTonTransaction, isTransferBlockchain, isTransferTransaction, isTronBlockchain, isTronTransaction, solanaBlockchain, starknetBlockchain, tonBlockchain, transferBlockchains, tronBlockchain };
|
|
889
|
+
export { GenericTransactionType, RangoClient, RoutingResultType, TonChainID, TransactionStatus, TransactionType, cosmosBlockchains, evmBlockchains, isCosmosBlockchain, isCosmosTransaction, isEvmBlockchain, isEvmTransaction, isSolanaBlockchain, isSolanaTransaction, isStarknetBlockchain, isTonBlockchain, isTonTransaction, isTransferBlockchain, isTransferTransaction, isTronBlockchain, isTronTransaction, isXrplBlockchain, solanaBlockchain, starknetBlockchain, tonBlockchain, transferBlockchains, tronBlockchain, xrplBlockchain };
|
|
886
890
|
//# sourceMappingURL=rango-sdk.esm.js.map
|
package/lib/rango-sdk.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rango-sdk.esm.js","sources":["../src/services/client.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/tron.ts","../node_modules/rango-types/src/api/shared/txs/ton.ts","../node_modules/rango-types/src/api/main/txs/evm.ts"],"sourcesContent":["import uuid from 'uuid-random'\nimport {\n MetaRequest,\n MetaResponse,\n BestRouteRequest,\n BestRouteResponse,\n CheckApprovalResponse,\n CheckTxStatusRequest,\n TransactionStatusResponse,\n CreateTransactionRequest,\n CreateTransactionResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n RequestOptions,\n BlockchainMeta,\n CompactMetaResponse,\n CompactToken,\n Token,\n MultiRouteRequest,\n MultiRouteResponse,\n ConfirmRouteResponse,\n ConfirmRouteRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceResponse,\n TokenBalanceRequest,\n SwapperMetaExtended,\n MultipleTokenBalanceRequest,\n MultipleTokenBalanceResponse,\n SearchCustomTokensRequest,\n SearchCustomTokensResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddresses = { 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, 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 }\n\n public async getAllMetadata(\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<CompactMetaResponse>(\n `/meta/compact?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n const reformatTokens = (tokens: CompactToken[]): Token[] =>\n tokens.map((tm) => ({\n blockchain: tm.b,\n symbol: tm.s,\n image: tm.i,\n address: tm.a || null,\n usdPrice: tm.p || null,\n isSecondaryCoin: tm.is || false,\n coinSource: tm.c || null,\n coinSourceUrl: tm.cu || null,\n name: tm.n || null,\n decimals: tm.d,\n isPopular: tm.ip || false,\n supportedSwappers: tm.ss || [],\n }))\n\n const tokens = reformatTokens(axiosResponse.data.tokens)\n const popularTokens = reformatTokens(axiosResponse.data.popularTokens)\n return { ...axiosResponse.data, tokens, popularTokens }\n }\n\n public async getBlockchains(\n options?: RequestOptions\n ): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getSwappers(\n options?: RequestOptions\n ): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getCustomToken(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async searchCustomTokens(\n searchCustomTokensRequest: SearchCustomTokensRequest,\n options?: RequestOptions\n ): Promise<SearchCustomTokensResponse> {\n const axiosResponse =\n await this.httpService.get<SearchCustomTokensResponse>(\n `/meta/token/search?apiKey=${this.apiKey}`,\n { params: searchCustomTokensRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async getBestRoute(\n requestBody: BestRouteRequest,\n options?: RequestOptions\n ): Promise<BestRouteResponse> {\n const axiosResponse = await this.httpService.post<BestRouteResponse>(\n `/routing/best?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async getAllRoutes(\n requestBody: MultiRouteRequest,\n options?: RequestOptions\n ): Promise<MultiRouteResponse> {\n const axiosResponse = await this.httpService.post<MultiRouteResponse>(\n `/routing/bests?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async confirmRoute(\n requestBody: ConfirmRouteRequest,\n options?: RequestOptions\n ): Promise<ConfirmRouteResponse> {\n const axiosResponse = await this.httpService.post<ConfirmRouteResponse>(\n `/routing/confirm?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n // @deprecated use confirmRoute instead\n public async confirmRouteRequest(\n requestBody: ConfirmRouteRequest,\n options?: RequestOptions\n ): Promise<ConfirmRouteResponse> {\n const axiosResponse = await this.httpService.post<ConfirmRouteResponse>(\n `/routing/confirm?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async checkApproval(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/tx/${requestId}/check-approval?apiKey=${this.apiKey}`,\n { params: { txId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async checkStatus(\n requestBody: CheckTxStatusRequest,\n options?: RequestOptions\n ): Promise<TransactionStatusResponse> {\n const axiosResponse =\n await this.httpService.post<TransactionStatusResponse>(\n `/tx/check-status?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async createTransaction(\n requestBody: CreateTransactionRequest,\n options?: RequestOptions\n ): Promise<CreateTransactionResponse> {\n const axiosResponse =\n await this.httpService.post<CreateTransactionResponse>(\n `/tx/create?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\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 `/tx/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n ...options,\n }\n )\n }\n\n public async getWalletsDetails(\n walletAddresses: WalletAddresses,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n let walletAddressesQueryParams = ''\n for (let i = 0; i < walletAddresses.length; i++) {\n const walletAddress = walletAddresses[i]\n walletAddressesQueryParams += `&address=${walletAddress.blockchain}.${walletAddress.address}`\n }\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/wallets/details?apiKey=${this.apiKey}${walletAddressesQueryParams}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getTokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/wallets/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async getMultipleTokenBalance(\n requestBody: MultipleTokenBalanceRequest,\n options?: RequestOptions\n ): Promise<MultipleTokenBalanceResponse> {\n const axiosResponse =\n await this.httpService.post<MultipleTokenBalanceResponse>(\n `/wallets/multiple-token-balance?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\n )\n return axiosResponse.data\n }\n}\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n} from './meta.js'\n\nexport const isEvmBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is EvmBlockchainMeta => blockchainMeta.type === 'EVM'\n\nexport const isCosmosBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is CosmosBlockchainMeta => blockchainMeta.type === 'COSMOS'\n\nexport const isSolanaBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is SolanaBlockchainMeta => blockchainMeta.type === 'SOLANA'\n\nexport const isTronBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TronBlockchainMeta => blockchainMeta.type === 'TRON'\n\nexport const isTransferBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TransferBlockchainMeta =>\n blockchainMeta.type === 'TRANSFER'\n\nexport const isStarknetBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is StarkNetBlockchainMeta =>\n blockchainMeta.type === 'STARKNET'\n\nexport const isTonBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TonBlockchainMeta => blockchainMeta.type === 'TON'\n\nexport const evmBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isEvmBlockchain)\n\nexport const solanaBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isSolanaBlockchain)\n\nexport const starknetBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isStarknetBlockchain)\n\nexport const tronBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTronBlockchain)\n\nexport const cosmosBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isCosmosBlockchain)\n\nexport const transferBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTransferBlockchain)\n\nexport const tonBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTonBlockchain)\n","/**\n * Routing Result Type\n *\n */\nexport enum RoutingResultType {\n OK = 'OK',\n HIGH_IMPACT = 'HIGH_IMPACT',\n NO_ROUTE = 'NO_ROUTE',\n INPUT_LIMIT_ISSUE = 'INPUT_LIMIT_ISSUE',\n HIGH_IMPACT_FOR_CREATE_TX = 'HIGH_IMPACT_FOR_CREATE_TX',\n}\n","/**\n * The type of transaction\n */\nexport enum TransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n TRON = 'TRON',\n STARKNET = 'STARKNET',\n TON = 'TON',\n SUI = 'SUI',\n XRPL = 'XRPL',\n}\n\n/**\n * The type of transaction\n * @deprecated use TransactionType instead\n */\nexport enum GenericTransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n}\n\n/**\n * A transaction's url that can be displayed to advanced user to track the progress\n *\n * @property {string} url - Url of the transaction in blockchain explorer. example: https://etherscan.io/tx/0xa1a3...\n * @property {string | null} description - A custom display name to help user distinguish the transactions from each\n * other. Example: Inbound, Outbound, Bridge, or null\n *\n */\nexport type SwapExplorerUrl = {\n description: string | null\n url: string\n}\n\n/**\n * APIErrorCode\n *\n * Error code of a swap failure\n *\n */\nexport type APIErrorCode =\n | 'TX_FAIL'\n | 'TX_EXPIRED'\n | 'FETCH_TX_FAILED'\n | 'USER_REJECT'\n | 'USER_CANCEL'\n | 'USER_CANCELED_TX'\n | 'CALL_WALLET_FAILED'\n | 'SEND_TX_FAILED'\n | 'CALL_OR_SEND_FAILED'\n | 'TX_FAILED_IN_BLOCKCHAIN'\n | 'CLIENT_UNEXPECTED_BEHAVIOUR'\n | 'INSUFFICIENT_APPROVE'\n\n/**\n * The function checks if a given string value is a valid API error code.\n * @param {string} value - a string that represents a possible API error code.\n * @returns A boolean value is being returned, indicating whether the input `value` is of type\n * `APIErrorCode` or not.\n */\nexport function isAPIErrorCode(value: string): value is APIErrorCode {\n return [\n 'TX_FAIL',\n 'TX_EXPIRED',\n 'FETCH_TX_FAILED',\n 'USER_REJECT',\n 'USER_CANCEL',\n 'USER_CANCELED_TX',\n 'CALL_WALLET_FAILED',\n 'SEND_TX_FAILED',\n 'CALL_OR_SEND_FAILED',\n 'TX_FAILED_IN_BLOCKCHAIN',\n 'CLIENT_UNEXPECTED_BEHAVIOUR',\n 'INSUFFICIENT_APPROVE',\n ].includes(value)\n}\n\n/**\n * ReportTransactionRequest\n *\n * It should be used when an error happened in client and we want to inform server that transaction failed,\n * E.g. user rejected the transaction dialog or and an RPC error raised during signing tx by user.\n *\n * @property {string} requestId - The requestId from best route endpoint\n * @property {APIErrorCode} eventType - Type of the event that happened, example: USER_REJECT\n * @property {number} [step] - Step number in which failure happened\n * @property {string} [reason] - Reason or message for the error\n * @property {[key: string]: string} [data] - @deprecated A list of key-value for extra details\n * @property {wallet?: string, errorCode? string} [tags] - A list of key-value for pre-defined tags\n *\n */\nexport type ReportTransactionRequest = {\n requestId: string\n eventType: APIErrorCode\n step?: number\n reason?: string\n data?: { [key: string]: string }\n tags?: { wallet?: string; errorCode?: string }\n}\n\n/**\n * The status of transaction in tracking\n */\nexport enum TransactionStatus {\n FAILED = 'failed',\n RUNNING = 'running',\n SUCCESS = 'success',\n}\n\n/**\n * Response body of check-approval\n * You could stop check approval if:\n * 1- approved successfully\n * => isApproved = true\n * 2- approval transaction failed\n * => isApproved = false && txStatus === 'failed'\n * 3- approval transaction succeeded but currentApprovedAmount is still less than requiredApprovedAmount\n * (e.g. user changed transaction data and enter another approve amount in MetaMask)\n * => isApproved = false && txStatus == 'success'\n *\n * @property {boolean} isApproved - A flag which indicates that the approve tx is done or not\n * @property {TransactionStatus | null} txStatus - Status of approve transaction in blockchain,\n * if isArppoved is false and txStatus is failed, it seems that approve transaction failed in blockchain\n * @property {string | null} requiredApprovedAmount - required amount to be approved by user\n * @property {string | null} currentApprovedAmount - current approved amount by user\n *\n */\nexport type CheckApprovalResponse = {\n isApproved: boolean\n txStatus: TransactionStatus | null\n requiredApprovedAmount: string | null\n currentApprovedAmount: string | null\n}\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * CosmosCoin\n */\nexport type CosmosCoin = {\n amount: string\n denom: string\n}\n\n/**\n * CosmosProtoMsg\n */\nexport type CosmosProtoMsg = {\n type_url: string\n value: number[]\n}\n\n/**\n * CosmosFee representing fee for cosmos transaction\n */\nexport type CosmosFee = {\n gas: string\n amount: CosmosCoin[]\n}\n\n/**\n * Main transaction object for COSMOS type transactions\n */\nexport type CosmosMessage = {\n signType: 'AMINO' | 'DIRECT'\n sequence: string | null\n source: number | null\n account_number: number | null\n rpcUrl: string\n chainId: string | null\n msgs: any[] // TODO\n protoMsgs: CosmosProtoMsg[]\n memo: string | null\n fee: CosmosFee | null\n}\n/**\n * An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages (e.g. XDefi)\n *\n * @property {AssetWithTicker} asset - The asset to be transferred\n * @property {string} amount - The machine-readable amount to transfer, example: 1000000000000000000\n * @property {number} decimals - The decimals for this asset, example: 18\n * @property {string | null} memo - Memo of transaction, could be null\n * @property {string} method - The transaction method, example: transfer, deposit\n * @property {string} recipient - The recipient address of transaction\n *\n */\nexport type CosmosRawTransferData = {\n amount: string\n asset: AssetWithTicker\n decimals: number\n memo: string | null\n method: string\n recipient: string\n}\n\n/**\n * A Cosmos transaction, child of GenericTransaction\n *\n * @property {TransactionType} type - This fields equals to COSMOS for all CosmosTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} fromWalletAddress - Address of wallet that this transaction should be executed in, same as the create transaction request's input\n * @property {CosmosMessage} data - Transaction data\n * @property {CosmosRawTransferData | null} rawTransfer - An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages\n *\n */\nexport interface CosmosTransaction extends BaseTransaction {\n type: TransactionType.COSMOS\n fromWalletAddress: string\n data: CosmosMessage\n rawTransfer: CosmosRawTransferData | null\n}\n\nexport const isCosmosTransaction = (transaction: {\n type: TransactionType\n}): transaction is CosmosTransaction =>\n transaction.type === TransactionType.COSMOS\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * Account metadata used to define instructions\n */\nexport type SolanaInstructionKey = {\n pubkey: string\n isSigner: boolean\n isWritable: boolean\n}\n\n/**\n * Transaction Instruction class\n */\nexport type SolanaInstruction = {\n keys: SolanaInstructionKey[]\n programId: string\n data: number[]\n}\n\n/**\n * Pair of signature and corresponding public key\n */\nexport type SolanaSignature = {\n signature: number[]\n publicKey: string\n}\n\n/**\n * This type of transaction is used for all solana transactions\n *\n * @property {TransactionType} type - This fields equals to SOLANA for all SolanaTransactions\n * @property {'LEGACY' | 'VERSIONED'} txType - Type of the solana transaction\n * @property {string} blockChain, equals to SOLANA\n * @property {string} from, Source wallet address\n * @property {string} identifier, Transaction hash used in case of retry\n * @property {string | null} recentBlockhash, A recent blockhash\n * @property {SolanaSignature[]} signatures, Signatures for the transaction\n * @property {number[] | null} serializedMessage, The byte array of the transaction\n * @property {SolanaInstruction[]} instructions, The instructions to atomically execute\n *\n */\nexport interface SolanaTransaction extends BaseTransaction {\n type: TransactionType.SOLANA\n txType: 'LEGACY' | 'VERSIONED'\n from: string\n identifier: string\n recentBlockhash: string | null\n signatures: SolanaSignature[]\n serializedMessage: number[] | null\n instructions: SolanaInstruction[]\n}\n\nexport const isSolanaTransaction = (transaction: {\n type: TransactionType\n}): transaction is SolanaTransaction =>\n transaction.type === TransactionType.SOLANA\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type InputToSign = { address: string, signingIndexes: number[] }\n/**\n * @property {unsignedPsbtBase64} unsignedPsbtBase64 - Base 64 representation of the Unsigned PSBT\n * @property {InputToSign[]} inputsToSign - Inputs to be signed\n */\nexport type PSBT = {\n unsignedPsbtBase64: string\n inputsToSign: InputToSign[]\n}\n/**\n * TransferTransaction. This type of transaction is used for UTXO blockchains including BTC, LTC, BCH\n *\n * @property {TransactionType} type - This fields equals to TRANSFER for all TransferTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} method - The method that should be passed to wallet. examples: deposit, transfer\n * @property {AssetWithTicker} asset\n * @property {string} amount - The machine-readable amount of transaction, example: 1000000000000000000\n * @property {number} decimals - The decimals of the asset\n * @property {string} fromWalletAddress - The source wallet address that can sign this transaction\n * @property {string} recipientAddress - The destination wallet address that the fund should be sent to\n * @property {string | null} memo - The memo of transaction, can be null\n * @property {PSBT | null} psbt - PSBT object containing base 64 representation of the Unsigned PSBT along with the inputs to be signed\n *\n */\nexport interface Transfer extends BaseTransaction {\n type: TransactionType.TRANSFER\n method: string\n asset: AssetWithTicker\n amount: string\n decimals: number\n fromWalletAddress: string\n recipientAddress: string\n memo: string | null\n psbt: PSBT | null\n}\n\nexport const isTransferTransaction = (transaction: {\n type: TransactionType\n}): transaction is Transfer => transaction.type === TransactionType.TRANSFER\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type TrxContractParameter = {\n value: unknown\n type_url: string\n}\n\nexport type TrxContractData = {\n parameter: TrxContractParameter\n type: string\n}\n\nexport type TrxRawData = {\n contract: TrxContractData[]\n ref_block_bytes: string\n ref_block_hash: string\n expiration: number\n timestamp: number\n}\n\n/**\n * TronTransaction\n *\n * @property {TransactionType} type - TransactionType.TRON\n * @property {boolean} isApprovalTx - Whether or not the transaction is an approval transaction.\n * @property {TrxRawData | null} raw_data - This is the raw data of the transaction.\n * @property {string | null} raw_data_hex - The raw hex data of the transaction.\n * @property {string} txID - The transaction ID.\n * @property {boolean} visible - boolean\n * @property {object} __payload__\n */\nexport interface TronTransaction extends BaseTransaction {\n type: TransactionType.TRON\n isApprovalTx: boolean\n raw_data: TrxRawData | null\n raw_data_hex: string | null\n txID: string\n visible: boolean\n __payload__: object\n}\n\nexport const isTronTransaction = (transaction: {\n type: TransactionType\n}): transaction is TronTransaction => transaction.type === TransactionType.TRON\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 { BaseTransaction, TransactionType } from '../../shared/index.js'\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 {string} blockChain - The blockchain that this transaction is going to run in\n * @property {boolean} isApprovalTx - Determines that this transaction is an approval transaction or not, if true user\n * should approve the transaction and call create transaction endpoint again to get the original tx. Beware that most\n * of the fields of this object will be passed directly to the wallet without any change.\n * @property {string | null} from - The source wallet address, it can be null\n * @property {string} to - Address of destination wallet or the smart contract or token that is going to be called\n * @property {string | null} data - The data of smart contract call, 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} nonce - The nonce value for transaction\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 extends BaseTransaction {\n type: TransactionType.EVM\n isApprovalTx: boolean\n from: string | null\n to: string\n data: string | null\n value: string | null\n nonce: 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"],"names":["RangoClient","apiKey","apiUrl","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","_proto","prototype","getAllMetadata","_getAllMetadata","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","axiosResponse","reformatTokens","tokens","popularTokens","wrap","_callee$","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","sent","map","tm","blockchain","b","symbol","s","image","i","address","a","usdPrice","p","isSecondaryCoin","is","coinSource","c","coinSourceUrl","cu","name","n","decimals","d","isPopular","ip","supportedSwappers","ss","data","abrupt","stop","_x","_x2","apply","arguments","getBlockchains","_getBlockchains","_callee2","_callee2$","_context2","_x3","getSwappers","_getSwappers","_callee3","_callee3$","_context3","_x4","getCustomToken","_getCustomToken","_callee4","customTokenRequest","_callee4$","_context4","_x5","_x6","searchCustomTokens","_searchCustomTokens","_callee5","searchCustomTokensRequest","_callee5$","_context5","_x7","_x8","getBestRoute","_getBestRoute","_callee6","requestBody","_callee6$","_context6","post","headers","_x9","_x10","getAllRoutes","_getAllRoutes","_callee7","_callee7$","_context7","_x11","_x12","confirmRoute","_confirmRoute","_callee8","_callee8$","_context8","_x13","_x14","confirmRouteRequest","_confirmRouteRequest","_callee9","_callee9$","_context9","_x15","_x16","checkApproval","_checkApproval","_callee10","requestId","txId","_callee10$","_context10","_x17","_x18","_x19","checkStatus","_checkStatus","_callee11","_callee11$","_context11","_x20","_x21","createTransaction","_createTransaction","_callee12","_callee12$","_context12","_x22","_x23","reportFailure","_reportFailure","_callee13","_callee13$","_context13","_x24","_x25","getWalletsDetails","_getWalletsDetails","_callee14","walletAddresses","walletAddressesQueryParams","walletAddress","_callee14$","_context14","length","_x26","_x27","getTokenBalance","_getTokenBalance","_callee15","tokenBalanceRequest","_callee15$","_context15","_x28","_x29","getMultipleTokenBalance","_getMultipleTokenBalance","_callee16","_callee16$","_context16","_x30","_x31"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCaA,WAAW;EAMtB,SAAAA,YAAYC,MAAc,EAAEC,MAAe;IACzC,IAAI,CAACA,MAAM,GAAGA,MAAM,IAAI,4BAA4B;IACpD,IAAI,CAACD,MAAM,GAAGA,MAAM;IACpB,IAAI;MACF,IAAI,OAAOE,MAAM,KAAK,WAAW,EAAE;QACjC,IAAMC,QAAQ,GAAGC,YAAY,CAACC,OAAO,CAAC,UAAU,CAAC;QACjD,IAAIF,QAAQ,EAAE;UACZ,IAA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AY,sBAKX;AALD,WAAY,sBAAsB;IAChC,qCAAW,CAAA;IACX,+CAAqB,CAAA;IACrB,2CAAiB,CAAA;IACjB,2CAAiB,CAAA;AACnB,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,QAKjC;AAmCD,AA8CA;;;AAGA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;AACrB,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;;IChCY,mBAAmB,GAAG,UAAC,WAEnC;IACC,OAAA,WAAW,CAAC,IAAI,KAAK,eAAe,CAAC,MAAM;AAA3C,CAA2C;;IC7BhC,mBAAmB,GAAG,UAAC,WAEnC;IACC,OAAA,WAAW,CAAC,IAAI,KAAK,eAAe,CAAC,MAAM;AAA3C,CAA2C;;ICjBhC,qBAAqB,GAAG,UAAC,WAErC,IAA8B,OAAA,WAAW,CAAC,IAAI,KAAK,eAAe,CAAC,QAAQ,GAAA;;ICA/D,iBAAiB,GAAG,UAAC,WAEjC,IAAqC,OAAA,WAAW,CAAC,IAAI,KAAK,eAAe,CAAC,IAAI,GAAA;;ICzCnE,UAGX;AAHD,WAAY,UAAU;IACpB,8BAAgB,CAAA;IAChB,4BAAc,CAAA;AAChB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAgCD,IAAa,gBAAgB,GAAG,UAAC,WAEhC,IAAoC,OAAA,WAAW,CAAC,IAAI,KAAK,eAAe,CAAC,GAAG,GAAA;;ICLhE,gBAAgB,GAAG,UAAC,WAEhC,IAAoC,OAAA,WAAW,CAAC,IAAI,KAAK,eAAe,CAAC,GAAG,GAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"rango-sdk.esm.js","sources":["../src/services/client.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/tron.ts","../node_modules/rango-types/src/api/shared/txs/ton.ts","../node_modules/rango-types/src/api/main/txs/evm.ts"],"sourcesContent":["import uuid from 'uuid-random'\nimport {\n MetaRequest,\n MetaResponse,\n BestRouteRequest,\n BestRouteResponse,\n CheckApprovalResponse,\n CheckTxStatusRequest,\n TransactionStatusResponse,\n CreateTransactionRequest,\n CreateTransactionResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n RequestOptions,\n BlockchainMeta,\n CompactMetaResponse,\n CompactToken,\n Token,\n MultiRouteRequest,\n MultiRouteResponse,\n ConfirmRouteResponse,\n ConfirmRouteRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceResponse,\n TokenBalanceRequest,\n SwapperMetaExtended,\n MultipleTokenBalanceRequest,\n MultipleTokenBalanceResponse,\n SearchCustomTokensRequest,\n SearchCustomTokensResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddresses = { 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, 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 }\n\n public async getAllMetadata(\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<CompactMetaResponse>(\n `/meta/compact?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n const reformatTokens = (tokens: CompactToken[]): Token[] =>\n tokens.map((tm) => ({\n blockchain: tm.b,\n symbol: tm.s,\n image: tm.i,\n address: tm.a || null,\n usdPrice: tm.p || null,\n isSecondaryCoin: tm.is || false,\n coinSource: tm.c || null,\n coinSourceUrl: tm.cu || null,\n name: tm.n || null,\n decimals: tm.d,\n isPopular: tm.ip || false,\n supportedSwappers: tm.ss || [],\n }))\n\n const tokens = reformatTokens(axiosResponse.data.tokens)\n const popularTokens = reformatTokens(axiosResponse.data.popularTokens)\n return { ...axiosResponse.data, tokens, popularTokens }\n }\n\n public async getBlockchains(\n options?: RequestOptions\n ): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getSwappers(\n options?: RequestOptions\n ): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getCustomToken(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async searchCustomTokens(\n searchCustomTokensRequest: SearchCustomTokensRequest,\n options?: RequestOptions\n ): Promise<SearchCustomTokensResponse> {\n const axiosResponse =\n await this.httpService.get<SearchCustomTokensResponse>(\n `/meta/token/search?apiKey=${this.apiKey}`,\n { params: searchCustomTokensRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async getBestRoute(\n requestBody: BestRouteRequest,\n options?: RequestOptions\n ): Promise<BestRouteResponse> {\n const axiosResponse = await this.httpService.post<BestRouteResponse>(\n `/routing/best?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async getAllRoutes(\n requestBody: MultiRouteRequest,\n options?: RequestOptions\n ): Promise<MultiRouteResponse> {\n const axiosResponse = await this.httpService.post<MultiRouteResponse>(\n `/routing/bests?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async confirmRoute(\n requestBody: ConfirmRouteRequest,\n options?: RequestOptions\n ): Promise<ConfirmRouteResponse> {\n const axiosResponse = await this.httpService.post<ConfirmRouteResponse>(\n `/routing/confirm?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n // @deprecated use confirmRoute instead\n public async confirmRouteRequest(\n requestBody: ConfirmRouteRequest,\n options?: RequestOptions\n ): Promise<ConfirmRouteResponse> {\n const axiosResponse = await this.httpService.post<ConfirmRouteResponse>(\n `/routing/confirm?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async checkApproval(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/tx/${requestId}/check-approval?apiKey=${this.apiKey}`,\n { params: { txId }, ...options }\n )\n return axiosResponse.data\n }\n\n public async checkStatus(\n requestBody: CheckTxStatusRequest,\n options?: RequestOptions\n ): Promise<TransactionStatusResponse> {\n const axiosResponse =\n await this.httpService.post<TransactionStatusResponse>(\n `/tx/check-status?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async createTransaction(\n requestBody: CreateTransactionRequest,\n options?: RequestOptions\n ): Promise<CreateTransactionResponse> {\n const axiosResponse =\n await this.httpService.post<CreateTransactionResponse>(\n `/tx/create?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\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 `/tx/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n ...options,\n }\n )\n }\n\n public async getWalletsDetails(\n walletAddresses: WalletAddresses,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n let walletAddressesQueryParams = ''\n for (let i = 0; i < walletAddresses.length; i++) {\n const walletAddress = walletAddresses[i]\n walletAddressesQueryParams += `&address=${walletAddress.blockchain}.${walletAddress.address}`\n }\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/wallets/details?apiKey=${this.apiKey}${walletAddressesQueryParams}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async getTokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/wallets/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async getMultipleTokenBalance(\n requestBody: MultipleTokenBalanceRequest,\n options?: RequestOptions\n ): Promise<MultipleTokenBalanceResponse> {\n const axiosResponse =\n await this.httpService.post<MultipleTokenBalanceResponse>(\n `/wallets/multiple-token-balance?apiKey=${this.apiKey}`,\n requestBody,\n { ...options }\n )\n return axiosResponse.data\n }\n}\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n XrplBlockchainMeta,\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 isXrplBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is XrplBlockchainMeta => blockchainMeta.type === 'XRPL'\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\nexport const xrplBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isXrplBlockchain)\n","/**\n * Routing Result Type\n *\n */\nexport enum RoutingResultType {\n OK = 'OK',\n HIGH_IMPACT = 'HIGH_IMPACT',\n NO_ROUTE = 'NO_ROUTE',\n INPUT_LIMIT_ISSUE = 'INPUT_LIMIT_ISSUE',\n HIGH_IMPACT_FOR_CREATE_TX = 'HIGH_IMPACT_FOR_CREATE_TX',\n}\n","/**\n * The type of transaction\n */\nexport enum TransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n TRON = 'TRON',\n STARKNET = 'STARKNET',\n TON = 'TON',\n SUI = 'SUI',\n XRPL = 'XRPL',\n}\n\n/**\n * The type of transaction\n * @deprecated use TransactionType instead\n */\nexport enum GenericTransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n}\n\n/**\n * A transaction's url that can be displayed to advanced user to track the progress\n *\n * @property {string} url - Url of the transaction in blockchain explorer. example: https://etherscan.io/tx/0xa1a3...\n * @property {string | null} description - A custom display name to help user distinguish the transactions from each\n * other. Example: Inbound, Outbound, Bridge, or null\n *\n */\nexport type SwapExplorerUrl = {\n description: string | null\n url: string\n}\n\n/**\n * APIErrorCode\n *\n * Error code of a swap failure\n *\n */\nexport type APIErrorCode =\n | 'TX_FAIL'\n | 'TX_EXPIRED'\n | 'FETCH_TX_FAILED'\n | 'USER_REJECT'\n | 'USER_CANCEL'\n | 'USER_CANCELED_TX'\n | 'CALL_WALLET_FAILED'\n | 'SEND_TX_FAILED'\n | 'CALL_OR_SEND_FAILED'\n | 'TX_FAILED_IN_BLOCKCHAIN'\n | 'CLIENT_UNEXPECTED_BEHAVIOUR'\n | 'INSUFFICIENT_APPROVE'\n\n/**\n * The function checks if a given string value is a valid API error code.\n * @param {string} value - a string that represents a possible API error code.\n * @returns A boolean value is being returned, indicating whether the input `value` is of type\n * `APIErrorCode` or not.\n */\nexport function isAPIErrorCode(value: string): value is APIErrorCode {\n return [\n 'TX_FAIL',\n 'TX_EXPIRED',\n 'FETCH_TX_FAILED',\n 'USER_REJECT',\n 'USER_CANCEL',\n 'USER_CANCELED_TX',\n 'CALL_WALLET_FAILED',\n 'SEND_TX_FAILED',\n 'CALL_OR_SEND_FAILED',\n 'TX_FAILED_IN_BLOCKCHAIN',\n 'CLIENT_UNEXPECTED_BEHAVIOUR',\n 'INSUFFICIENT_APPROVE',\n ].includes(value)\n}\n\n/**\n * ReportTransactionRequest\n *\n * It should be used when an error happened in client and we want to inform server that transaction failed,\n * E.g. user rejected the transaction dialog or and an RPC error raised during signing tx by user.\n *\n * @property {string} requestId - The requestId from best route endpoint\n * @property {APIErrorCode} eventType - Type of the event that happened, example: USER_REJECT\n * @property {number} [step] - Step number in which failure happened\n * @property {string} [reason] - Reason or message for the error\n * @property {[key: string]: string} [data] - @deprecated A list of key-value for extra details\n * @property {wallet?: string, errorCode? string} [tags] - A list of key-value for pre-defined tags\n *\n */\nexport type ReportTransactionRequest = {\n requestId: string\n eventType: APIErrorCode\n step?: number\n reason?: string\n data?: { [key: string]: string }\n tags?: { wallet?: string; errorCode?: string }\n}\n\n/**\n * The status of transaction in tracking\n */\nexport enum TransactionStatus {\n FAILED = 'failed',\n RUNNING = 'running',\n SUCCESS = 'success',\n}\n\n/**\n * Response body of check-approval\n * You could stop check approval if:\n * 1- approved successfully\n * => isApproved = true\n * 2- approval transaction failed\n * => isApproved = false && txStatus === 'failed'\n * 3- approval transaction succeeded but currentApprovedAmount is still less than requiredApprovedAmount\n * (e.g. user changed transaction data and enter another approve amount in MetaMask)\n * => isApproved = false && txStatus == 'success'\n *\n * @property {boolean} isApproved - A flag which indicates that the approve tx is done or not\n * @property {TransactionStatus | null} txStatus - Status of approve transaction in blockchain,\n * if isArppoved is false and txStatus is failed, it seems that approve transaction failed in blockchain\n * @property {string | null} requiredApprovedAmount - required amount to be approved by user\n * @property {string | null} currentApprovedAmount - current approved amount by user\n *\n */\nexport type CheckApprovalResponse = {\n isApproved: boolean\n txStatus: TransactionStatus | null\n requiredApprovedAmount: string | null\n currentApprovedAmount: string | null\n}\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * CosmosCoin\n */\nexport type CosmosCoin = {\n amount: string\n denom: string\n}\n\n/**\n * CosmosProtoMsg\n */\nexport type CosmosProtoMsg = {\n type_url: string\n value: number[]\n}\n\n/**\n * CosmosFee representing fee for cosmos transaction\n */\nexport type CosmosFee = {\n gas: string\n amount: CosmosCoin[]\n}\n\n/**\n * Main transaction object for COSMOS type transactions\n */\nexport type CosmosMessage = {\n signType: 'AMINO' | 'DIRECT'\n sequence: string | null\n source: number | null\n account_number: number | null\n rpcUrl: string\n chainId: string | null\n msgs: any[] // TODO\n protoMsgs: CosmosProtoMsg[]\n memo: string | null\n fee: CosmosFee | null\n}\n/**\n * An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages (e.g. XDefi)\n *\n * @property {AssetWithTicker} asset - The asset to be transferred\n * @property {string} amount - The machine-readable amount to transfer, example: 1000000000000000000\n * @property {number} decimals - The decimals for this asset, example: 18\n * @property {string | null} memo - Memo of transaction, could be null\n * @property {string} method - The transaction method, example: transfer, deposit\n * @property {string} recipient - The recipient address of transaction\n *\n */\nexport type CosmosRawTransferData = {\n amount: string\n asset: AssetWithTicker\n decimals: number\n memo: string | null\n method: string\n recipient: string\n}\n\n/**\n * A Cosmos transaction, child of GenericTransaction\n *\n * @property {TransactionType} type - This fields equals to COSMOS for all CosmosTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} fromWalletAddress - Address of wallet that this transaction should be executed in, same as the create transaction request's input\n * @property {CosmosMessage} data - Transaction data\n * @property {CosmosRawTransferData | null} rawTransfer - An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages\n *\n */\nexport interface CosmosTransaction extends BaseTransaction {\n type: TransactionType.COSMOS\n fromWalletAddress: string\n data: CosmosMessage\n rawTransfer: CosmosRawTransferData | null\n}\n\nexport const isCosmosTransaction = (transaction: {\n type: TransactionType\n}): transaction is CosmosTransaction =>\n transaction.type === TransactionType.COSMOS\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\n/**\n * Account metadata used to define instructions\n */\nexport type SolanaInstructionKey = {\n pubkey: string\n isSigner: boolean\n isWritable: boolean\n}\n\n/**\n * Transaction Instruction class\n */\nexport type SolanaInstruction = {\n keys: SolanaInstructionKey[]\n programId: string\n data: number[]\n}\n\n/**\n * Pair of signature and corresponding public key\n */\nexport type SolanaSignature = {\n signature: number[]\n publicKey: string\n}\n\n/**\n * This type of transaction is used for all solana transactions\n *\n * @property {TransactionType} type - This fields equals to SOLANA for all SolanaTransactions\n * @property {'LEGACY' | 'VERSIONED'} txType - Type of the solana transaction\n * @property {string} blockChain, equals to SOLANA\n * @property {string} from, Source wallet address\n * @property {string} identifier, Transaction hash used in case of retry\n * @property {string | null} recentBlockhash, A recent blockhash\n * @property {SolanaSignature[]} signatures, Signatures for the transaction\n * @property {number[] | null} serializedMessage, The byte array of the transaction\n * @property {SolanaInstruction[]} instructions, The instructions to atomically execute\n *\n */\nexport interface SolanaTransaction extends BaseTransaction {\n type: TransactionType.SOLANA\n txType: 'LEGACY' | 'VERSIONED'\n from: string\n identifier: string\n recentBlockhash: string | null\n signatures: SolanaSignature[]\n serializedMessage: number[] | null\n instructions: SolanaInstruction[]\n}\n\nexport const isSolanaTransaction = (transaction: {\n type: TransactionType\n}): transaction is SolanaTransaction =>\n transaction.type === TransactionType.SOLANA\n","import { AssetWithTicker } from '../common.js'\nimport { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type InputToSign = { address: string, signingIndexes: number[] }\n/**\n * @property {unsignedPsbtBase64} unsignedPsbtBase64 - Base 64 representation of the Unsigned PSBT\n * @property {InputToSign[]} inputsToSign - Inputs to be signed\n */\nexport type PSBT = {\n unsignedPsbtBase64: string\n inputsToSign: InputToSign[]\n}\n/**\n * TransferTransaction. This type of transaction is used for UTXO blockchains including BTC, LTC, BCH\n *\n * @property {TransactionType} type - This fields equals to TRANSFER for all TransferTransactions\n * @property {string} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction\n * @property {string} method - The method that should be passed to wallet. examples: deposit, transfer\n * @property {AssetWithTicker} asset\n * @property {string} amount - The machine-readable amount of transaction, example: 1000000000000000000\n * @property {number} decimals - The decimals of the asset\n * @property {string} fromWalletAddress - The source wallet address that can sign this transaction\n * @property {string} recipientAddress - The destination wallet address that the fund should be sent to\n * @property {string | null} memo - The memo of transaction, can be null\n * @property {PSBT | null} psbt - PSBT object containing base 64 representation of the Unsigned PSBT along with the inputs to be signed\n *\n */\nexport interface Transfer extends BaseTransaction {\n type: TransactionType.TRANSFER\n method: string\n asset: AssetWithTicker\n amount: string\n decimals: number\n fromWalletAddress: string\n recipientAddress: string\n memo: string | null\n psbt: PSBT | null\n}\n\nexport const isTransferTransaction = (transaction: {\n type: TransactionType\n}): transaction is Transfer => transaction.type === TransactionType.TRANSFER\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport type TrxContractParameter = {\n value: unknown\n type_url: string\n}\n\nexport type TrxContractData = {\n parameter: TrxContractParameter\n type: string\n}\n\nexport type TrxRawData = {\n contract: TrxContractData[]\n ref_block_bytes: string\n ref_block_hash: string\n expiration: number\n timestamp: number\n}\n\n/**\n * TronTransaction\n *\n * @property {TransactionType} type - TransactionType.TRON\n * @property {boolean} isApprovalTx - Whether or not the transaction is an approval transaction.\n * @property {TrxRawData | null} raw_data - This is the raw data of the transaction.\n * @property {string | null} raw_data_hex - The raw hex data of the transaction.\n * @property {string} txID - The transaction ID.\n * @property {boolean} visible - boolean\n * @property {object} __payload__\n */\nexport interface TronTransaction extends BaseTransaction {\n type: TransactionType.TRON\n isApprovalTx: boolean\n raw_data: TrxRawData | null\n raw_data_hex: string | null\n txID: string\n visible: boolean\n __payload__: object\n}\n\nexport const isTronTransaction = (transaction: {\n type: TransactionType\n}): transaction is TronTransaction => transaction.type === TransactionType.TRON\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 { BaseTransaction, TransactionType } from '../../shared/index.js'\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 {string} blockChain - The blockchain that this transaction is going to run in\n * @property {boolean} isApprovalTx - Determines that this transaction is an approval transaction or not, if true user\n * should approve the transaction and call create transaction endpoint again to get the original tx. Beware that most\n * of the fields of this object will be passed directly to the wallet without any change.\n * @property {string | null} from - The source wallet address, it can be null\n * @property {string} to - Address of destination wallet or the smart contract or token that is going to be called\n * @property {string | null} data - The data of smart contract call, 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} nonce - The nonce value for transaction\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 extends BaseTransaction {\n type: TransactionType.EVM\n isApprovalTx: boolean\n from: string | null\n to: string\n data: string | null\n value: string | null\n nonce: 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"],"names":["RangoClient","apiKey","apiUrl","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","_proto","prototype","getAllMetadata","_getAllMetadata","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","axiosResponse","reformatTokens","tokens","popularTokens","wrap","_callee$","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","sent","map","tm","blockchain","b","symbol","s","image","i","address","a","usdPrice","p","isSecondaryCoin","is","coinSource","c","coinSourceUrl","cu","name","n","decimals","d","isPopular","ip","supportedSwappers","ss","data","abrupt","stop","_x","_x2","apply","arguments","getBlockchains","_getBlockchains","_callee2","_callee2$","_context2","_x3","getSwappers","_getSwappers","_callee3","_callee3$","_context3","_x4","getCustomToken","_getCustomToken","_callee4","customTokenRequest","_callee4$","_context4","_x5","_x6","searchCustomTokens","_searchCustomTokens","_callee5","searchCustomTokensRequest","_callee5$","_context5","_x7","_x8","getBestRoute","_getBestRoute","_callee6","requestBody","_callee6$","_context6","post","headers","_x9","_x10","getAllRoutes","_getAllRoutes","_callee7","_callee7$","_context7","_x11","_x12","confirmRoute","_confirmRoute","_callee8","_callee8$","_context8","_x13","_x14","confirmRouteRequest","_confirmRouteRequest","_callee9","_callee9$","_context9","_x15","_x16","checkApproval","_checkApproval","_callee10","requestId","txId","_callee10$","_context10","_x17","_x18","_x19","checkStatus","_checkStatus","_callee11","_callee11$","_context11","_x20","_x21","createTransaction","_createTransaction","_callee12","_callee12$","_context12","_x22","_x23","reportFailure","_reportFailure","_callee13","_callee13$","_context13","_x24","_x25","getWalletsDetails","_getWalletsDetails","_callee14","walletAddresses","walletAddressesQueryParams","walletAddress","_callee14$","_context14","length","_x26","_x27","getTokenBalance","_getTokenBalance","_callee15","tokenBalanceRequest","_callee15$","_context15","_x28","_x29","getMultipleTokenBalance","_getMultipleTokenBalance","_callee16","_callee16$","_context16","_x30","_x31"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCaA,WAAW;EAMtB,SAAAA,YAAYC,MAAc,EAAEC,MAAe;IACzC,IAAI,CAACA,MAAM,GAAGA,MAAM,IAAI,4BAA4B;IACpD,IAAI,CAACD,MAAM,GAAGA,MAAM;IACpB,IAAI;MACF,IAAI,OAAOE,MAAM,KAAK,WAAW,EAAE;QACjC,IAAMC,QAAQ,GAAGC,YAAY,CAACC,OAAO,CAAC,UAAU,CAAC;QACjD,IAAIF,QAAQ,EAAE;UACZ,IA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AAC,GAAG,GAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rango-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.73",
|
|
4
4
|
"description": "Rango Exchange SDK for dApps",
|
|
5
5
|
"module": "lib/rango-sdk.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.
|
|
46
|
+
"rango-types": "^0.1.94",
|
|
47
47
|
"uuid-random": "^1.3.2"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|