rango-sdk-basic 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/lib/index.d.ts +2 -2
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +8 -21
  4. package/lib/rango-sdk-basic.cjs.development.js +1002 -0
  5. package/lib/rango-sdk-basic.cjs.development.js.map +1 -0
  6. package/lib/rango-sdk-basic.cjs.production.min.js +2 -0
  7. package/lib/rango-sdk-basic.cjs.production.min.js.map +1 -0
  8. package/lib/rango-sdk-basic.esm.js +999 -0
  9. package/lib/rango-sdk-basic.esm.js.map +1 -0
  10. package/lib/services/client.d.ts +21 -21
  11. package/lib/services/client.d.ts.map +1 -1
  12. package/lib/services/executor.d.ts +7 -7
  13. package/lib/services/executor.d.ts.map +1 -1
  14. package/lib/services/httpService.d.ts +1 -1
  15. package/lib/services/httpService.d.ts.map +1 -1
  16. package/lib/services/index.d.ts +1 -1
  17. package/lib/services/index.d.ts.map +1 -1
  18. package/lib/types/api/balance.d.ts +1 -38
  19. package/lib/types/api/balance.d.ts.map +1 -1
  20. package/lib/types/api/common.d.ts +3 -128
  21. package/lib/types/api/common.d.ts.map +1 -1
  22. package/lib/types/api/meta.d.ts +1 -183
  23. package/lib/types/api/meta.d.ts.map +1 -1
  24. package/lib/types/api/routing.d.ts +1 -43
  25. package/lib/types/api/routing.d.ts.map +1 -1
  26. package/lib/types/api/transactions.d.ts +1 -188
  27. package/lib/types/api/transactions.d.ts.map +1 -1
  28. package/lib/types/api/txs/cosmos.d.ts +1 -68
  29. package/lib/types/api/txs/cosmos.d.ts.map +1 -1
  30. package/lib/types/api/txs/evm.d.ts +1 -29
  31. package/lib/types/api/txs/evm.d.ts.map +1 -1
  32. package/lib/types/api/txs/index.d.ts +3 -3
  33. package/lib/types/api/txs/index.d.ts.map +1 -1
  34. package/lib/types/api/txs/transfer.d.ts +1 -28
  35. package/lib/types/api/txs/transfer.d.ts.map +1 -1
  36. package/lib/types/index.d.ts +7 -7
  37. package/lib/types/index.d.ts.map +1 -1
  38. package/lib/types/utils/errors.d.ts +22 -22
  39. package/lib/types/utils/errors.d.ts.map +1 -1
  40. package/lib/utils/errors.d.ts +1 -1
  41. package/lib/utils/errors.d.ts.map +1 -1
  42. package/lib/utils/promise.d.ts +1 -1
  43. package/lib/utils/promise.d.ts.map +1 -1
  44. package/package.json +20 -19
  45. package/lib/index.js.map +0 -1
  46. package/lib/services/client.js +0 -257
  47. package/lib/services/client.js.map +0 -1
  48. package/lib/services/executor.js +0 -196
  49. package/lib/services/executor.js.map +0 -1
  50. package/lib/services/httpService.js +0 -14
  51. package/lib/services/httpService.js.map +0 -1
  52. package/lib/services/index.js +0 -6
  53. package/lib/services/index.js.map +0 -1
  54. package/lib/types/api/balance.js +0 -3
  55. package/lib/types/api/balance.js.map +0 -1
  56. package/lib/types/api/common.js +0 -11
  57. package/lib/types/api/common.js.map +0 -1
  58. package/lib/types/api/meta.js +0 -3
  59. package/lib/types/api/meta.js.map +0 -1
  60. package/lib/types/api/routing.js +0 -3
  61. package/lib/types/api/routing.js.map +0 -1
  62. package/lib/types/api/transactions.js +0 -22
  63. package/lib/types/api/transactions.js.map +0 -1
  64. package/lib/types/api/txs/cosmos.js +0 -3
  65. package/lib/types/api/txs/cosmos.js.map +0 -1
  66. package/lib/types/api/txs/evm.js +0 -3
  67. package/lib/types/api/txs/evm.js.map +0 -1
  68. package/lib/types/api/txs/index.js +0 -20
  69. package/lib/types/api/txs/index.js.map +0 -1
  70. package/lib/types/api/txs/transfer.js +0 -3
  71. package/lib/types/api/txs/transfer.js.map +0 -1
  72. package/lib/types/index.js +0 -24
  73. package/lib/types/index.js.map +0 -1
  74. package/lib/types/utils/errors.js +0 -26
  75. package/lib/types/utils/errors.js.map +0 -1
  76. package/lib/utils/errors.js +0 -31
  77. package/lib/utils/errors.js.map +0 -1
  78. package/lib/utils/promise.js +0 -8
  79. package/lib/utils/promise.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rango-sdk-basic.esm.js","sources":["../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/v4.js","../src/services/httpService.ts","../src/types/api/common.ts","../node_modules/rango-types/src/api/shared/transactions.ts","../src/types/utils/errors.ts","../src/utils/promise.ts","../src/services/executor.ts","../src/utils/errors.ts","../src/services/client.ts"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","import axios from 'axios'\n\nconst baseURL =\n typeof process !== 'undefined' && process.env.REACT_APP_RANGO_BASE_URL\n ? process.env.REACT_APP_RANGO_BASE_URL\n : 'https://api.rango.exchange'\n\nexport const httpService = axios.create({\n baseURL,\n})\n","import { Asset } from 'rango-types/lib/api/basic'\nexport * from 'rango-types/lib/api/basic/common'\n\nexport function assetToString(asset: Asset): string {\n if (!!asset.address)\n return `${asset.blockchain}.${asset.symbol}--${asset.address}`\n else return `${asset.blockchain}.${asset.symbol}`\n}\n",null,"export const MetamaskErrorCodes = {\n rpc: {\n invalidInput: -32000,\n resourceNotFound: -32001,\n resourceUnavailable: -32002,\n transactionRejected: -32003,\n methodNotSupported: -32004,\n limitExceeded: -32005,\n parse: -32700,\n invalidRequest: -32600,\n methodNotFound: -32601,\n invalidParams: -32602,\n internal: -32603,\n },\n provider: {\n userRejectedRequest: 4001,\n unauthorized: 4100,\n unsupportedMethod: 4200,\n disconnected: 4900,\n chainDisconnected: 4901,\n },\n}\n","export function sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n","import { Signer } from 'ethers'\nimport { RangoClient } from './client'\nimport { EvmTransaction } from '../types/api/txs'\nimport {\n StatusResponse,\n SwapResponse,\n TransactionStatus,\n TransactionType,\n} from '../types/api/transactions'\nimport { sleep } from '../utils/promise'\n\nexport function prepareEvmTransaction(\n evmTx: EvmTransaction,\n isApprove: boolean\n) {\n const gasPrice =\n !!evmTx.gasPrice && !evmTx.gasPrice.startsWith('0x')\n ? '0x' + parseInt(evmTx.gasPrice).toString(16)\n : null\n const manipulatedTx = {\n ...evmTx,\n gasPrice,\n }\n let tx = {}\n if (!!manipulatedTx.from) tx = { ...tx, from: manipulatedTx.from }\n if (isApprove) {\n if (!!manipulatedTx.approveTo) tx = { ...tx, to: manipulatedTx.approveTo }\n if (!!manipulatedTx.approveData)\n tx = { ...tx, data: manipulatedTx.approveData }\n } else {\n if (!!manipulatedTx.txTo) tx = { ...tx, to: manipulatedTx.txTo }\n if (!!manipulatedTx.txData) tx = { ...tx, data: manipulatedTx.txData }\n if (!!manipulatedTx.value) tx = { ...tx, value: manipulatedTx.value }\n if (!!manipulatedTx.gasLimit)\n tx = { ...tx, gasLimit: manipulatedTx.gasLimit }\n if (!!manipulatedTx.gasPrice)\n tx = { ...tx, gasPrice: manipulatedTx.gasPrice }\n }\n return tx\n}\n\nasync function checkApprovalSync(\n requestId: string,\n txId: string,\n rangoClient: RangoClient\n) {\n while (true) {\n try {\n const approvalResponse = await rangoClient.isApproved(requestId, txId)\n if (approvalResponse.isApproved) return true\n } catch (err) {\n console.log('ignorinig error', { err })\n }\n await sleep(3_000)\n }\n}\n\nexport const checkTransactionStatusSync = async (\n requestId: string,\n txId: string,\n rangoClient: RangoClient\n) => {\n let txStatus: StatusResponse | undefined\n while (true) {\n try {\n txStatus = await rangoClient.status({\n requestId,\n txId,\n })\n } catch (err) {\n console.log('ignorinig error', { err })\n }\n if (!!txStatus) {\n if (\n !!txStatus.status &&\n [TransactionStatus.FAILED, TransactionStatus.SUCCESS].includes(\n txStatus.status\n )\n ) {\n return txStatus\n }\n }\n await sleep(3_000)\n }\n}\n\nexport const executeEvmRoute = async (\n client: RangoClient,\n signer: Signer,\n route: SwapResponse\n): Promise<StatusResponse> => {\n const { tx, requestId, error, resultType } = route\n if (resultType != 'OK') throw new Error(resultType)\n if (!!error || !tx)\n throw new Error(error || 'Error creating the transaction.')\n if (tx?.type !== TransactionType.EVM)\n throw new Error('Non Evm transactions are not supported yet.')\n const evmTransaction = tx as EvmTransaction\n const txChainId = parseInt(evmTransaction.blockChain.chainId || '-1')\n let signerChainId = await signer.getChainId()\n if (signerChainId !== txChainId) {\n throw new Error(\n `Signer chainId ${signerChainId} doesn't match required chainId ${txChainId}.`\n )\n }\n if (!!evmTransaction.approveTo && !!evmTransaction.approveData) {\n const approveTxData = prepareEvmTransaction(evmTransaction, true)\n const approveTx = await signer.sendTransaction(approveTxData)\n approveTx.wait()\n await checkApprovalSync(requestId, approveTx.hash, client)\n }\n signerChainId = await signer.getChainId()\n if (signerChainId !== txChainId) {\n throw new Error(\n `Signer chainId ${signerChainId} doesn't match required chainId ${txChainId}.`\n )\n }\n const mainTxData = prepareEvmTransaction(evmTransaction, false)\n const mainTx = await signer.sendTransaction(mainTxData)\n mainTx.wait()\n const status = await checkTransactionStatusSync(\n requestId,\n mainTx.hash,\n client\n )\n return status\n}\n","import { getMessageFromCode } from 'eth-rpc-errors'\nimport { MetamaskErrorCodes } from '../types/utils/errors'\n\nexport const prettifyError = (error: any) => {\n if (!error) return error\n if (error.code && (error.code === 'ACTION_REJECTED' || error.code === 4001))\n return new Error('Transaction Rejected')\n if (error && typeof error.code === 'number') {\n if (Object.values(MetamaskErrorCodes.provider).includes(error.code)) {\n return new Error(getMessageFromCode(error.code))\n }\n if (Object.values(MetamaskErrorCodes.rpc).includes(error.code)) {\n if (\n error.code === MetamaskErrorCodes.rpc.internal &&\n error.message?.includes('underpriced')\n )\n return new Error('Transaction underpriced')\n if (\n error.message?.includes('intrinsic gas too low') ||\n error.message?.includes('out of gas')\n )\n return new Error('This Gas limit is low.')\n return new Error(getMessageFromCode(error.code))\n }\n }\n if (error.message) return new Error(error.message)\n return error\n}\n","import { v4 } from 'uuid'\n\nimport { httpService } from './httpService'\nimport {\n MetaResponse,\n QuoteRequest,\n QuoteResponse,\n CheckApprovalResponse,\n StatusRequest,\n StatusResponse,\n SwapRequest,\n SwapResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n assetToString,\n BlockchainMeta,\n SwapperMetaDto,\n} from '../types'\nimport { Signer } from 'ethers'\nimport { executeEvmRoute as executeEvmRoute } from './executor'\nimport { prettifyError } from '../utils/errors'\n\ntype WalletAddress = { blockchain: string; address: string }\n\nexport class RangoClient {\n private readonly deviceId: string\n\n private readonly apiKey: string\n\n constructor(apiKey: string, debug: boolean = false) {\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 = v4()\n localStorage.setItem('deviceId', generatedId)\n this.deviceId = generatedId\n }\n } else {\n this.deviceId = v4()\n }\n } catch (e) {\n this.deviceId = v4()\n }\n if (debug) {\n httpService.interceptors.request.use((request: any) => {\n console.log('Starting Request', JSON.stringify(request, null, 2))\n return request\n })\n httpService.interceptors.response.use((response: any) => {\n console.log('Response:', JSON.stringify(response, null, 2))\n return response\n })\n }\n }\n\n public async meta(): Promise<MetaResponse> {\n const axiosResponse = await httpService.get<MetaResponse>(\n `/basic/meta?apiKey=${this.apiKey}`\n )\n return axiosResponse.data\n }\n\n public async chains(): Promise<BlockchainMeta[]> {\n const axiosResponse = await httpService.get<BlockchainMeta[]>(\n `/basic/meta/blockchains?apiKey=${this.apiKey}`\n )\n return axiosResponse.data\n }\n\n public async swappers(): Promise<SwapperMetaDto[]> {\n const axiosResponse = await httpService.get<SwapperMetaDto[]>(\n `/basic/meta/swappers?apiKey=${this.apiKey}`\n )\n return axiosResponse.data\n }\n\n public async quote(quoteRequest: QuoteRequest): Promise<QuoteResponse> {\n const body = {\n ...quoteRequest,\n from: assetToString(quoteRequest.from),\n to: assetToString(quoteRequest.to),\n swappers:\n !!quoteRequest.swappers && quoteRequest.swappers.length > 0\n ? quoteRequest.swappers.join(',')\n : undefined,\n messagingProtocols:\n !!quoteRequest.messagingProtocols &&\n quoteRequest.messagingProtocols.length > 0\n ? quoteRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await httpService.get<QuoteResponse>(\n `/basic/quote?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n }\n )\n return axiosResponse.data\n }\n\n public async isApproved(\n requestId: string,\n txId: string\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await httpService.get<CheckApprovalResponse>(\n `/basic/is-approved?apiKey=${this.apiKey}`,\n {\n params: { requestId, txId },\n headers: { 'X-Rango-Id': this.deviceId },\n }\n )\n return axiosResponse.data\n }\n\n public async status(statusRequest: StatusRequest): Promise<StatusResponse> {\n const axiosResponse = await httpService.get<StatusResponse>(\n `/basic/status?apiKey=${this.apiKey}`,\n {\n params: statusRequest,\n headers: { 'X-Rango-Id': this.deviceId },\n }\n )\n return axiosResponse.data\n }\n\n public async swap(swapRequest: SwapRequest): Promise<SwapResponse> {\n const body = {\n ...swapRequest,\n from: assetToString(swapRequest.from),\n to: assetToString(swapRequest.to),\n swappers:\n !!swapRequest.swappers && swapRequest.swappers.length > 0\n ? swapRequest.swappers.join(',')\n : undefined,\n messagingProtocols:\n !!swapRequest.messagingProtocols &&\n swapRequest.messagingProtocols.length > 0\n ? swapRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await httpService.get<SwapResponse>(\n `/basic/swap?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n }\n )\n return axiosResponse.data\n }\n\n public async reportFailure(\n requestBody: ReportTransactionRequest\n ): Promise<void> {\n await httpService.post(\n `/basic/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n headers: { 'X-Rango-Id': this.deviceId },\n }\n )\n }\n\n public async balance(\n walletAddress: WalletAddress\n ): Promise<WalletDetailsResponse> {\n const axiosResponse = await httpService.get<WalletDetailsResponse>(\n `/basic/balance?apiKey=${this.apiKey}`,\n {\n params: walletAddress,\n headers: { 'X-Rango-Id': this.deviceId },\n }\n )\n return axiosResponse.data\n }\n\n public async executeEvmRoute(\n signer: any,\n route: SwapResponse\n ): Promise<StatusResponse> {\n try {\n return await executeEvmRoute(this, signer as Signer, route)\n } catch (error) {\n throw prettifyError(error)\n }\n }\n}\n"],"names":["baseURL","process","env","REACT_APP_RANGO_BASE_URL","httpService","axios","create","assetToString","asset","address","blockchain","symbol","MetamaskErrorCodes","rpc","invalidInput","resourceNotFound","resourceUnavailable","transactionRejected","methodNotSupported","limitExceeded","parse","invalidRequest","methodNotFound","invalidParams","internal","provider","userRejectedRequest","unauthorized","unsupportedMethod","disconnected","chainDisconnected","sleep","ms","Promise","resolve","setTimeout","prepareEvmTransaction","evmTx","isApprove","gasPrice","startsWith","parseInt","toString","manipulatedTx","tx","from","approveTo","to","approveData","data","txTo","txData","value","gasLimit","checkApprovalSync","requestId","txId","rangoClient","isApproved","approvalResponse","console","log","err","checkTransactionStatusSync","status","txStatus","TransactionStatus","FAILED","SUCCESS","includes","executeEvmRoute","client","signer","route","error","resultType","Error","type","TransactionType","EVM","evmTransaction","txChainId","blockChain","chainId","getChainId","signerChainId","approveTxData","sendTransaction","approveTx","wait","hash","mainTxData","mainTx","prettifyError","code","Object","values","getMessageFromCode","message","RangoClient","apiKey","debug","window","deviceId","localStorage","getItem","generatedId","v4","setItem","e","interceptors","request","use","JSON","stringify","response","meta","get","axiosResponse","chains","swappers","quote","quoteRequest","body","length","join","undefined","messagingProtocols","params","headers","statusRequest","swap","swapRequest","reportFailure","requestBody","post","balance","walletAddress"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA,IAAI,eAAe,CAAC;AACpB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AAClB,SAAS,GAAG,GAAG;AAC9B;AACA,EAAE,IAAI,CAAC,eAAe,EAAE;AACxB;AACA,IAAI,eAAe,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACrH;AACA,IAAI,IAAI,CAAC,eAAe,EAAE;AAC1B,MAAM,MAAM,IAAI,KAAK,CAAC,0GAA0G,CAAC,CAAC;AAClI,KAAK;AACL,GAAG;AACH;AACA,EAAE,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC;;AChBA;AACA;AACA;AACA;AACA;AACA,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB;AACA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,E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CACF;UAAA;YANKe,aAAa;YAAA,kCAOZA,aAAa,CAACrE,IAAI;UAAA;UAAA;YAAA;;;KAC1B;IAAA;MAAA;;IAAA;;EAAA,OAEYoF,aAAa;IAAA,6FAAnB,kBACLC,WAAqC;MAAA;QAAA;UAAA;YAAA;YAAA,OAE/BlI,WAAW,CAACmI,IAAI,8BACO,IAAI,CAACnC,MAAM,EACtCkC,WAAW,EACX;cACEL,OAAO,EAAE;gBAAE,YAAY,EAAE,IAAI,CAAC1B;;aAC/B,CACF;UAAA;UAAA;YAAA;;;KACF;IAAA;MAAA;;IAAA;;EAAA,OAEYiC,OAAO;IAAA,uFAAb,kBACLC,aAA4B;MAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OAEArI,WAAW,CAACiH,GAAG,4BAChB,IAAI,CAACjB,MAAM,EACpC;cACE4B,MAAM,EAAES,aAAa;cACrBR,OAAO,EAAE;gBAAE,YAAY,EAAE,IAAI,CAAC1B;;aAC/B,CACF;UAAA;YANKe,aAAa;YAAA,kCAOZA,aAAa,CAACrE,IAAI;UAAA;UAAA;YAAA;;;KAC1B;IAAA;MAAA;;IAAA;;EAAA,OAEYqB,eAAe;IAAA,gGAArB,mBACLE,MAAW,EACXC,KAAmB;MAAA;QAAA;UAAA;YAAA;YAAA;YAAA,OAGJH,eAAe,CAAC,IAAI,EAAEE,MAAgB,EAAEC,KAAK,CAAC;UAAA;YAAA;UAAA;YAAA;YAAA;YAAA,MAErDoB,aAAa,eAAO;UAAA;UAAA;YAAA;;;KAE7B;IAAA;MAAA;;IAAA;;EAAA;AAAA;;;;"}
@@ -1,22 +1,22 @@
1
- import { MetaResponse, QuoteRequest, QuoteResponse, CheckApprovalResponse, StatusRequest, StatusResponse, SwapRequest, SwapResponse, ReportTransactionRequest, WalletDetailsResponse, BlockchainMeta, SwapperMetaDto } from '../types';
2
- type WalletAddress = {
3
- blockchain: string;
4
- address: string;
5
- };
6
- export declare class RangoClient {
7
- private readonly deviceId;
8
- private readonly apiKey;
9
- constructor(apiKey: string, debug?: boolean);
10
- meta(): Promise<MetaResponse>;
11
- chains(): Promise<BlockchainMeta[]>;
12
- swappers(): Promise<SwapperMetaDto[]>;
13
- quote(quoteRequest: QuoteRequest): Promise<QuoteResponse>;
14
- isApproved(requestId: string, txId: string): Promise<CheckApprovalResponse>;
15
- status(statusRequest: StatusRequest): Promise<StatusResponse>;
16
- swap(swapRequest: SwapRequest): Promise<SwapResponse>;
17
- reportFailure(requestBody: ReportTransactionRequest): Promise<void>;
18
- balance(walletAddress: WalletAddress): Promise<WalletDetailsResponse>;
19
- executeEvmRoute(signer: any, route: SwapResponse): Promise<StatusResponse>;
20
- }
21
- export {};
1
+ import { MetaResponse, QuoteRequest, QuoteResponse, CheckApprovalResponse, StatusRequest, StatusResponse, SwapRequest, SwapResponse, ReportTransactionRequest, WalletDetailsResponse, BlockchainMeta, SwapperMetaDto } from '../types';
2
+ declare type WalletAddress = {
3
+ blockchain: string;
4
+ address: string;
5
+ };
6
+ export declare class RangoClient {
7
+ private readonly deviceId;
8
+ private readonly apiKey;
9
+ constructor(apiKey: string, debug?: boolean);
10
+ meta(): Promise<MetaResponse>;
11
+ chains(): Promise<BlockchainMeta[]>;
12
+ swappers(): Promise<SwapperMetaDto[]>;
13
+ quote(quoteRequest: QuoteRequest): Promise<QuoteResponse>;
14
+ isApproved(requestId: string, txId: string): Promise<CheckApprovalResponse>;
15
+ status(statusRequest: StatusRequest): Promise<StatusResponse>;
16
+ swap(swapRequest: SwapRequest): Promise<SwapResponse>;
17
+ reportFailure(requestBody: ReportTransactionRequest): Promise<void>;
18
+ balance(walletAddress: WalletAddress): Promise<WalletDetailsResponse>;
19
+ executeEvmRoute(signer: any, route: SwapResponse): Promise<StatusResponse>;
20
+ }
21
+ export {};
22
22
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,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EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,wBAAwB,EACxB,qBAAqB,EAErB,cAAc,EACd,cAAc,EACf,MAAM,UAAU,CAAA;AAKjB,aAAK,aAAa,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE5D,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IAEjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;gBAEnB,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,OAAe;IA8BrC,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC;IAO7B,MAAM,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAOnC,QAAQ,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAOrC,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAyBzD,UAAU,CACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,qBAAqB,CAAC;IAWpB,MAAM,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAW7D,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;IAyBrD,aAAa,CACxB,WAAW,EAAE,wBAAwB,GACpC,OAAO,CAAC,IAAI,CAAC;IAUH,OAAO,CAClB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,qBAAqB,CAAC;IAWpB,eAAe,CAC1B,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,cAAc,CAAC;CAO3B"}
@@ -1,8 +1,8 @@
1
- import { Signer } from 'ethers';
2
- import { RangoClient } from './client';
3
- import { EvmTransaction } from '../types/api/txs';
4
- import { StatusResponse, SwapResponse } from '../types/api/transactions';
5
- export declare function prepareEvmTransaction(evmTx: EvmTransaction, isApprove: boolean): {};
6
- export declare const checkTransactionStatusSync: (requestId: string, txId: string, rangoClient: RangoClient) => Promise<StatusResponse>;
7
- export declare const executeEvmRoute: (client: RangoClient, signer: Signer, route: SwapResponse) => Promise<StatusResponse>;
1
+ import { Signer } from 'ethers';
2
+ import { RangoClient } from './client';
3
+ import { EvmTransaction } from '../types/api/txs';
4
+ import { StatusResponse, SwapResponse } from '../types/api/transactions';
5
+ export declare function prepareEvmTransaction(evmTx: EvmTransaction, isApprove: boolean): {};
6
+ export declare const checkTransactionStatusSync: (requestId: string, txId: string, rangoClient: RangoClient) => Promise<StatusResponse>;
7
+ export declare const executeEvmRoute: (client: RangoClient, signer: Signer, route: SwapResponse) => Promise<StatusResponse>;
8
8
  //# sourceMappingURL=executor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/services/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EACL,cAAc,EACd,YAAY,EAGb,MAAM,2BAA2B,CAAA;AAGlC,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,OAAO,MA0BnB;AAkBD,eAAO,MAAM,0BAA0B,cAC1B,MAAM,QACX,MAAM,eACC,WAAW,4BAwBzB,CAAA;AAED,eAAO,MAAM,eAAe,WAClB,WAAW,UACX,MAAM,SACP,YAAY,KAClB,QAAQ,cAAc,CAoCxB,CAAA"}
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/services/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EACL,cAAc,EACd,YAAY,EAGb,MAAM,2BAA2B,CAAA;AAGlC,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,OAAO,MA0BnB;AAkBD,eAAO,MAAM,0BAA0B,cAC1B,MAAM,QACX,MAAM,eACC,WAAW,4BAwBzB,CAAA;AAED,eAAO,MAAM,eAAe,WAClB,WAAW,UACX,MAAM,SACP,YAAY,KAClB,OAAO,CAAC,cAAc,CAoCxB,CAAA"}
@@ -1,2 +1,2 @@
1
- export declare const httpService: import("axios").AxiosInstance;
1
+ export declare const httpService: import("axios").AxiosInstance;
2
2
  //# sourceMappingURL=httpService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"httpService.d.ts","sourceRoot":"","sources":["../../src/services/httpService.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,+BAEtB,CAAA"}
1
+ {"version":3,"file":"httpService.d.ts","sourceRoot":"","sources":["../src/services/httpService.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,+BAEtB,CAAA"}
@@ -1,2 +1,2 @@
1
- export { RangoClient } from './client';
1
+ export { RangoClient } from './client';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA"}
@@ -1,39 +1,2 @@
1
- import type { Asset, Amount } from './common';
2
- /**
3
- * Pair of the asset and its amount in wallet balance
4
- *
5
- * @property {Amount} amount
6
- * @property {Asset} asset
7
- *
8
- */
9
- export type AssetAndAmount = {
10
- amount: Amount;
11
- asset: Asset;
12
- };
13
- /**
14
- * Balance of a specific address inside a specific blockchain
15
- *
16
- * @property {boolean} failed - If true, Rango was not able to fetch balance of this wallet, maybe try again later
17
- * @property {string} blockChain - Wallet blockchain
18
- * @property {string} address - Wallet address
19
- * @property {AssetAndAmount[] | null} balances - Examples: BSC, TERRA, OSMOSIS, ...
20
- * @property {string} explorerUrl - The explorer url of the wallet, example: https://bscscan.com/address/0x7a3....fdsza
21
- *
22
- */
23
- export type WalletDetail = {
24
- failed: boolean;
25
- blockChain: string;
26
- address: string;
27
- balances: AssetAndAmount[] | null;
28
- explorerUrl: string;
29
- };
30
- /**
31
- * Response of checking wallet balance
32
- *
33
- * @property {WalletDetail[]} wallets - list of wallet assets
34
- *
35
- */
36
- export type WalletDetailsResponse = {
37
- wallets: WalletDetail[];
38
- };
1
+ export * from 'rango-types/lib/api/basic/balance';
39
2
  //# sourceMappingURL=balance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../../src/types/api/balance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAE7C;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,KAAK,CAAA;CACb,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAAA;IACjC,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB,CAAA"}
1
+ {"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../src/types/api/balance.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAA"}
@@ -1,129 +1,4 @@
1
- import { SwapperMetaDto, Token } from './meta';
2
- /**
3
- * An asset which is unique by (blockchain, symbol, address)
4
- *
5
- * @property {string} blockchain - The blockchain which this token belongs to
6
- * @property {string | null} address - Smart contract address of token, null for native tokens
7
- * @property {string} symbol - The display token symbol, e.g. USDT, BTC, ...
8
- *
9
- */
10
- export type Asset = {
11
- blockchain: string;
12
- address: string | null;
13
- symbol: string;
14
- };
15
- export declare function assetToString(asset: Asset): string;
16
- /**
17
- * The amount of an asset, including value & decimals.
18
- * The value is machine-readable, to make it human-readable it should be shifted by decimals.
19
- *
20
- * @property {string} amount - The machine-readable amount shifted by decimals, example: 1000000000000000000
21
- * @property {number} decimals - The decimals of the token in blockchain, example: 18
22
- *
23
- */
24
- export type Amount = {
25
- amount: string;
26
- decimals: number;
27
- };
28
- /**
29
- * A fee unit, including the type of asset and the amount of fee
30
- *
31
- * @property {string} name - A display name for this fee, example: Network Fee
32
- * @property {Token} token - Underlying token for paying fee, example: BNB for BSC blockchain
33
- * @property {string} expenseType - Type of the fee, example: FROM_SOURCE_WALLET
34
- * @property {string} amount - The human readable amount of fee, example: 0.004
35
- *
36
- */
37
- export type SwapFee = {
38
- name: string;
39
- token: Token;
40
- expenseType: 'FROM_SOURCE_WALLET' | 'DECREASE_FROM_OUTPUT' | 'FROM_DESTINATION_WALLET';
41
- amount: string;
42
- };
43
- /**
44
- * Type of the swapper
45
- *
46
- */
47
- export type SwapperType = 'BRIDGE' | 'DEX' | 'AGGREGATOR';
48
- /**
49
- * A quote path from asset x (from) to asset y (to)
50
- *
51
- * @property {Token} from - The source asset
52
- * @property {Token} to - The destination asset
53
- * @property {SwapperMetaDto} swapper - Swapper for this path
54
- * @property {SwapperType} swapperType - Type of swapper
55
- * @property {string} expectedOutput - Expected output
56
- * @property {number} estimatedTimeInSeconds - Expected duration
57
- *
58
- */
59
- export type QuotePath = {
60
- from: Token;
61
- to: Token;
62
- swapper: SwapperMetaDto;
63
- swapperType: SwapperType;
64
- expectedOutput: string;
65
- estimatedTimeInSeconds: number;
66
- };
67
- /**
68
- * Limitations on input amount for requested route
69
- *
70
- * @property {string | null} min - Limitation on minimum input amount for this route
71
- * @property {string | null} max - Limitation on maximum input amount for this route
72
- * @property {'INCLUSIVE' | 'EXCLUSIVE'} type - type of limitation
73
- *
74
- */
75
- export type AmountRestriction = {
76
- min: string | null;
77
- max: string | null;
78
- type: 'INCLUSIVE' | 'EXCLUSIVE';
79
- };
80
- /**
81
- * A step of a multi-step swap route
82
- *
83
- * @property {Token} from - Source token
84
- * @property {Token} to - Destination token
85
- * @property {string} outputAmount - The estimation of Rango from output amount for Y
86
- * @property {string} outputAmountMin - The estimation of Rango from output amount for Y
87
- * @property {number | null} outputAmountUsd - The estimation of Rango from output usd value for Y
88
- * @property {SwapperMetaDto} swapper - Swapper suggested for this path
89
- * @property {QuotePath[] | null} path - The internal routing of this step showing how the initial swap request will
90
- * be split and executed. This can be used for previewing purpose to give the user a sense of what's going to happen.
91
- * Null indicates that there is no internal mechanism and swapping is simple and straight-forward.
92
- * @property {SwapFee[]} fee - List of fees that are taken from user in this step
93
- * @property {number | null} feeUsd - Amount of fee in usd
94
- * @property {AmountRestriction | null} amountRestriction - restrictions on input amount. This field is informational
95
- * and there is no need to apply it in client-side
96
- * @property {number} estimatedTimeInSeconds - The estimated time (in seconds) that this step might take, beware that
97
- * this number is just an estimation and should be used only for user preview, example: 15
98
- *
99
- */
100
- export type QuoteSimulationResult = {
101
- from: Token;
102
- to: Token;
103
- outputAmount: string;
104
- outputAmountMin: string;
105
- outputAmountUsd: number | null;
106
- swapper: SwapperMetaDto;
107
- path: QuotePath[] | null;
108
- fee: SwapFee[];
109
- feeUsd: number | null;
110
- amountRestriction: AmountRestriction | null;
111
- estimatedTimeInSeconds: number;
112
- };
113
- /**
114
- * An asset with its ticker
115
- *
116
- * @property {string} blockchain - Blockchain of asset
117
- * @property {string | null} address - Contract address of the asset, null for native tokens
118
- * @property {string} symbol - Symbol of an asset, example: BUSD
119
- * @property {string} ticker - The ticker of the asset which normally is a combination of symbol and address,
120
- * required by some javascript wallets
121
- *
122
- */
123
- export type AssetWithTicker = {
124
- blockchain: string;
125
- address: string | null;
126
- symbol: string;
127
- ticker: string;
128
- };
1
+ import { Asset } from 'rango-types/lib/api/basic';
2
+ export * from 'rango-types/lib/api/basic/common';
3
+ export declare function assetToString(asset: Asset): string;
129
4
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/api/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE9C;;;;;;;GAOG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAIlD;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,KAAK,CAAA;IACZ,WAAW,EACP,oBAAoB,GACpB,sBAAsB,GACtB,yBAAyB,CAAA;IAC7B,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,KAAK,GAAG,YAAY,CAAA;AAEzD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,KAAK,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,OAAO,EAAE,cAAc,CAAA;IACvB,WAAW,EAAE,WAAW,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;IACtB,sBAAsB,EAAE,MAAM,CAAA;CAC/B,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,IAAI,EAAE,WAAW,GAAG,WAAW,CAAA;CAChC,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,KAAK,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;IACxB,GAAG,EAAE,OAAO,EAAE,CAAA;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC3C,sBAAsB,EAAE,MAAM,CAAA;CAC/B,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf,CAAA"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/api/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAEhD,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAIlD"}
@@ -1,184 +1,2 @@
1
- import type { Asset, SwapperType } from './common';
2
- import { TransactionType } from './transactions';
3
- /**
4
- * EVM Chain Info
5
- *
6
- * @property {string} chainName - Chain name, e.g. Polygon Mainnet
7
- * @property {name: string, symbol: string, decimals: null} nativeCurrency
8
- * @property {string[]} rpcUrls - e.g. "https://polygon-rpc.com"
9
- * @property {string[]} blockExplorerUrls - e.g. "https://polygonscan.com"
10
- * @property {string} addressUrl - Explorer address base url for this blockchain,
11
- * e.g. "https://bscscan.com/address/{wallet}"
12
- * @property {string} transactionUrl - Explorer transaction base url for this blockchain,
13
- * e.g. "https://bscscan.com/tx/{txHash}"
14
- *
15
- */
16
- export type EVMChainInfo = {
17
- chainName: string;
18
- nativeCurrency: {
19
- name: string;
20
- symbol: string;
21
- decimals: number;
22
- };
23
- rpcUrls: string[];
24
- blockExplorerUrls: string[];
25
- addressUrl: string;
26
- transactionUrl: string;
27
- };
28
- /**
29
- * Cosmos Chain Info - Used for adding experimental chains to keplr if needed
30
- *
31
- * @see https://github.com/osmosis-labs/osmosis-frontend/blob/0b88e39740cb087be576f464bfcd6cc2971ed2fd/packages/web/config/chain-infos.ts
32
- *
33
- */
34
- export type CosmosChainInfo = {
35
- experimental: boolean;
36
- rpc: string;
37
- rest: string;
38
- cosmostationLcdUrl: string | null;
39
- cosmostationApiUrl: string | null;
40
- cosmostationDenomTracePath: string;
41
- mintScanName: string | null;
42
- chainName: string;
43
- stakeCurrency: {
44
- coinDenom: string;
45
- coinMinimalDenom: string;
46
- coinDecimals: number;
47
- coinGeckoId: string;
48
- coinImageUrl: string;
49
- };
50
- bip44: {
51
- coinType: number;
52
- };
53
- bech32Config: {
54
- bech32PrefixAccAddr: string;
55
- bech32PrefixAccPub: string;
56
- bech32PrefixValAddr: string;
57
- bech32PrefixValPub: string;
58
- bech32PrefixConsAddr: string;
59
- bech32PrefixConsPub: string;
60
- };
61
- currencies: {
62
- coinDenom: string;
63
- coinMinimalDenom: string;
64
- coinDecimals: number;
65
- coinGeckoId: string;
66
- coinImageUrl: string;
67
- }[];
68
- feeCurrencies: {
69
- coinDenom: string;
70
- coinMinimalDenom: string;
71
- coinDecimals: number;
72
- coinGeckoId: string;
73
- coinImageUrl: string;
74
- }[];
75
- features: string[];
76
- explorerUrlToTx: string;
77
- gasPriceStep: {
78
- low: number;
79
- average: number;
80
- high: number;
81
- } | null;
82
- };
83
- /**
84
- * Blockchain Meta Information
85
- *
86
- * @property {string} name - Unique name of blockchain, this field is used in all endpoints as the identifier
87
- * @property {number} defaultDecimals - The default decimals of blockchain, do not use it in computations, use Token.decimals instead
88
- * @property {Asset[]} feeAssets - List of assets that can be used as fee in this blockchain
89
- * @property {string[]} addressPatterns - List of all regex patterns for wallet addresses of this blockchain, can be
90
- * used for input validation, example: [ "^(0x)[0-9A-Fa-f]{40}$" ]
91
- * @property {string} logo - Logo of the blockchain
92
- * @property {string} displayName - Display name for the blockchain
93
- * @property {string} shortName - Short name for the blockchain
94
- * @property {string} color - Suggested color for the blockchain
95
- * @property {boolean} enabled - Is blockchain enabled or not in Rango
96
- * @property {TransactionType} type - Type of the blockchain
97
- * @property {string | null} chainId - e.g. "0xa86a" for Avax, "osmosis-1" for Osmosis, etc.
98
- * @property {EVMChainInfo | CosmosChainInfo | null} info - Chain specific information
99
- *
100
- */
101
- export type BlockchainMetaBase = {
102
- name: string;
103
- shortName: string;
104
- displayName: string;
105
- defaultDecimals: number;
106
- feeAssets: Asset[];
107
- addressPatterns: string[];
108
- logo: string;
109
- color: string;
110
- enabled: boolean;
111
- type: TransactionType;
112
- chainId: string | null;
113
- info: EVMChainInfo | CosmosChainInfo | null;
114
- };
115
- export interface EvmBlockchainMeta extends BlockchainMetaBase {
116
- type: TransactionType.EVM;
117
- chainId: string;
118
- info: EVMChainInfo;
119
- }
120
- export interface CosmosBlockchainMeta extends BlockchainMetaBase {
121
- type: TransactionType.COSMOS;
122
- chainId: string;
123
- info: CosmosChainInfo;
124
- }
125
- export interface TransferBlockchainMeta extends BlockchainMetaBase {
126
- type: TransactionType.TRANSFER;
127
- chainId: null;
128
- info: null;
129
- }
130
- export type BlockchainMeta = EvmBlockchainMeta | CosmosBlockchainMeta | TransferBlockchainMeta;
131
- /**
132
- * Metadata of Swapper
133
- *
134
- * @property {string} id - Unique identifier for the swapper
135
- * @property {string} title - Display name for the swapper
136
- * @property {string} logo - Icon logo for the swapper
137
- * @property {string} swapperGroup - Group name for swapper
138
- * @property {SwapperType[]} types - Type of the transaction supported by the swapper
139
- *
140
- */
141
- export type SwapperMetaDto = {
142
- id: string;
143
- title: string;
144
- logo: string;
145
- swapperGroup: string;
146
- types: SwapperType[];
147
- };
148
- /**
149
- * All metadata info for a token, unique by (blockchain, symbol, address) tuple
150
- *
151
- * @property {string} blockchain - The blockchain which this token belongs to
152
- * @property {string | null} chainId - The chainId which this token belongs to, e.g. 1 for ETH, 56 for BSC and ...
153
- * @property {string | null} address - Smart contract address of token, null for native tokens
154
- * @property {string} symbol - The token symbol, e.g: ADA
155
- * @property {string} name - The token name, e.g: Binance Pegged ETH
156
- * @property {number} decimals - Decimals of token in blockchain, example: 18
157
- * @property {string} image - Url of its image, example: https://api.rango.exchange/tokens/ETH/ETH.png
158
- * @property {string | decimals} usdPrice - The token unit price
159
- *
160
- */
161
- export type Token = {
162
- blockchain: string;
163
- chainId: string | null;
164
- address: string | null;
165
- symbol: string;
166
- name: string;
167
- decimals: number;
168
- image: string;
169
- usdPrice: string | null;
170
- };
171
- /**
172
- * Metadata info for all blockchains and tokens supported
173
- *
174
- * @property {BlockchainMeta[]} blockchains - List of all supported blockchains
175
- * @property {Token[]} tokens - List of all tokens
176
- * @property {SwapperMetaDto[]} swappers - List of all DEXes & Bridges
177
- *
178
- */
179
- export type MetaResponse = {
180
- blockchains: BlockchainMeta[];
181
- tokens: Token[];
182
- swappers: SwapperMetaDto[];
183
- };
1
+ export * from 'rango-types/lib/api/basic/meta';
184
2
  //# sourceMappingURL=meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/types/api/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,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AC9D,IAAI,EAAE,eAAe,CAAC,MAAM,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,eAAe,CAAA;CACtB;AACD,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAA;IAC9B,OAAO,EAAE,IAAI,CAAA;IACb,IAAI,EAAE,IAAI,CAAA;CACX;AAED,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,oBAAoB,GACpB,sBAAsB,CAAA;AAE1B;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,WAAW,EAAE,CAAA;CACrB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,cAAc,EAAE,CAAA;IAC7B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,QAAQ,EAAE,cAAc,EAAE,CAAA;CAC3B,CAAA"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/types/api/meta.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAA"}
@@ -1,44 +1,2 @@
1
- import type { Asset, QuoteSimulationResult } from './common';
2
- /**
3
- * Body of quote request
4
- *
5
- * @property {Asset} from - The source asset
6
- * @property {Asset} to - The destination asset
7
- * @property {string} amount - The human-readable amount of asset X that is going to be swapped, example: 0.28
8
- * @property {string[]} [swappers] - List of all accepted swappers, an empty list means no filter is required
9
- * @property {string[]} [messagingProtocols] - List of all messaging protocols, an empty list means no filter is required
10
- * @property {string} [sourceContract] - Address of your contract on source chain (will be called in case of refund in the source chain)
11
- * @property {string} [destinationContract] - Address of your contract on destination chain (will be called in case of success/refund in the destination chain)
12
- * @property {string} [imMessage] - The message that you want to pass to your contract on the destination chain
13
- * @property {boolean} contractCall - Mark it true if you are going to call this quote via your own contract, so we
14
- * will filter routes that are not possible to be called from a contract
15
- *
16
- */
17
- export type QuoteRequest = {
18
- from: Asset;
19
- to: Asset;
20
- amount: string;
21
- swappers?: string[];
22
- messagingProtocols?: string[];
23
- sourceContract?: string;
24
- destinationContract?: string;
25
- imMessage?: string;
26
- contractCall?: boolean;
27
- };
28
- /**
29
- * The response of quote API, if the route field is null, it means that no route is found
30
- *
31
- * @property {string} requestId - The unique requestId which is generated for this request by the server. It should be
32
- * passed down to all other endpoints if this swap continues on. e.g. d10657ce-b13a-405c-825b-b47f8a5016ad
33
- * @property {string} resultType - Type of result for route (OK or error type)
34
- * @property {QuoteSimulationResult | null} route - Suggested route
35
- * @property {string | null} error - Error message
36
- *
37
- */
38
- export type QuoteResponse = {
39
- requestId: string;
40
- resultType: 'OK' | 'HIGH_IMPACT' | 'INPUT_LIMIT_ISSUE' | 'NO_ROUTE';
41
- route: QuoteSimulationResult | null;
42
- error: string | null;
43
- };
1
+ export * from 'rango-types/lib/api/basic/routing';
44
2
  //# sourceMappingURL=routing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../../src/types/api/routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAE5D;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,KAAK,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,IAAI,GAAG,aAAa,GAAG,mBAAmB,GAAG,UAAU,CAAA;IACnE,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAAA;IACnC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA"}
1
+ {"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/types/api/routing.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAA"}