rango-sdk 0.1.13 → 0.1.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.
@@ -353,12 +353,9 @@ function _extends() {
353
353
  return _extends.apply(this, arguments);
354
354
  }
355
355
 
356
- var httpService = /*#__PURE__*/axios.create({
357
- baseURL: 'https://api.rango.exchange'
358
- });
359
-
360
356
  var RangoClient = /*#__PURE__*/function () {
361
- function RangoClient(apiKey) {
357
+ function RangoClient(apiKey, apiUrl) {
358
+ this.apiUrl = apiUrl || 'https://api.rango.exchange';
362
359
  this.apiKey = apiKey;
363
360
  try {
364
361
  if (typeof window !== 'undefined') {
@@ -376,6 +373,9 @@ var RangoClient = /*#__PURE__*/function () {
376
373
  } catch (e) {
377
374
  this.deviceId = uuid();
378
375
  }
376
+ this.httpService = axios.create({
377
+ baseURL: this.apiUrl
378
+ });
379
379
  }
380
380
  var _proto = RangoClient.prototype;
381
381
  _proto.getAllMetadata = /*#__PURE__*/function () {
@@ -385,7 +385,7 @@ var RangoClient = /*#__PURE__*/function () {
385
385
  while (1) switch (_context.prev = _context.next) {
386
386
  case 0:
387
387
  _context.next = 2;
388
- return httpService.get("/meta?apiKey=" + this.apiKey, _extends({}, options));
388
+ return this.httpService.get("/meta?apiKey=" + this.apiKey, _extends({}, options));
389
389
  case 2:
390
390
  axiosResponse = _context.sent;
391
391
  return _context.abrupt("return", axiosResponse.data);
@@ -407,7 +407,7 @@ var RangoClient = /*#__PURE__*/function () {
407
407
  while (1) switch (_context2.prev = _context2.next) {
408
408
  case 0:
409
409
  _context2.next = 2;
410
- return httpService.post("/routing/best?apiKey=" + this.apiKey, requestBody, _extends({
410
+ return this.httpService.post("/routing/best?apiKey=" + this.apiKey, requestBody, _extends({
411
411
  headers: {
412
412
  'X-Rango-Id': this.deviceId
413
413
  }
@@ -433,7 +433,7 @@ var RangoClient = /*#__PURE__*/function () {
433
433
  while (1) switch (_context3.prev = _context3.next) {
434
434
  case 0:
435
435
  _context3.next = 2;
436
- return httpService.get("/tx/" + requestId + "/check-approval?apiKey=" + this.apiKey, _extends({}, options));
436
+ return this.httpService.get("/tx/" + requestId + "/check-approval?apiKey=" + this.apiKey, _extends({}, options));
437
437
  case 2:
438
438
  axiosResponse = _context3.sent;
439
439
  return _context3.abrupt("return", axiosResponse.data);
@@ -455,7 +455,7 @@ var RangoClient = /*#__PURE__*/function () {
455
455
  while (1) switch (_context4.prev = _context4.next) {
456
456
  case 0:
457
457
  _context4.next = 2;
458
- return httpService.post("/tx/check-status?apiKey=" + this.apiKey, requestBody, _extends({}, options));
458
+ return this.httpService.post("/tx/check-status?apiKey=" + this.apiKey, requestBody, _extends({}, options));
459
459
  case 2:
460
460
  axiosResponse = _context4.sent;
461
461
  return _context4.abrupt("return", axiosResponse.data);
@@ -477,7 +477,7 @@ var RangoClient = /*#__PURE__*/function () {
477
477
  while (1) switch (_context5.prev = _context5.next) {
478
478
  case 0:
479
479
  _context5.next = 2;
480
- return httpService.post("/tx/create?apiKey=" + this.apiKey, requestBody, _extends({}, options));
480
+ return this.httpService.post("/tx/create?apiKey=" + this.apiKey, requestBody, _extends({}, options));
481
481
  case 2:
482
482
  axiosResponse = _context5.sent;
483
483
  return _context5.abrupt("return", axiosResponse.data);
@@ -498,7 +498,7 @@ var RangoClient = /*#__PURE__*/function () {
498
498
  while (1) switch (_context6.prev = _context6.next) {
499
499
  case 0:
500
500
  _context6.next = 2;
501
- return httpService.post("/tx/report-tx?apiKey=" + this.apiKey, requestBody, _extends({}, options));
501
+ return this.httpService.post("/tx/report-tx?apiKey=" + this.apiKey, requestBody, _extends({}, options));
502
502
  case 2:
503
503
  case "end":
504
504
  return _context6.stop();
@@ -522,7 +522,7 @@ var RangoClient = /*#__PURE__*/function () {
522
522
  walletAddressesQueryParams += "&address=" + walletAddress.blockchain + "." + walletAddress.address;
523
523
  }
524
524
  _context7.next = 4;
525
- return httpService.get("/wallets/details?apiKey=" + this.apiKey + walletAddressesQueryParams, _extends({}, options));
525
+ return this.httpService.get("/wallets/details?apiKey=" + this.apiKey + walletAddressesQueryParams, _extends({}, options));
526
526
  case 4:
527
527
  axiosResponse = _context7.sent;
528
528
  return _context7.abrupt("return", axiosResponse.data);
@@ -599,18 +599,18 @@ var transferBlockchains = function transferBlockchains(blockchains) {
599
599
  TransactionType["TRON"] = "TRON";
600
600
  TransactionType["STARKNET"] = "STARKNET";
601
601
  })(exports.TransactionType || (exports.TransactionType = {}));
602
- /**
603
- * The type of transaction
604
- * @deprecated use TransactionType instead
605
- */
606
- var GenericTransactionType = exports.TransactionType;
602
+ (function (GenericTransactionType) {
603
+ GenericTransactionType["EVM"] = "EVM";
604
+ GenericTransactionType["TRANSFER"] = "TRANSFER";
605
+ GenericTransactionType["COSMOS"] = "COSMOS";
606
+ GenericTransactionType["SOLANA"] = "SOLANA";
607
+ })(exports.GenericTransactionType || (exports.GenericTransactionType = {}));
607
608
  (function (TransactionStatus) {
608
609
  TransactionStatus["FAILED"] = "failed";
609
610
  TransactionStatus["RUNNING"] = "running";
610
611
  TransactionStatus["SUCCESS"] = "success";
611
612
  })(exports.TransactionStatus || (exports.TransactionStatus = {}));
612
613
 
613
- exports.GenericTransactionType = GenericTransactionType;
614
614
  exports.RangoClient = RangoClient;
615
615
  exports.cosmosBlockchains = cosmosBlockchains;
616
616
  exports.evmBlockchains = evmBlockchains;
@@ -1 +1 @@
1
- {"version":3,"file":"rango-sdk.cjs.development.js","sources":["../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":["import axios from 'axios'\n\nexport const httpService = axios.create({\n baseURL: 'https://api.rango.exchange',\n})\n","import uuid from 'uuid-random'\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 = 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 }\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":["httpService","axios","create","baseURL","RangoClient","apiKey","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","getAllMetadata","options","get","axiosResponse","data","getBestRoute","requestBody","post","headers","checkApproval","requestId","checkStatus","createTransaction","reportFailure","getWalletsDetails","walletAddresses","walletAddressesQueryParams","i","length","walletAddress","blockchain","address","blockchainMeta"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,IAAMA,WAAW,gBAAGC,KAAK,CAACC,MAAM,CAAC;EACtCC,OAAO,EAAE;CACV,CAAC;;ICeWC,WAAW;EAKtB,qBAAYC,MAAc;IACxB,IAAI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AU,SAAID,aAAa,CAACE,OAAS;;YAC9F;YAAA,OAC2BnC,WAAW,CAACgB,GAAG,8BACd,IAAI,CAACX,MAAM,GAAGyB,0BAA0B,eAC9Df,OAAO,EACb;UAAA;YAHKE,aAAa;YAAA,kCAIZA,aAAa,CAACC,IAAI;UAAA;UAAA;YAAA;;;KAC1B;IAAA;MAAA;;IAAA;;EAAA;AAAA;;mBCtF2B,2BAAA;;;qDAIUkB;;;AAGtC;;;AAKF;;;yDAI0CA;;;;;;;;;;;;;;;;;;;;;;;;;ACpD1C;;;;AAIA,AAAA;gCAAY;;;;;;ACJZ;;;AAGA,AAAA;;;;;;;;AASA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;"}
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"],"sourcesContent":["import uuid from 'uuid-random'\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'\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(options?: RequestOptions): Promise<MetaResponse> {\n const axiosResponse = await this.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 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 checkApproval(\n requestId: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.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 =\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",null,null,null],"names":["RangoClient","apiKey","apiUrl","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","getAllMetadata","options","get","axiosResponse","data","getBestRoute","requestBody","post","headers","checkApproval","requestId","checkStatus","createTransaction","reportFailure","getWalletsDetails","walletAddresses","walletAddressesQueryParams","i","length","walletAddress","blockchain","address","blockchainMeta"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkBaA,WAAW;EAMtB,qBAAYC,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,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AACC,IAAI;UAAA;UAAA;YAAA;;;KAC1B;IAAA;MAAA;;IAAA;;EAAA;AAAA;;mBChG2B,2BAAA;;;qDAIUkB;;;AAGtC;;;AAKF;;;yDAI0CA;;;;;;;;;;;;;;;;;;;;;;;;;ACpD1C;;;;AAIA,AAAA;gCAAY;;;;;;ACJZ;;;AAGA,AAAA;;;;;;;;AASA,AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("uuid-random"));function r(){r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=Object.create((e&&e.prototype instanceof l?e:l).prototype),a=new L(n||[]);return o(i,"_invoke",{value:T(t,r,a)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var h={};function l(){}function v(){}function d(){}var y={};s(y,a,(function(){return this}));var g=Object.getPrototypeOf,x=g&&g(g(k([])));x&&x!==e&&n.call(x,a)&&(y=x);var m=d.prototype=l.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var r;o(this,"_invoke",{value:function(o,i){function a(){return new e((function(r,a){!function r(o,i,a,c){var u=p(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}})}function T(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=p(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function k(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:I}}function I(){return{value:void 0,done:!0}}return v.prototype=d,o(m,"constructor",{value:d,configurable:!0}),o(d,"constructor",{value:v,configurable:!0}),v.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),s(b.prototype,c,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),s(m,u,"Generator"),s(m,a,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))}}function i(){return(i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}var a,c,u=t(require("axios")).create({baseURL:"https://api.rango.exchange"}),s=function(){function t(t){this.apiKey=t;try{if("undefined"!=typeof window){var r=localStorage.getItem("deviceId");if(r)this.deviceId=r;else{var n=e();localStorage.setItem("deviceId",n),this.deviceId=n}}else this.deviceId=e()}catch(t){this.deviceId=e()}}var n=t.prototype;return n.getAllMetadata=function(){var t=o(r().mark((function t(e){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.get("/meta?apiKey="+this.apiKey,i({},e));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.getBestRoute=function(){var t=o(r().mark((function t(e,n){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.post("/routing/best?apiKey="+this.apiKey,e,i({headers:{"X-Rango-Id":this.deviceId}},n));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.checkApproval=function(){var t=o(r().mark((function t(e,n){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.get("/tx/"+e+"/check-approval?apiKey="+this.apiKey,i({},n));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.checkStatus=function(){var t=o(r().mark((function t(e,n){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.post("/tx/check-status?apiKey="+this.apiKey,e,i({},n));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.createTransaction=function(){var t=o(r().mark((function t(e,n){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.post("/tx/create?apiKey="+this.apiKey,e,i({},n));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.reportFailure=function(){var t=o(r().mark((function t(e,n){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.post("/tx/report-tx?apiKey="+this.apiKey,e,i({},n));case 2:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),n.getWalletsDetails=function(){var t=o(r().mark((function t(e,n){var o,a,c;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o="",a=0;a<e.length;a++)o+="&address="+(c=e[a]).blockchain+"."+c.address;return t.next=4,u.get("/wallets/details?apiKey="+this.apiKey+o,i({},n));case 4:return t.abrupt("return",t.sent.data);case 6:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),t}(),f=function(t){return"EVM"===t.type},p=function(t){return"COSMOS"===t.type},h=function(t){return"SOLANA"===t.type},l=function(t){return"TRON"===t.type},v=function(t){return"TRANSFER"===t.type},d=function(t){return"STARKNET"===t.type};(a=exports.RoutingResultType||(exports.RoutingResultType={})).OK="OK",a.HIGH_IMPACT="HIGH_IMPACT",a.NO_ROUTE="NO_ROUTE",a.INPUT_LIMIT_ISSUE="INPUT_LIMIT_ISSUE",(c=exports.TransactionType||(exports.TransactionType={})).EVM="EVM",c.TRANSFER="TRANSFER",c.COSMOS="COSMOS",c.SOLANA="SOLANA",c.TRON="TRON",c.STARKNET="STARKNET";var y,g=exports.TransactionType;(y=exports.TransactionStatus||(exports.TransactionStatus={})).FAILED="failed",y.RUNNING="running",y.SUCCESS="success",exports.GenericTransactionType=g,exports.RangoClient=s,exports.cosmosBlockchains=function(t){return t.filter(p)},exports.evmBlockchains=function(t){return t.filter(f)},exports.isCosmosBlockchain=p,exports.isEvmBlockchain=f,exports.isSolanaBlockchain=h,exports.isStarknetBlockchain=d,exports.isTransferBlockchain=v,exports.isTronBlockchain=l,exports.solanaBlockchain=function(t){return t.filter(h)},exports.starknetBlockchain=function(t){return t.filter(d)},exports.transferBlockchains=function(t){return t.filter(v)},exports.tronBlockchain=function(t){return t.filter(l)};
1
+ "use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("uuid-random")),r=t(require("axios"));function n(){n=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=Object.create((e&&e.prototype instanceof l?e:l).prototype),a=new L(n||[]);return o(i,"_invoke",{value:O(t,r,a)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var f={};function l(){}function v(){}function d(){}var y={};s(y,a,(function(){return this}));var g=Object.getPrototypeOf,x=g&&g(g(k([])));x&&x!==e&&r.call(x,a)&&(y=x);var m=d.prototype=l.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){var n;o(this,"_invoke",{value:function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,c){var u=p(t[o],t,i);if("throw"!==u.type){var s=u.arg,h=s.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}})}function O(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=p(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function k(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:N}}function N(){return{value:void 0,done:!0}}return v.prototype=d,o(m,"constructor",{value:d,configurable:!0}),o(d,"constructor",{value:v,configurable:!0}),v.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(S.prototype),s(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new S(h(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),s(m,u,"Generator"),s(m,a,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function o(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function c(t){o(a,n,i,c,u,"next",t)}function u(t){o(a,n,i,c,u,"throw",t)}c(void 0)}))}}function a(){return(a=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}var c,u,s,h,p=function(){function t(t,n){this.apiUrl=n||"https://api.rango.exchange",this.apiKey=t;try{if("undefined"!=typeof window){var o=localStorage.getItem("deviceId");if(o)this.deviceId=o;else{var i=e();localStorage.setItem("deviceId",i),this.deviceId=i}}else this.deviceId=e()}catch(t){this.deviceId=e()}this.httpService=r.create({baseURL:this.apiUrl})}var o=t.prototype;return o.getAllMetadata=function(){var t=i(n().mark((function t(e){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/meta?apiKey="+this.apiKey,a({},e));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),o.getBestRoute=function(){var t=i(n().mark((function t(e,r){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/routing/best?apiKey="+this.apiKey,e,a({headers:{"X-Rango-Id":this.deviceId}},r));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),o.checkApproval=function(){var t=i(n().mark((function t(e,r){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.get("/tx/"+e+"/check-approval?apiKey="+this.apiKey,a({},r));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),o.checkStatus=function(){var t=i(n().mark((function t(e,r){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/tx/check-status?apiKey="+this.apiKey,e,a({},r));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),o.createTransaction=function(){var t=i(n().mark((function t(e,r){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/tx/create?apiKey="+this.apiKey,e,a({},r));case 2:return t.abrupt("return",t.sent.data);case 4:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),o.reportFailure=function(){var t=i(n().mark((function t(e,r){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.httpService.post("/tx/report-tx?apiKey="+this.apiKey,e,a({},r));case 2:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),o.getWalletsDetails=function(){var t=i(n().mark((function t(e,r){var o,i,c;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o="",i=0;i<e.length;i++)o+="&address="+(c=e[i]).blockchain+"."+c.address;return t.next=4,this.httpService.get("/wallets/details?apiKey="+this.apiKey+o,a({},r));case 4:return t.abrupt("return",t.sent.data);case 6:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),t}(),f=function(t){return"EVM"===t.type},l=function(t){return"COSMOS"===t.type},v=function(t){return"SOLANA"===t.type},d=function(t){return"TRON"===t.type},y=function(t){return"TRANSFER"===t.type},g=function(t){return"STARKNET"===t.type};(c=exports.RoutingResultType||(exports.RoutingResultType={})).OK="OK",c.HIGH_IMPACT="HIGH_IMPACT",c.NO_ROUTE="NO_ROUTE",c.INPUT_LIMIT_ISSUE="INPUT_LIMIT_ISSUE",(u=exports.TransactionType||(exports.TransactionType={})).EVM="EVM",u.TRANSFER="TRANSFER",u.COSMOS="COSMOS",u.SOLANA="SOLANA",u.TRON="TRON",u.STARKNET="STARKNET",(s=exports.GenericTransactionType||(exports.GenericTransactionType={})).EVM="EVM",s.TRANSFER="TRANSFER",s.COSMOS="COSMOS",s.SOLANA="SOLANA",(h=exports.TransactionStatus||(exports.TransactionStatus={})).FAILED="failed",h.RUNNING="running",h.SUCCESS="success",exports.RangoClient=p,exports.cosmosBlockchains=function(t){return t.filter(l)},exports.evmBlockchains=function(t){return t.filter(f)},exports.isCosmosBlockchain=l,exports.isEvmBlockchain=f,exports.isSolanaBlockchain=v,exports.isStarknetBlockchain=g,exports.isTransferBlockchain=y,exports.isTronBlockchain=d,exports.solanaBlockchain=function(t){return t.filter(v)},exports.starknetBlockchain=function(t){return t.filter(g)},exports.transferBlockchains=function(t){return t.filter(y)},exports.tronBlockchain=function(t){return t.filter(d)};
2
2
  //# sourceMappingURL=rango-sdk.cjs.production.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rango-sdk.cjs.production.min.js","sources":["../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/transactions.ts"],"sourcesContent":["import axios from 'axios'\n\nexport const httpService = axios.create({\n baseURL: 'https://api.rango.exchange',\n})\n","import uuid from 'uuid-random'\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 = 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 }\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],"names":["httpService","create","baseURL","RangoClient","apiKey","this","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","_proto","getAllMetadata","options","_context","get","data","getBestRoute","requestBody","_context2","post","headers","X-Rango-Id","checkApproval","requestId","_context3","checkStatus","_context4","createTransaction","_context5","reportFailure","_context6","getWalletsDetails","walletAddresses","walletAddressesQueryParams","i","length","walletAddress","blockchain","address","_context7","blockchainMeta"],"mappings":"gpOAEO,QAAMA,sBAAoBC,OAAO,CACtCC,QAAS,+BCgBEC,aAKX,WAAYC,GACVC,KAAKD,OAASA,EACd,IACE,GAAsB,oBAAXE,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,KAEnB,kBAgFA,OAhFAG,EAEYC,0BAAc,kBAApB,WAAqBC,GAAwB,6BAAA,6BAAA,OAAA,OAAAC,SACtBjB,EAAYkB,oBACtBb,KAAKD,YAChBY,IACN,OAHkB,gCAIEG,MAAI,OAAA,UAAA,+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AHkB,gCAIEG,MAAI,OAAA,UAAA,+BAC1B,OAAA,cAAA,uFClFqCyB,mHAYEA,yYCpC1C"}
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 MetaResponse,\n BestRouteRequest,\n BestRouteResponse,\n CheckApprovalResponse,\n CheckTxStatusRequest,\n TransactionStatusResponse,\n CreateTransactionRequest,\n CreateTransactionResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n RequestOptions,\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(options?: RequestOptions): Promise<MetaResponse> {\n const axiosResponse = await this.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 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 checkApproval(\n requestId: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.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 =\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",null],"names":["RangoClient","apiKey","apiUrl","this","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","_proto","getAllMetadata","options","_context","get","data","getBestRoute","requestBody","_context2","post","headers","X-Rango-Id","checkApproval","requestId","_context3","checkStatus","_context4","createTransaction","_context5","reportFailure","_context6","getWalletsDetails","walletAddresses","walletAddressesQueryParams","i","length","walletAddress","blockchain","address","_context7","blockchainMeta"],"mappings":"krOAkBaA,aAMX,WAAYC,EAAgBC,G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,SAGhB/B,KAAKS,YAAYa,0BACAtB,KAAKF,OAC1BsB,OACKL,IACN,OALgB,gCAMEG,MAAI,OAAA,UAAA,+BAC1B,OAAA,cAAA,mCAAAL,EAEYmB,yBAAa,kBAAnB,WACLZ,EACAL,GAAwB,6BAAA,6BAAA,OAAA,OAAAkB,SAElBjC,KAAKS,YAAYa,6BACGtB,KAAKF,OAC7BsB,OAEKL,IAEN,OAAA,UAAA,+BACF,OAAA,cAAA,mCAAAF,EAEYqB,6BAAiB,kBAAvB,WACLC,EACApB,GAAwB,UAAA,6BAAA,6BAAA,OAGxB,IADIqB,EAA6B,GACxBC,EAAI,EAAGA,EAAIF,EAAgBG,OAAQD,IAE1CD,gBADMG,EAAgBJ,EAAgBE,IACkBG,eAAcD,EAAcE,QACrF,OAAAC,SAC2B1C,KAAKS,YAAYQ,+BAChBjB,KAAKF,OAASsC,OACpCrB,IACN,OAHkB,gCAIEG,MAAI,OAAA,UAAA,+BAC1B,OAAA,cAAA,uFC5FqCyB,mHAYEA"}
@@ -347,12 +347,9 @@ function _extends() {
347
347
  return _extends.apply(this, arguments);
348
348
  }
349
349
 
350
- var httpService = /*#__PURE__*/axios.create({
351
- baseURL: 'https://api.rango.exchange'
352
- });
353
-
354
350
  var RangoClient = /*#__PURE__*/function () {
355
- function RangoClient(apiKey) {
351
+ function RangoClient(apiKey, apiUrl) {
352
+ this.apiUrl = apiUrl || 'https://api.rango.exchange';
356
353
  this.apiKey = apiKey;
357
354
  try {
358
355
  if (typeof window !== 'undefined') {
@@ -370,6 +367,9 @@ var RangoClient = /*#__PURE__*/function () {
370
367
  } catch (e) {
371
368
  this.deviceId = uuid();
372
369
  }
370
+ this.httpService = axios.create({
371
+ baseURL: this.apiUrl
372
+ });
373
373
  }
374
374
  var _proto = RangoClient.prototype;
375
375
  _proto.getAllMetadata = /*#__PURE__*/function () {
@@ -379,7 +379,7 @@ var RangoClient = /*#__PURE__*/function () {
379
379
  while (1) switch (_context.prev = _context.next) {
380
380
  case 0:
381
381
  _context.next = 2;
382
- return httpService.get("/meta?apiKey=" + this.apiKey, _extends({}, options));
382
+ return this.httpService.get("/meta?apiKey=" + this.apiKey, _extends({}, options));
383
383
  case 2:
384
384
  axiosResponse = _context.sent;
385
385
  return _context.abrupt("return", axiosResponse.data);
@@ -401,7 +401,7 @@ var RangoClient = /*#__PURE__*/function () {
401
401
  while (1) switch (_context2.prev = _context2.next) {
402
402
  case 0:
403
403
  _context2.next = 2;
404
- return httpService.post("/routing/best?apiKey=" + this.apiKey, requestBody, _extends({
404
+ return this.httpService.post("/routing/best?apiKey=" + this.apiKey, requestBody, _extends({
405
405
  headers: {
406
406
  'X-Rango-Id': this.deviceId
407
407
  }
@@ -427,7 +427,7 @@ var RangoClient = /*#__PURE__*/function () {
427
427
  while (1) switch (_context3.prev = _context3.next) {
428
428
  case 0:
429
429
  _context3.next = 2;
430
- return httpService.get("/tx/" + requestId + "/check-approval?apiKey=" + this.apiKey, _extends({}, options));
430
+ return this.httpService.get("/tx/" + requestId + "/check-approval?apiKey=" + this.apiKey, _extends({}, options));
431
431
  case 2:
432
432
  axiosResponse = _context3.sent;
433
433
  return _context3.abrupt("return", axiosResponse.data);
@@ -449,7 +449,7 @@ var RangoClient = /*#__PURE__*/function () {
449
449
  while (1) switch (_context4.prev = _context4.next) {
450
450
  case 0:
451
451
  _context4.next = 2;
452
- return httpService.post("/tx/check-status?apiKey=" + this.apiKey, requestBody, _extends({}, options));
452
+ return this.httpService.post("/tx/check-status?apiKey=" + this.apiKey, requestBody, _extends({}, options));
453
453
  case 2:
454
454
  axiosResponse = _context4.sent;
455
455
  return _context4.abrupt("return", axiosResponse.data);
@@ -471,7 +471,7 @@ var RangoClient = /*#__PURE__*/function () {
471
471
  while (1) switch (_context5.prev = _context5.next) {
472
472
  case 0:
473
473
  _context5.next = 2;
474
- return httpService.post("/tx/create?apiKey=" + this.apiKey, requestBody, _extends({}, options));
474
+ return this.httpService.post("/tx/create?apiKey=" + this.apiKey, requestBody, _extends({}, options));
475
475
  case 2:
476
476
  axiosResponse = _context5.sent;
477
477
  return _context5.abrupt("return", axiosResponse.data);
@@ -492,7 +492,7 @@ var RangoClient = /*#__PURE__*/function () {
492
492
  while (1) switch (_context6.prev = _context6.next) {
493
493
  case 0:
494
494
  _context6.next = 2;
495
- return httpService.post("/tx/report-tx?apiKey=" + this.apiKey, requestBody, _extends({}, options));
495
+ return this.httpService.post("/tx/report-tx?apiKey=" + this.apiKey, requestBody, _extends({}, options));
496
496
  case 2:
497
497
  case "end":
498
498
  return _context6.stop();
@@ -516,7 +516,7 @@ var RangoClient = /*#__PURE__*/function () {
516
516
  walletAddressesQueryParams += "&address=" + walletAddress.blockchain + "." + walletAddress.address;
517
517
  }
518
518
  _context7.next = 4;
519
- return httpService.get("/wallets/details?apiKey=" + this.apiKey + walletAddressesQueryParams, _extends({}, options));
519
+ return this.httpService.get("/wallets/details?apiKey=" + this.apiKey + walletAddressesQueryParams, _extends({}, options));
520
520
  case 4:
521
521
  axiosResponse = _context7.sent;
522
522
  return _context7.abrupt("return", axiosResponse.data);
@@ -599,7 +599,13 @@ var TransactionType;
599
599
  * The type of transaction
600
600
  * @deprecated use TransactionType instead
601
601
  */
602
- var GenericTransactionType = TransactionType;
602
+ var GenericTransactionType;
603
+ (function (GenericTransactionType) {
604
+ GenericTransactionType["EVM"] = "EVM";
605
+ GenericTransactionType["TRANSFER"] = "TRANSFER";
606
+ GenericTransactionType["COSMOS"] = "COSMOS";
607
+ GenericTransactionType["SOLANA"] = "SOLANA";
608
+ })(GenericTransactionType || (GenericTransactionType = {}));
603
609
  /**
604
610
  * The status of transaction in tracking
605
611
  */
@@ -1 +1 @@
1
- {"version":3,"file":"rango-sdk.esm.js","sources":["../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":["import axios from 'axios'\n\nexport const httpService = axios.create({\n baseURL: 'https://api.rango.exchange',\n})\n","import uuid from 'uuid-random'\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 = 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 }\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":["httpService","axios","create","baseURL","RangoClient","apiKey","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","getAllMetadata","options","get","axiosResponse","data","getBestRoute","requestBody","post","headers","checkApproval","requestId","checkStatus","createTransaction","reportFailure","getWalletsDetails","walletAddresses","walletAddressesQueryParams","i","length","walletAddress","blockchain","address","blockchainMeta"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,GAAG,CAAC,EAAEA,CAAC,GAAGF,eAAe,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;cACzCE,aAAa,GAAGJ,eAAe,CAACE,CAAC,CAAC;cACxCD,0BAA0B,kBAAgBG,aAAa,CAACC,UAAU,SAAID,aAAa,CAACE,OAAS;;YAC9F;YAAA,OAC2BnC,WAAW,CAACgB,GAAG,8BACd,IAAI,CAACX,MAAM,GAAGyB,0BAA0B,eAC9Df,OAAO,EACb;UAAA;YAHKE,aAAa;YAAA,kCAIZA,aAAa,CAACC,IAAI;UAAA;UAAA;YAAA;;;KAC1B;IAAA;MAAA;;IAAA;;EAAA;AAAA;;mBCtF2B,2BAAA;;;qDAIUkB;;;AAGtC;;;AAKF;;;yDAI0CA;;;;;;;;;;;;;;;;;;;;;;;;;ACpD1C;;;;AAIA;AAAA;gCAAY;;;;;;ACJZ;;;AAGA;AAAA;;;;;;;;AASA;;;;AAIA;;;;;;;;;;;;;"}
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"],"sourcesContent":["import uuid from 'uuid-random'\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'\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(options?: RequestOptions): Promise<MetaResponse> {\n const axiosResponse = await this.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 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 checkApproval(\n requestId: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.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 =\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",null,null,null],"names":["RangoClient","apiKey","apiUrl","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","getAllMetadata","options","get","axiosResponse","data","getBestRoute","requestBody","post","headers","checkApproval","requestId","checkStatus","createTransaction","reportFailure","getWalletsDetails","walletAddresses","walletAddressesQueryParams","i","length","walletAddress","blockchain","address","blockchainMeta"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkBaA,WAAW;EAMtB,qBAAYC,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,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AC2B,IAAI,CAACzB,WAAW,CAACM,GAAG,8BACnB,IAAI,CAAChB,MAAM,GAAG8B,0BAA0B,eAC9Df,OAAO,EACb;UAAA;YAHKE,aAAa;YAAA,kCAIZA,aAAa,CAACC,IAAI;UAAA;UAAA;YAAA;;;KAC1B;IAAA;MAAA;;IAAA;;EAAA;AAAA;;mBChG2B,2BAAA;;;qDAIUkB;;;AAGtC;;;AAKF;;;yDAI0CA;;;;;;;;;;;;;;;;;;;;;;;;;ACpD1C;;;;AAIA;AAAA;gCAAY;;;;;;ACJZ;;;AAGA;AAAA;;;;;;;;AASA;;;;AAIA;AAAA;;;;;;;;;;;;;;;;;;"}
@@ -6,7 +6,9 @@ declare type WalletAddresses = {
6
6
  export declare class RangoClient {
7
7
  private readonly deviceId;
8
8
  private readonly apiKey;
9
- constructor(apiKey: string);
9
+ private readonly apiUrl;
10
+ private readonly httpService;
11
+ constructor(apiKey: string, apiUrl?: string);
10
12
  getAllMetadata(options?: RequestOptions): Promise<MetaResponse>;
11
13
  getBestRoute(requestBody: BestRouteRequest, options?: RequestOptions): Promise<BestRouteResponse>;
12
14
  checkApproval(requestId: string, options?: RequestOptions): Promise<CheckApprovalResponse>;
@@ -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,EACrB,cAAc,EACf,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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B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;gBAE/B,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAwB9B,cAAc,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAQ/D,YAAY,CACvB,WAAW,EAAE,gBAAgB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,iBAAiB,CAAC;IAShB,aAAa,CACxB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,qBAAqB,CAAC;IAQpB,WAAW,CACtB,WAAW,EAAE,oBAAoB,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,yBAAyB,CAAC;IAUxB,iBAAiB,CAC5B,WAAW,EAAE,wBAAwB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,yBAAyB,CAAC;IAUxB,aAAa,CACxB,WAAW,EAAE,wBAAwB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;IAUH,iBAAiB,CAC5B,eAAe,EAAE,eAAe,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,qBAAqB,CAAC;CAYlC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rango-sdk",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
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.14",
45
+ "rango-types": "^0.1.16",
46
46
  "uuid-random": "^1.3.2"
47
47
  },
48
48
  "publishConfig": {
@@ -1,2 +0,0 @@
1
- export declare const httpService: import("axios").AxiosInstance;
2
- //# sourceMappingURL=httpService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"httpService.d.ts","sourceRoot":"","sources":["../src/services/httpService.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,+BAEtB,CAAA"}