rango-sdk 0.1.2 → 0.1.4

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 (38) hide show
  1. package/lib/dist/index.d.ts +3 -0
  2. package/lib/dist/index.d.ts.map +1 -0
  3. package/lib/dist/index.js +8 -0
  4. package/lib/dist/rango-sdk.cjs.development.js +672 -0
  5. package/lib/dist/rango-sdk.cjs.development.js.map +1 -0
  6. package/lib/dist/rango-sdk.cjs.production.min.js +2 -0
  7. package/lib/dist/rango-sdk.cjs.production.min.js.map +1 -0
  8. package/lib/dist/rango-sdk.esm.js +659 -0
  9. package/lib/dist/rango-sdk.esm.js.map +1 -0
  10. package/lib/dist/services/client.d.ts +19 -0
  11. package/lib/dist/services/client.d.ts.map +1 -0
  12. package/lib/dist/services/httpService.d.ts +2 -0
  13. package/lib/dist/services/httpService.d.ts.map +1 -0
  14. package/lib/dist/services/index.d.ts +2 -0
  15. package/lib/dist/services/index.d.ts.map +1 -0
  16. package/lib/dist/types/api/balance.d.ts +2 -0
  17. package/lib/dist/types/api/balance.d.ts.map +1 -0
  18. package/lib/dist/types/api/common.d.ts +2 -0
  19. package/lib/dist/types/api/common.d.ts.map +1 -0
  20. package/lib/dist/types/api/meta.d.ts +3 -0
  21. package/lib/dist/types/api/meta.d.ts.map +1 -0
  22. package/lib/dist/types/api/routing.d.ts +2 -0
  23. package/lib/dist/types/api/routing.d.ts.map +1 -0
  24. package/lib/dist/types/api/transactions.d.ts +2 -0
  25. package/lib/dist/types/api/transactions.d.ts.map +1 -0
  26. package/lib/dist/types/api/txs/cosmos.d.ts +2 -0
  27. package/lib/dist/types/api/txs/cosmos.d.ts.map +1 -0
  28. package/lib/dist/types/api/txs/evm.d.ts +2 -0
  29. package/lib/dist/types/api/txs/evm.d.ts.map +1 -0
  30. package/lib/dist/types/api/txs/index.d.ts +5 -0
  31. package/lib/dist/types/api/txs/index.d.ts.map +1 -0
  32. package/lib/dist/types/api/txs/solana.d.ts +2 -0
  33. package/lib/dist/types/api/txs/solana.d.ts.map +1 -0
  34. package/lib/dist/types/api/txs/transfer.d.ts +2 -0
  35. package/lib/dist/types/api/txs/transfer.d.ts.map +1 -0
  36. package/lib/dist/types/index.d.ts +7 -0
  37. package/lib/dist/types/index.d.ts.map +1 -0
  38. package/package.json +2 -2
@@ -0,0 +1,3 @@
1
+ export { RangoClient } from './services';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,8 @@
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
+ }
@@ -0,0 +1,672 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
+
7
+ var axios = _interopDefault(require('axios'));
8
+
9
+ function _regeneratorRuntime() {
10
+ _regeneratorRuntime = function () {
11
+ return exports;
12
+ };
13
+ var exports = {},
14
+ Op = Object.prototype,
15
+ hasOwn = Op.hasOwnProperty,
16
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
17
+ obj[key] = desc.value;
18
+ },
19
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
20
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
21
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
22
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
23
+ function define(obj, key, value) {
24
+ return Object.defineProperty(obj, key, {
25
+ value: value,
26
+ enumerable: !0,
27
+ configurable: !0,
28
+ writable: !0
29
+ }), obj[key];
30
+ }
31
+ try {
32
+ define({}, "");
33
+ } catch (err) {
34
+ define = function (obj, key, value) {
35
+ return obj[key] = value;
36
+ };
37
+ }
38
+ function wrap(innerFn, outerFn, self, tryLocsList) {
39
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
40
+ generator = Object.create(protoGenerator.prototype),
41
+ context = new Context(tryLocsList || []);
42
+ return defineProperty(generator, "_invoke", {
43
+ value: makeInvokeMethod(innerFn, self, context)
44
+ }), generator;
45
+ }
46
+ function tryCatch(fn, obj, arg) {
47
+ try {
48
+ return {
49
+ type: "normal",
50
+ arg: fn.call(obj, arg)
51
+ };
52
+ } catch (err) {
53
+ return {
54
+ type: "throw",
55
+ arg: err
56
+ };
57
+ }
58
+ }
59
+ exports.wrap = wrap;
60
+ var ContinueSentinel = {};
61
+ function Generator() {}
62
+ function GeneratorFunction() {}
63
+ function GeneratorFunctionPrototype() {}
64
+ var IteratorPrototype = {};
65
+ define(IteratorPrototype, iteratorSymbol, function () {
66
+ return this;
67
+ });
68
+ var getProto = Object.getPrototypeOf,
69
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
70
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
71
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
72
+ function defineIteratorMethods(prototype) {
73
+ ["next", "throw", "return"].forEach(function (method) {
74
+ define(prototype, method, function (arg) {
75
+ return this._invoke(method, arg);
76
+ });
77
+ });
78
+ }
79
+ function AsyncIterator(generator, PromiseImpl) {
80
+ function invoke(method, arg, resolve, reject) {
81
+ var record = tryCatch(generator[method], generator, arg);
82
+ if ("throw" !== record.type) {
83
+ var result = record.arg,
84
+ value = result.value;
85
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
86
+ invoke("next", value, resolve, reject);
87
+ }, function (err) {
88
+ invoke("throw", err, resolve, reject);
89
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
90
+ result.value = unwrapped, resolve(result);
91
+ }, function (error) {
92
+ return invoke("throw", error, resolve, reject);
93
+ });
94
+ }
95
+ reject(record.arg);
96
+ }
97
+ var previousPromise;
98
+ defineProperty(this, "_invoke", {
99
+ value: function (method, arg) {
100
+ function callInvokeWithMethodAndArg() {
101
+ return new PromiseImpl(function (resolve, reject) {
102
+ invoke(method, arg, resolve, reject);
103
+ });
104
+ }
105
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
106
+ }
107
+ });
108
+ }
109
+ function makeInvokeMethod(innerFn, self, context) {
110
+ var state = "suspendedStart";
111
+ return function (method, arg) {
112
+ if ("executing" === state) throw new Error("Generator is already running");
113
+ if ("completed" === state) {
114
+ if ("throw" === method) throw arg;
115
+ return doneResult();
116
+ }
117
+ for (context.method = method, context.arg = arg;;) {
118
+ var delegate = context.delegate;
119
+ if (delegate) {
120
+ var delegateResult = maybeInvokeDelegate(delegate, context);
121
+ if (delegateResult) {
122
+ if (delegateResult === ContinueSentinel) continue;
123
+ return delegateResult;
124
+ }
125
+ }
126
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
127
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
128
+ context.dispatchException(context.arg);
129
+ } else "return" === context.method && context.abrupt("return", context.arg);
130
+ state = "executing";
131
+ var record = tryCatch(innerFn, self, context);
132
+ if ("normal" === record.type) {
133
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
134
+ return {
135
+ value: record.arg,
136
+ done: context.done
137
+ };
138
+ }
139
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
140
+ }
141
+ };
142
+ }
143
+ function maybeInvokeDelegate(delegate, context) {
144
+ var methodName = context.method,
145
+ method = delegate.iterator[methodName];
146
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
147
+ var record = tryCatch(method, delegate.iterator, context.arg);
148
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
149
+ var info = record.arg;
150
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
151
+ }
152
+ function pushTryEntry(locs) {
153
+ var entry = {
154
+ tryLoc: locs[0]
155
+ };
156
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
157
+ }
158
+ function resetTryEntry(entry) {
159
+ var record = entry.completion || {};
160
+ record.type = "normal", delete record.arg, entry.completion = record;
161
+ }
162
+ function Context(tryLocsList) {
163
+ this.tryEntries = [{
164
+ tryLoc: "root"
165
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
166
+ }
167
+ function values(iterable) {
168
+ if (iterable) {
169
+ var iteratorMethod = iterable[iteratorSymbol];
170
+ if (iteratorMethod) return iteratorMethod.call(iterable);
171
+ if ("function" == typeof iterable.next) return iterable;
172
+ if (!isNaN(iterable.length)) {
173
+ var i = -1,
174
+ next = function next() {
175
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
176
+ return next.value = undefined, next.done = !0, next;
177
+ };
178
+ return next.next = next;
179
+ }
180
+ }
181
+ return {
182
+ next: doneResult
183
+ };
184
+ }
185
+ function doneResult() {
186
+ return {
187
+ value: undefined,
188
+ done: !0
189
+ };
190
+ }
191
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
192
+ value: GeneratorFunctionPrototype,
193
+ configurable: !0
194
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
195
+ value: GeneratorFunction,
196
+ configurable: !0
197
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
198
+ var ctor = "function" == typeof genFun && genFun.constructor;
199
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
200
+ }, exports.mark = function (genFun) {
201
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
202
+ }, exports.awrap = function (arg) {
203
+ return {
204
+ __await: arg
205
+ };
206
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
207
+ return this;
208
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
209
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
210
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
211
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
212
+ return result.done ? result.value : iter.next();
213
+ });
214
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
215
+ return this;
216
+ }), define(Gp, "toString", function () {
217
+ return "[object Generator]";
218
+ }), exports.keys = function (val) {
219
+ var object = Object(val),
220
+ keys = [];
221
+ for (var key in object) keys.push(key);
222
+ return keys.reverse(), function next() {
223
+ for (; keys.length;) {
224
+ var key = keys.pop();
225
+ if (key in object) return next.value = key, next.done = !1, next;
226
+ }
227
+ return next.done = !0, next;
228
+ };
229
+ }, exports.values = values, Context.prototype = {
230
+ constructor: Context,
231
+ reset: function (skipTempReset) {
232
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
233
+ },
234
+ stop: function () {
235
+ this.done = !0;
236
+ var rootRecord = this.tryEntries[0].completion;
237
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
238
+ return this.rval;
239
+ },
240
+ dispatchException: function (exception) {
241
+ if (this.done) throw exception;
242
+ var context = this;
243
+ function handle(loc, caught) {
244
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
245
+ }
246
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
247
+ var entry = this.tryEntries[i],
248
+ record = entry.completion;
249
+ if ("root" === entry.tryLoc) return handle("end");
250
+ if (entry.tryLoc <= this.prev) {
251
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
252
+ hasFinally = hasOwn.call(entry, "finallyLoc");
253
+ if (hasCatch && hasFinally) {
254
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
255
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
256
+ } else if (hasCatch) {
257
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
258
+ } else {
259
+ if (!hasFinally) throw new Error("try statement without catch or finally");
260
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
261
+ }
262
+ }
263
+ }
264
+ },
265
+ abrupt: function (type, arg) {
266
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
267
+ var entry = this.tryEntries[i];
268
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
269
+ var finallyEntry = entry;
270
+ break;
271
+ }
272
+ }
273
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
274
+ var record = finallyEntry ? finallyEntry.completion : {};
275
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
276
+ },
277
+ complete: function (record, afterLoc) {
278
+ if ("throw" === record.type) throw record.arg;
279
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
280
+ },
281
+ finish: function (finallyLoc) {
282
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
283
+ var entry = this.tryEntries[i];
284
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
285
+ }
286
+ },
287
+ catch: function (tryLoc) {
288
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
289
+ var entry = this.tryEntries[i];
290
+ if (entry.tryLoc === tryLoc) {
291
+ var record = entry.completion;
292
+ if ("throw" === record.type) {
293
+ var thrown = record.arg;
294
+ resetTryEntry(entry);
295
+ }
296
+ return thrown;
297
+ }
298
+ }
299
+ throw new Error("illegal catch attempt");
300
+ },
301
+ delegateYield: function (iterable, resultName, nextLoc) {
302
+ return this.delegate = {
303
+ iterator: values(iterable),
304
+ resultName: resultName,
305
+ nextLoc: nextLoc
306
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
307
+ }
308
+ }, exports;
309
+ }
310
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
311
+ try {
312
+ var info = gen[key](arg);
313
+ var value = info.value;
314
+ } catch (error) {
315
+ reject(error);
316
+ return;
317
+ }
318
+ if (info.done) {
319
+ resolve(value);
320
+ } else {
321
+ Promise.resolve(value).then(_next, _throw);
322
+ }
323
+ }
324
+ function _asyncToGenerator(fn) {
325
+ return function () {
326
+ var self = this,
327
+ args = arguments;
328
+ return new Promise(function (resolve, reject) {
329
+ var gen = fn.apply(self, args);
330
+ function _next(value) {
331
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
332
+ }
333
+ function _throw(err) {
334
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
335
+ }
336
+ _next(undefined);
337
+ });
338
+ };
339
+ }
340
+
341
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
342
+ // require the crypto API and do not support built-in fallback to lower quality random number
343
+ // generators (like Math.random()).
344
+ var getRandomValues;
345
+ var rnds8 = /*#__PURE__*/new Uint8Array(16);
346
+ function rng() {
347
+ // lazy load so that environments that need to polyfill have a chance to do so
348
+ if (!getRandomValues) {
349
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
350
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
351
+ if (!getRandomValues) {
352
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
353
+ }
354
+ }
355
+ return getRandomValues(rnds8);
356
+ }
357
+
358
+ /**
359
+ * Convert array of 16 byte values to UUID string format of the form:
360
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
361
+ */
362
+
363
+ var byteToHex = [];
364
+ for (var i = 0; i < 256; ++i) {
365
+ byteToHex.push((i + 0x100).toString(16).slice(1));
366
+ }
367
+ function unsafeStringify(arr, offset) {
368
+ if (offset === void 0) {
369
+ offset = 0;
370
+ }
371
+ // Note: Be careful editing this code! It's been tuned for performance
372
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
373
+ 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();
374
+ }
375
+
376
+ var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && /*#__PURE__*/crypto.randomUUID.bind(crypto);
377
+ var _native = {
378
+ randomUUID: randomUUID
379
+ };
380
+
381
+ function v4(options, buf, offset) {
382
+ if (_native.randomUUID && !buf && !options) {
383
+ return _native.randomUUID();
384
+ }
385
+ options = options || {};
386
+ var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
387
+
388
+ rnds[6] = rnds[6] & 0x0f | 0x40;
389
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
390
+
391
+ if (buf) {
392
+ offset = offset || 0;
393
+ for (var i = 0; i < 16; ++i) {
394
+ buf[offset + i] = rnds[i];
395
+ }
396
+ return buf;
397
+ }
398
+ return unsafeStringify(rnds);
399
+ }
400
+
401
+ var httpService = /*#__PURE__*/axios.create({
402
+ baseURL: 'https://api.rango.exchange'
403
+ });
404
+
405
+ var RangoClient = /*#__PURE__*/function () {
406
+ function RangoClient(apiKey) {
407
+ this.apiKey = apiKey;
408
+ try {
409
+ if (typeof window !== 'undefined') {
410
+ var deviceId = localStorage.getItem('deviceId');
411
+ if (deviceId) {
412
+ this.deviceId = deviceId;
413
+ } else {
414
+ var generatedId = v4();
415
+ localStorage.setItem('deviceId', generatedId);
416
+ this.deviceId = generatedId;
417
+ }
418
+ } else {
419
+ this.deviceId = v4();
420
+ }
421
+ } catch (e) {
422
+ this.deviceId = v4();
423
+ }
424
+ }
425
+ var _proto = RangoClient.prototype;
426
+ _proto.getAllMetadata = /*#__PURE__*/function () {
427
+ var _getAllMetadata = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
428
+ var axiosResponse;
429
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
430
+ while (1) switch (_context.prev = _context.next) {
431
+ case 0:
432
+ _context.next = 2;
433
+ return httpService.get("/meta?apiKey=" + this.apiKey);
434
+ case 2:
435
+ axiosResponse = _context.sent;
436
+ return _context.abrupt("return", axiosResponse.data);
437
+ case 4:
438
+ case "end":
439
+ return _context.stop();
440
+ }
441
+ }, _callee, this);
442
+ }));
443
+ function getAllMetadata() {
444
+ return _getAllMetadata.apply(this, arguments);
445
+ }
446
+ return getAllMetadata;
447
+ }();
448
+ _proto.getBestRoute = /*#__PURE__*/function () {
449
+ var _getBestRoute = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(requestBody) {
450
+ var axiosResponse;
451
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
452
+ while (1) switch (_context2.prev = _context2.next) {
453
+ case 0:
454
+ _context2.next = 2;
455
+ return httpService.post("/routing/best?apiKey=" + this.apiKey, requestBody, {
456
+ headers: {
457
+ 'X-Rango-Id': this.deviceId
458
+ }
459
+ });
460
+ case 2:
461
+ axiosResponse = _context2.sent;
462
+ return _context2.abrupt("return", axiosResponse.data);
463
+ case 4:
464
+ case "end":
465
+ return _context2.stop();
466
+ }
467
+ }, _callee2, this);
468
+ }));
469
+ function getBestRoute(_x) {
470
+ return _getBestRoute.apply(this, arguments);
471
+ }
472
+ return getBestRoute;
473
+ }();
474
+ _proto.checkApproval = /*#__PURE__*/function () {
475
+ var _checkApproval = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(requestId) {
476
+ var axiosResponse;
477
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
478
+ while (1) switch (_context3.prev = _context3.next) {
479
+ case 0:
480
+ _context3.next = 2;
481
+ return httpService.get("/tx/" + requestId + "/check-approval?apiKey=" + this.apiKey);
482
+ case 2:
483
+ axiosResponse = _context3.sent;
484
+ return _context3.abrupt("return", axiosResponse.data);
485
+ case 4:
486
+ case "end":
487
+ return _context3.stop();
488
+ }
489
+ }, _callee3, this);
490
+ }));
491
+ function checkApproval(_x2) {
492
+ return _checkApproval.apply(this, arguments);
493
+ }
494
+ return checkApproval;
495
+ }();
496
+ _proto.checkStatus = /*#__PURE__*/function () {
497
+ var _checkStatus = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(requestBody) {
498
+ var axiosResponse;
499
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
500
+ while (1) switch (_context4.prev = _context4.next) {
501
+ case 0:
502
+ _context4.next = 2;
503
+ return httpService.post("/tx/check-status?apiKey=" + this.apiKey, requestBody);
504
+ case 2:
505
+ axiosResponse = _context4.sent;
506
+ return _context4.abrupt("return", axiosResponse.data);
507
+ case 4:
508
+ case "end":
509
+ return _context4.stop();
510
+ }
511
+ }, _callee4, this);
512
+ }));
513
+ function checkStatus(_x3) {
514
+ return _checkStatus.apply(this, arguments);
515
+ }
516
+ return checkStatus;
517
+ }();
518
+ _proto.createTransaction = /*#__PURE__*/function () {
519
+ var _createTransaction = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(requestBody) {
520
+ var axiosResponse;
521
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
522
+ while (1) switch (_context5.prev = _context5.next) {
523
+ case 0:
524
+ _context5.next = 2;
525
+ return httpService.post("/tx/create?apiKey=" + this.apiKey, requestBody);
526
+ case 2:
527
+ axiosResponse = _context5.sent;
528
+ return _context5.abrupt("return", axiosResponse.data);
529
+ case 4:
530
+ case "end":
531
+ return _context5.stop();
532
+ }
533
+ }, _callee5, this);
534
+ }));
535
+ function createTransaction(_x4) {
536
+ return _createTransaction.apply(this, arguments);
537
+ }
538
+ return createTransaction;
539
+ }();
540
+ _proto.reportFailure = /*#__PURE__*/function () {
541
+ var _reportFailure = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(requestBody) {
542
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
543
+ while (1) switch (_context6.prev = _context6.next) {
544
+ case 0:
545
+ _context6.next = 2;
546
+ return httpService.post("/tx/report-tx?apiKey=" + this.apiKey, requestBody);
547
+ case 2:
548
+ case "end":
549
+ return _context6.stop();
550
+ }
551
+ }, _callee6, this);
552
+ }));
553
+ function reportFailure(_x5) {
554
+ return _reportFailure.apply(this, arguments);
555
+ }
556
+ return reportFailure;
557
+ }();
558
+ _proto.getWalletsDetails = /*#__PURE__*/function () {
559
+ var _getWalletsDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(walletAddresses) {
560
+ var walletAddressesQueryParams, i, walletAddress, axiosResponse;
561
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
562
+ while (1) switch (_context7.prev = _context7.next) {
563
+ case 0:
564
+ walletAddressesQueryParams = '';
565
+ for (i = 0; i < walletAddresses.length; i++) {
566
+ walletAddress = walletAddresses[i];
567
+ walletAddressesQueryParams += "&address=" + walletAddress.blockchain + "." + walletAddress.address;
568
+ }
569
+ _context7.next = 4;
570
+ return httpService.get("/wallets/details?apiKey=" + this.apiKey + walletAddressesQueryParams);
571
+ case 4:
572
+ axiosResponse = _context7.sent;
573
+ return _context7.abrupt("return", axiosResponse.data);
574
+ case 6:
575
+ case "end":
576
+ return _context7.stop();
577
+ }
578
+ }, _callee7, this);
579
+ }));
580
+ function getWalletsDetails(_x6) {
581
+ return _getWalletsDetails.apply(this, arguments);
582
+ }
583
+ return getWalletsDetails;
584
+ }();
585
+ return RangoClient;
586
+ }();
587
+
588
+ var isEvmBlockchain = function isEvmBlockchain(blockchainMeta) {
589
+ return blockchainMeta.type === 'EVM';
590
+ };
591
+ var isCosmosBlockchain = function isCosmosBlockchain(blockchainMeta) {
592
+ return blockchainMeta.type === 'COSMOS';
593
+ };
594
+ var isSolanaBlockchain = function isSolanaBlockchain(blockchainMeta) {
595
+ return blockchainMeta.type === 'SOLANA';
596
+ };
597
+ var isTronBlockchain = function isTronBlockchain(blockchainMeta) {
598
+ return blockchainMeta.type === 'TRON';
599
+ };
600
+ var isTransferBlockchain = function isTransferBlockchain(blockchainMeta) {
601
+ return blockchainMeta.type === 'TRANSFER';
602
+ };
603
+ var isStarknetBlockchain = function isStarknetBlockchain(blockchainMeta) {
604
+ return blockchainMeta.type === 'STARKNET';
605
+ };
606
+ var evmBlockchains = function evmBlockchains(blockchains) {
607
+ return blockchains.filter(isEvmBlockchain);
608
+ };
609
+ var solanaBlockchain = function solanaBlockchain(blockchains) {
610
+ return blockchains.filter(isSolanaBlockchain);
611
+ };
612
+ var starknetBlockchain = function starknetBlockchain(blockchains) {
613
+ return blockchains.filter(isStarknetBlockchain);
614
+ };
615
+ var tronBlockchain = function tronBlockchain(blockchains) {
616
+ return blockchains.filter(isTronBlockchain);
617
+ };
618
+ var cosmosBlockchains = function cosmosBlockchains(blockchains) {
619
+ return blockchains.filter(isCosmosBlockchain);
620
+ };
621
+ var transferBlockchains = function transferBlockchains(blockchains) {
622
+ return blockchains.filter(isTransferBlockchain);
623
+ };
624
+
625
+ /**
626
+ * Routing Result Type
627
+ *
628
+ */
629
+ (function (RoutingResultType) {
630
+ RoutingResultType["OK"] = "OK";
631
+ RoutingResultType["HIGH_IMPACT"] = "HIGH_IMPACT";
632
+ RoutingResultType["NO_ROUTE"] = "NO_ROUTE";
633
+ RoutingResultType["INPUT_LIMIT_ISSUE"] = "INPUT_LIMIT_ISSUE";
634
+ })(exports.RoutingResultType || (exports.RoutingResultType = {}));
635
+
636
+ /**
637
+ * The type of transaction
638
+ */
639
+ (function (TransactionType) {
640
+ TransactionType["EVM"] = "EVM";
641
+ TransactionType["TRANSFER"] = "TRANSFER";
642
+ TransactionType["COSMOS"] = "COSMOS";
643
+ TransactionType["SOLANA"] = "SOLANA";
644
+ TransactionType["TRON"] = "TRON";
645
+ TransactionType["STARKNET"] = "STARKNET";
646
+ })(exports.TransactionType || (exports.TransactionType = {}));
647
+ /**
648
+ * The type of transaction
649
+ * @deprecated use TransactionType instead
650
+ */
651
+ var GenericTransactionType = exports.TransactionType;
652
+ (function (TransactionStatus) {
653
+ TransactionStatus["FAILED"] = "failed";
654
+ TransactionStatus["RUNNING"] = "running";
655
+ TransactionStatus["SUCCESS"] = "success";
656
+ })(exports.TransactionStatus || (exports.TransactionStatus = {}));
657
+
658
+ exports.GenericTransactionType = GenericTransactionType;
659
+ exports.RangoClient = RangoClient;
660
+ exports.cosmosBlockchains = cosmosBlockchains;
661
+ exports.evmBlockchains = evmBlockchains;
662
+ exports.isCosmosBlockchain = isCosmosBlockchain;
663
+ exports.isEvmBlockchain = isEvmBlockchain;
664
+ exports.isSolanaBlockchain = isSolanaBlockchain;
665
+ exports.isStarknetBlockchain = isStarknetBlockchain;
666
+ exports.isTransferBlockchain = isTransferBlockchain;
667
+ exports.isTronBlockchain = isTronBlockchain;
668
+ exports.solanaBlockchain = solanaBlockchain;
669
+ exports.starknetBlockchain = starknetBlockchain;
670
+ exports.transferBlockchains = transferBlockchains;
671
+ exports.tronBlockchain = tronBlockchain;
672
+ //# sourceMappingURL=rango-sdk.cjs.development.js.map