rango-sdk 0.1.4 → 0.1.6

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 (50) hide show
  1. package/lib/rango-sdk.cjs.development.js +36 -22
  2. package/lib/rango-sdk.cjs.development.js.map +1 -1
  3. package/lib/rango-sdk.cjs.production.min.js +1 -1
  4. package/lib/rango-sdk.cjs.production.min.js.map +1 -1
  5. package/lib/rango-sdk.esm.js +36 -22
  6. package/lib/rango-sdk.esm.js.map +1 -1
  7. package/lib/services/client.d.ts +8 -8
  8. package/lib/services/client.d.ts.map +1 -1
  9. package/lib/types/configs.d.ts +5 -0
  10. package/lib/types/configs.d.ts.map +1 -0
  11. package/lib/types/index.d.ts +1 -0
  12. package/lib/types/index.d.ts.map +1 -1
  13. package/package.json +2 -2
  14. package/lib/dist/index.d.ts +0 -3
  15. package/lib/dist/index.d.ts.map +0 -1
  16. package/lib/dist/index.js +0 -8
  17. package/lib/dist/rango-sdk.cjs.development.js +0 -672
  18. package/lib/dist/rango-sdk.cjs.development.js.map +0 -1
  19. package/lib/dist/rango-sdk.cjs.production.min.js +0 -2
  20. package/lib/dist/rango-sdk.cjs.production.min.js.map +0 -1
  21. package/lib/dist/rango-sdk.esm.js +0 -659
  22. package/lib/dist/rango-sdk.esm.js.map +0 -1
  23. package/lib/dist/services/client.d.ts +0 -19
  24. package/lib/dist/services/client.d.ts.map +0 -1
  25. package/lib/dist/services/httpService.d.ts +0 -2
  26. package/lib/dist/services/httpService.d.ts.map +0 -1
  27. package/lib/dist/services/index.d.ts +0 -2
  28. package/lib/dist/services/index.d.ts.map +0 -1
  29. package/lib/dist/types/api/balance.d.ts +0 -2
  30. package/lib/dist/types/api/balance.d.ts.map +0 -1
  31. package/lib/dist/types/api/common.d.ts +0 -2
  32. package/lib/dist/types/api/common.d.ts.map +0 -1
  33. package/lib/dist/types/api/meta.d.ts +0 -3
  34. package/lib/dist/types/api/meta.d.ts.map +0 -1
  35. package/lib/dist/types/api/routing.d.ts +0 -2
  36. package/lib/dist/types/api/routing.d.ts.map +0 -1
  37. package/lib/dist/types/api/transactions.d.ts +0 -2
  38. package/lib/dist/types/api/transactions.d.ts.map +0 -1
  39. package/lib/dist/types/api/txs/cosmos.d.ts +0 -2
  40. package/lib/dist/types/api/txs/cosmos.d.ts.map +0 -1
  41. package/lib/dist/types/api/txs/evm.d.ts +0 -2
  42. package/lib/dist/types/api/txs/evm.d.ts.map +0 -1
  43. package/lib/dist/types/api/txs/index.d.ts +0 -5
  44. package/lib/dist/types/api/txs/index.d.ts.map +0 -1
  45. package/lib/dist/types/api/txs/solana.d.ts +0 -2
  46. package/lib/dist/types/api/txs/solana.d.ts.map +0 -1
  47. package/lib/dist/types/api/txs/transfer.d.ts +0 -2
  48. package/lib/dist/types/api/txs/transfer.d.ts.map +0 -1
  49. package/lib/dist/types/index.d.ts +0 -7
  50. package/lib/dist/types/index.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"rango-sdk.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/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"],"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\nexport const httpService = axios.create({\n baseURL: 'https://api.rango.exchange',\n})\n","import { v4 } from 'uuid'\n\nimport { httpService } from './httpService'\nimport {\n MetaResponse,\n BestRouteRequest,\n BestRouteResponse,\n CheckApprovalResponse,\n CheckTxStatusRequest,\n TransactionStatusResponse,\n CreateTransactionRequest,\n CreateTransactionResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n} from '../types'\n\ntype WalletAddresses = { blockchain: string; address: string }[]\n\nexport class RangoClient {\n private readonly deviceId: string\n\n private readonly apiKey: string\n\n constructor(apiKey: string) {\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 }\n\n public async getAllMetadata(): Promise<MetaResponse> {\n const axiosResponse = await httpService.get<MetaResponse>(\n `/meta?apiKey=${this.apiKey}`\n )\n return axiosResponse.data\n }\n\n public async getBestRoute(\n requestBody: BestRouteRequest\n ): Promise<BestRouteResponse> {\n const axiosResponse = await httpService.post<BestRouteResponse>(\n `/routing/best?apiKey=${this.apiKey}`,\n requestBody,\n { headers: { 'X-Rango-Id': this.deviceId } }\n )\n return axiosResponse.data\n }\n\n public async checkApproval(\n requestId: string\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await httpService.get<CheckApprovalResponse>(\n `/tx/${requestId}/check-approval?apiKey=${this.apiKey}`\n )\n return axiosResponse.data\n }\n\n public async checkStatus(\n requestBody: CheckTxStatusRequest\n ): Promise<TransactionStatusResponse> {\n const axiosResponse = await httpService.post<TransactionStatusResponse>(\n `/tx/check-status?apiKey=${this.apiKey}`,\n requestBody\n )\n return axiosResponse.data\n }\n\n public async createTransaction(\n requestBody: CreateTransactionRequest\n ): Promise<CreateTransactionResponse> {\n const axiosResponse = await httpService.post<CreateTransactionResponse>(\n `/tx/create?apiKey=${this.apiKey}`,\n requestBody\n )\n return axiosResponse.data\n }\n\n public async reportFailure(\n requestBody: ReportTransactionRequest\n ): Promise<void> {\n await httpService.post(`/tx/report-tx?apiKey=${this.apiKey}`, requestBody)\n }\n\n public async getWalletsDetails(\n walletAddresses: WalletAddresses\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 httpService.get<WalletDetailsResponse>(\n `/wallets/details?apiKey=${this.apiKey}${walletAddressesQueryParams}`\n )\n return axiosResponse.data\n }\n}\n",null,null,null],"names":["getRandomValues","rnds8","Uint8Array","rng","crypto","bind","Error","byteToHex","i","push","toString","slice","unsafeStringify","arr","offset","toLowerCase","randomUUID","v4","options","buf","native","rnds","random","httpService","axios","create","baseURL","RangoClient","apiKey","window","deviceId","localStorage","getItem","generatedId","setItem","e","getAllMetadata","get","axiosResponse","data","getBestRoute","requestBody","post","headers","checkApproval","requestId","checkStatus","createTransaction","reportFailure","getWalletsDetails","walletAddresses","walletAddressesQueryParams","length","walletAddress","blockchain","address","blockchainMeta"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A;;IAAA;;EAAA,OAEYS,aAAa;IAAA,6FAAnB,kBACLP,WAAqC;MAAA;QAAA;UAAA;YAAA;YAAA,OAE/BlB,WAAW,CAACmB,IAAI,2BAAyB,IAAI,CAACd,MAAM,EAAIa,WAAW,CAAC;UAAA;UAAA;YAAA;;;KAC3E;IAAA;MAAA;;IAAA;;EAAA,OAEYQ,iBAAiB;IAAA,iGAAvB,kBACLC,eAAgC;MAAA;MAAA;QAAA;UAAA;YAE5BC,0BAA0B,GAAG,EAAE;YACnC,KAAS3C,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG0C,eAAe,CAACE,MAAM,EAAE5C,CAAC,EAAE,EAAE;cACzC6C,aAAa,GAAGH,eAAe,CAAC1C,CAAC,CAAC;cACxC2C,0BAA0B,kBAAgBE,aAAa,CAACC,UAAU,SAAID,aAAa,CAACE,OAAS;;YAC9F;YAAA,OAC2BhC,WAAW,CAACc,GAAG,8BACd,IAAI,CAACT,MAAM,GAAGuB,0BAA0B,CACpE;UAAA;YAFKb,aAAa;YAAA,kCAGZA,aAAa,CAACC,IAAI;UAAA;UAAA;YAAA;;;KAC1B;IAAA;MAAA;;IAAA;;EAAA;AAAA;;mBCxE2B,2BAAA;;;qDAIUiB;;;AAGtC;;;AAKF;;;yDAI0CA;;;;;;;;;;;;;;;;;;;;;;;;;ACpD1C;;;;AAIA;AAAA;gCAAY;;;;;;ACJZ;;;AAGA;AAAA;;;;;;;;AASA;;;;AAIA;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"rango-sdk.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/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"],"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\nexport const httpService = axios.create({\n baseURL: 'https://api.rango.exchange',\n})\n","import { v4 } from 'uuid'\n\nimport { httpService } from './httpService'\nimport {\n MetaResponse,\n BestRouteRequest,\n BestRouteResponse,\n CheckApprovalResponse,\n CheckTxStatusRequest,\n TransactionStatusResponse,\n CreateTransactionRequest,\n CreateTransactionResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n RequestOptions,\n} from '../types'\n\ntype WalletAddresses = { blockchain: string; address: string }[]\n\nexport class RangoClient {\n private readonly deviceId: string\n\n private readonly apiKey: string\n\n constructor(apiKey: string) {\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 }\n\n public async getAllMetadata(options?: RequestOptions): Promise<MetaResponse> {\n const axiosResponse = await httpService.get<MetaResponse>(\n `/meta?apiKey=${this.apiKey}`,\n { ...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 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 checkApproval(\n requestId: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await httpService.get<CheckApprovalResponse>(\n `/tx/${requestId}/check-approval?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async checkStatus(\n requestBody: CheckTxStatusRequest,\n options?: RequestOptions\n ): Promise<TransactionStatusResponse> {\n const axiosResponse = await 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 = await 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 httpService.post(`/tx/report-tx?apiKey=${this.apiKey}`, requestBody, {\n ...options,\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 httpService.get<WalletDetailsResponse>(\n `/wallets/details?apiKey=${this.apiKey}${walletAddressesQueryParams}`,\n { ...options }\n )\n return axiosResponse.data\n }\n}\n",null,null,null],"names":["getRandomValues","rnds8","Uint8Array","rng","crypto","bind","Error","byteToHex","i","push","toString","slice","unsafeStringify","arr","offset","toLowerCase","randomUUID","v4","options","buf","native","rnds","random","httpService","axios","create","baseURL","RangoClient","apiKey","window","deviceId","localStorage","getItem","generatedId","setItem","e","getAllMetadata","get","axiosResponse","data","getBestRoute","requestBody","post","headers","checkApproval","requestId","checkStatus","createTransaction","reportFailure","getWalletsDetails","walletAddresses","walletAddressesQueryParams","length","walletAddress","blockchain","address","blockchainMeta"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA,IAAIA,eAAe;AACnB,IAAMC,KAAK,gBAAG,IAAIC,UAAU,CAAC,EAAE,CAAC;AACjB,SAASC,GAAG,GAAG;;EAE5B,IAAI,CAACH,eAAe,EAAE;;IAEpBA,eAAe,GAAG,OAAOI,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACJ,eAAe,IAAII,MAAM,CAACJ,eAAe,CAACK,IAAI,CAACD,MAAM,CAAC;IAEhH,IAAI,CAACJ,eAAe,EAAE;MACpB,MAAM,IAAIM,KAAK,CAAC,0GAA0G,CAAC;;;EAI/H,OAAON,eAAe,CAACC,KAAK,CAAC;AAC/B;;AChBA;AACA;AACA;AACA;;AAEA,IAAMM,SAAS,GAAG,EAAE;AAEpB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG,GAAG,EAAE,EAAEA,CAAC,EAAE;EAC5BD,SAAS,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AC2BhC,WAAW,CAACc,GAAG,8BACd,IAAI,CAACT,MAAM,GAAGuB,0BAA0B,eAC9DjC,OAAO,EACb;UAAA;YAHKoB,aAAa;YAAA,kCAIZA,aAAa,CAACC,IAAI;UAAA;UAAA;YAAA;;;KAC1B;IAAA;MAAA;;IAAA;;EAAA;AAAA;;mBCtF2B,2BAAA;;;qDAIUiB;;;AAGtC;;;AAKF;;;yDAI0CA;;;;;;;;;;;;;;;;;;;;;;;;;ACpD1C;;;;AAIA;AAAA;gCAAY;;;;;;ACJZ;;;AAGA;AAAA;;;;;;;;AASA;;;;AAIA;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { MetaResponse, BestRouteRequest, BestRouteResponse, CheckApprovalResponse, CheckTxStatusRequest, TransactionStatusResponse, CreateTransactionRequest, CreateTransactionResponse, ReportTransactionRequest, WalletDetailsResponse } from '../types';
1
+ import { MetaResponse, BestRouteRequest, BestRouteResponse, CheckApprovalResponse, CheckTxStatusRequest, TransactionStatusResponse, CreateTransactionRequest, CreateTransactionResponse, ReportTransactionRequest, WalletDetailsResponse, RequestOptions } from '../types';
2
2
  declare type WalletAddresses = {
3
3
  blockchain: string;
4
4
  address: string;
@@ -7,13 +7,13 @@ export declare class RangoClient {
7
7
  private readonly deviceId;
8
8
  private readonly apiKey;
9
9
  constructor(apiKey: string);
10
- getAllMetadata(): Promise<MetaResponse>;
11
- getBestRoute(requestBody: BestRouteRequest): Promise<BestRouteResponse>;
12
- checkApproval(requestId: string): Promise<CheckApprovalResponse>;
13
- checkStatus(requestBody: CheckTxStatusRequest): Promise<TransactionStatusResponse>;
14
- createTransaction(requestBody: CreateTransactionRequest): Promise<CreateTransactionResponse>;
15
- reportFailure(requestBody: ReportTransactionRequest): Promise<void>;
16
- getWalletsDetails(walletAddresses: WalletAddresses): Promise<WalletDetailsResponse>;
10
+ getAllMetadata(options?: RequestOptions): Promise<MetaResponse>;
11
+ getBestRoute(requestBody: BestRouteRequest, options?: RequestOptions): Promise<BestRouteResponse>;
12
+ checkApproval(requestId: string, options?: RequestOptions): Promise<CheckApprovalResponse>;
13
+ checkStatus(requestBody: CheckTxStatusRequest, options?: RequestOptions): Promise<TransactionStatusResponse>;
14
+ createTransaction(requestBody: CreateTransactionRequest, options?: RequestOptions): Promise<CreateTransactionResponse>;
15
+ reportFailure(requestBody: ReportTransactionRequest, options?: RequestOptions): Promise<void>;
16
+ getWalletsDetails(walletAddresses: WalletAddresses, options?: RequestOptions): Promise<WalletDetailsResponse>;
17
17
  }
18
18
  export {};
19
19
  //# 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,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,UAAU,CAAA;AAEjB,aAAK,eAAe,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAAA;AAEhE,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IAEjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;gBAEnB,MAAM,EAAE,MAAM;IAoBb,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC;IAOvC,YAAY,CACvB,WAAW,EAAE,gBAAgB,GAC5B,OAAO,CAAC,iBAAiB,CAAC;IAShB,aAAa,CACxB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC;IAOpB,WAAW,CACtB,WAAW,EAAE,oBAAoB,GAChC,OAAO,CAAC,yBAAyB,CAAC;IAQxB,iBAAiB,CAC5B,WAAW,EAAE,wBAAwB,GACpC,OAAO,CAAC,yBAAyB,CAAC;IAQxB,aAAa,CACxB,WAAW,EAAE,wBAAwB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,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,qBAAqB,CAAC;CAYlC"}
@@ -0,0 +1,5 @@
1
+ import { GenericAbortSignal } from 'axios';
2
+ export interface RequestOptions {
3
+ signal?: GenericAbortSignal;
4
+ }
5
+ //# sourceMappingURL=configs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../src/types/configs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAE1C,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,kBAAkB,CAAA;CAC5B"}
@@ -4,4 +4,5 @@ export * from './api/meta';
4
4
  export * from './api/routing';
5
5
  export * from './api/transactions';
6
6
  export * from './api/txs';
7
+ export * from './configs';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rango-sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Rango Exchange SDK for dApps",
5
5
  "module": "lib/rango-sdk.esm.js",
6
6
  "main": "lib/index.js",
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "axios": "^1.2.6",
44
44
  "bignumber.js": "^9.1.1",
45
- "rango-types": "^0.1.7",
45
+ "rango-types": "^0.1.8",
46
46
  "uuid": "^9.0.0"
47
47
  },
48
48
  "publishConfig": {
@@ -1,3 +0,0 @@
1
- export { RangoClient } from './services';
2
- export * from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,cAAc,SAAS,CAAA"}
package/lib/dist/index.js DELETED
@@ -1,8 +0,0 @@
1
-
2
- 'use strict'
3
-
4
- if (process.env.NODE_ENV === 'production') {
5
- module.exports = require('./rango-sdk.cjs.production.min.js')
6
- } else {
7
- module.exports = require('./rango-sdk.cjs.development.js')
8
- }