rango-sdk 0.1.69 → 0.1.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -785,47 +785,37 @@ var RangoClient = /*#__PURE__*/function () {
|
|
|
785
785
|
return RangoClient;
|
|
786
786
|
}();
|
|
787
787
|
|
|
788
|
-
var isEvmBlockchain = function
|
|
789
|
-
|
|
788
|
+
var isEvmBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'EVM'; };
|
|
789
|
+
var isCosmosBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'COSMOS'; };
|
|
790
|
+
var isSolanaBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'SOLANA'; };
|
|
791
|
+
var isTronBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'TRON'; };
|
|
792
|
+
var isTransferBlockchain = function (blockchainMeta) {
|
|
793
|
+
return blockchainMeta.type === 'TRANSFER';
|
|
790
794
|
};
|
|
791
|
-
var
|
|
792
|
-
|
|
795
|
+
var isStarknetBlockchain = function (blockchainMeta) {
|
|
796
|
+
return blockchainMeta.type === 'STARKNET';
|
|
793
797
|
};
|
|
794
|
-
var
|
|
795
|
-
|
|
798
|
+
var isTonBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'TON'; };
|
|
799
|
+
var evmBlockchains = function (blockchains) {
|
|
800
|
+
return blockchains.filter(isEvmBlockchain);
|
|
796
801
|
};
|
|
797
|
-
var
|
|
798
|
-
|
|
802
|
+
var solanaBlockchain = function (blockchains) {
|
|
803
|
+
return blockchains.filter(isSolanaBlockchain);
|
|
799
804
|
};
|
|
800
|
-
var
|
|
801
|
-
|
|
805
|
+
var starknetBlockchain = function (blockchains) {
|
|
806
|
+
return blockchains.filter(isStarknetBlockchain);
|
|
802
807
|
};
|
|
803
|
-
var
|
|
804
|
-
|
|
808
|
+
var tronBlockchain = function (blockchains) {
|
|
809
|
+
return blockchains.filter(isTronBlockchain);
|
|
805
810
|
};
|
|
806
|
-
var
|
|
807
|
-
|
|
811
|
+
var cosmosBlockchains = function (blockchains) {
|
|
812
|
+
return blockchains.filter(isCosmosBlockchain);
|
|
808
813
|
};
|
|
809
|
-
var
|
|
810
|
-
|
|
814
|
+
var transferBlockchains = function (blockchains) {
|
|
815
|
+
return blockchains.filter(isTransferBlockchain);
|
|
811
816
|
};
|
|
812
|
-
var
|
|
813
|
-
|
|
814
|
-
};
|
|
815
|
-
var starknetBlockchain = function starknetBlockchain(blockchains) {
|
|
816
|
-
return blockchains.filter(isStarknetBlockchain);
|
|
817
|
-
};
|
|
818
|
-
var tronBlockchain = function tronBlockchain(blockchains) {
|
|
819
|
-
return blockchains.filter(isTronBlockchain);
|
|
820
|
-
};
|
|
821
|
-
var cosmosBlockchains = function cosmosBlockchains(blockchains) {
|
|
822
|
-
return blockchains.filter(isCosmosBlockchain);
|
|
823
|
-
};
|
|
824
|
-
var transferBlockchains = function transferBlockchains(blockchains) {
|
|
825
|
-
return blockchains.filter(isTransferBlockchain);
|
|
826
|
-
};
|
|
827
|
-
var tonBlockchain = function tonBlockchain(blockchains) {
|
|
828
|
-
return blockchains.filter(isTonBlockchain);
|
|
817
|
+
var tonBlockchain = function (blockchains) {
|
|
818
|
+
return blockchains.filter(isTonBlockchain);
|
|
829
819
|
};
|
|
830
820
|
|
|
831
821
|
/**
|
|
@@ -833,66 +823,58 @@ var tonBlockchain = function tonBlockchain(blockchains) {
|
|
|
833
823
|
*
|
|
834
824
|
*/
|
|
835
825
|
(function (RoutingResultType) {
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
826
|
+
RoutingResultType["OK"] = "OK";
|
|
827
|
+
RoutingResultType["HIGH_IMPACT"] = "HIGH_IMPACT";
|
|
828
|
+
RoutingResultType["NO_ROUTE"] = "NO_ROUTE";
|
|
829
|
+
RoutingResultType["INPUT_LIMIT_ISSUE"] = "INPUT_LIMIT_ISSUE";
|
|
830
|
+
RoutingResultType["HIGH_IMPACT_FOR_CREATE_TX"] = "HIGH_IMPACT_FOR_CREATE_TX";
|
|
841
831
|
})(exports.RoutingResultType || (exports.RoutingResultType = {}));
|
|
842
832
|
|
|
843
833
|
/**
|
|
844
834
|
* The type of transaction
|
|
845
835
|
*/
|
|
846
836
|
(function (TransactionType) {
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
837
|
+
TransactionType["EVM"] = "EVM";
|
|
838
|
+
TransactionType["TRANSFER"] = "TRANSFER";
|
|
839
|
+
TransactionType["COSMOS"] = "COSMOS";
|
|
840
|
+
TransactionType["SOLANA"] = "SOLANA";
|
|
841
|
+
TransactionType["TRON"] = "TRON";
|
|
842
|
+
TransactionType["STARKNET"] = "STARKNET";
|
|
843
|
+
TransactionType["TON"] = "TON";
|
|
844
|
+
TransactionType["SUI"] = "SUI";
|
|
845
|
+
TransactionType["XRPL"] = "XRPL";
|
|
856
846
|
})(exports.TransactionType || (exports.TransactionType = {}));
|
|
857
847
|
(function (GenericTransactionType) {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
848
|
+
GenericTransactionType["EVM"] = "EVM";
|
|
849
|
+
GenericTransactionType["TRANSFER"] = "TRANSFER";
|
|
850
|
+
GenericTransactionType["COSMOS"] = "COSMOS";
|
|
851
|
+
GenericTransactionType["SOLANA"] = "SOLANA";
|
|
862
852
|
})(exports.GenericTransactionType || (exports.GenericTransactionType = {}));
|
|
863
853
|
(function (TransactionStatus) {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
854
|
+
TransactionStatus["FAILED"] = "failed";
|
|
855
|
+
TransactionStatus["RUNNING"] = "running";
|
|
856
|
+
TransactionStatus["SUCCESS"] = "success";
|
|
867
857
|
})(exports.TransactionStatus || (exports.TransactionStatus = {}));
|
|
868
858
|
|
|
869
|
-
var isCosmosTransaction = function
|
|
870
|
-
|
|
859
|
+
var isCosmosTransaction = function (transaction) {
|
|
860
|
+
return transaction.type === exports.TransactionType.COSMOS;
|
|
871
861
|
};
|
|
872
862
|
|
|
873
|
-
var isSolanaTransaction = function
|
|
874
|
-
|
|
863
|
+
var isSolanaTransaction = function (transaction) {
|
|
864
|
+
return transaction.type === exports.TransactionType.SOLANA;
|
|
875
865
|
};
|
|
876
866
|
|
|
877
|
-
var isTransferTransaction = function
|
|
878
|
-
return transaction.type === exports.TransactionType.TRANSFER;
|
|
879
|
-
};
|
|
867
|
+
var isTransferTransaction = function (transaction) { return transaction.type === exports.TransactionType.TRANSFER; };
|
|
880
868
|
|
|
881
|
-
var isTronTransaction = function
|
|
882
|
-
return transaction.type === exports.TransactionType.TRON;
|
|
883
|
-
};
|
|
869
|
+
var isTronTransaction = function (transaction) { return transaction.type === exports.TransactionType.TRON; };
|
|
884
870
|
|
|
885
871
|
(function (TonChainID) {
|
|
886
|
-
|
|
887
|
-
|
|
872
|
+
TonChainID["MAINNET"] = "-239";
|
|
873
|
+
TonChainID["TESTNET"] = "-3";
|
|
888
874
|
})(exports.TonChainID || (exports.TonChainID = {}));
|
|
889
|
-
var isTonTransaction = function
|
|
890
|
-
return transaction.type === exports.TransactionType.TON;
|
|
891
|
-
};
|
|
875
|
+
var isTonTransaction = function (transaction) { return transaction.type === exports.TransactionType.TON; };
|
|
892
876
|
|
|
893
|
-
var isEvmTransaction = function
|
|
894
|
-
return transaction.type === exports.TransactionType.EVM;
|
|
895
|
-
};
|
|
877
|
+
var isEvmTransaction = function (transaction) { return transaction.type === exports.TransactionType.EVM; };
|
|
896
878
|
|
|
897
879
|
exports.RangoClient = RangoClient;
|
|
898
880
|
exports.cosmosBlockchains = cosmosBlockchains;
|
|
@@ -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/ton.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 { 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"],"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","isEvmBlockchain","blockchainMeta"],"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,IA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vF,OAAwB;MAAA,IAAAM,aAAA;MAAA,OAAAV,mBAAA,GAAAc,IAAA,UAAA8J,WAAAC,UAAA;QAAA,kBAAAA,UAAA,CAAA5J,IAAA,GAAA4J,UAAA,CAAA3J,IAAA;UAAA;YAAA2J,UAAA,CAAA3J,IAAA;YAAA,OAGhB,IAAI,CAAC3B,WAAW,CAACuG,IAAI,6CACiB,IAAI,CAACjH,MAAM,EACrD8G,WAAW,EAAAxE,QAAA,KACNf,OAAO,CAAE,CACf;UAAA;YALGM,aAAa,GAAAmK,UAAA,CAAAnJ,IAAA;YAAA,OAAAmJ,UAAA,CAAAvH,MAAA,WAMZ5C,aAAa,CAAC2C,IAAI;UAAA;UAAA;YAAA,OAAAwH,UAAA,CAAAtH,IAAA;;SAAAoH,SAAA;KAC1B;IAAA,SAAAF,wBAAAK,IAAA,EAAAC,IAAA;MAAA,OAAAL,wBAAA,CAAAhH,KAAA,OAAAC,SAAA;;IAAA,OAAA8G,uBAAA;;EAAA,OAAA7L,WAAA;AAAA;;mBCrP2B,2BAAAoM;;;qDAIUC;;;AAGtC;;;AAKF;;;yDAI0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzD1C;;;;AAIA,AAAA;gCAAY;;;;;;;ACJZ;;;AAGA,AAAA;;;;;;;;;;;AAYA,AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
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,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,IAAI,CAACA,QAAQ,GAAGA,QAAQ;SACzB,MAAM;UACL,IAAMG,WAAW,GAAGC,IAAI,EAAE;UAC1BH,YAAY,CAACI,OAAO,CAAC,UAAU,EAAEF,WAAW,CAAC;UAC7C,IAAI,CAACH,QAAQ,GAAGG,WAAW;;OAE9B,MAAM;QACL,IAAI,CAACH,QAAQ,GAAGI,IAAI,EAAE;;KAEzB,CAAC,OAAOE,CAAC,EAAE;MACV,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mBAAmB,GAAG,UAAC,WAEnC;IACC,OAAA,WAAW,CAAC,IAAI,KAAKF,uBAAe,CAAC,MAAM;AAA3C,CAA2C;;IC7BhC,mBAAmB,GAAG,UAAC,WAEnC;IACC,OAAA,WAAW,CAAC,IAAI,KAAKA,uBAAe,CAAC,MAAM;AAA3C,CAA2C;;ICjBhC,qBAAqB,GAAG,UAAC,WAErC,IAA8B,OAAA,WAAW,CAAC,IAAI,KAAKA,uBAAe,CAAC,QAAQ,GAAA;;ICA/D,iBAAiB,GAAG,UAAC,WAEjC,IAAqC,OAAA,WAAW,CAAC,IAAI,KAAKA,uBAAe,CAAC,IAAI,GAAA;;ACzC/E,WAAY,UAAU;IACpB,8BAAgB,CAAA;IAChB,4BAAc,CAAA;AAChB,CAAC,EAHWG,kBAAU,KAAVA,kBAAU,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rango-sdk.cjs.production.min.js","sources":["../src/services/client.ts","../../../node_modules/rango-types/src/api/shared/type-gaurds.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"],"names":["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","blockchainMeta"],"mappings":"ikOAoCaA,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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KAAKF,OAASkK,EAA0B5H,KAC9Dd,IACN,OAHkB,OAAA4I,EAAA3F,gBAAA2F,EAAA7F,KAIEC,MAAI,OAAA,UAAA,OAAA4F,EAAA1F,UAAAsF,YAC1B,OAAA,SAAAM,EAAAC,GAAA,OAAAR,EAAAlF,WAAAC,eAAA/D,EAEYyJ,2BAAe,IAAAC,EAAAtJ,EAAAC,IAAAC,MAArB,SAAAqJ,EACLC,EACAnJ,GAAwB,OAAAJ,IAAAc,eAAA0I,GAAA,cAAAA,EAAAxI,KAAAwI,EAAAvI,MAAA,OAAA,OAAAuI,EAAAvI,OAEInC,KAAKS,YAAYiC,qCACV1C,KAAKF,OAAMsC,GAC1CT,OAAQ8I,GAAwBnJ,IACnC,OAHkB,OAAAoJ,EAAAnG,gBAAAmG,EAAArG,KAIEC,MAAI,OAAA,UAAA,OAAAoG,EAAAlG,UAAAgG,YAC1B,OAAA,SAAAG,EAAAC,GAAA,OAAAL,EAAA5F,WAAAC,eAAA/D,EAEYgK,mCAAuB,IAAAC,EAAA7J,EAAAC,IAAAC,MAA7B,SAAA4J,EACLvE,EACAlF,GAAwB,OAAAJ,IAAAc,eAAAgJ,GAAA,cAAAA,EAAA9I,KAAA8I,EAAA7I,MAAA,OAAA,OAAA6I,EAAA7I,OAGhBnC,KAAKS,YAAYiG,+CACqB1G,KAAKF,OAC/C0G,EAAWpE,KACNd,IACN,OALgB,OAAA0J,EAAAzG,gBAAAyG,EAAA3G,KAMEC,MAAI,OAAA,UAAA,OAAA0G,EAAAxG,UAAAuG,YAC1B,OAAA,SAAAE,EAAAC,GAAA,OAAAJ,EAAAnG,WAAAC,eAAA/E,oDCjPqCsL,mHAYEA"}
|
|
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","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,iBAA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Blockchain = function
|
|
783
|
-
|
|
782
|
+
var isEvmBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'EVM'; };
|
|
783
|
+
var isCosmosBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'COSMOS'; };
|
|
784
|
+
var isSolanaBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'SOLANA'; };
|
|
785
|
+
var isTronBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'TRON'; };
|
|
786
|
+
var isTransferBlockchain = function (blockchainMeta) {
|
|
787
|
+
return blockchainMeta.type === 'TRANSFER';
|
|
784
788
|
};
|
|
785
|
-
var
|
|
786
|
-
|
|
789
|
+
var isStarknetBlockchain = function (blockchainMeta) {
|
|
790
|
+
return blockchainMeta.type === 'STARKNET';
|
|
787
791
|
};
|
|
788
|
-
var
|
|
789
|
-
|
|
792
|
+
var isTonBlockchain = function (blockchainMeta) { return blockchainMeta.type === 'TON'; };
|
|
793
|
+
var evmBlockchains = function (blockchains) {
|
|
794
|
+
return blockchains.filter(isEvmBlockchain);
|
|
790
795
|
};
|
|
791
|
-
var
|
|
792
|
-
|
|
796
|
+
var solanaBlockchain = function (blockchains) {
|
|
797
|
+
return blockchains.filter(isSolanaBlockchain);
|
|
793
798
|
};
|
|
794
|
-
var
|
|
795
|
-
|
|
799
|
+
var starknetBlockchain = function (blockchains) {
|
|
800
|
+
return blockchains.filter(isStarknetBlockchain);
|
|
796
801
|
};
|
|
797
|
-
var
|
|
798
|
-
|
|
802
|
+
var tronBlockchain = function (blockchains) {
|
|
803
|
+
return blockchains.filter(isTronBlockchain);
|
|
799
804
|
};
|
|
800
|
-
var
|
|
801
|
-
|
|
805
|
+
var cosmosBlockchains = function (blockchains) {
|
|
806
|
+
return blockchains.filter(isCosmosBlockchain);
|
|
802
807
|
};
|
|
803
|
-
var
|
|
804
|
-
|
|
808
|
+
var transferBlockchains = function (blockchains) {
|
|
809
|
+
return blockchains.filter(isTransferBlockchain);
|
|
805
810
|
};
|
|
806
|
-
var
|
|
807
|
-
|
|
808
|
-
};
|
|
809
|
-
var starknetBlockchain = function starknetBlockchain(blockchains) {
|
|
810
|
-
return blockchains.filter(isStarknetBlockchain);
|
|
811
|
-
};
|
|
812
|
-
var tronBlockchain = function tronBlockchain(blockchains) {
|
|
813
|
-
return blockchains.filter(isTronBlockchain);
|
|
814
|
-
};
|
|
815
|
-
var cosmosBlockchains = function cosmosBlockchains(blockchains) {
|
|
816
|
-
return blockchains.filter(isCosmosBlockchain);
|
|
817
|
-
};
|
|
818
|
-
var transferBlockchains = function transferBlockchains(blockchains) {
|
|
819
|
-
return blockchains.filter(isTransferBlockchain);
|
|
820
|
-
};
|
|
821
|
-
var tonBlockchain = function tonBlockchain(blockchains) {
|
|
822
|
-
return blockchains.filter(isTonBlockchain);
|
|
811
|
+
var tonBlockchain = function (blockchains) {
|
|
812
|
+
return blockchains.filter(isTonBlockchain);
|
|
823
813
|
};
|
|
824
814
|
|
|
825
815
|
/**
|
|
@@ -828,11 +818,11 @@ var tonBlockchain = function tonBlockchain(blockchains) {
|
|
|
828
818
|
*/
|
|
829
819
|
var RoutingResultType;
|
|
830
820
|
(function (RoutingResultType) {
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
821
|
+
RoutingResultType["OK"] = "OK";
|
|
822
|
+
RoutingResultType["HIGH_IMPACT"] = "HIGH_IMPACT";
|
|
823
|
+
RoutingResultType["NO_ROUTE"] = "NO_ROUTE";
|
|
824
|
+
RoutingResultType["INPUT_LIMIT_ISSUE"] = "INPUT_LIMIT_ISSUE";
|
|
825
|
+
RoutingResultType["HIGH_IMPACT_FOR_CREATE_TX"] = "HIGH_IMPACT_FOR_CREATE_TX";
|
|
836
826
|
})(RoutingResultType || (RoutingResultType = {}));
|
|
837
827
|
|
|
838
828
|
/**
|
|
@@ -840,15 +830,15 @@ var RoutingResultType;
|
|
|
840
830
|
*/
|
|
841
831
|
var TransactionType;
|
|
842
832
|
(function (TransactionType) {
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
833
|
+
TransactionType["EVM"] = "EVM";
|
|
834
|
+
TransactionType["TRANSFER"] = "TRANSFER";
|
|
835
|
+
TransactionType["COSMOS"] = "COSMOS";
|
|
836
|
+
TransactionType["SOLANA"] = "SOLANA";
|
|
837
|
+
TransactionType["TRON"] = "TRON";
|
|
838
|
+
TransactionType["STARKNET"] = "STARKNET";
|
|
839
|
+
TransactionType["TON"] = "TON";
|
|
840
|
+
TransactionType["SUI"] = "SUI";
|
|
841
|
+
TransactionType["XRPL"] = "XRPL";
|
|
852
842
|
})(TransactionType || (TransactionType = {}));
|
|
853
843
|
/**
|
|
854
844
|
* The type of transaction
|
|
@@ -856,49 +846,41 @@ var TransactionType;
|
|
|
856
846
|
*/
|
|
857
847
|
var GenericTransactionType;
|
|
858
848
|
(function (GenericTransactionType) {
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
849
|
+
GenericTransactionType["EVM"] = "EVM";
|
|
850
|
+
GenericTransactionType["TRANSFER"] = "TRANSFER";
|
|
851
|
+
GenericTransactionType["COSMOS"] = "COSMOS";
|
|
852
|
+
GenericTransactionType["SOLANA"] = "SOLANA";
|
|
863
853
|
})(GenericTransactionType || (GenericTransactionType = {}));
|
|
864
854
|
/**
|
|
865
855
|
* The status of transaction in tracking
|
|
866
856
|
*/
|
|
867
857
|
var TransactionStatus;
|
|
868
858
|
(function (TransactionStatus) {
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
859
|
+
TransactionStatus["FAILED"] = "failed";
|
|
860
|
+
TransactionStatus["RUNNING"] = "running";
|
|
861
|
+
TransactionStatus["SUCCESS"] = "success";
|
|
872
862
|
})(TransactionStatus || (TransactionStatus = {}));
|
|
873
863
|
|
|
874
|
-
var isCosmosTransaction = function
|
|
875
|
-
|
|
864
|
+
var isCosmosTransaction = function (transaction) {
|
|
865
|
+
return transaction.type === TransactionType.COSMOS;
|
|
876
866
|
};
|
|
877
867
|
|
|
878
|
-
var isSolanaTransaction = function
|
|
879
|
-
|
|
868
|
+
var isSolanaTransaction = function (transaction) {
|
|
869
|
+
return transaction.type === TransactionType.SOLANA;
|
|
880
870
|
};
|
|
881
871
|
|
|
882
|
-
var isTransferTransaction = function
|
|
883
|
-
return transaction.type === TransactionType.TRANSFER;
|
|
884
|
-
};
|
|
872
|
+
var isTransferTransaction = function (transaction) { return transaction.type === TransactionType.TRANSFER; };
|
|
885
873
|
|
|
886
|
-
var isTronTransaction = function
|
|
887
|
-
return transaction.type === TransactionType.TRON;
|
|
888
|
-
};
|
|
874
|
+
var isTronTransaction = function (transaction) { return transaction.type === TransactionType.TRON; };
|
|
889
875
|
|
|
890
876
|
var TonChainID;
|
|
891
877
|
(function (TonChainID) {
|
|
892
|
-
|
|
893
|
-
|
|
878
|
+
TonChainID["MAINNET"] = "-239";
|
|
879
|
+
TonChainID["TESTNET"] = "-3";
|
|
894
880
|
})(TonChainID || (TonChainID = {}));
|
|
895
|
-
var isTonTransaction = function
|
|
896
|
-
return transaction.type === TransactionType.TON;
|
|
897
|
-
};
|
|
881
|
+
var isTonTransaction = function (transaction) { return transaction.type === TransactionType.TON; };
|
|
898
882
|
|
|
899
|
-
var isEvmTransaction = function
|
|
900
|
-
return transaction.type === TransactionType.EVM;
|
|
901
|
-
};
|
|
883
|
+
var isEvmTransaction = function (transaction) { return transaction.type === TransactionType.EVM; };
|
|
902
884
|
|
|
903
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 };
|
|
904
886
|
//# 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/ton.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 { 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"],"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","isEvmBlockchain","blockchainMeta"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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/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,IAAI,CAACA,QAAQ,GAAGA,QAAQ;SACzB,MAAM;UACL,IAAMG,WAAW,GAAGC,IAAI,EAAE;UAC1BH,Y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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;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rango-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.71",
|
|
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.89",
|
|
47
47
|
"uuid-random": "^1.3.2"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|