rango-sdk 0.5.0 → 0.5.1-next.0
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.
- package/.turbo/turbo-build.log +12 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -8
- package/lib/index.js.map +7 -0
- package/lib/services/client.d.ts +29 -29
- package/lib/services/client.d.ts.map +1 -1
- package/lib/services/index.d.ts +1 -1
- package/lib/services/index.d.ts.map +1 -1
- package/lib/tsconfig.build.tsbuildinfo +1 -0
- package/lib/types/api/balance.d.ts +1 -1
- package/lib/types/api/balance.d.ts.map +1 -1
- package/lib/types/api/common.d.ts +1 -1
- package/lib/types/api/common.d.ts.map +1 -1
- package/lib/types/api/meta.d.ts +3 -3
- package/lib/types/api/meta.d.ts.map +1 -1
- package/lib/types/api/routing.d.ts +1 -1
- package/lib/types/api/routing.d.ts.map +1 -1
- package/lib/types/api/transactions.d.ts +1 -1
- package/lib/types/api/transactions.d.ts.map +1 -1
- package/lib/types/api/txs/cosmos.d.ts +1 -1
- package/lib/types/api/txs/cosmos.d.ts.map +1 -1
- package/lib/types/api/txs/evm.d.ts +1 -1
- package/lib/types/api/txs/evm.d.ts.map +1 -1
- package/lib/types/api/txs/index.d.ts +7 -7
- package/lib/types/api/txs/index.d.ts.map +1 -1
- package/lib/types/api/txs/solana.d.ts +1 -1
- package/lib/types/api/txs/solana.d.ts.map +1 -1
- package/lib/types/api/txs/starknet.d.ts +1 -1
- package/lib/types/api/txs/starknet.d.ts.map +1 -1
- package/lib/types/api/txs/ton.d.ts +1 -1
- package/lib/types/api/txs/ton.d.ts.map +1 -1
- package/lib/types/api/txs/transfer.d.ts +1 -1
- package/lib/types/api/txs/transfer.d.ts.map +1 -1
- package/lib/types/api/txs/tron.d.ts +1 -1
- package/lib/types/api/txs/tron.d.ts.map +1 -1
- package/lib/types/configs.d.ts +4 -4
- package/lib/types/configs.d.ts.map +1 -1
- package/lib/types/index.d.ts +7 -7
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/tsconfig.build.json +3 -0
- package/tsconfig.json +13 -0
- package/lib/rango-sdk.cjs.development.js +0 -936
- package/lib/rango-sdk.cjs.development.js.map +0 -1
- package/lib/rango-sdk.cjs.production.min.js +0 -2
- package/lib/rango-sdk.cjs.production.min.js.map +0 -1
- package/lib/rango-sdk.esm.js +0 -918
- package/lib/rango-sdk.esm.js.map +0 -1
|
@@ -1,936 +0,0 @@
|
|
|
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 uuid = _interopDefault(require('uuid-random'));
|
|
8
|
-
var axios = _interopDefault(require('axios'));
|
|
9
|
-
|
|
10
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
11
|
-
try {
|
|
12
|
-
var i = n[a](c),
|
|
13
|
-
u = i.value;
|
|
14
|
-
} catch (n) {
|
|
15
|
-
return void e(n);
|
|
16
|
-
}
|
|
17
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
18
|
-
}
|
|
19
|
-
function _asyncToGenerator(n) {
|
|
20
|
-
return function () {
|
|
21
|
-
var t = this,
|
|
22
|
-
e = arguments;
|
|
23
|
-
return new Promise(function (r, o) {
|
|
24
|
-
var a = n.apply(t, e);
|
|
25
|
-
function _next(n) {
|
|
26
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
27
|
-
}
|
|
28
|
-
function _throw(n) {
|
|
29
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
30
|
-
}
|
|
31
|
-
_next(void 0);
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function _extends() {
|
|
36
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
37
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
38
|
-
var t = arguments[e];
|
|
39
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
40
|
-
}
|
|
41
|
-
return n;
|
|
42
|
-
}, _extends.apply(null, arguments);
|
|
43
|
-
}
|
|
44
|
-
function _regeneratorRuntime() {
|
|
45
|
-
_regeneratorRuntime = function () {
|
|
46
|
-
return e;
|
|
47
|
-
};
|
|
48
|
-
var t,
|
|
49
|
-
e = {},
|
|
50
|
-
r = Object.prototype,
|
|
51
|
-
n = r.hasOwnProperty,
|
|
52
|
-
o = Object.defineProperty || function (t, e, r) {
|
|
53
|
-
t[e] = r.value;
|
|
54
|
-
},
|
|
55
|
-
i = "function" == typeof Symbol ? Symbol : {},
|
|
56
|
-
a = i.iterator || "@@iterator",
|
|
57
|
-
c = i.asyncIterator || "@@asyncIterator",
|
|
58
|
-
u = i.toStringTag || "@@toStringTag";
|
|
59
|
-
function define(t, e, r) {
|
|
60
|
-
return Object.defineProperty(t, e, {
|
|
61
|
-
value: r,
|
|
62
|
-
enumerable: !0,
|
|
63
|
-
configurable: !0,
|
|
64
|
-
writable: !0
|
|
65
|
-
}), t[e];
|
|
66
|
-
}
|
|
67
|
-
try {
|
|
68
|
-
define({}, "");
|
|
69
|
-
} catch (t) {
|
|
70
|
-
define = function (t, e, r) {
|
|
71
|
-
return t[e] = r;
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function wrap(t, e, r, n) {
|
|
75
|
-
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
76
|
-
a = Object.create(i.prototype),
|
|
77
|
-
c = new Context(n || []);
|
|
78
|
-
return o(a, "_invoke", {
|
|
79
|
-
value: makeInvokeMethod(t, r, c)
|
|
80
|
-
}), a;
|
|
81
|
-
}
|
|
82
|
-
function tryCatch(t, e, r) {
|
|
83
|
-
try {
|
|
84
|
-
return {
|
|
85
|
-
type: "normal",
|
|
86
|
-
arg: t.call(e, r)
|
|
87
|
-
};
|
|
88
|
-
} catch (t) {
|
|
89
|
-
return {
|
|
90
|
-
type: "throw",
|
|
91
|
-
arg: t
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
e.wrap = wrap;
|
|
96
|
-
var h = "suspendedStart",
|
|
97
|
-
l = "suspendedYield",
|
|
98
|
-
f = "executing",
|
|
99
|
-
s = "completed",
|
|
100
|
-
y = {};
|
|
101
|
-
function Generator() {}
|
|
102
|
-
function GeneratorFunction() {}
|
|
103
|
-
function GeneratorFunctionPrototype() {}
|
|
104
|
-
var p = {};
|
|
105
|
-
define(p, a, function () {
|
|
106
|
-
return this;
|
|
107
|
-
});
|
|
108
|
-
var d = Object.getPrototypeOf,
|
|
109
|
-
v = d && d(d(values([])));
|
|
110
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
111
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
112
|
-
function defineIteratorMethods(t) {
|
|
113
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
114
|
-
define(t, e, function (t) {
|
|
115
|
-
return this._invoke(e, t);
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
function AsyncIterator(t, e) {
|
|
120
|
-
function invoke(r, o, i, a) {
|
|
121
|
-
var c = tryCatch(t[r], t, o);
|
|
122
|
-
if ("throw" !== c.type) {
|
|
123
|
-
var u = c.arg,
|
|
124
|
-
h = u.value;
|
|
125
|
-
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
126
|
-
invoke("next", t, i, a);
|
|
127
|
-
}, function (t) {
|
|
128
|
-
invoke("throw", t, i, a);
|
|
129
|
-
}) : e.resolve(h).then(function (t) {
|
|
130
|
-
u.value = t, i(u);
|
|
131
|
-
}, function (t) {
|
|
132
|
-
return invoke("throw", t, i, a);
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
a(c.arg);
|
|
136
|
-
}
|
|
137
|
-
var r;
|
|
138
|
-
o(this, "_invoke", {
|
|
139
|
-
value: function (t, n) {
|
|
140
|
-
function callInvokeWithMethodAndArg() {
|
|
141
|
-
return new e(function (e, r) {
|
|
142
|
-
invoke(t, n, e, r);
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
function makeInvokeMethod(e, r, n) {
|
|
150
|
-
var o = h;
|
|
151
|
-
return function (i, a) {
|
|
152
|
-
if (o === f) throw Error("Generator is already running");
|
|
153
|
-
if (o === s) {
|
|
154
|
-
if ("throw" === i) throw a;
|
|
155
|
-
return {
|
|
156
|
-
value: t,
|
|
157
|
-
done: !0
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
for (n.method = i, n.arg = a;;) {
|
|
161
|
-
var c = n.delegate;
|
|
162
|
-
if (c) {
|
|
163
|
-
var u = maybeInvokeDelegate(c, n);
|
|
164
|
-
if (u) {
|
|
165
|
-
if (u === y) continue;
|
|
166
|
-
return u;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
170
|
-
if (o === h) throw o = s, n.arg;
|
|
171
|
-
n.dispatchException(n.arg);
|
|
172
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
173
|
-
o = f;
|
|
174
|
-
var p = tryCatch(e, r, n);
|
|
175
|
-
if ("normal" === p.type) {
|
|
176
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
177
|
-
return {
|
|
178
|
-
value: p.arg,
|
|
179
|
-
done: n.done
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
function maybeInvokeDelegate(e, r) {
|
|
187
|
-
var n = r.method,
|
|
188
|
-
o = e.iterator[n];
|
|
189
|
-
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
190
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
191
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
192
|
-
var a = i.arg;
|
|
193
|
-
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
194
|
-
}
|
|
195
|
-
function pushTryEntry(t) {
|
|
196
|
-
var e = {
|
|
197
|
-
tryLoc: t[0]
|
|
198
|
-
};
|
|
199
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
200
|
-
}
|
|
201
|
-
function resetTryEntry(t) {
|
|
202
|
-
var e = t.completion || {};
|
|
203
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
204
|
-
}
|
|
205
|
-
function Context(t) {
|
|
206
|
-
this.tryEntries = [{
|
|
207
|
-
tryLoc: "root"
|
|
208
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
209
|
-
}
|
|
210
|
-
function values(e) {
|
|
211
|
-
if (e || "" === e) {
|
|
212
|
-
var r = e[a];
|
|
213
|
-
if (r) return r.call(e);
|
|
214
|
-
if ("function" == typeof e.next) return e;
|
|
215
|
-
if (!isNaN(e.length)) {
|
|
216
|
-
var o = -1,
|
|
217
|
-
i = function next() {
|
|
218
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
219
|
-
return next.value = t, next.done = !0, next;
|
|
220
|
-
};
|
|
221
|
-
return i.next = i;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
225
|
-
}
|
|
226
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
227
|
-
value: GeneratorFunctionPrototype,
|
|
228
|
-
configurable: !0
|
|
229
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
230
|
-
value: GeneratorFunction,
|
|
231
|
-
configurable: !0
|
|
232
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
233
|
-
var e = "function" == typeof t && t.constructor;
|
|
234
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
235
|
-
}, e.mark = function (t) {
|
|
236
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
237
|
-
}, e.awrap = function (t) {
|
|
238
|
-
return {
|
|
239
|
-
__await: t
|
|
240
|
-
};
|
|
241
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
242
|
-
return this;
|
|
243
|
-
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
244
|
-
void 0 === i && (i = Promise);
|
|
245
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
246
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
247
|
-
return t.done ? t.value : a.next();
|
|
248
|
-
});
|
|
249
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
250
|
-
return this;
|
|
251
|
-
}), define(g, "toString", function () {
|
|
252
|
-
return "[object Generator]";
|
|
253
|
-
}), e.keys = function (t) {
|
|
254
|
-
var e = Object(t),
|
|
255
|
-
r = [];
|
|
256
|
-
for (var n in e) r.push(n);
|
|
257
|
-
return r.reverse(), function next() {
|
|
258
|
-
for (; r.length;) {
|
|
259
|
-
var t = r.pop();
|
|
260
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
261
|
-
}
|
|
262
|
-
return next.done = !0, next;
|
|
263
|
-
};
|
|
264
|
-
}, e.values = values, Context.prototype = {
|
|
265
|
-
constructor: Context,
|
|
266
|
-
reset: function (e) {
|
|
267
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
268
|
-
},
|
|
269
|
-
stop: function () {
|
|
270
|
-
this.done = !0;
|
|
271
|
-
var t = this.tryEntries[0].completion;
|
|
272
|
-
if ("throw" === t.type) throw t.arg;
|
|
273
|
-
return this.rval;
|
|
274
|
-
},
|
|
275
|
-
dispatchException: function (e) {
|
|
276
|
-
if (this.done) throw e;
|
|
277
|
-
var r = this;
|
|
278
|
-
function handle(n, o) {
|
|
279
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
280
|
-
}
|
|
281
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
282
|
-
var i = this.tryEntries[o],
|
|
283
|
-
a = i.completion;
|
|
284
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
285
|
-
if (i.tryLoc <= this.prev) {
|
|
286
|
-
var c = n.call(i, "catchLoc"),
|
|
287
|
-
u = n.call(i, "finallyLoc");
|
|
288
|
-
if (c && u) {
|
|
289
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
290
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
291
|
-
} else if (c) {
|
|
292
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
293
|
-
} else {
|
|
294
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
295
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
abrupt: function (t, e) {
|
|
301
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
302
|
-
var o = this.tryEntries[r];
|
|
303
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
304
|
-
var i = o;
|
|
305
|
-
break;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
309
|
-
var a = i ? i.completion : {};
|
|
310
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
311
|
-
},
|
|
312
|
-
complete: function (t, e) {
|
|
313
|
-
if ("throw" === t.type) throw t.arg;
|
|
314
|
-
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), y;
|
|
315
|
-
},
|
|
316
|
-
finish: function (t) {
|
|
317
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
318
|
-
var r = this.tryEntries[e];
|
|
319
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
320
|
-
}
|
|
321
|
-
},
|
|
322
|
-
catch: function (t) {
|
|
323
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
324
|
-
var r = this.tryEntries[e];
|
|
325
|
-
if (r.tryLoc === t) {
|
|
326
|
-
var n = r.completion;
|
|
327
|
-
if ("throw" === n.type) {
|
|
328
|
-
var o = n.arg;
|
|
329
|
-
resetTryEntry(r);
|
|
330
|
-
}
|
|
331
|
-
return o;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
throw Error("illegal catch attempt");
|
|
335
|
-
},
|
|
336
|
-
delegateYield: function (e, r, n) {
|
|
337
|
-
return this.delegate = {
|
|
338
|
-
iterator: values(e),
|
|
339
|
-
resultName: r,
|
|
340
|
-
nextLoc: n
|
|
341
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
342
|
-
}
|
|
343
|
-
}, e;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
var RangoClient = /*#__PURE__*/function () {
|
|
347
|
-
function RangoClient(apiKey, apiUrl) {
|
|
348
|
-
this.apiUrl = apiUrl || 'https://api.rango.exchange';
|
|
349
|
-
this.apiKey = apiKey;
|
|
350
|
-
try {
|
|
351
|
-
if (typeof window !== 'undefined') {
|
|
352
|
-
var deviceId = localStorage.getItem('deviceId');
|
|
353
|
-
if (deviceId) {
|
|
354
|
-
this.deviceId = deviceId;
|
|
355
|
-
} else {
|
|
356
|
-
var generatedId = uuid();
|
|
357
|
-
localStorage.setItem('deviceId', generatedId);
|
|
358
|
-
this.deviceId = generatedId;
|
|
359
|
-
}
|
|
360
|
-
} else {
|
|
361
|
-
this.deviceId = uuid();
|
|
362
|
-
}
|
|
363
|
-
} catch (e) {
|
|
364
|
-
this.deviceId = uuid();
|
|
365
|
-
}
|
|
366
|
-
this.httpService = axios.create({
|
|
367
|
-
baseURL: this.apiUrl
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
var _proto = RangoClient.prototype;
|
|
371
|
-
_proto.getAllMetadata = /*#__PURE__*/function () {
|
|
372
|
-
var _getAllMetadata = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(metaRequest, options) {
|
|
373
|
-
var _metaRequest$blockcha, _metaRequest$swappers, _metaRequest$swappers2, _metaRequest$transact;
|
|
374
|
-
var params, axiosResponse, reformatTokens, tokens, popularTokens;
|
|
375
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
376
|
-
while (1) switch (_context.prev = _context.next) {
|
|
377
|
-
case 0:
|
|
378
|
-
params = _extends({}, metaRequest, {
|
|
379
|
-
blockchains: metaRequest == null || (_metaRequest$blockcha = metaRequest.blockchains) == null ? void 0 : _metaRequest$blockcha.join(),
|
|
380
|
-
swappers: metaRequest == null || (_metaRequest$swappers = metaRequest.swappers) == null ? void 0 : _metaRequest$swappers.join(),
|
|
381
|
-
swappersGroups: metaRequest == null || (_metaRequest$swappers2 = metaRequest.swappersGroups) == null ? void 0 : _metaRequest$swappers2.join(),
|
|
382
|
-
transactionTypes: metaRequest == null || (_metaRequest$transact = metaRequest.transactionTypes) == null ? void 0 : _metaRequest$transact.join()
|
|
383
|
-
});
|
|
384
|
-
_context.next = 3;
|
|
385
|
-
return this.httpService.get("/meta/compact?apiKey=" + this.apiKey, _extends({
|
|
386
|
-
params: params
|
|
387
|
-
}, options));
|
|
388
|
-
case 3:
|
|
389
|
-
axiosResponse = _context.sent;
|
|
390
|
-
reformatTokens = function reformatTokens(tokens) {
|
|
391
|
-
return tokens.map(function (tm) {
|
|
392
|
-
return {
|
|
393
|
-
blockchain: tm.b,
|
|
394
|
-
symbol: tm.s,
|
|
395
|
-
image: tm.i,
|
|
396
|
-
address: tm.a || null,
|
|
397
|
-
usdPrice: tm.p || null,
|
|
398
|
-
isSecondaryCoin: tm.is || false,
|
|
399
|
-
coinSource: tm.c || null,
|
|
400
|
-
coinSourceUrl: tm.cu || null,
|
|
401
|
-
name: tm.n || null,
|
|
402
|
-
decimals: tm.d,
|
|
403
|
-
isPopular: tm.ip || false,
|
|
404
|
-
supportedSwappers: tm.ss || []
|
|
405
|
-
};
|
|
406
|
-
});
|
|
407
|
-
};
|
|
408
|
-
tokens = reformatTokens(axiosResponse.data.tokens);
|
|
409
|
-
popularTokens = reformatTokens(axiosResponse.data.popularTokens);
|
|
410
|
-
return _context.abrupt("return", _extends({}, axiosResponse.data, {
|
|
411
|
-
tokens: tokens,
|
|
412
|
-
popularTokens: popularTokens
|
|
413
|
-
}));
|
|
414
|
-
case 8:
|
|
415
|
-
case "end":
|
|
416
|
-
return _context.stop();
|
|
417
|
-
}
|
|
418
|
-
}, _callee, this);
|
|
419
|
-
}));
|
|
420
|
-
function getAllMetadata(_x, _x2) {
|
|
421
|
-
return _getAllMetadata.apply(this, arguments);
|
|
422
|
-
}
|
|
423
|
-
return getAllMetadata;
|
|
424
|
-
}();
|
|
425
|
-
_proto.getBlockchains = /*#__PURE__*/function () {
|
|
426
|
-
var _getBlockchains = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(options) {
|
|
427
|
-
var axiosResponse;
|
|
428
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
429
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
430
|
-
case 0:
|
|
431
|
-
_context2.next = 2;
|
|
432
|
-
return this.httpService.get("/meta/blockchains?apiKey=" + this.apiKey, _extends({}, options));
|
|
433
|
-
case 2:
|
|
434
|
-
axiosResponse = _context2.sent;
|
|
435
|
-
return _context2.abrupt("return", axiosResponse.data);
|
|
436
|
-
case 4:
|
|
437
|
-
case "end":
|
|
438
|
-
return _context2.stop();
|
|
439
|
-
}
|
|
440
|
-
}, _callee2, this);
|
|
441
|
-
}));
|
|
442
|
-
function getBlockchains(_x3) {
|
|
443
|
-
return _getBlockchains.apply(this, arguments);
|
|
444
|
-
}
|
|
445
|
-
return getBlockchains;
|
|
446
|
-
}();
|
|
447
|
-
_proto.getSwappers = /*#__PURE__*/function () {
|
|
448
|
-
var _getSwappers = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(options) {
|
|
449
|
-
var axiosResponse;
|
|
450
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
451
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
452
|
-
case 0:
|
|
453
|
-
_context3.next = 2;
|
|
454
|
-
return this.httpService.get("/meta/swappers?apiKey=" + this.apiKey, _extends({}, options));
|
|
455
|
-
case 2:
|
|
456
|
-
axiosResponse = _context3.sent;
|
|
457
|
-
return _context3.abrupt("return", axiosResponse.data);
|
|
458
|
-
case 4:
|
|
459
|
-
case "end":
|
|
460
|
-
return _context3.stop();
|
|
461
|
-
}
|
|
462
|
-
}, _callee3, this);
|
|
463
|
-
}));
|
|
464
|
-
function getSwappers(_x4) {
|
|
465
|
-
return _getSwappers.apply(this, arguments);
|
|
466
|
-
}
|
|
467
|
-
return getSwappers;
|
|
468
|
-
}();
|
|
469
|
-
_proto.getCustomToken = /*#__PURE__*/function () {
|
|
470
|
-
var _getCustomToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(customTokenRequest, options) {
|
|
471
|
-
var axiosResponse;
|
|
472
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
473
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
474
|
-
case 0:
|
|
475
|
-
_context4.next = 2;
|
|
476
|
-
return this.httpService.get("/meta/custom-token?apiKey=" + this.apiKey, _extends({
|
|
477
|
-
params: customTokenRequest
|
|
478
|
-
}, options));
|
|
479
|
-
case 2:
|
|
480
|
-
axiosResponse = _context4.sent;
|
|
481
|
-
return _context4.abrupt("return", axiosResponse.data);
|
|
482
|
-
case 4:
|
|
483
|
-
case "end":
|
|
484
|
-
return _context4.stop();
|
|
485
|
-
}
|
|
486
|
-
}, _callee4, this);
|
|
487
|
-
}));
|
|
488
|
-
function getCustomToken(_x5, _x6) {
|
|
489
|
-
return _getCustomToken.apply(this, arguments);
|
|
490
|
-
}
|
|
491
|
-
return getCustomToken;
|
|
492
|
-
}();
|
|
493
|
-
_proto.searchCustomTokens = /*#__PURE__*/function () {
|
|
494
|
-
var _searchCustomTokens = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(searchCustomTokensRequest, options) {
|
|
495
|
-
var axiosResponse;
|
|
496
|
-
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
497
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
498
|
-
case 0:
|
|
499
|
-
_context5.next = 2;
|
|
500
|
-
return this.httpService.get("/meta/token/search?apiKey=" + this.apiKey, _extends({
|
|
501
|
-
params: searchCustomTokensRequest
|
|
502
|
-
}, options));
|
|
503
|
-
case 2:
|
|
504
|
-
axiosResponse = _context5.sent;
|
|
505
|
-
return _context5.abrupt("return", axiosResponse.data);
|
|
506
|
-
case 4:
|
|
507
|
-
case "end":
|
|
508
|
-
return _context5.stop();
|
|
509
|
-
}
|
|
510
|
-
}, _callee5, this);
|
|
511
|
-
}));
|
|
512
|
-
function searchCustomTokens(_x7, _x8) {
|
|
513
|
-
return _searchCustomTokens.apply(this, arguments);
|
|
514
|
-
}
|
|
515
|
-
return searchCustomTokens;
|
|
516
|
-
}();
|
|
517
|
-
_proto.getBestRoute = /*#__PURE__*/function () {
|
|
518
|
-
var _getBestRoute = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(requestBody, options) {
|
|
519
|
-
var axiosResponse;
|
|
520
|
-
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
521
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
522
|
-
case 0:
|
|
523
|
-
_context6.next = 2;
|
|
524
|
-
return this.httpService.post("/routing/best?apiKey=" + this.apiKey, requestBody, _extends({
|
|
525
|
-
headers: {
|
|
526
|
-
'X-Rango-Id': this.deviceId
|
|
527
|
-
}
|
|
528
|
-
}, options));
|
|
529
|
-
case 2:
|
|
530
|
-
axiosResponse = _context6.sent;
|
|
531
|
-
return _context6.abrupt("return", axiosResponse.data);
|
|
532
|
-
case 4:
|
|
533
|
-
case "end":
|
|
534
|
-
return _context6.stop();
|
|
535
|
-
}
|
|
536
|
-
}, _callee6, this);
|
|
537
|
-
}));
|
|
538
|
-
function getBestRoute(_x9, _x10) {
|
|
539
|
-
return _getBestRoute.apply(this, arguments);
|
|
540
|
-
}
|
|
541
|
-
return getBestRoute;
|
|
542
|
-
}();
|
|
543
|
-
_proto.getAllRoutes = /*#__PURE__*/function () {
|
|
544
|
-
var _getAllRoutes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(requestBody, options) {
|
|
545
|
-
var axiosResponse;
|
|
546
|
-
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
547
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
548
|
-
case 0:
|
|
549
|
-
_context7.next = 2;
|
|
550
|
-
return this.httpService.post("/routing/bests?apiKey=" + this.apiKey, requestBody, _extends({
|
|
551
|
-
headers: {
|
|
552
|
-
'X-Rango-Id': this.deviceId
|
|
553
|
-
}
|
|
554
|
-
}, options));
|
|
555
|
-
case 2:
|
|
556
|
-
axiosResponse = _context7.sent;
|
|
557
|
-
return _context7.abrupt("return", axiosResponse.data);
|
|
558
|
-
case 4:
|
|
559
|
-
case "end":
|
|
560
|
-
return _context7.stop();
|
|
561
|
-
}
|
|
562
|
-
}, _callee7, this);
|
|
563
|
-
}));
|
|
564
|
-
function getAllRoutes(_x11, _x12) {
|
|
565
|
-
return _getAllRoutes.apply(this, arguments);
|
|
566
|
-
}
|
|
567
|
-
return getAllRoutes;
|
|
568
|
-
}();
|
|
569
|
-
_proto.confirmRoute = /*#__PURE__*/function () {
|
|
570
|
-
var _confirmRoute = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(requestBody, options) {
|
|
571
|
-
var axiosResponse;
|
|
572
|
-
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
573
|
-
while (1) switch (_context8.prev = _context8.next) {
|
|
574
|
-
case 0:
|
|
575
|
-
_context8.next = 2;
|
|
576
|
-
return this.httpService.post("/routing/confirm?apiKey=" + this.apiKey, requestBody, _extends({
|
|
577
|
-
headers: {
|
|
578
|
-
'X-Rango-Id': this.deviceId
|
|
579
|
-
}
|
|
580
|
-
}, options));
|
|
581
|
-
case 2:
|
|
582
|
-
axiosResponse = _context8.sent;
|
|
583
|
-
return _context8.abrupt("return", axiosResponse.data);
|
|
584
|
-
case 4:
|
|
585
|
-
case "end":
|
|
586
|
-
return _context8.stop();
|
|
587
|
-
}
|
|
588
|
-
}, _callee8, this);
|
|
589
|
-
}));
|
|
590
|
-
function confirmRoute(_x13, _x14) {
|
|
591
|
-
return _confirmRoute.apply(this, arguments);
|
|
592
|
-
}
|
|
593
|
-
return confirmRoute;
|
|
594
|
-
}() // @deprecated use confirmRoute instead
|
|
595
|
-
;
|
|
596
|
-
_proto.confirmRouteRequest =
|
|
597
|
-
/*#__PURE__*/
|
|
598
|
-
function () {
|
|
599
|
-
var _confirmRouteRequest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(requestBody, options) {
|
|
600
|
-
var axiosResponse;
|
|
601
|
-
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
602
|
-
while (1) switch (_context9.prev = _context9.next) {
|
|
603
|
-
case 0:
|
|
604
|
-
_context9.next = 2;
|
|
605
|
-
return this.httpService.post("/routing/confirm?apiKey=" + this.apiKey, requestBody, _extends({
|
|
606
|
-
headers: {
|
|
607
|
-
'X-Rango-Id': this.deviceId
|
|
608
|
-
}
|
|
609
|
-
}, options));
|
|
610
|
-
case 2:
|
|
611
|
-
axiosResponse = _context9.sent;
|
|
612
|
-
return _context9.abrupt("return", axiosResponse.data);
|
|
613
|
-
case 4:
|
|
614
|
-
case "end":
|
|
615
|
-
return _context9.stop();
|
|
616
|
-
}
|
|
617
|
-
}, _callee9, this);
|
|
618
|
-
}));
|
|
619
|
-
function confirmRouteRequest(_x15, _x16) {
|
|
620
|
-
return _confirmRouteRequest.apply(this, arguments);
|
|
621
|
-
}
|
|
622
|
-
return confirmRouteRequest;
|
|
623
|
-
}();
|
|
624
|
-
_proto.checkApproval = /*#__PURE__*/function () {
|
|
625
|
-
var _checkApproval = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(requestId, txId, options) {
|
|
626
|
-
var axiosResponse;
|
|
627
|
-
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
628
|
-
while (1) switch (_context10.prev = _context10.next) {
|
|
629
|
-
case 0:
|
|
630
|
-
_context10.next = 2;
|
|
631
|
-
return this.httpService.get("/tx/" + requestId + "/check-approval?apiKey=" + this.apiKey, _extends({
|
|
632
|
-
params: {
|
|
633
|
-
txId: txId
|
|
634
|
-
}
|
|
635
|
-
}, options));
|
|
636
|
-
case 2:
|
|
637
|
-
axiosResponse = _context10.sent;
|
|
638
|
-
return _context10.abrupt("return", axiosResponse.data);
|
|
639
|
-
case 4:
|
|
640
|
-
case "end":
|
|
641
|
-
return _context10.stop();
|
|
642
|
-
}
|
|
643
|
-
}, _callee10, this);
|
|
644
|
-
}));
|
|
645
|
-
function checkApproval(_x17, _x18, _x19) {
|
|
646
|
-
return _checkApproval.apply(this, arguments);
|
|
647
|
-
}
|
|
648
|
-
return checkApproval;
|
|
649
|
-
}();
|
|
650
|
-
_proto.checkStatus = /*#__PURE__*/function () {
|
|
651
|
-
var _checkStatus = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(requestBody, options) {
|
|
652
|
-
var axiosResponse;
|
|
653
|
-
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
654
|
-
while (1) switch (_context11.prev = _context11.next) {
|
|
655
|
-
case 0:
|
|
656
|
-
_context11.next = 2;
|
|
657
|
-
return this.httpService.post("/tx/check-status?apiKey=" + this.apiKey, requestBody, _extends({}, options));
|
|
658
|
-
case 2:
|
|
659
|
-
axiosResponse = _context11.sent;
|
|
660
|
-
return _context11.abrupt("return", axiosResponse.data);
|
|
661
|
-
case 4:
|
|
662
|
-
case "end":
|
|
663
|
-
return _context11.stop();
|
|
664
|
-
}
|
|
665
|
-
}, _callee11, this);
|
|
666
|
-
}));
|
|
667
|
-
function checkStatus(_x20, _x21) {
|
|
668
|
-
return _checkStatus.apply(this, arguments);
|
|
669
|
-
}
|
|
670
|
-
return checkStatus;
|
|
671
|
-
}();
|
|
672
|
-
_proto.createTransaction = /*#__PURE__*/function () {
|
|
673
|
-
var _createTransaction = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(requestBody, options) {
|
|
674
|
-
var axiosResponse;
|
|
675
|
-
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
676
|
-
while (1) switch (_context12.prev = _context12.next) {
|
|
677
|
-
case 0:
|
|
678
|
-
_context12.next = 2;
|
|
679
|
-
return this.httpService.post("/tx/create?apiKey=" + this.apiKey, requestBody, _extends({}, options));
|
|
680
|
-
case 2:
|
|
681
|
-
axiosResponse = _context12.sent;
|
|
682
|
-
return _context12.abrupt("return", axiosResponse.data);
|
|
683
|
-
case 4:
|
|
684
|
-
case "end":
|
|
685
|
-
return _context12.stop();
|
|
686
|
-
}
|
|
687
|
-
}, _callee12, this);
|
|
688
|
-
}));
|
|
689
|
-
function createTransaction(_x22, _x23) {
|
|
690
|
-
return _createTransaction.apply(this, arguments);
|
|
691
|
-
}
|
|
692
|
-
return createTransaction;
|
|
693
|
-
}();
|
|
694
|
-
_proto.reportFailure = /*#__PURE__*/function () {
|
|
695
|
-
var _reportFailure = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(requestBody, options) {
|
|
696
|
-
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
697
|
-
while (1) switch (_context13.prev = _context13.next) {
|
|
698
|
-
case 0:
|
|
699
|
-
_context13.next = 2;
|
|
700
|
-
return this.httpService.post("/tx/report-tx?apiKey=" + this.apiKey, requestBody, _extends({}, options));
|
|
701
|
-
case 2:
|
|
702
|
-
case "end":
|
|
703
|
-
return _context13.stop();
|
|
704
|
-
}
|
|
705
|
-
}, _callee13, this);
|
|
706
|
-
}));
|
|
707
|
-
function reportFailure(_x24, _x25) {
|
|
708
|
-
return _reportFailure.apply(this, arguments);
|
|
709
|
-
}
|
|
710
|
-
return reportFailure;
|
|
711
|
-
}();
|
|
712
|
-
_proto.getWalletsDetails = /*#__PURE__*/function () {
|
|
713
|
-
var _getWalletsDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(walletAddresses, options) {
|
|
714
|
-
var walletAddressesQueryParams, i, walletAddress, axiosResponse;
|
|
715
|
-
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
716
|
-
while (1) switch (_context14.prev = _context14.next) {
|
|
717
|
-
case 0:
|
|
718
|
-
walletAddressesQueryParams = '';
|
|
719
|
-
for (i = 0; i < walletAddresses.length; i++) {
|
|
720
|
-
walletAddress = walletAddresses[i];
|
|
721
|
-
walletAddressesQueryParams += "&address=" + walletAddress.blockchain + "." + walletAddress.address;
|
|
722
|
-
}
|
|
723
|
-
_context14.next = 4;
|
|
724
|
-
return this.httpService.get("/wallets/details?apiKey=" + this.apiKey + walletAddressesQueryParams, _extends({}, options));
|
|
725
|
-
case 4:
|
|
726
|
-
axiosResponse = _context14.sent;
|
|
727
|
-
return _context14.abrupt("return", axiosResponse.data);
|
|
728
|
-
case 6:
|
|
729
|
-
case "end":
|
|
730
|
-
return _context14.stop();
|
|
731
|
-
}
|
|
732
|
-
}, _callee14, this);
|
|
733
|
-
}));
|
|
734
|
-
function getWalletsDetails(_x26, _x27) {
|
|
735
|
-
return _getWalletsDetails.apply(this, arguments);
|
|
736
|
-
}
|
|
737
|
-
return getWalletsDetails;
|
|
738
|
-
}();
|
|
739
|
-
_proto.getTokenBalance = /*#__PURE__*/function () {
|
|
740
|
-
var _getTokenBalance = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(tokenBalanceRequest, options) {
|
|
741
|
-
var axiosResponse;
|
|
742
|
-
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
743
|
-
while (1) switch (_context15.prev = _context15.next) {
|
|
744
|
-
case 0:
|
|
745
|
-
_context15.next = 2;
|
|
746
|
-
return this.httpService.get("/wallets/token-balance?apiKey=" + this.apiKey, _extends({
|
|
747
|
-
params: tokenBalanceRequest
|
|
748
|
-
}, options));
|
|
749
|
-
case 2:
|
|
750
|
-
axiosResponse = _context15.sent;
|
|
751
|
-
return _context15.abrupt("return", axiosResponse.data);
|
|
752
|
-
case 4:
|
|
753
|
-
case "end":
|
|
754
|
-
return _context15.stop();
|
|
755
|
-
}
|
|
756
|
-
}, _callee15, this);
|
|
757
|
-
}));
|
|
758
|
-
function getTokenBalance(_x28, _x29) {
|
|
759
|
-
return _getTokenBalance.apply(this, arguments);
|
|
760
|
-
}
|
|
761
|
-
return getTokenBalance;
|
|
762
|
-
}();
|
|
763
|
-
_proto.getMultipleTokenBalance = /*#__PURE__*/function () {
|
|
764
|
-
var _getMultipleTokenBalance = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(requestBody, options) {
|
|
765
|
-
var axiosResponse;
|
|
766
|
-
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
767
|
-
while (1) switch (_context16.prev = _context16.next) {
|
|
768
|
-
case 0:
|
|
769
|
-
_context16.next = 2;
|
|
770
|
-
return this.httpService.post("/wallets/multiple-token-balance?apiKey=" + this.apiKey, requestBody, _extends({}, options));
|
|
771
|
-
case 2:
|
|
772
|
-
axiosResponse = _context16.sent;
|
|
773
|
-
return _context16.abrupt("return", axiosResponse.data);
|
|
774
|
-
case 4:
|
|
775
|
-
case "end":
|
|
776
|
-
return _context16.stop();
|
|
777
|
-
}
|
|
778
|
-
}, _callee16, this);
|
|
779
|
-
}));
|
|
780
|
-
function getMultipleTokenBalance(_x30, _x31) {
|
|
781
|
-
return _getMultipleTokenBalance.apply(this, arguments);
|
|
782
|
-
}
|
|
783
|
-
return getMultipleTokenBalance;
|
|
784
|
-
}();
|
|
785
|
-
return RangoClient;
|
|
786
|
-
}();
|
|
787
|
-
|
|
788
|
-
var isEvmBlockchain = function isEvmBlockchain(blockchainMeta) {
|
|
789
|
-
return blockchainMeta.type === 'EVM';
|
|
790
|
-
};
|
|
791
|
-
var isCosmosBlockchain = function isCosmosBlockchain(blockchainMeta) {
|
|
792
|
-
return blockchainMeta.type === 'COSMOS';
|
|
793
|
-
};
|
|
794
|
-
var isSolanaBlockchain = function isSolanaBlockchain(blockchainMeta) {
|
|
795
|
-
return blockchainMeta.type === 'SOLANA';
|
|
796
|
-
};
|
|
797
|
-
var isTronBlockchain = function isTronBlockchain(blockchainMeta) {
|
|
798
|
-
return blockchainMeta.type === 'TRON';
|
|
799
|
-
};
|
|
800
|
-
var isTransferBlockchain = function isTransferBlockchain(blockchainMeta) {
|
|
801
|
-
return blockchainMeta.type === 'TRANSFER';
|
|
802
|
-
};
|
|
803
|
-
var isStarknetBlockchain = function isStarknetBlockchain(blockchainMeta) {
|
|
804
|
-
return blockchainMeta.type === 'STARKNET';
|
|
805
|
-
};
|
|
806
|
-
var isTonBlockchain = function isTonBlockchain(blockchainMeta) {
|
|
807
|
-
return blockchainMeta.type === 'TON';
|
|
808
|
-
};
|
|
809
|
-
var isXrplBlockchain = function isXrplBlockchain(blockchainMeta) {
|
|
810
|
-
return blockchainMeta.type === 'XRPL';
|
|
811
|
-
};
|
|
812
|
-
var isHyperliquidBlockchain = function isHyperliquidBlockchain(blockchainMeta) {
|
|
813
|
-
return blockchainMeta.type === 'HYPERLIQUID';
|
|
814
|
-
};
|
|
815
|
-
var evmBlockchains = function evmBlockchains(blockchains) {
|
|
816
|
-
return blockchains.filter(isEvmBlockchain);
|
|
817
|
-
};
|
|
818
|
-
var solanaBlockchain = function solanaBlockchain(blockchains) {
|
|
819
|
-
return blockchains.filter(isSolanaBlockchain);
|
|
820
|
-
};
|
|
821
|
-
var starknetBlockchain = function starknetBlockchain(blockchains) {
|
|
822
|
-
return blockchains.filter(isStarknetBlockchain);
|
|
823
|
-
};
|
|
824
|
-
var tronBlockchain = function tronBlockchain(blockchains) {
|
|
825
|
-
return blockchains.filter(isTronBlockchain);
|
|
826
|
-
};
|
|
827
|
-
var cosmosBlockchains = function cosmosBlockchains(blockchains) {
|
|
828
|
-
return blockchains.filter(isCosmosBlockchain);
|
|
829
|
-
};
|
|
830
|
-
var transferBlockchains = function transferBlockchains(blockchains) {
|
|
831
|
-
return blockchains.filter(isTransferBlockchain);
|
|
832
|
-
};
|
|
833
|
-
var tonBlockchain = function tonBlockchain(blockchains) {
|
|
834
|
-
return blockchains.filter(isTonBlockchain);
|
|
835
|
-
};
|
|
836
|
-
var xrplBlockchain = function xrplBlockchain(blockchains) {
|
|
837
|
-
return blockchains.filter(isXrplBlockchain);
|
|
838
|
-
};
|
|
839
|
-
var hyperliquidBlockchain = function hyperliquidBlockchain(blockchains) {
|
|
840
|
-
return blockchains.filter(isHyperliquidBlockchain);
|
|
841
|
-
};
|
|
842
|
-
|
|
843
|
-
/**
|
|
844
|
-
* Routing Result Type
|
|
845
|
-
*
|
|
846
|
-
*/
|
|
847
|
-
(function (RoutingResultType) {
|
|
848
|
-
RoutingResultType["OK"] = "OK";
|
|
849
|
-
RoutingResultType["HIGH_IMPACT"] = "HIGH_IMPACT";
|
|
850
|
-
RoutingResultType["NO_ROUTE"] = "NO_ROUTE";
|
|
851
|
-
RoutingResultType["INPUT_LIMIT_ISSUE"] = "INPUT_LIMIT_ISSUE";
|
|
852
|
-
RoutingResultType["HIGH_IMPACT_FOR_CREATE_TX"] = "HIGH_IMPACT_FOR_CREATE_TX";
|
|
853
|
-
})(exports.RoutingResultType || (exports.RoutingResultType = {}));
|
|
854
|
-
|
|
855
|
-
/**
|
|
856
|
-
* The type of transaction
|
|
857
|
-
*/
|
|
858
|
-
(function (TransactionType) {
|
|
859
|
-
TransactionType["EVM"] = "EVM";
|
|
860
|
-
TransactionType["TRANSFER"] = "TRANSFER";
|
|
861
|
-
TransactionType["COSMOS"] = "COSMOS";
|
|
862
|
-
TransactionType["SOLANA"] = "SOLANA";
|
|
863
|
-
TransactionType["TRON"] = "TRON";
|
|
864
|
-
TransactionType["STARKNET"] = "STARKNET";
|
|
865
|
-
TransactionType["TON"] = "TON";
|
|
866
|
-
TransactionType["SUI"] = "SUI";
|
|
867
|
-
TransactionType["XRPL"] = "XRPL";
|
|
868
|
-
TransactionType["STELLAR"] = "STELLAR";
|
|
869
|
-
TransactionType["HYPERLIQUID"] = "HYPERLIQUID";
|
|
870
|
-
})(exports.TransactionType || (exports.TransactionType = {}));
|
|
871
|
-
(function (GenericTransactionType) {
|
|
872
|
-
GenericTransactionType["EVM"] = "EVM";
|
|
873
|
-
GenericTransactionType["TRANSFER"] = "TRANSFER";
|
|
874
|
-
GenericTransactionType["COSMOS"] = "COSMOS";
|
|
875
|
-
GenericTransactionType["SOLANA"] = "SOLANA";
|
|
876
|
-
})(exports.GenericTransactionType || (exports.GenericTransactionType = {}));
|
|
877
|
-
(function (TransactionStatus) {
|
|
878
|
-
TransactionStatus["FAILED"] = "failed";
|
|
879
|
-
TransactionStatus["RUNNING"] = "running";
|
|
880
|
-
TransactionStatus["SUCCESS"] = "success";
|
|
881
|
-
})(exports.TransactionStatus || (exports.TransactionStatus = {}));
|
|
882
|
-
|
|
883
|
-
var isCosmosTransaction = function isCosmosTransaction(transaction) {
|
|
884
|
-
return transaction.type === exports.TransactionType.COSMOS;
|
|
885
|
-
};
|
|
886
|
-
|
|
887
|
-
var isSolanaTransaction = function isSolanaTransaction(transaction) {
|
|
888
|
-
return transaction.type === exports.TransactionType.SOLANA;
|
|
889
|
-
};
|
|
890
|
-
|
|
891
|
-
var isTransferTransaction = function isTransferTransaction(transaction) {
|
|
892
|
-
return transaction.type === exports.TransactionType.TRANSFER;
|
|
893
|
-
};
|
|
894
|
-
|
|
895
|
-
var isTronTransaction = function isTronTransaction(transaction) {
|
|
896
|
-
return transaction.type === exports.TransactionType.TRON;
|
|
897
|
-
};
|
|
898
|
-
|
|
899
|
-
(function (TonChainID) {
|
|
900
|
-
TonChainID["MAINNET"] = "-239";
|
|
901
|
-
TonChainID["TESTNET"] = "-3";
|
|
902
|
-
})(exports.TonChainID || (exports.TonChainID = {}));
|
|
903
|
-
var isTonTransaction = function isTonTransaction(transaction) {
|
|
904
|
-
return transaction.type === exports.TransactionType.TON;
|
|
905
|
-
};
|
|
906
|
-
|
|
907
|
-
var isEvmTransaction = function isEvmTransaction(transaction) {
|
|
908
|
-
return transaction.type === exports.TransactionType.EVM;
|
|
909
|
-
};
|
|
910
|
-
|
|
911
|
-
exports.RangoClient = RangoClient;
|
|
912
|
-
exports.cosmosBlockchains = cosmosBlockchains;
|
|
913
|
-
exports.evmBlockchains = evmBlockchains;
|
|
914
|
-
exports.hyperliquidBlockchain = hyperliquidBlockchain;
|
|
915
|
-
exports.isCosmosBlockchain = isCosmosBlockchain;
|
|
916
|
-
exports.isCosmosTransaction = isCosmosTransaction;
|
|
917
|
-
exports.isEvmBlockchain = isEvmBlockchain;
|
|
918
|
-
exports.isEvmTransaction = isEvmTransaction;
|
|
919
|
-
exports.isHyperliquidBlockchain = isHyperliquidBlockchain;
|
|
920
|
-
exports.isSolanaBlockchain = isSolanaBlockchain;
|
|
921
|
-
exports.isSolanaTransaction = isSolanaTransaction;
|
|
922
|
-
exports.isStarknetBlockchain = isStarknetBlockchain;
|
|
923
|
-
exports.isTonBlockchain = isTonBlockchain;
|
|
924
|
-
exports.isTonTransaction = isTonTransaction;
|
|
925
|
-
exports.isTransferBlockchain = isTransferBlockchain;
|
|
926
|
-
exports.isTransferTransaction = isTransferTransaction;
|
|
927
|
-
exports.isTronBlockchain = isTronBlockchain;
|
|
928
|
-
exports.isTronTransaction = isTronTransaction;
|
|
929
|
-
exports.isXrplBlockchain = isXrplBlockchain;
|
|
930
|
-
exports.solanaBlockchain = solanaBlockchain;
|
|
931
|
-
exports.starknetBlockchain = starknetBlockchain;
|
|
932
|
-
exports.tonBlockchain = tonBlockchain;
|
|
933
|
-
exports.transferBlockchains = transferBlockchains;
|
|
934
|
-
exports.tronBlockchain = tronBlockchain;
|
|
935
|
-
exports.xrplBlockchain = xrplBlockchain;
|
|
936
|
-
//# sourceMappingURL=rango-sdk.cjs.development.js.map
|