@aurigami/sdk 0.1.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.
@@ -0,0 +1,1478 @@
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 sdkCore = require('@pendle/sdk-core');
8
+ var IERC20 = _interopDefault(require('@aurigami/contracts/artifacts/contracts/EIP20Interface.sol/EIP20Interface.json'));
9
+ var ethers$2 = require('ethers');
10
+ var AuToken = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuToken.sol/AuToken.json'));
11
+
12
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
13
+ try {
14
+ var info = gen[key](arg);
15
+ var value = info.value;
16
+ } catch (error) {
17
+ reject(error);
18
+ return;
19
+ }
20
+
21
+ if (info.done) {
22
+ resolve(value);
23
+ } else {
24
+ Promise.resolve(value).then(_next, _throw);
25
+ }
26
+ }
27
+
28
+ function _asyncToGenerator(fn) {
29
+ return function () {
30
+ var self = this,
31
+ args = arguments;
32
+ return new Promise(function (resolve, reject) {
33
+ var gen = fn.apply(self, args);
34
+
35
+ function _next(value) {
36
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
37
+ }
38
+
39
+ function _throw(err) {
40
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
41
+ }
42
+
43
+ _next(undefined);
44
+ });
45
+ };
46
+ }
47
+
48
+ function _inheritsLoose(subClass, superClass) {
49
+ subClass.prototype = Object.create(superClass.prototype);
50
+ subClass.prototype.constructor = subClass;
51
+
52
+ _setPrototypeOf(subClass, superClass);
53
+ }
54
+
55
+ function _setPrototypeOf(o, p) {
56
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
57
+ o.__proto__ = p;
58
+ return o;
59
+ };
60
+
61
+ return _setPrototypeOf(o, p);
62
+ }
63
+
64
+ function createCommonjsModule(fn, module) {
65
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
66
+ }
67
+
68
+ var runtime_1 = createCommonjsModule(function (module) {
69
+ /**
70
+ * Copyright (c) 2014-present, Facebook, Inc.
71
+ *
72
+ * This source code is licensed under the MIT license found in the
73
+ * LICENSE file in the root directory of this source tree.
74
+ */
75
+
76
+ var runtime = (function (exports) {
77
+
78
+ var Op = Object.prototype;
79
+ var hasOwn = Op.hasOwnProperty;
80
+ var undefined$1; // More compressible than void 0.
81
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
82
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
83
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
84
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
85
+
86
+ function define(obj, key, value) {
87
+ Object.defineProperty(obj, key, {
88
+ value: value,
89
+ enumerable: true,
90
+ configurable: true,
91
+ writable: true
92
+ });
93
+ return obj[key];
94
+ }
95
+ try {
96
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
97
+ define({}, "");
98
+ } catch (err) {
99
+ define = function(obj, key, value) {
100
+ return obj[key] = value;
101
+ };
102
+ }
103
+
104
+ function wrap(innerFn, outerFn, self, tryLocsList) {
105
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
106
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
107
+ var generator = Object.create(protoGenerator.prototype);
108
+ var context = new Context(tryLocsList || []);
109
+
110
+ // The ._invoke method unifies the implementations of the .next,
111
+ // .throw, and .return methods.
112
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
113
+
114
+ return generator;
115
+ }
116
+ exports.wrap = wrap;
117
+
118
+ // Try/catch helper to minimize deoptimizations. Returns a completion
119
+ // record like context.tryEntries[i].completion. This interface could
120
+ // have been (and was previously) designed to take a closure to be
121
+ // invoked without arguments, but in all the cases we care about we
122
+ // already have an existing method we want to call, so there's no need
123
+ // to create a new function object. We can even get away with assuming
124
+ // the method takes exactly one argument, since that happens to be true
125
+ // in every case, so we don't have to touch the arguments object. The
126
+ // only additional allocation required is the completion record, which
127
+ // has a stable shape and so hopefully should be cheap to allocate.
128
+ function tryCatch(fn, obj, arg) {
129
+ try {
130
+ return { type: "normal", arg: fn.call(obj, arg) };
131
+ } catch (err) {
132
+ return { type: "throw", arg: err };
133
+ }
134
+ }
135
+
136
+ var GenStateSuspendedStart = "suspendedStart";
137
+ var GenStateSuspendedYield = "suspendedYield";
138
+ var GenStateExecuting = "executing";
139
+ var GenStateCompleted = "completed";
140
+
141
+ // Returning this object from the innerFn has the same effect as
142
+ // breaking out of the dispatch switch statement.
143
+ var ContinueSentinel = {};
144
+
145
+ // Dummy constructor functions that we use as the .constructor and
146
+ // .constructor.prototype properties for functions that return Generator
147
+ // objects. For full spec compliance, you may wish to configure your
148
+ // minifier not to mangle the names of these two functions.
149
+ function Generator() {}
150
+ function GeneratorFunction() {}
151
+ function GeneratorFunctionPrototype() {}
152
+
153
+ // This is a polyfill for %IteratorPrototype% for environments that
154
+ // don't natively support it.
155
+ var IteratorPrototype = {};
156
+ define(IteratorPrototype, iteratorSymbol, function () {
157
+ return this;
158
+ });
159
+
160
+ var getProto = Object.getPrototypeOf;
161
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
162
+ if (NativeIteratorPrototype &&
163
+ NativeIteratorPrototype !== Op &&
164
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
165
+ // This environment has a native %IteratorPrototype%; use it instead
166
+ // of the polyfill.
167
+ IteratorPrototype = NativeIteratorPrototype;
168
+ }
169
+
170
+ var Gp = GeneratorFunctionPrototype.prototype =
171
+ Generator.prototype = Object.create(IteratorPrototype);
172
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
173
+ define(Gp, "constructor", GeneratorFunctionPrototype);
174
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
175
+ GeneratorFunction.displayName = define(
176
+ GeneratorFunctionPrototype,
177
+ toStringTagSymbol,
178
+ "GeneratorFunction"
179
+ );
180
+
181
+ // Helper for defining the .next, .throw, and .return methods of the
182
+ // Iterator interface in terms of a single ._invoke method.
183
+ function defineIteratorMethods(prototype) {
184
+ ["next", "throw", "return"].forEach(function(method) {
185
+ define(prototype, method, function(arg) {
186
+ return this._invoke(method, arg);
187
+ });
188
+ });
189
+ }
190
+
191
+ exports.isGeneratorFunction = function(genFun) {
192
+ var ctor = typeof genFun === "function" && genFun.constructor;
193
+ return ctor
194
+ ? ctor === GeneratorFunction ||
195
+ // For the native GeneratorFunction constructor, the best we can
196
+ // do is to check its .name property.
197
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
198
+ : false;
199
+ };
200
+
201
+ exports.mark = function(genFun) {
202
+ if (Object.setPrototypeOf) {
203
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
204
+ } else {
205
+ genFun.__proto__ = GeneratorFunctionPrototype;
206
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
207
+ }
208
+ genFun.prototype = Object.create(Gp);
209
+ return genFun;
210
+ };
211
+
212
+ // Within the body of any async function, `await x` is transformed to
213
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
214
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
215
+ // meant to be awaited.
216
+ exports.awrap = function(arg) {
217
+ return { __await: arg };
218
+ };
219
+
220
+ function AsyncIterator(generator, PromiseImpl) {
221
+ function invoke(method, arg, resolve, reject) {
222
+ var record = tryCatch(generator[method], generator, arg);
223
+ if (record.type === "throw") {
224
+ reject(record.arg);
225
+ } else {
226
+ var result = record.arg;
227
+ var value = result.value;
228
+ if (value &&
229
+ typeof value === "object" &&
230
+ hasOwn.call(value, "__await")) {
231
+ return PromiseImpl.resolve(value.__await).then(function(value) {
232
+ invoke("next", value, resolve, reject);
233
+ }, function(err) {
234
+ invoke("throw", err, resolve, reject);
235
+ });
236
+ }
237
+
238
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
239
+ // When a yielded Promise is resolved, its final value becomes
240
+ // the .value of the Promise<{value,done}> result for the
241
+ // current iteration.
242
+ result.value = unwrapped;
243
+ resolve(result);
244
+ }, function(error) {
245
+ // If a rejected Promise was yielded, throw the rejection back
246
+ // into the async generator function so it can be handled there.
247
+ return invoke("throw", error, resolve, reject);
248
+ });
249
+ }
250
+ }
251
+
252
+ var previousPromise;
253
+
254
+ function enqueue(method, arg) {
255
+ function callInvokeWithMethodAndArg() {
256
+ return new PromiseImpl(function(resolve, reject) {
257
+ invoke(method, arg, resolve, reject);
258
+ });
259
+ }
260
+
261
+ return previousPromise =
262
+ // If enqueue has been called before, then we want to wait until
263
+ // all previous Promises have been resolved before calling invoke,
264
+ // so that results are always delivered in the correct order. If
265
+ // enqueue has not been called before, then it is important to
266
+ // call invoke immediately, without waiting on a callback to fire,
267
+ // so that the async generator function has the opportunity to do
268
+ // any necessary setup in a predictable way. This predictability
269
+ // is why the Promise constructor synchronously invokes its
270
+ // executor callback, and why async functions synchronously
271
+ // execute code before the first await. Since we implement simple
272
+ // async functions in terms of async generators, it is especially
273
+ // important to get this right, even though it requires care.
274
+ previousPromise ? previousPromise.then(
275
+ callInvokeWithMethodAndArg,
276
+ // Avoid propagating failures to Promises returned by later
277
+ // invocations of the iterator.
278
+ callInvokeWithMethodAndArg
279
+ ) : callInvokeWithMethodAndArg();
280
+ }
281
+
282
+ // Define the unified helper method that is used to implement .next,
283
+ // .throw, and .return (see defineIteratorMethods).
284
+ this._invoke = enqueue;
285
+ }
286
+
287
+ defineIteratorMethods(AsyncIterator.prototype);
288
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
289
+ return this;
290
+ });
291
+ exports.AsyncIterator = AsyncIterator;
292
+
293
+ // Note that simple async functions are implemented on top of
294
+ // AsyncIterator objects; they just return a Promise for the value of
295
+ // the final result produced by the iterator.
296
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
297
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
298
+
299
+ var iter = new AsyncIterator(
300
+ wrap(innerFn, outerFn, self, tryLocsList),
301
+ PromiseImpl
302
+ );
303
+
304
+ return exports.isGeneratorFunction(outerFn)
305
+ ? iter // If outerFn is a generator, return the full iterator.
306
+ : iter.next().then(function(result) {
307
+ return result.done ? result.value : iter.next();
308
+ });
309
+ };
310
+
311
+ function makeInvokeMethod(innerFn, self, context) {
312
+ var state = GenStateSuspendedStart;
313
+
314
+ return function invoke(method, arg) {
315
+ if (state === GenStateExecuting) {
316
+ throw new Error("Generator is already running");
317
+ }
318
+
319
+ if (state === GenStateCompleted) {
320
+ if (method === "throw") {
321
+ throw arg;
322
+ }
323
+
324
+ // Be forgiving, per 25.3.3.3.3 of the spec:
325
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
326
+ return doneResult();
327
+ }
328
+
329
+ context.method = method;
330
+ context.arg = arg;
331
+
332
+ while (true) {
333
+ var delegate = context.delegate;
334
+ if (delegate) {
335
+ var delegateResult = maybeInvokeDelegate(delegate, context);
336
+ if (delegateResult) {
337
+ if (delegateResult === ContinueSentinel) continue;
338
+ return delegateResult;
339
+ }
340
+ }
341
+
342
+ if (context.method === "next") {
343
+ // Setting context._sent for legacy support of Babel's
344
+ // function.sent implementation.
345
+ context.sent = context._sent = context.arg;
346
+
347
+ } else if (context.method === "throw") {
348
+ if (state === GenStateSuspendedStart) {
349
+ state = GenStateCompleted;
350
+ throw context.arg;
351
+ }
352
+
353
+ context.dispatchException(context.arg);
354
+
355
+ } else if (context.method === "return") {
356
+ context.abrupt("return", context.arg);
357
+ }
358
+
359
+ state = GenStateExecuting;
360
+
361
+ var record = tryCatch(innerFn, self, context);
362
+ if (record.type === "normal") {
363
+ // If an exception is thrown from innerFn, we leave state ===
364
+ // GenStateExecuting and loop back for another invocation.
365
+ state = context.done
366
+ ? GenStateCompleted
367
+ : GenStateSuspendedYield;
368
+
369
+ if (record.arg === ContinueSentinel) {
370
+ continue;
371
+ }
372
+
373
+ return {
374
+ value: record.arg,
375
+ done: context.done
376
+ };
377
+
378
+ } else if (record.type === "throw") {
379
+ state = GenStateCompleted;
380
+ // Dispatch the exception by looping back around to the
381
+ // context.dispatchException(context.arg) call above.
382
+ context.method = "throw";
383
+ context.arg = record.arg;
384
+ }
385
+ }
386
+ };
387
+ }
388
+
389
+ // Call delegate.iterator[context.method](context.arg) and handle the
390
+ // result, either by returning a { value, done } result from the
391
+ // delegate iterator, or by modifying context.method and context.arg,
392
+ // setting context.delegate to null, and returning the ContinueSentinel.
393
+ function maybeInvokeDelegate(delegate, context) {
394
+ var method = delegate.iterator[context.method];
395
+ if (method === undefined$1) {
396
+ // A .throw or .return when the delegate iterator has no .throw
397
+ // method always terminates the yield* loop.
398
+ context.delegate = null;
399
+
400
+ if (context.method === "throw") {
401
+ // Note: ["return"] must be used for ES3 parsing compatibility.
402
+ if (delegate.iterator["return"]) {
403
+ // If the delegate iterator has a return method, give it a
404
+ // chance to clean up.
405
+ context.method = "return";
406
+ context.arg = undefined$1;
407
+ maybeInvokeDelegate(delegate, context);
408
+
409
+ if (context.method === "throw") {
410
+ // If maybeInvokeDelegate(context) changed context.method from
411
+ // "return" to "throw", let that override the TypeError below.
412
+ return ContinueSentinel;
413
+ }
414
+ }
415
+
416
+ context.method = "throw";
417
+ context.arg = new TypeError(
418
+ "The iterator does not provide a 'throw' method");
419
+ }
420
+
421
+ return ContinueSentinel;
422
+ }
423
+
424
+ var record = tryCatch(method, delegate.iterator, context.arg);
425
+
426
+ if (record.type === "throw") {
427
+ context.method = "throw";
428
+ context.arg = record.arg;
429
+ context.delegate = null;
430
+ return ContinueSentinel;
431
+ }
432
+
433
+ var info = record.arg;
434
+
435
+ if (! info) {
436
+ context.method = "throw";
437
+ context.arg = new TypeError("iterator result is not an object");
438
+ context.delegate = null;
439
+ return ContinueSentinel;
440
+ }
441
+
442
+ if (info.done) {
443
+ // Assign the result of the finished delegate to the temporary
444
+ // variable specified by delegate.resultName (see delegateYield).
445
+ context[delegate.resultName] = info.value;
446
+
447
+ // Resume execution at the desired location (see delegateYield).
448
+ context.next = delegate.nextLoc;
449
+
450
+ // If context.method was "throw" but the delegate handled the
451
+ // exception, let the outer generator proceed normally. If
452
+ // context.method was "next", forget context.arg since it has been
453
+ // "consumed" by the delegate iterator. If context.method was
454
+ // "return", allow the original .return call to continue in the
455
+ // outer generator.
456
+ if (context.method !== "return") {
457
+ context.method = "next";
458
+ context.arg = undefined$1;
459
+ }
460
+
461
+ } else {
462
+ // Re-yield the result returned by the delegate method.
463
+ return info;
464
+ }
465
+
466
+ // The delegate iterator is finished, so forget it and continue with
467
+ // the outer generator.
468
+ context.delegate = null;
469
+ return ContinueSentinel;
470
+ }
471
+
472
+ // Define Generator.prototype.{next,throw,return} in terms of the
473
+ // unified ._invoke helper method.
474
+ defineIteratorMethods(Gp);
475
+
476
+ define(Gp, toStringTagSymbol, "Generator");
477
+
478
+ // A Generator should always return itself as the iterator object when the
479
+ // @@iterator function is called on it. Some browsers' implementations of the
480
+ // iterator prototype chain incorrectly implement this, causing the Generator
481
+ // object to not be returned from this call. This ensures that doesn't happen.
482
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
483
+ define(Gp, iteratorSymbol, function() {
484
+ return this;
485
+ });
486
+
487
+ define(Gp, "toString", function() {
488
+ return "[object Generator]";
489
+ });
490
+
491
+ function pushTryEntry(locs) {
492
+ var entry = { tryLoc: locs[0] };
493
+
494
+ if (1 in locs) {
495
+ entry.catchLoc = locs[1];
496
+ }
497
+
498
+ if (2 in locs) {
499
+ entry.finallyLoc = locs[2];
500
+ entry.afterLoc = locs[3];
501
+ }
502
+
503
+ this.tryEntries.push(entry);
504
+ }
505
+
506
+ function resetTryEntry(entry) {
507
+ var record = entry.completion || {};
508
+ record.type = "normal";
509
+ delete record.arg;
510
+ entry.completion = record;
511
+ }
512
+
513
+ function Context(tryLocsList) {
514
+ // The root entry object (effectively a try statement without a catch
515
+ // or a finally block) gives us a place to store values thrown from
516
+ // locations where there is no enclosing try statement.
517
+ this.tryEntries = [{ tryLoc: "root" }];
518
+ tryLocsList.forEach(pushTryEntry, this);
519
+ this.reset(true);
520
+ }
521
+
522
+ exports.keys = function(object) {
523
+ var keys = [];
524
+ for (var key in object) {
525
+ keys.push(key);
526
+ }
527
+ keys.reverse();
528
+
529
+ // Rather than returning an object with a next method, we keep
530
+ // things simple and return the next function itself.
531
+ return function next() {
532
+ while (keys.length) {
533
+ var key = keys.pop();
534
+ if (key in object) {
535
+ next.value = key;
536
+ next.done = false;
537
+ return next;
538
+ }
539
+ }
540
+
541
+ // To avoid creating an additional object, we just hang the .value
542
+ // and .done properties off the next function object itself. This
543
+ // also ensures that the minifier will not anonymize the function.
544
+ next.done = true;
545
+ return next;
546
+ };
547
+ };
548
+
549
+ function values(iterable) {
550
+ if (iterable) {
551
+ var iteratorMethod = iterable[iteratorSymbol];
552
+ if (iteratorMethod) {
553
+ return iteratorMethod.call(iterable);
554
+ }
555
+
556
+ if (typeof iterable.next === "function") {
557
+ return iterable;
558
+ }
559
+
560
+ if (!isNaN(iterable.length)) {
561
+ var i = -1, next = function next() {
562
+ while (++i < iterable.length) {
563
+ if (hasOwn.call(iterable, i)) {
564
+ next.value = iterable[i];
565
+ next.done = false;
566
+ return next;
567
+ }
568
+ }
569
+
570
+ next.value = undefined$1;
571
+ next.done = true;
572
+
573
+ return next;
574
+ };
575
+
576
+ return next.next = next;
577
+ }
578
+ }
579
+
580
+ // Return an iterator with no values.
581
+ return { next: doneResult };
582
+ }
583
+ exports.values = values;
584
+
585
+ function doneResult() {
586
+ return { value: undefined$1, done: true };
587
+ }
588
+
589
+ Context.prototype = {
590
+ constructor: Context,
591
+
592
+ reset: function(skipTempReset) {
593
+ this.prev = 0;
594
+ this.next = 0;
595
+ // Resetting context._sent for legacy support of Babel's
596
+ // function.sent implementation.
597
+ this.sent = this._sent = undefined$1;
598
+ this.done = false;
599
+ this.delegate = null;
600
+
601
+ this.method = "next";
602
+ this.arg = undefined$1;
603
+
604
+ this.tryEntries.forEach(resetTryEntry);
605
+
606
+ if (!skipTempReset) {
607
+ for (var name in this) {
608
+ // Not sure about the optimal order of these conditions:
609
+ if (name.charAt(0) === "t" &&
610
+ hasOwn.call(this, name) &&
611
+ !isNaN(+name.slice(1))) {
612
+ this[name] = undefined$1;
613
+ }
614
+ }
615
+ }
616
+ },
617
+
618
+ stop: function() {
619
+ this.done = true;
620
+
621
+ var rootEntry = this.tryEntries[0];
622
+ var rootRecord = rootEntry.completion;
623
+ if (rootRecord.type === "throw") {
624
+ throw rootRecord.arg;
625
+ }
626
+
627
+ return this.rval;
628
+ },
629
+
630
+ dispatchException: function(exception) {
631
+ if (this.done) {
632
+ throw exception;
633
+ }
634
+
635
+ var context = this;
636
+ function handle(loc, caught) {
637
+ record.type = "throw";
638
+ record.arg = exception;
639
+ context.next = loc;
640
+
641
+ if (caught) {
642
+ // If the dispatched exception was caught by a catch block,
643
+ // then let that catch block handle the exception normally.
644
+ context.method = "next";
645
+ context.arg = undefined$1;
646
+ }
647
+
648
+ return !! caught;
649
+ }
650
+
651
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
652
+ var entry = this.tryEntries[i];
653
+ var record = entry.completion;
654
+
655
+ if (entry.tryLoc === "root") {
656
+ // Exception thrown outside of any try block that could handle
657
+ // it, so set the completion value of the entire function to
658
+ // throw the exception.
659
+ return handle("end");
660
+ }
661
+
662
+ if (entry.tryLoc <= this.prev) {
663
+ var hasCatch = hasOwn.call(entry, "catchLoc");
664
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
665
+
666
+ if (hasCatch && hasFinally) {
667
+ if (this.prev < entry.catchLoc) {
668
+ return handle(entry.catchLoc, true);
669
+ } else if (this.prev < entry.finallyLoc) {
670
+ return handle(entry.finallyLoc);
671
+ }
672
+
673
+ } else if (hasCatch) {
674
+ if (this.prev < entry.catchLoc) {
675
+ return handle(entry.catchLoc, true);
676
+ }
677
+
678
+ } else if (hasFinally) {
679
+ if (this.prev < entry.finallyLoc) {
680
+ return handle(entry.finallyLoc);
681
+ }
682
+
683
+ } else {
684
+ throw new Error("try statement without catch or finally");
685
+ }
686
+ }
687
+ }
688
+ },
689
+
690
+ abrupt: function(type, arg) {
691
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
692
+ var entry = this.tryEntries[i];
693
+ if (entry.tryLoc <= this.prev &&
694
+ hasOwn.call(entry, "finallyLoc") &&
695
+ this.prev < entry.finallyLoc) {
696
+ var finallyEntry = entry;
697
+ break;
698
+ }
699
+ }
700
+
701
+ if (finallyEntry &&
702
+ (type === "break" ||
703
+ type === "continue") &&
704
+ finallyEntry.tryLoc <= arg &&
705
+ arg <= finallyEntry.finallyLoc) {
706
+ // Ignore the finally entry if control is not jumping to a
707
+ // location outside the try/catch block.
708
+ finallyEntry = null;
709
+ }
710
+
711
+ var record = finallyEntry ? finallyEntry.completion : {};
712
+ record.type = type;
713
+ record.arg = arg;
714
+
715
+ if (finallyEntry) {
716
+ this.method = "next";
717
+ this.next = finallyEntry.finallyLoc;
718
+ return ContinueSentinel;
719
+ }
720
+
721
+ return this.complete(record);
722
+ },
723
+
724
+ complete: function(record, afterLoc) {
725
+ if (record.type === "throw") {
726
+ throw record.arg;
727
+ }
728
+
729
+ if (record.type === "break" ||
730
+ record.type === "continue") {
731
+ this.next = record.arg;
732
+ } else if (record.type === "return") {
733
+ this.rval = this.arg = record.arg;
734
+ this.method = "return";
735
+ this.next = "end";
736
+ } else if (record.type === "normal" && afterLoc) {
737
+ this.next = afterLoc;
738
+ }
739
+
740
+ return ContinueSentinel;
741
+ },
742
+
743
+ finish: function(finallyLoc) {
744
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
745
+ var entry = this.tryEntries[i];
746
+ if (entry.finallyLoc === finallyLoc) {
747
+ this.complete(entry.completion, entry.afterLoc);
748
+ resetTryEntry(entry);
749
+ return ContinueSentinel;
750
+ }
751
+ }
752
+ },
753
+
754
+ "catch": function(tryLoc) {
755
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
756
+ var entry = this.tryEntries[i];
757
+ if (entry.tryLoc === tryLoc) {
758
+ var record = entry.completion;
759
+ if (record.type === "throw") {
760
+ var thrown = record.arg;
761
+ resetTryEntry(entry);
762
+ }
763
+ return thrown;
764
+ }
765
+ }
766
+
767
+ // The context.catch method must only be called with a location
768
+ // argument that corresponds to a known catch block.
769
+ throw new Error("illegal catch attempt");
770
+ },
771
+
772
+ delegateYield: function(iterable, resultName, nextLoc) {
773
+ this.delegate = {
774
+ iterator: values(iterable),
775
+ resultName: resultName,
776
+ nextLoc: nextLoc
777
+ };
778
+
779
+ if (this.method === "next") {
780
+ // Deliberately forget the last sent value so that we don't
781
+ // accidentally pass it on to the delegate.
782
+ this.arg = undefined$1;
783
+ }
784
+
785
+ return ContinueSentinel;
786
+ }
787
+ };
788
+
789
+ // Regardless of whether this script is executing as a CommonJS module
790
+ // or not, return the runtime object so that we can declare the variable
791
+ // regeneratorRuntime in the outer scope, which allows this module to be
792
+ // injected easily by `bin/regenerator --include-runtime script.js`.
793
+ return exports;
794
+
795
+ }(
796
+ // If this script is executing as a CommonJS module, use module.exports
797
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
798
+ // object. Either way, the resulting object will be used to initialize
799
+ // the regeneratorRuntime variable at the top of this file.
800
+ module.exports
801
+ ));
802
+
803
+ try {
804
+ regeneratorRuntime = runtime;
805
+ } catch (accidentalStrictMode) {
806
+ // This module should not be running in strict mode, so the above
807
+ // assignment should always work unless something is misconfigured. Just
808
+ // in case runtime.js accidentally runs in strict mode, in modern engines
809
+ // we can explicitly access globalThis. In older engines we can escape
810
+ // strict mode using a global Function call. This could conceivably fail
811
+ // if a Content Security Policy forbids using Function, but in that case
812
+ // the proper solution is to fix the accidental strict mode problem. If
813
+ // you've misconfigured your bundler to force strict mode and applied a
814
+ // CSP to forbid Function, and you're not willing to fix either of those
815
+ // problems, please detail your unique predicament in a GitHub issue.
816
+ if (typeof globalThis === "object") {
817
+ globalThis.regeneratorRuntime = runtime;
818
+ } else {
819
+ Function("r", "regeneratorRuntime = r")(runtime);
820
+ }
821
+ }
822
+ });
823
+
824
+ var BlockchainEntityRead = function BlockchainEntityRead(providerOrSigner) {
825
+ this._providerOrSigner = providerOrSigner;
826
+ };
827
+ var BlockchainEntityReadWrite = /*#__PURE__*/function (_BlockchainEntityRead) {
828
+ _inheritsLoose(BlockchainEntityReadWrite, _BlockchainEntityRead);
829
+
830
+ function BlockchainEntityReadWrite(signer) {
831
+ return _BlockchainEntityRead.call(this, signer) || this;
832
+ }
833
+
834
+ return BlockchainEntityReadWrite;
835
+ }(BlockchainEntityRead);
836
+ var BlockchainEntity = /*#__PURE__*/function () {
837
+ function BlockchainEntity() {}
838
+
839
+ var _proto = BlockchainEntity.prototype;
840
+
841
+ _proto.read = function read(provider) {
842
+ return new BlockchainEntityRead(provider);
843
+ };
844
+
845
+ _proto.readWrite = function readWrite(signer) {
846
+ return new BlockchainEntityReadWrite(signer);
847
+ };
848
+
849
+ return BlockchainEntity;
850
+ }();
851
+
852
+ var dummyToken = /*#__PURE__*/new sdkCore.Token({
853
+ chainId: 43114,
854
+ decimal: 6,
855
+ symbol: 'USDC',
856
+ address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e'
857
+ });
858
+ var dummyPly = /*#__PURE__*/new sdkCore.Token({
859
+ chainId: 43114,
860
+ decimal: 18,
861
+ symbol: 'QI',
862
+ address: '0x8729438eb15e2c8b576fcc6aecda6a148776c0f5'
863
+ });
864
+ var dummyPlyAurora = /*#__PURE__*/new sdkCore.Token({
865
+ chainId: 43114,
866
+ decimal: 18,
867
+ symbol: 'QIWAVAX',
868
+ address: '0xE530dC2095Ef5653205CF5ea79F8979a7028065c'
869
+ });
870
+ var dummyTokenAmount = /*#__PURE__*/new sdkCore.CurrencyAmount({
871
+ currency: dummyToken,
872
+ amount: '123.456',
873
+ isRaw: false
874
+ });
875
+ var dummyZeroTokenAmount = /*#__PURE__*/new sdkCore.CurrencyAmount({
876
+ currency: dummyToken,
877
+ amount: '0'
878
+ });
879
+ var dummyTokenAmount2 = /*#__PURE__*/new sdkCore.CurrencyAmount({
880
+ currency: dummyToken,
881
+ amount: '456.123',
882
+ isRaw: false
883
+ });
884
+ var dummyTokenAmount3 = /*#__PURE__*/new sdkCore.CurrencyAmount({
885
+ currency: dummyToken,
886
+ amount: '1000.123',
887
+ isRaw: false
888
+ });
889
+ var dummyMarketAddress = '0xbeb5d47a3f720ec0a390d04b4d41ed7d9688bc7f';
890
+ var dummyUserMarketDetails = {
891
+ market: dummyMarketAddress,
892
+ depositBalance: dummyTokenAmount2,
893
+ borrowBalance: dummyZeroTokenAmount,
894
+ isCollateral: true,
895
+ maxWithdrawableAmount: dummyTokenAmount
896
+ };
897
+
898
+ var ethers = /*#__PURE__*/require('ethers');
899
+
900
+ var DOLLAR = /*#__PURE__*/new sdkCore.Token({
901
+ chainId: 43114,
902
+ decimal: 2,
903
+ symbol: 'USDC',
904
+ address: '0x0000000000000000000000000000000000000001'
905
+ });
906
+ var AVAX_DEFAULT_PROVIDER_URL = 'https://api.avax.network/ext/bc/C/rpc';
907
+ var AVAX_DEFAULT_PROVIDER = /*#__PURE__*/new ethers.providers.JsonRpcProvider(AVAX_DEFAULT_PROVIDER_URL);
908
+ var dummyPrivateKey = '1111111111111111111111111111111111111111111111111111111111111111';
909
+ var AVAX_DEFAULT_SIGNER = /*#__PURE__*/new ethers.Wallet(dummyPrivateKey);
910
+
911
+ var ethers$1 = /*#__PURE__*/require('ethers');
912
+
913
+ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
914
+ _inheritsLoose(SdkRead, _BlockchainEntityRead);
915
+
916
+ function SdkRead(providerOrSigner) {
917
+ return _BlockchainEntityRead.call(this, providerOrSigner) || this;
918
+ }
919
+
920
+ var _proto = SdkRead.prototype;
921
+
922
+ _proto.getLockingDetails = /*#__PURE__*/function () {
923
+ var _getLockingDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
924
+ return runtime_1.wrap(function _callee$(_context) {
925
+ while (1) {
926
+ switch (_context.prev = _context.next) {
927
+ case 0:
928
+ return _context.abrupt("return", {
929
+ vestingStart: 1673280000,
930
+ currentUnlockPortion: 0.17,
931
+ nextUnlockPortion: 0.19
932
+ });
933
+
934
+ case 1:
935
+ case "end":
936
+ return _context.stop();
937
+ }
938
+ }
939
+ }, _callee);
940
+ }));
941
+
942
+ function getLockingDetails() {
943
+ return _getLockingDetails.apply(this, arguments);
944
+ }
945
+
946
+ return getLockingDetails;
947
+ }();
948
+
949
+ _proto.getUserDetails = /*#__PURE__*/function () {
950
+ var _getUserDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(userAddress) {
951
+ return runtime_1.wrap(function _callee2$(_context2) {
952
+ while (1) {
953
+ switch (_context2.prev = _context2.next) {
954
+ case 0:
955
+ return _context2.abrupt("return", {
956
+ markets: [dummyUserMarketDetails],
957
+ borrowLimit: dummyTokenAmount3,
958
+ accruedPly: new sdkCore.CurrencyAmount({
959
+ currency: dummyPly,
960
+ amount: '100.12',
961
+ isRaw: false
962
+ }),
963
+ lockedPly: new sdkCore.CurrencyAmount({
964
+ currency: dummyPly,
965
+ amount: '200.12',
966
+ isRaw: false
967
+ }),
968
+ borrowableAmount: dummyTokenAmount2
969
+ });
970
+
971
+ case 1:
972
+ case "end":
973
+ return _context2.stop();
974
+ }
975
+ }
976
+ }, _callee2);
977
+ }));
978
+
979
+ function getUserDetails(_x) {
980
+ return _getUserDetails.apply(this, arguments);
981
+ }
982
+
983
+ return getUserDetails;
984
+ }();
985
+
986
+ _proto.getPlyAuroraPoolDetails = /*#__PURE__*/function () {
987
+ var _getPlyAuroraPoolDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
988
+ return runtime_1.wrap(function _callee3$(_context3) {
989
+ while (1) {
990
+ switch (_context3.prev = _context3.next) {
991
+ case 0:
992
+ return _context3.abrupt("return", {
993
+ totalStakedLiquidity: new sdkCore.CurrencyAmount({
994
+ currency: dummyPlyAurora,
995
+ amount: '12.1',
996
+ isRaw: false
997
+ }),
998
+ apy: 1.21
999
+ });
1000
+
1001
+ case 1:
1002
+ case "end":
1003
+ return _context3.stop();
1004
+ }
1005
+ }
1006
+ }, _callee3);
1007
+ }));
1008
+
1009
+ function getPlyAuroraPoolDetails() {
1010
+ return _getPlyAuroraPoolDetails.apply(this, arguments);
1011
+ }
1012
+
1013
+ return getPlyAuroraPoolDetails;
1014
+ }();
1015
+
1016
+ _proto.getTokenPrice = /*#__PURE__*/function () {
1017
+ var _getTokenPrice = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(token) {
1018
+ return runtime_1.wrap(function _callee4$(_context4) {
1019
+ while (1) {
1020
+ switch (_context4.prev = _context4.next) {
1021
+ case 0:
1022
+ if (!(token.address == dummyToken.address)) {
1023
+ _context4.next = 2;
1024
+ break;
1025
+ }
1026
+
1027
+ return _context4.abrupt("return", new sdkCore.CurrencyAmount({
1028
+ currency: DOLLAR,
1029
+ amount: '1',
1030
+ isRaw: false
1031
+ }));
1032
+
1033
+ case 2:
1034
+ return _context4.abrupt("return", new sdkCore.CurrencyAmount({
1035
+ currency: DOLLAR,
1036
+ amount: '12.1',
1037
+ isRaw: false
1038
+ }));
1039
+
1040
+ case 3:
1041
+ case "end":
1042
+ return _context4.stop();
1043
+ }
1044
+ }
1045
+ }, _callee4);
1046
+ }));
1047
+
1048
+ function getTokenPrice(_x2) {
1049
+ return _getTokenPrice.apply(this, arguments);
1050
+ }
1051
+
1052
+ return getTokenPrice;
1053
+ }();
1054
+
1055
+ _proto.stakeBalanceOf = /*#__PURE__*/function () {
1056
+ var _stakeBalanceOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(user) {
1057
+ return runtime_1.wrap(function _callee5$(_context5) {
1058
+ while (1) {
1059
+ switch (_context5.prev = _context5.next) {
1060
+ case 0:
1061
+ return _context5.abrupt("return", new sdkCore.CurrencyAmount({
1062
+ currency: dummyPlyAurora,
1063
+ amount: '103.4',
1064
+ isRaw: false
1065
+ }));
1066
+
1067
+ case 1:
1068
+ case "end":
1069
+ return _context5.stop();
1070
+ }
1071
+ }
1072
+ }, _callee5);
1073
+ }));
1074
+
1075
+ function stakeBalanceOf(_x3) {
1076
+ return _stakeBalanceOf.apply(this, arguments);
1077
+ }
1078
+
1079
+ return stakeBalanceOf;
1080
+ }();
1081
+
1082
+ return SdkRead;
1083
+ }(BlockchainEntityRead);
1084
+ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
1085
+ _inheritsLoose(SdkReadWrite, _SdkRead);
1086
+
1087
+ function SdkReadWrite() {
1088
+ var _this;
1089
+
1090
+ _this = _SdkRead.apply(this, arguments) || this;
1091
+ _this.dummyTransaction = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6() {
1092
+ var dummyErc20Token;
1093
+ return runtime_1.wrap(function _callee6$(_context6) {
1094
+ while (1) {
1095
+ switch (_context6.prev = _context6.next) {
1096
+ case 0:
1097
+ dummyErc20Token = new ethers$2.Contract(dummyToken.address, IERC20.abi, _this._providerOrSigner);
1098
+ _context6.next = 3;
1099
+ return dummyErc20Token.approve(dummyToken.address, 123);
1100
+
1101
+ case 3:
1102
+ return _context6.abrupt("return", _context6.sent);
1103
+
1104
+ case 4:
1105
+ case "end":
1106
+ return _context6.stop();
1107
+ }
1108
+ }
1109
+ }, _callee6);
1110
+ }));
1111
+ return _this;
1112
+ }
1113
+
1114
+ var _proto2 = SdkReadWrite.prototype;
1115
+
1116
+ _proto2.claim = /*#__PURE__*/function () {
1117
+ var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
1118
+ return runtime_1.wrap(function _callee7$(_context7) {
1119
+ while (1) {
1120
+ switch (_context7.prev = _context7.next) {
1121
+ case 0:
1122
+ return _context7.abrupt("return", this.dummyTransaction());
1123
+
1124
+ case 1:
1125
+ case "end":
1126
+ return _context7.stop();
1127
+ }
1128
+ }
1129
+ }, _callee7, this);
1130
+ }));
1131
+
1132
+ function claim() {
1133
+ return _claim.apply(this, arguments);
1134
+ }
1135
+
1136
+ return claim;
1137
+ }();
1138
+
1139
+ _proto2.stake = /*#__PURE__*/function () {
1140
+ var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount) {
1141
+ return runtime_1.wrap(function _callee8$(_context8) {
1142
+ while (1) {
1143
+ switch (_context8.prev = _context8.next) {
1144
+ case 0:
1145
+ return _context8.abrupt("return", this.dummyTransaction());
1146
+
1147
+ case 1:
1148
+ case "end":
1149
+ return _context8.stop();
1150
+ }
1151
+ }
1152
+ }, _callee8, this);
1153
+ }));
1154
+
1155
+ function stake(_x4) {
1156
+ return _stake.apply(this, arguments);
1157
+ }
1158
+
1159
+ return stake;
1160
+ }();
1161
+
1162
+ _proto2.unstake = /*#__PURE__*/function () {
1163
+ var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(amount) {
1164
+ return runtime_1.wrap(function _callee9$(_context9) {
1165
+ while (1) {
1166
+ switch (_context9.prev = _context9.next) {
1167
+ case 0:
1168
+ return _context9.abrupt("return", this.dummyTransaction());
1169
+
1170
+ case 1:
1171
+ case "end":
1172
+ return _context9.stop();
1173
+ }
1174
+ }
1175
+ }, _callee9, this);
1176
+ }));
1177
+
1178
+ function unstake(_x5) {
1179
+ return _unstake.apply(this, arguments);
1180
+ }
1181
+
1182
+ return unstake;
1183
+ }();
1184
+
1185
+ return SdkReadWrite;
1186
+ }(SdkRead);
1187
+ var SDK = /*#__PURE__*/function (_BlockchainEntity) {
1188
+ _inheritsLoose(SDK, _BlockchainEntity);
1189
+
1190
+ function SDK() {
1191
+ return _BlockchainEntity.call(this) || this;
1192
+ }
1193
+
1194
+ var _proto3 = SDK.prototype;
1195
+
1196
+ _proto3.read = function read(provider) {
1197
+ return new SdkRead(provider);
1198
+ };
1199
+
1200
+ SDK.defaultProvider = function defaultProvider() {
1201
+ return new ethers$1.providers.JsonRpcProvider(AVAX_DEFAULT_PROVIDER_URL);
1202
+ };
1203
+
1204
+ return SDK;
1205
+ }(BlockchainEntity);
1206
+
1207
+ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
1208
+ _inheritsLoose(MoneyMarketRead, _BlockchainEntityRead);
1209
+
1210
+ function MoneyMarketRead(providerOrSigner, auToken) {
1211
+ var _this;
1212
+
1213
+ _this = _BlockchainEntityRead.call(this, providerOrSigner) || this;
1214
+ _this._auToken = new ethers$2.Contract(auToken, AuToken.abi, providerOrSigner);
1215
+ return _this;
1216
+ }
1217
+
1218
+ var _proto = MoneyMarketRead.prototype;
1219
+
1220
+ _proto.getDetails = /*#__PURE__*/function () {
1221
+ var _getDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
1222
+ return runtime_1.wrap(function _callee$(_context) {
1223
+ while (1) {
1224
+ switch (_context.prev = _context.next) {
1225
+ case 0:
1226
+ return _context.abrupt("return", {
1227
+ auTokenAddress: '0x1111111111111111111111111111111111111111',
1228
+ totalTokenDeposited: dummyTokenAmount,
1229
+ totalTokenBorrowed: dummyTokenAmount2,
1230
+ depositApy: 0.1234,
1231
+ depositPlyApy: 0.2345,
1232
+ borrowApy: 0.24,
1233
+ borrowPlyApy: 0.18,
1234
+ collateralRatio: 0.7
1235
+ });
1236
+
1237
+ case 1:
1238
+ case "end":
1239
+ return _context.stop();
1240
+ }
1241
+ }
1242
+ }, _callee);
1243
+ }));
1244
+
1245
+ function getDetails() {
1246
+ return _getDetails.apply(this, arguments);
1247
+ }
1248
+
1249
+ return getDetails;
1250
+ }();
1251
+
1252
+ return MoneyMarketRead;
1253
+ }(BlockchainEntityRead);
1254
+ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
1255
+ _inheritsLoose(MoneyMarketReadWrite, _MoneyMarketRead);
1256
+
1257
+ function MoneyMarketReadWrite() {
1258
+ var _this2;
1259
+
1260
+ _this2 = _MoneyMarketRead.apply(this, arguments) || this;
1261
+ _this2.dummyTransaction = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
1262
+ var dummyErc20Token;
1263
+ return runtime_1.wrap(function _callee2$(_context2) {
1264
+ while (1) {
1265
+ switch (_context2.prev = _context2.next) {
1266
+ case 0:
1267
+ dummyErc20Token = new ethers$2.Contract(dummyToken.address, IERC20.abi, _this2._providerOrSigner);
1268
+ _context2.next = 3;
1269
+ return dummyErc20Token.approve(dummyToken.address, 123);
1270
+
1271
+ case 3:
1272
+ return _context2.abrupt("return", _context2.sent);
1273
+
1274
+ case 4:
1275
+ case "end":
1276
+ return _context2.stop();
1277
+ }
1278
+ }
1279
+ }, _callee2);
1280
+ }));
1281
+ return _this2;
1282
+ }
1283
+
1284
+ var _proto2 = MoneyMarketReadWrite.prototype;
1285
+
1286
+ _proto2.deposit = /*#__PURE__*/function () {
1287
+ var _deposit = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(amount) {
1288
+ return runtime_1.wrap(function _callee3$(_context3) {
1289
+ while (1) {
1290
+ switch (_context3.prev = _context3.next) {
1291
+ case 0:
1292
+ return _context3.abrupt("return", this.dummyTransaction());
1293
+
1294
+ case 1:
1295
+ case "end":
1296
+ return _context3.stop();
1297
+ }
1298
+ }
1299
+ }, _callee3, this);
1300
+ }));
1301
+
1302
+ function deposit(_x) {
1303
+ return _deposit.apply(this, arguments);
1304
+ }
1305
+
1306
+ return deposit;
1307
+ }();
1308
+
1309
+ _proto2.borrow = /*#__PURE__*/function () {
1310
+ var _borrow = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(amount) {
1311
+ return runtime_1.wrap(function _callee4$(_context4) {
1312
+ while (1) {
1313
+ switch (_context4.prev = _context4.next) {
1314
+ case 0:
1315
+ return _context4.abrupt("return", this.dummyTransaction());
1316
+
1317
+ case 1:
1318
+ case "end":
1319
+ return _context4.stop();
1320
+ }
1321
+ }
1322
+ }, _callee4, this);
1323
+ }));
1324
+
1325
+ function borrow(_x2) {
1326
+ return _borrow.apply(this, arguments);
1327
+ }
1328
+
1329
+ return borrow;
1330
+ }();
1331
+
1332
+ _proto2.withdraw = /*#__PURE__*/function () {
1333
+ var _withdraw = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(amount) {
1334
+ return runtime_1.wrap(function _callee5$(_context5) {
1335
+ while (1) {
1336
+ switch (_context5.prev = _context5.next) {
1337
+ case 0:
1338
+ return _context5.abrupt("return", this.dummyTransaction());
1339
+
1340
+ case 1:
1341
+ case "end":
1342
+ return _context5.stop();
1343
+ }
1344
+ }
1345
+ }, _callee5, this);
1346
+ }));
1347
+
1348
+ function withdraw(_x3) {
1349
+ return _withdraw.apply(this, arguments);
1350
+ }
1351
+
1352
+ return withdraw;
1353
+ }();
1354
+
1355
+ _proto2.repay = /*#__PURE__*/function () {
1356
+ var _repay = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(amount) {
1357
+ return runtime_1.wrap(function _callee6$(_context6) {
1358
+ while (1) {
1359
+ switch (_context6.prev = _context6.next) {
1360
+ case 0:
1361
+ return _context6.abrupt("return", this.dummyTransaction());
1362
+
1363
+ case 1:
1364
+ case "end":
1365
+ return _context6.stop();
1366
+ }
1367
+ }
1368
+ }, _callee6, this);
1369
+ }));
1370
+
1371
+ function repay(_x4) {
1372
+ return _repay.apply(this, arguments);
1373
+ }
1374
+
1375
+ return repay;
1376
+ }();
1377
+
1378
+ _proto2.enableCollateral = /*#__PURE__*/function () {
1379
+ var _enableCollateral = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
1380
+ return runtime_1.wrap(function _callee7$(_context7) {
1381
+ while (1) {
1382
+ switch (_context7.prev = _context7.next) {
1383
+ case 0:
1384
+ return _context7.abrupt("return", this.dummyTransaction());
1385
+
1386
+ case 1:
1387
+ case "end":
1388
+ return _context7.stop();
1389
+ }
1390
+ }
1391
+ }, _callee7, this);
1392
+ }));
1393
+
1394
+ function enableCollateral() {
1395
+ return _enableCollateral.apply(this, arguments);
1396
+ }
1397
+
1398
+ return enableCollateral;
1399
+ }();
1400
+
1401
+ _proto2.disableCollateral = /*#__PURE__*/function () {
1402
+ var _disableCollateral = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8() {
1403
+ return runtime_1.wrap(function _callee8$(_context8) {
1404
+ while (1) {
1405
+ switch (_context8.prev = _context8.next) {
1406
+ case 0:
1407
+ return _context8.abrupt("return", this.dummyTransaction());
1408
+
1409
+ case 1:
1410
+ case "end":
1411
+ return _context8.stop();
1412
+ }
1413
+ }
1414
+ }, _callee8, this);
1415
+ }));
1416
+
1417
+ function disableCollateral() {
1418
+ return _disableCollateral.apply(this, arguments);
1419
+ }
1420
+
1421
+ return disableCollateral;
1422
+ }();
1423
+
1424
+ return MoneyMarketReadWrite;
1425
+ }(MoneyMarketRead);
1426
+ var MoneyMarket = /*#__PURE__*/function (_BlockchainEntity) {
1427
+ _inheritsLoose(MoneyMarket, _BlockchainEntity);
1428
+
1429
+ function MoneyMarket(address) {
1430
+ var _this3;
1431
+
1432
+ _this3 = _BlockchainEntity.call(this) || this;
1433
+ _this3.address = sdkCore.validateAndParseAddress(address);
1434
+ return _this3;
1435
+ }
1436
+
1437
+ var _proto3 = MoneyMarket.prototype;
1438
+
1439
+ _proto3.read = function read(provider) {
1440
+ return new MoneyMarketRead(provider, this.address);
1441
+ };
1442
+
1443
+ return MoneyMarket;
1444
+ }(BlockchainEntity);
1445
+
1446
+ function formatObject(object) {
1447
+ return JSON.stringify(object, null, ' ');
1448
+ }
1449
+
1450
+ function sum(a, b) {
1451
+ return a + b;
1452
+ }
1453
+
1454
+ exports.AVAX_DEFAULT_PROVIDER = AVAX_DEFAULT_PROVIDER;
1455
+ exports.AVAX_DEFAULT_PROVIDER_URL = AVAX_DEFAULT_PROVIDER_URL;
1456
+ exports.AVAX_DEFAULT_SIGNER = AVAX_DEFAULT_SIGNER;
1457
+ exports.BlockchainEntity = BlockchainEntity;
1458
+ exports.BlockchainEntityRead = BlockchainEntityRead;
1459
+ exports.BlockchainEntityReadWrite = BlockchainEntityReadWrite;
1460
+ exports.DOLLAR = DOLLAR;
1461
+ exports.MoneyMarket = MoneyMarket;
1462
+ exports.MoneyMarketRead = MoneyMarketRead;
1463
+ exports.MoneyMarketReadWrite = MoneyMarketReadWrite;
1464
+ exports.SDK = SDK;
1465
+ exports.SdkRead = SdkRead;
1466
+ exports.SdkReadWrite = SdkReadWrite;
1467
+ exports.dummyMarketAddress = dummyMarketAddress;
1468
+ exports.dummyPly = dummyPly;
1469
+ exports.dummyPlyAurora = dummyPlyAurora;
1470
+ exports.dummyToken = dummyToken;
1471
+ exports.dummyTokenAmount = dummyTokenAmount;
1472
+ exports.dummyTokenAmount2 = dummyTokenAmount2;
1473
+ exports.dummyTokenAmount3 = dummyTokenAmount3;
1474
+ exports.dummyUserMarketDetails = dummyUserMarketDetails;
1475
+ exports.dummyZeroTokenAmount = dummyZeroTokenAmount;
1476
+ exports.formatObject = formatObject;
1477
+ exports.sum = sum;
1478
+ //# sourceMappingURL=sdk.cjs.development.js.map