@aurigami/sdk 0.3.3 → 0.3.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.
- package/dist/sdk.cjs.development.js +21 -23
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +21 -23
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/SDK.ts +4 -8
- package/src/types.ts +1 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@ethersproject/abstract-signer"),n=e(require("bignumber.js")),r=require("ethers"),a=e(require("@aurigami/contracts/artifacts/contracts/AuErc20.sol/AuErc20.json")),i=e(require("@aurigami/contracts/artifacts/contracts/AuETH.sol/AuETH.json")),o=e(require("@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json")),s=e(require("@aurigami/contracts/artifacts/contracts/AuriLens.sol/AuriLens.json")),u=e(require("@aurigami/contracts/artifacts/contracts/TokenLock.sol/TokenLock.json")),c=e(require("@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json"));function p(e,t,n,r,a,i,o){try{var s=e[i](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,a)}function d(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){p(i,r,a,o,s,"next",e)}function s(e){p(i,r,a,o,s,"throw",e)}o(void 0)}))}}function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return y(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var h,m=(function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=Object.create((t&&t.prototype instanceof d?t:d).prototype),i=new T(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(a,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw i;return{value:void 0,done:!0}}for(n.method=a,n.arg=i;;){var o=n.delegate;if(o){var s=x(o,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,i),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var p={};function d(){}function l(){}function y(){}var f={};s(f,a,(function(){return this}));var h=Object.getPrototypeOf,m=h&&h(h(A([])));m&&m!==t&&n.call(m,a)&&(f=m);var w=y.prototype=d.prototype=Object.create(f);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){var r;this._invoke=function(a,i){function o(){return new t((function(r,o){!function r(a,i,o,s){var u=c(e[a],e,i);if("throw"!==u.type){var p=u.arg,d=p.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(d).then((function(e){p.value=e,o(p)}),(function(e){return r("throw",e,o,s)}))}s(u.arg)}(a,i,r,o)}))}return r=r?r.then(o,o):o()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function g(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(g,this),this.reset(!0)}function A(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:L}}function L(){return{value:void 0,done:!0}}return l.prototype=y,s(w,"constructor",y),s(y,"constructor",l),l.displayName=s(y,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,s(e,o,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},b(v.prototype),s(v.prototype,i,(function(){return this})),e.AsyncIterator=v,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new v(u(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},b(w),s(w,o,"Generator"),s(w,a,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=A,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;k(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:A(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(h={exports:{}}),h.exports),w=function(e){this._networkConnection=e},b=function(e){function n(n){if(!(n.signer instanceof t.Signer))throw Error("Signer is not provided when constructing BlockchainEntityReadWrite");return e.call(this,n)||this}return l(n,e),n}(w),v=function(){function e(){}var t=e.prototype;return t.read=function(e){return new w(e)},t.readWrite=function(e){return new b(e)},e}(),x=require("ethers"),g=new x.providers.JsonRpcProvider("https://api.avax.network/ext/bc/C/rpc"),k=new x.providers.JsonRpcProvider("https://mainnet.aurora.dev"),T="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",A=new x.Wallet("1111111111111111111111111111111111111111111111111111111111111111",k),L={auTokens:[{address:"0x2dEf6eb801757655AD227110d65C80DB595bBc60".toLowerCase(),underlying:"0xb12bfca5a55806aaf64e99521918a4bf0fc40802".toLowerCase()},{address:"0x7b47690b04494A628151Dbb86B4cC95CF2629B14".toLowerCase(),underlying:T.toLowerCase()},{address:"0xFB0e4680B8b1c7B69fb6a3988029c74fea871DD9".toLowerCase(),underlying:"0xf4eb217ba2454613b15dbdea6e5f22276410e89e".toLowerCase()},{address:"0x6bB82009b316A9098C23E3962b4371E879c8D23D".toLowerCase(),underlying:"0x4988a896b1227218e4a686fde5eabdcabd91571f".toLowerCase()},{address:"0xBf43057c634868251e65e39b4f27662f644454b4".toLowerCase(),underlying:"0xe3520349f477a5f6eb06107066048508498a291b".toLowerCase()},{address:"0x83Ae17f197C1F1260543d4D5A710772761535066".toLowerCase(),underlying:"0x8bec47865ade3b172a928df8f990bc7f2a3b9f79".toLowerCase()},{address:"0xcC5CA0156317C1FF2A96E0f45659625081352071".toLowerCase(),underlying:"0xC42C30aC6Cc15faC9bD938618BcaA1a1FaE8501d".toLowerCase()},{address:"0x173Bf18675D52B4887C5d40E935C3ab1192aFb4C".toLowerCase(),underlying:"0xb9b8d9e5557381BF025f1A59B602ad3F19A4e4Be".toLowerCase()}],misc:{COMPTROLLER:"0x3b416D37A85F7aD941e36258d4Da660A1898E181".toLowerCase(),oracle:"0x08A74ca75BAE803e92752f8d7A5cD718b1cA6509".toLowerCase(),AURIFAIRLAUNCH:"0xeed0433Cbc81F25061bb739Ff8f1D5736b16d038".toLowerCase(),AURILENS:"0xb11820C3d8ae1f6C31047644C59190280651C9da".toLowerCase(),TOKENLOCK:"0x537754515509A83Ce2D076c0982292AC5289b408".toLowerCase()},tokens:{AURORA:"0x8bec47865ade3b172a928df8f990bc7f2a3b9f79".toLowerCase(),PLY:"0xb9b8d9e5557381BF025f1A59B602ad3F19A4e4Be".toLowerCase(),AURPLY:"0x822E871518C22E8570cFbEa43FddbBFF963d4bdE".toLowerCase()}},C=new n(.95),E={"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee":18,"0xb9b8d9e5557381bf025f1a59b602ad3f19a4e4be":18,"0x83ae17f197c1f1260543d4d5a710772761535066":8,"0xf4eb217ba2454613b15dbdea6e5f22276410e89e":8,"0x4988a896b1227218e4a686fde5eabdcabd91571f":6,"0xfb0e4680b8b1c7b69fb6a3988029c74fea871dd9":8,"0xb12bfca5a55806aaf64e99521918a4bf0fc40802":6,"0xbf43057c634868251e65e39b4f27662f644454b4":8,"0xc42c30ac6cc15fac9bd938618bcaa1a1fae8501d":24,"0x7b47690b04494a628151dbb86b4cc95cf2629b14":8,"0x822e871518c22e8570cfbea43fddbbff963d4bde":18,"0x2def6eb801757655ad227110d65c80db595bbc60":8,"0x6bb82009b316a9098c23e3962b4371e879c8d23d":8,"0x8bec47865ade3b172a928df8f990bc7f2a3b9f79":18,"0xcc5ca0156317c1ff2a96e0f45659625081352071":8,"0xe3520349f477a5f6eb06107066048508498a291b":18,"0x173bf18675d52b4887c5d40e935c3ab1192afb4c":8};function P(e){return r.BigNumber.from(10).pow(e).toString()}var _,R=function(e,t){return e.toLowerCase()==t.toLowerCase()},S=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Math.trunc(Date.now()/1e3));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function B(e){try{return r.utils.getAddress(e)}catch(t){throw new Error("Invalid address: "+e)}}function M(e){return E[e.toLowerCase()]}function F(e,t,r){return t.lte(0)?new n("999999999"):e.multipliedBy(r).dividedBy(t)}(_=exports.ComptrollerRewardType||(exports.ComptrollerRewardType={}))[_.PLY=0]="PLY",_[_.AURORA=1]="AURORA";var O=function(e,t){this.address=e.toLowerCase(),this.decimals=t},D=new O(L.tokens.PLY,M(L.tokens.PLY)),U=new O(L.tokens.AURPLY,M(L.tokens.AURPLY)),I=function(){function e(e,t,r){void 0===r&&(r=!0),this.rawAmnt=r?t:new n(t).times(P(e.decimals)).toFixed(0),this.token=e}var t=e.prototype;return t.formattedAmount=function(){return new n(this.rawAmnt).div(P(this.token.decimals)).toString()},t.rawAmount=function(){return this.rawAmnt},e}(),N=[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"feed",type:"address"},{indexed:!1,internalType:"string",name:"symbol",type:"string"}],name:"FeedSet",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"NewAdmin",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"previousPriceMantissa",type:"uint256"},{indexed:!1,internalType:"uint256",name:"requestedPriceMantissa",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newPriceMantissa",type:"uint256"}],name:"PricePosted",type:"event"},{constant:!0,inputs:[],name:"admin",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"asset",type:"address"}],name:"assetPrices",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"string",name:"symbol",type:"string"}],name:"getFeed",outputs:[{internalType:"contract AggregatorV2V3Interface",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"contract QiToken",name:"qiToken",type:"address"}],name:"getUnderlyingPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"isPriceOracle",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"newAdmin",type:"address"}],name:"setAdmin",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"price",type:"uint256"}],name:"setDirectPrice",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"string",name:"symbol",type:"string"},{internalType:"address",name:"feed",type:"address"}],name:"setFeed",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"contract QiToken",name:"qiToken",type:"address"},{internalType:"uint256",name:"underlyingPriceMantissa",type:"uint256"}],name:"setUnderlyingPrice",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],j=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"pure",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"reserve0",type:"uint112"},{internalType:"uint112",name:"reserve1",type:"uint112"},{internalType:"uint32",name:"blockTimestampLast",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[],name:"sync",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],Y=[],q=require("axios");function W(e){return G.apply(this,arguments)}function G(){return(G=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q.get("https://api.coingecko.com/api/v3/simple/price?ids="+t+"&vs_currencies=usd").then((function(e){return e.data}));case 2:return e.abrupt("return",new n(e.sent[t].usd));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(e){return H.apply(this,arguments)}function H(){return(H=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!R(t,L.tokens.AURORA)){e.next=4;break}return e.abrupt("return",W("aurora-near"));case 4:throw Error("Unknown token "+t+" in fetchPriceFromCoingecko");case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(e,t){return J.apply(this,arguments)}function J(){return(J=d(m.mark((function e(t,n){var a,i,o;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=[],i=new r.Contract(t,j,n),a.push(i.token0()),a.push(i.toekn1()),a.push(i.getReserves()),a.push(i.totalSupply()),e.next=8,Promise.all(a);case 8:return e.abrupt("return",{token0:(o=e.sent)[0],token1:o[1],reserve0:o[2].reserve0,reserve1:o[2].reserve1,totalSupply:o[3]});case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Q(e,t){return X.apply(this,arguments)}function X(){return(X=d(m.mark((function e(t,r){var a,i,o;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K(t,r);case 2:return a=e.sent,e.prev=3,e.next=6,te(a.token0,r);case 6:return i=e.sent.multipliedBy(a.reserve0.toString()).multipliedBy(2),e.abrupt("return",i.multipliedBy(P(18)).dividedBy(new n(a.totalSupply.toString())));case 11:return e.prev=11,e.t0=e.catch(3),e.prev=13,e.next=16,te(a.token1,r);case 16:return o=e.sent.multipliedBy(a.reserve1.toString()).multipliedBy(2),e.abrupt("return",o.multipliedBy(P(18)).dividedBy(new n(a.totalSupply.toString())));case 21:throw e.prev=21,e.t1=e.catch(13),Error("Unable to fetch price for both tokens of LP "+t);case 24:case"end":return e.stop()}}),e,null,[[3,11],[13,21]])})))).apply(this,arguments)}function z(e,t){return new n(e.toString()).div(P(36-t))}function Z(e,t,n){return $.apply(this,arguments)}function $(){return($=d(m.mark((function e(t,n,a){var i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new r.Contract(L.misc.oracle,N,a),e.next=3,i.getUnderlyingPrice(t);case 3:return e.abrupt("return",z(e.sent,n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(){return(ee=d(m.mark((function e(t){var n,a,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new r.Contract(L.misc.AURILENS,Y,t),a=L.auTokens.map((function(e){return e.address})),i=L.auTokens.map((function(e){return M(e.underlying)})),e.next=5,n.auTokenUnderlyingPriceAll(a);case 5:return e.abrupt("return",e.sent.map((function(e,t){return{auToken:e.auToken,underlyingPrice:z(e.underlyingPrice,i[t])}})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(e,t){return ne.apply(this,arguments)}function ne(){return(ne=d(m.mark((function e(t,n){var r;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===(r=L.auTokens.find((function(e){return R(e.underlying,t)})))){e.next=5;break}return e.abrupt("return",Z(r.address,M(t),n));case 5:if(!R(t,L.misc.AUPLYLP)){e.next=9;break}return e.abrupt("return",Q(t,n));case 9:return e.abrupt("return",V(t));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function re(e,t,n){return ae.apply(this,arguments)}function ae(){return(ae=d(m.mark((function e(t,r,a){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==a){e.next=4;break}return e.next=3,te(t.token.address,r);case 3:a=e.sent;case 4:return e.abrupt("return",new n(t.formattedAmount()).multipliedBy(a));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ie=function(e){function t(t,n,u){var c;return(c=e.call(this,t)||this).auToken=R(u,T)?new r.Contract(n,i.abi,t.provider):new r.Contract(n,a.abi,t.provider),c.underlying=new O(u,M(u)),c._comptroller=new r.Contract(L.misc.COMPTROLLER,o.abi,t.provider),c._auriLens=new r.Contract(L.misc.AURILENS,s.abi,t.provider),c}l(t,e);var u=t.prototype;return u.getRewardSpeeds=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._auriLens.getRewardSpeeds(this._comptroller.address,this.auToken.address);case 2:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getTotalTokenBorrowed=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=I,e.t1=this.underlying,e.next=4,this.auToken.totalBorrows();case 4:return e.t2=e.sent.toString(),e.abrupt("return",new e.t0(e.t1,e.t2));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getTotalTokenDeposited=function(){var e=d(m.mark((function e(){var t,n,a,i=this;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=[]).push(this.getTotalTokenBorrowed().then((function(e){n=e}))),t.push(this.auToken.getCash().then((function(e){a=new I(i.underlying,e.toString())}))),e.next=5,Promise.all(t);case 5:return e.abrupt("return",new I(this.underlying,r.BigNumber.from(a.rawAmount()).add(n.rawAmount()).toString()));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getDepositAPY=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.auToken.supplyRatePerTimestamp();case 2:return e.abrupt("return",new n(e.sent.toString()).multipliedBy(31536e3).div(P(18)));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getBorrowAPY=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.auToken.borrowRatePerTimestamp();case 2:return e.abrupt("return",new n(e.sent.toString()).multipliedBy(31536e3).div(P(18)));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getCollateralRatio=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._comptroller.markets(this.auToken.address).then((function(e){return new n(e.collateralFactorMantissa.toString()).div(P(18))})));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getBorrowPlyAPY=function(){var e=d(m.mark((function e(){var t,n,r,a,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=[]).push(this.getTotalTokenBorrowed().then((function(e){n=e}))),t.push(this._comptroller.rewardSpeeds(exports.ComptrollerRewardType.PLY,this.auToken.address,!1).then((function(e){r=new I(D,e.toString())}))),t.push(te(L.tokens.PLY,this._networkConnection.provider).then((function(e){a=e}))),t.push(te(this.underlying.address,this._networkConnection.provider).then((function(e){i=e}))),e.next=7,Promise.all(t);case 7:return e.abrupt("return",F(a.multipliedBy(r.formattedAmount()),i.multipliedBy(n.formattedAmount()),31536e3));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getDepositPlyAPY=function(){var e=d(m.mark((function e(){var t,n,r,a,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=[]).push(this.getTotalTokenDeposited().then((function(e){n=e}))),t.push(this._comptroller.rewardSpeeds(exports.ComptrollerRewardType.PLY,this.auToken.address,!0).then((function(e){r=new I(D,e.toString())}))),t.push(te(L.tokens.PLY,this._networkConnection.provider).then((function(e){a=e}))),t.push(te(this.underlying.address,this._networkConnection.provider).then((function(e){i=e}))),e.next=7,Promise.all(t);case 7:return e.abrupt("return",F(a.multipliedBy(r.formattedAmount()),i.multipliedBy(n.formattedAmount()),31536e3));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getDetails=function(){var e=d(m.mark((function e(){var t,n,r,a,i,o,s,u,c,p,d;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=[]).push(this.getTotalTokenDeposited().then((function(e){n=e}))),t.push(this.getTotalTokenBorrowed().then((function(e){r=e}))),t.push(this.getDepositAPY().then((function(e){a=e.toNumber()}))),t.push(this.getBorrowAPY().then((function(e){i=e.toNumber()}))),t.push(this.getCollateralRatio().then((function(e){o=e.toNumber()}))),t.push(this.getRewardSpeeds().then((function(e){c=e}))),t.push(te(L.tokens.PLY,this._networkConnection.provider).then((function(e){s=e}))),t.push(te(this.underlying.address,this._networkConnection.provider).then((function(e){u=e}))),e.next=11,Promise.all(t);case 11:return e.t0=F,e.next=14,re(new I(D,c.plyRewardBorrowSpeed.toString()),this._networkConnection.provider,s);case 14:return e.t1=e.sent,e.t2=u.multipliedBy(r.formattedAmount()),e.t3=31536e3,p=(0,e.t0)(e.t1,e.t2,e.t3),e.t4=F,e.next=21,re(new I(D,c.plyRewardSupplySpeed.toString()),this._networkConnection.provider,s);case 21:return e.t5=e.sent,e.t6=u.multipliedBy(n.formattedAmount()),e.t7=31536e3,d=(0,e.t4)(e.t5,e.t6,e.t7),e.abrupt("return",{auTokenAddress:this.auToken.address,totalTokenDeposited:n,totalTokenBorrowed:r,depositApy:a,depositPlyApy:d.toNumber(),borrowApy:i,borrowPlyApy:p.toNumber(),collateralRatio:o});case 26:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getUserBorrowBalance=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.auToken.callStatic.borrowBalanceCurrent(t);case 2:return e.abrupt("return",new I(this.underlying,e.sent.toString()));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),u.getUserDepositBalance=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.auToken.callStatic.balanceOfUnderlying(t);case 2:return e.abrupt("return",new I(this.underlying,e.sent.toString()));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t}(w),oe=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var n=t.prototype;return n.deposit=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!R(t.token.address,T)){e.next=4;break}return e.abrupt("return",this.auToken.connect(this._networkConnection.signer).mint({value:t.rawAmount()}));case 4:return e.abrupt("return",this.auToken.connect(this._networkConnection.signer).mint(t.rawAmount()));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.borrow=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.auToken.connect(this._networkConnection.signer).borrow(t.rawAmount()));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.withdraw=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.auToken.connect(this._networkConnection.signer).redeemUnderlying(t.rawAmount()));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.repay=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!R(t.token.address,T)){e.next=4;break}return e.abrupt("return",this.auToken.connect(this._networkConnection.signer).repayBorrow({value:t.rawAmount()}));case 4:return e.abrupt("return",this.auToken.connect(this._networkConnection.signer).repayBorrow(t.rawAmount()));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.enableCollateral=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._comptroller.connect(this._networkConnection.signer).enterMarkets([this.auToken.address]));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n.disableCollateral=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._comptroller.connect(this._networkConnection.signer).exitMarket(this.auToken.address));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t}(ie),se=function(e){function t(t,n){var r;return(r=e.call(this)||this).address=B(t),r.underlying=B(n),r}return l(t,e),t.prototype.read=function(e){return new ie(e,this.address,this.underlying)},t}(v),ue=function(e){function t(t){var n;return(n=e.call(this,t)||this)._comptroller=new r.Contract(L.misc.COMPTROLLER,o.abi,t.provider),n._tokenLock=new r.Contract(L.misc.TOKENLOCK,u.abi,t.provider),n._auriFairLaunch=new r.Contract(L.misc.AURIFAIRLAUNCH,c.abi,t.provider),n._auriLens=new r.Contract(L.misc.AURILENS,s.abi,t.provider),n}l(t,e);var a=t.prototype;return a.getLockingDetails=function(){var e=d(m.mark((function e(){var t,a,i,o;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(this._networkConnection.provider),e.next=3,S(this._networkConnection.provider);case 3:return t=r.BigNumber.from(e.sent-1640995200).div(604800).toNumber(),a=1e4,(i=[]).push(this._tokenLock.percentageLock(t)),i.push(this._tokenLock.percentageLock(t+1).catch((function(e){return a}))),e.next=11,Promise.all(i).then((function(e){return e.map((function(e){return e.toString()}))}));case 11:return o=e.sent,e.abrupt("return",{vestingStart:1640995200,currentUnlockPortion:new n(a).minus(o[0]).div(a).toNumber(),nextUnlockPortion:new n(a).minus(o[1]).div(a).toNumber()});case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),a.getUserDetails=function(){var e=d(m.mark((function e(t){var r,a,i,o,s,u,c,p,d,l,y,h,w,b,v,x,g,k,T,A,E,_,S=this;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=L.auTokens.length,a=[],o=new Array(r),s=[],u=new n(0),c=[],p=function(){var e=l.value,n={};a.push(n),n.market=e.underlying;var r=new ie(S._networkConnection,e.address,e.underlying);s.push(r.getUserDepositBalance(t).then((function(e){n.depositBalance=e}))),s.push(r.getUserBorrowBalance(t).then((function(e){n.borrowBalance=e}))),s.push(r.getCollateralRatio().then((function(e){o[b]=e}))),c.push(te(r.underlying.address,S._networkConnection.provider))},d=f(L.auTokens);!(l=d()).done;)p();return s.push(this._comptroller.getAssetsIn(t).then((function(e){i=e}))),e.next=11,Promise.all(s);case 11:return e.next=13,Promise.all(c);case 13:for(y=e.sent,h=[],w=function(){var e=L.auTokens[b];a[b].isCollateral=i.filter((function(t){R(e.address,t)})).length>0,h.push(re(a[b].depositBalance,S._networkConnection.provider,y[b]))},b=0;b<r;b++)w();return e.next=19,Promise.all(h);case 19:return u=e.sent.reduce((function(e,t,n){return a[n].isCollateral?e.plus(t.multipliedBy(o[n])):e})),(s=[]).push(this._comptroller.getAccountLiquidity(t)),s.push(this._auriLens.callStatic.getRewardBalancesMetadata(this._comptroller.address,this._auriFairLaunch.address,t,[0])),s.push(this._tokenLock.lockedAmounts(t)),e.next=27,Promise.all(s);case 27:for(v=(g=e.sent)[1],x=g[2],k=u.minus(new n(g[0][1].toString()).div(P(18))),T=u.multipliedBy(C),A=T.lte(k)?new n(0):T.minus(k),b=0;b<r;b++)_=new ie(this._networkConnection,(E=L.auTokens[b]).address,E.underlying),a[b].maxWithdrawableAmount=new I(_.underlying,A.div(y[b]).toFixed(18));return e.abrupt("return",{markets:a,borrowLimit:{currency:"USD",amount:T.toFixed(6)},accruedPly:new I(D,v.plyAccrued.toString()),lockedPly:new I(D,x.toString()),borrowableAmount:{currency:"USD",amount:A.toFixed(6)}});case 36:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),a.getPlyAuroraPoolDetails=function(){var e=d(m.mark((function e(){var t,n,r,a,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=[]).push(this._auriFairLaunch.getPoolInfo(0).then((function(e){t=e.totalStake,n=e.rewardPerSecond}))),e.next=4,Promise.all(r);case 4:return(r=[]).push(re(new I(D,n.toString()),this._networkConnection.provider).then((function(e){return a=e}))),r.push(re(new I(U,t.toString()),this._networkConnection.provider).then((function(e){return i=e}))),e.next=9,Promise.all(r);case 9:return e.abrupt("return",{totalStakedLiquidity:new I(U,t.toString()),apy:F(a,i,31536e3).toFixed(6)});case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),a.getTokenPrice=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,te(t.address,this._networkConnection.provider);case 2:return e.abrupt("return",{currency:"USD",amount:e.sent.toFixed(6)});case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),a.stakeBalanceOf=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._auriFairLaunch.getUserInfo(0,t);case 2:return e.abrupt("return",new I(U,e.sent.amount.toString()));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t}(w),ce=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var n=t.prototype;return n.claim=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._auriLens.connect(this._networkConnection.signer).claimRewards(this._comptroller.address,this._auriFairLaunch.address,[0]));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n.stake=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._auriFairLaunch.connect(this._networkConnection.signer).deposit(0,t.rawAmount(),!1));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.unstake=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._auriFairLaunch.connect(this._networkConnection.signer).withdraw(0,t.rawAmount()));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t}(ue),pe=function(e){function t(){return e.call(this)||this}return l(t,e),t.prototype.read=function(e){return new ue(e)},t.defaultProvider=function(){return new r.ethers.providers.JsonRpcProvider("https://api.avax.network/ext/bc/C/rpc")},t}(v),de=new O("0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",6),le=new O("0x8729438eb15e2c8b576fcc6aecda6a148776c0f5",18),ye=new O("0xE530dC2095Ef5653205CF5ea79F8979a7028065c",18),fe=new I(de,"123.456",!1),he=new I(de,"0"),me=new I(de,"456.123",!1),we=new I(de,"1000.123",!1),be={market:"0xbeb5d47a3f720ec0a390d04b4d41ed7d9688bc7f",depositBalance:me,borrowBalance:he,isCollateral:!0,maxWithdrawableAmount:fe};exports.AURORA_CHAINID=1313161554,exports.AURORA_DEFAULT_PROVIDER=k,exports.AURORA_DEFAULT_PROVIDER_URL="https://mainnet.aurora.dev",exports.AURORA_DEFAULT_SIGNER=A,exports.AURPLYToken=U,exports.AVAX_DEFAULT_PROVIDER=g,exports.AVAX_DEFAULT_PROVIDER_URL="https://api.avax.network/ext/bc/C/rpc",exports.AurPlyPid=0,exports.BORROW_LIMIT_BUFFER=C,exports.BlockchainEntity=v,exports.BlockchainEntityRead=w,exports.BlockchainEntityReadWrite=b,exports.DECIMAL_PRECISION=6,exports.ETHAddress=T,exports.MoneyMarket=se,exports.MoneyMarketRead=ie,exports.MoneyMarketReadWrite=oe,exports.ONE_DAY=86400,exports.ONE_YEAR=31536e3,exports.PLYToken=D,exports.REWARDCLAIMSTART=1640995200,exports.SDK=pe,exports.SdkRead=ue,exports.SdkReadWrite=ce,exports.Token=O,exports.TokenAmount=I,exports.calcLMRewardApr=F,exports.decimalFactor=P,exports.dummyAddress="0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE",exports.dummyMarketAddress="0xbeb5d47a3f720ec0a390d04b4d41ed7d9688bc7f",exports.dummyPly=le,exports.dummyPlyAurora=ye,exports.dummyToken=de,exports.dummyTokenAmount=fe,exports.dummyTokenAmount2=me,exports.dummyTokenAmount3=we,exports.dummyUserMarketDetails=be,exports.dummyZeroTokenAmount=he,exports.fetchLPPositions=K,exports.fetchLPPrice=Q,exports.fetchPrice=te,exports.fetchPriceFromCoingecko=V,exports.fetchPriceFromCoingeckoAPI=W,exports.fetchPriceFromOracle=Z,exports.fetchUnderlyingTokensPrices=function(e){return ee.apply(this,arguments)},exports.fetchValuation=re,exports.formatObject=function(e){return JSON.stringify(e,null," ")},exports.getCurrentTimestamp=S,exports.getDecimal=M,exports.isSameAddress=R,exports.networkAddresses=L,exports.validateAndParseAddress=B;
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@ethersproject/abstract-signer"),n=e(require("bignumber.js")),r=require("ethers"),a=e(require("@aurigami/contracts/artifacts/contracts/AuErc20.sol/AuErc20.json")),i=e(require("@aurigami/contracts/artifacts/contracts/AuETH.sol/AuETH.json")),o=e(require("@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json")),s=e(require("@aurigami/contracts/artifacts/contracts/AuriLens.sol/AuriLens.json")),u=e(require("@aurigami/contracts/artifacts/contracts/TokenLock.sol/TokenLock.json")),c=e(require("@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json"));function p(e,t,n,r,a,i,o){try{var s=e[i](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,a)}function d(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){p(i,r,a,o,s,"next",e)}function s(e){p(i,r,a,o,s,"throw",e)}o(void 0)}))}}function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return y(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var h,m=(function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=Object.create((t&&t.prototype instanceof d?t:d).prototype),i=new T(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(a,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw i;return{value:void 0,done:!0}}for(n.method=a,n.arg=i;;){var o=n.delegate;if(o){var s=x(o,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,i),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var p={};function d(){}function l(){}function y(){}var f={};s(f,a,(function(){return this}));var h=Object.getPrototypeOf,m=h&&h(h(A([])));m&&m!==t&&n.call(m,a)&&(f=m);var w=y.prototype=d.prototype=Object.create(f);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){var r;this._invoke=function(a,i){function o(){return new t((function(r,o){!function r(a,i,o,s){var u=c(e[a],e,i);if("throw"!==u.type){var p=u.arg,d=p.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(d).then((function(e){p.value=e,o(p)}),(function(e){return r("throw",e,o,s)}))}s(u.arg)}(a,i,r,o)}))}return r=r?r.then(o,o):o()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return p;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function g(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(g,this),this.reset(!0)}function A(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:L}}function L(){return{value:void 0,done:!0}}return l.prototype=y,s(w,"constructor",y),s(y,"constructor",l),l.displayName=s(y,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,s(e,o,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},b(v.prototype),s(v.prototype,i,(function(){return this})),e.AsyncIterator=v,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new v(u(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},b(w),s(w,o,"Generator"),s(w,a,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=A,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;k(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:A(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(h={exports:{}}),h.exports),w=function(e){this._networkConnection=e},b=function(e){function n(n){if(!(n.signer instanceof t.Signer))throw Error("Signer is not provided when constructing BlockchainEntityReadWrite");return e.call(this,n)||this}return l(n,e),n}(w),v=function(){function e(){}var t=e.prototype;return t.read=function(e){return new w(e)},t.readWrite=function(e){return new b(e)},e}(),x=require("ethers"),g=new x.providers.JsonRpcProvider("https://api.avax.network/ext/bc/C/rpc"),k=new x.providers.JsonRpcProvider("https://mainnet.aurora.dev"),T="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",A=new x.Wallet("1111111111111111111111111111111111111111111111111111111111111111",k),L={auTokens:[{address:"0x2dEf6eb801757655AD227110d65C80DB595bBc60".toLowerCase(),underlying:"0xb12bfca5a55806aaf64e99521918a4bf0fc40802".toLowerCase()},{address:"0x7b47690b04494A628151Dbb86B4cC95CF2629B14".toLowerCase(),underlying:T.toLowerCase()},{address:"0xFB0e4680B8b1c7B69fb6a3988029c74fea871DD9".toLowerCase(),underlying:"0xf4eb217ba2454613b15dbdea6e5f22276410e89e".toLowerCase()},{address:"0x6bB82009b316A9098C23E3962b4371E879c8D23D".toLowerCase(),underlying:"0x4988a896b1227218e4a686fde5eabdcabd91571f".toLowerCase()},{address:"0xBf43057c634868251e65e39b4f27662f644454b4".toLowerCase(),underlying:"0xe3520349f477a5f6eb06107066048508498a291b".toLowerCase()},{address:"0x83Ae17f197C1F1260543d4D5A710772761535066".toLowerCase(),underlying:"0x8bec47865ade3b172a928df8f990bc7f2a3b9f79".toLowerCase()},{address:"0xcC5CA0156317C1FF2A96E0f45659625081352071".toLowerCase(),underlying:"0xC42C30aC6Cc15faC9bD938618BcaA1a1FaE8501d".toLowerCase()},{address:"0x173Bf18675D52B4887C5d40E935C3ab1192aFb4C".toLowerCase(),underlying:"0xb9b8d9e5557381BF025f1A59B602ad3F19A4e4Be".toLowerCase()}],misc:{COMPTROLLER:"0x3b416D37A85F7aD941e36258d4Da660A1898E181".toLowerCase(),oracle:"0x08A74ca75BAE803e92752f8d7A5cD718b1cA6509".toLowerCase(),AURIFAIRLAUNCH:"0xeed0433Cbc81F25061bb739Ff8f1D5736b16d038".toLowerCase(),AURILENS:"0xb11820C3d8ae1f6C31047644C59190280651C9da".toLowerCase(),TOKENLOCK:"0x537754515509A83Ce2D076c0982292AC5289b408".toLowerCase()},tokens:{AURORA:"0x8bec47865ade3b172a928df8f990bc7f2a3b9f79".toLowerCase(),PLY:"0xb9b8d9e5557381BF025f1A59B602ad3F19A4e4Be".toLowerCase(),AURPLY:"0x822E871518C22E8570cFbEa43FddbBFF963d4bdE".toLowerCase()}},C=new n(.95),E={"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee":18,"0xb9b8d9e5557381bf025f1a59b602ad3f19a4e4be":18,"0x83ae17f197c1f1260543d4d5a710772761535066":8,"0xf4eb217ba2454613b15dbdea6e5f22276410e89e":8,"0x4988a896b1227218e4a686fde5eabdcabd91571f":6,"0xfb0e4680b8b1c7b69fb6a3988029c74fea871dd9":8,"0xb12bfca5a55806aaf64e99521918a4bf0fc40802":6,"0xbf43057c634868251e65e39b4f27662f644454b4":8,"0xc42c30ac6cc15fac9bd938618bcaa1a1fae8501d":24,"0x7b47690b04494a628151dbb86b4cc95cf2629b14":8,"0x822e871518c22e8570cfbea43fddbbff963d4bde":18,"0x2def6eb801757655ad227110d65c80db595bbc60":8,"0x6bb82009b316a9098c23e3962b4371e879c8d23d":8,"0x8bec47865ade3b172a928df8f990bc7f2a3b9f79":18,"0xcc5ca0156317c1ff2a96e0f45659625081352071":8,"0xe3520349f477a5f6eb06107066048508498a291b":18,"0x173bf18675d52b4887c5d40e935c3ab1192afb4c":8};function P(e){return r.BigNumber.from(10).pow(e).toString()}var _,R=function(e,t){return e.toLowerCase()==t.toLowerCase()},S=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Math.trunc(Date.now()/1e3));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function B(e){try{return r.utils.getAddress(e)}catch(t){throw new Error("Invalid address: "+e)}}function M(e){return E[e.toLowerCase()]}function F(e,t,r){return t.lte(0)?new n("999999999"):e.multipliedBy(r).dividedBy(t)}(_=exports.ComptrollerRewardType||(exports.ComptrollerRewardType={}))[_.PLY=0]="PLY",_[_.AURORA=1]="AURORA";var O=function(e,t){this.address=e.toLowerCase(),this.decimals=t},D=new O(L.tokens.PLY,M(L.tokens.PLY)),U=new O(L.tokens.AURPLY,M(L.tokens.AURPLY)),I=function(){function e(e,t,r){void 0===r&&(r=!0),this.rawAmnt=r?t:new n(t).times(P(e.decimals)).toFixed(0),this.token=e}var t=e.prototype;return t.formattedAmount=function(){return new n(this.rawAmnt).div(P(this.token.decimals)).toString()},t.rawAmount=function(){return this.rawAmnt},e}(),N=[{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"feed",type:"address"},{indexed:!1,internalType:"string",name:"symbol",type:"string"}],name:"FeedSet",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldAdmin",type:"address"},{indexed:!1,internalType:"address",name:"newAdmin",type:"address"}],name:"NewAdmin",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"previousPriceMantissa",type:"uint256"},{indexed:!1,internalType:"uint256",name:"requestedPriceMantissa",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newPriceMantissa",type:"uint256"}],name:"PricePosted",type:"event"},{constant:!0,inputs:[],name:"admin",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"asset",type:"address"}],name:"assetPrices",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"string",name:"symbol",type:"string"}],name:"getFeed",outputs:[{internalType:"contract AggregatorV2V3Interface",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"contract QiToken",name:"qiToken",type:"address"}],name:"getUnderlyingPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"isPriceOracle",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"newAdmin",type:"address"}],name:"setAdmin",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"price",type:"uint256"}],name:"setDirectPrice",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"string",name:"symbol",type:"string"},{internalType:"address",name:"feed",type:"address"}],name:"setFeed",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"contract QiToken",name:"qiToken",type:"address"},{internalType:"uint256",name:"underlyingPriceMantissa",type:"uint256"}],name:"setUnderlyingPrice",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],j=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"pure",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"reserve0",type:"uint112"},{internalType:"uint112",name:"reserve1",type:"uint112"},{internalType:"uint32",name:"blockTimestampLast",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[],name:"sync",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],Y=[],q=require("axios");function W(e){return G.apply(this,arguments)}function G(){return(G=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q.get("https://api.coingecko.com/api/v3/simple/price?ids="+t+"&vs_currencies=usd").then((function(e){return e.data}));case 2:return e.abrupt("return",new n(e.sent[t].usd));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(e){return H.apply(this,arguments)}function H(){return(H=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!R(t,L.tokens.AURORA)){e.next=4;break}return e.abrupt("return",W("aurora-near"));case 4:throw Error("Unknown token "+t+" in fetchPriceFromCoingecko");case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(e,t){return J.apply(this,arguments)}function J(){return(J=d(m.mark((function e(t,n){var a,i,o;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=[],i=new r.Contract(t,j,n),a.push(i.token0()),a.push(i.toekn1()),a.push(i.getReserves()),a.push(i.totalSupply()),e.next=8,Promise.all(a);case 8:return e.abrupt("return",{token0:(o=e.sent)[0],token1:o[1],reserve0:o[2].reserve0,reserve1:o[2].reserve1,totalSupply:o[3]});case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Q(e,t){return X.apply(this,arguments)}function X(){return(X=d(m.mark((function e(t,r){var a,i,o;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K(t,r);case 2:return a=e.sent,e.prev=3,e.next=6,te(a.token0,r);case 6:return i=e.sent.multipliedBy(a.reserve0.toString()).multipliedBy(2),e.abrupt("return",i.multipliedBy(P(18)).dividedBy(new n(a.totalSupply.toString())));case 11:return e.prev=11,e.t0=e.catch(3),e.prev=13,e.next=16,te(a.token1,r);case 16:return o=e.sent.multipliedBy(a.reserve1.toString()).multipliedBy(2),e.abrupt("return",o.multipliedBy(P(18)).dividedBy(new n(a.totalSupply.toString())));case 21:throw e.prev=21,e.t1=e.catch(13),Error("Unable to fetch price for both tokens of LP "+t);case 24:case"end":return e.stop()}}),e,null,[[3,11],[13,21]])})))).apply(this,arguments)}function z(e,t){return new n(e.toString()).div(P(36-t))}function Z(e,t,n){return $.apply(this,arguments)}function $(){return($=d(m.mark((function e(t,n,a){var i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new r.Contract(L.misc.oracle,N,a),e.next=3,i.getUnderlyingPrice(t);case 3:return e.abrupt("return",z(e.sent,n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(){return(ee=d(m.mark((function e(t){var n,a,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new r.Contract(L.misc.AURILENS,Y,t),a=L.auTokens.map((function(e){return e.address})),i=L.auTokens.map((function(e){return M(e.underlying)})),e.next=5,n.auTokenUnderlyingPriceAll(a);case 5:return e.abrupt("return",e.sent.map((function(e,t){return{auToken:e.auToken,underlyingPrice:z(e.underlyingPrice,i[t])}})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(e,t){return ne.apply(this,arguments)}function ne(){return(ne=d(m.mark((function e(t,n){var r;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===(r=L.auTokens.find((function(e){return R(e.underlying,t)})))){e.next=5;break}return e.abrupt("return",Z(r.address,M(t),n));case 5:if(!R(t,L.misc.AUPLYLP)){e.next=9;break}return e.abrupt("return",Q(t,n));case 9:return e.abrupt("return",V(t));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function re(e,t,n){return ae.apply(this,arguments)}function ae(){return(ae=d(m.mark((function e(t,r,a){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==a){e.next=4;break}return e.next=3,te(t.token.address,r);case 3:a=e.sent;case 4:return e.abrupt("return",new n(t.formattedAmount()).multipliedBy(a));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ie=function(e){function t(t,n,u){var c;return(c=e.call(this,t)||this).auToken=R(u,T)?new r.Contract(n,i.abi,t.provider):new r.Contract(n,a.abi,t.provider),c.underlying=new O(u,M(u)),c._comptroller=new r.Contract(L.misc.COMPTROLLER,o.abi,t.provider),c._auriLens=new r.Contract(L.misc.AURILENS,s.abi,t.provider),c}l(t,e);var u=t.prototype;return u.getRewardSpeeds=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._auriLens.getRewardSpeeds(this._comptroller.address,this.auToken.address);case 2:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getTotalTokenBorrowed=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=I,e.t1=this.underlying,e.next=4,this.auToken.totalBorrows();case 4:return e.t2=e.sent.toString(),e.abrupt("return",new e.t0(e.t1,e.t2));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getTotalTokenDeposited=function(){var e=d(m.mark((function e(){var t,n,a,i=this;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=[]).push(this.getTotalTokenBorrowed().then((function(e){n=e}))),t.push(this.auToken.getCash().then((function(e){a=new I(i.underlying,e.toString())}))),e.next=5,Promise.all(t);case 5:return e.abrupt("return",new I(this.underlying,r.BigNumber.from(a.rawAmount()).add(n.rawAmount()).toString()));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getDepositAPY=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.auToken.supplyRatePerTimestamp();case 2:return e.abrupt("return",new n(e.sent.toString()).multipliedBy(31536e3).div(P(18)));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getBorrowAPY=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.auToken.borrowRatePerTimestamp();case 2:return e.abrupt("return",new n(e.sent.toString()).multipliedBy(31536e3).div(P(18)));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getCollateralRatio=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._comptroller.markets(this.auToken.address).then((function(e){return new n(e.collateralFactorMantissa.toString()).div(P(18))})));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getBorrowPlyAPY=function(){var e=d(m.mark((function e(){var t,n,r,a,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=[]).push(this.getTotalTokenBorrowed().then((function(e){n=e}))),t.push(this._comptroller.rewardSpeeds(exports.ComptrollerRewardType.PLY,this.auToken.address,!1).then((function(e){r=new I(D,e.toString())}))),t.push(te(L.tokens.PLY,this._networkConnection.provider).then((function(e){a=e}))),t.push(te(this.underlying.address,this._networkConnection.provider).then((function(e){i=e}))),e.next=7,Promise.all(t);case 7:return e.abrupt("return",F(a.multipliedBy(r.formattedAmount()),i.multipliedBy(n.formattedAmount()),31536e3));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getDepositPlyAPY=function(){var e=d(m.mark((function e(){var t,n,r,a,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=[]).push(this.getTotalTokenDeposited().then((function(e){n=e}))),t.push(this._comptroller.rewardSpeeds(exports.ComptrollerRewardType.PLY,this.auToken.address,!0).then((function(e){r=new I(D,e.toString())}))),t.push(te(L.tokens.PLY,this._networkConnection.provider).then((function(e){a=e}))),t.push(te(this.underlying.address,this._networkConnection.provider).then((function(e){i=e}))),e.next=7,Promise.all(t);case 7:return e.abrupt("return",F(a.multipliedBy(r.formattedAmount()),i.multipliedBy(n.formattedAmount()),31536e3));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getDetails=function(){var e=d(m.mark((function e(){var t,n,r,a,i,o,s,u,c,p,d;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=[]).push(this.getTotalTokenDeposited().then((function(e){n=e}))),t.push(this.getTotalTokenBorrowed().then((function(e){r=e}))),t.push(this.getDepositAPY().then((function(e){a=e.toNumber()}))),t.push(this.getBorrowAPY().then((function(e){i=e.toNumber()}))),t.push(this.getCollateralRatio().then((function(e){o=e.toNumber()}))),t.push(this.getRewardSpeeds().then((function(e){c=e}))),t.push(te(L.tokens.PLY,this._networkConnection.provider).then((function(e){s=e}))),t.push(te(this.underlying.address,this._networkConnection.provider).then((function(e){u=e}))),e.next=11,Promise.all(t);case 11:return e.t0=F,e.next=14,re(new I(D,c.plyRewardBorrowSpeed.toString()),this._networkConnection.provider,s);case 14:return e.t1=e.sent,e.t2=u.multipliedBy(r.formattedAmount()),e.t3=31536e3,p=(0,e.t0)(e.t1,e.t2,e.t3),e.t4=F,e.next=21,re(new I(D,c.plyRewardSupplySpeed.toString()),this._networkConnection.provider,s);case 21:return e.t5=e.sent,e.t6=u.multipliedBy(n.formattedAmount()),e.t7=31536e3,d=(0,e.t4)(e.t5,e.t6,e.t7),e.abrupt("return",{auTokenAddress:this.auToken.address,totalTokenDeposited:n,totalTokenBorrowed:r,depositApy:a,depositPlyApy:d.toNumber(),borrowApy:i,borrowPlyApy:p.toNumber(),collateralRatio:o});case 26:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),u.getUserBorrowBalance=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.auToken.callStatic.borrowBalanceCurrent(t);case 2:return e.abrupt("return",new I(this.underlying,e.sent.toString()));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),u.getUserDepositBalance=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.auToken.callStatic.balanceOfUnderlying(t);case 2:return e.abrupt("return",new I(this.underlying,e.sent.toString()));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t}(w),oe=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var n=t.prototype;return n.deposit=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!R(t.token.address,T)){e.next=4;break}return e.abrupt("return",this.auToken.connect(this._networkConnection.signer).mint({value:t.rawAmount()}));case 4:return e.abrupt("return",this.auToken.connect(this._networkConnection.signer).mint(t.rawAmount()));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.borrow=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.auToken.connect(this._networkConnection.signer).borrow(t.rawAmount()));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.withdraw=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.auToken.connect(this._networkConnection.signer).redeemUnderlying(t.rawAmount()));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.repay=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!R(t.token.address,T)){e.next=4;break}return e.abrupt("return",this.auToken.connect(this._networkConnection.signer).repayBorrow({value:t.rawAmount()}));case 4:return e.abrupt("return",this.auToken.connect(this._networkConnection.signer).repayBorrow(t.rawAmount()));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.enableCollateral=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._comptroller.connect(this._networkConnection.signer).enterMarkets([this.auToken.address]));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n.disableCollateral=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._comptroller.connect(this._networkConnection.signer).exitMarket(this.auToken.address));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t}(ie),se=function(e){function t(t,n){var r;return(r=e.call(this)||this).address=B(t),r.underlying=B(n),r}return l(t,e),t.prototype.read=function(e){return new ie(e,this.address,this.underlying)},t}(v),ue=function(e){function t(t){var n;return(n=e.call(this,t)||this)._comptroller=new r.Contract(L.misc.COMPTROLLER,o.abi,t.provider),n._tokenLock=new r.Contract(L.misc.TOKENLOCK,u.abi,t.provider),n._auriFairLaunch=new r.Contract(L.misc.AURIFAIRLAUNCH,c.abi,t.provider),n._auriLens=new r.Contract(L.misc.AURILENS,s.abi,t.provider),n}l(t,e);var a=t.prototype;return a.getLockingDetails=function(){var e=d(m.mark((function e(){var t,a,i,o;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(this._networkConnection.provider);case 2:return t=r.BigNumber.from(e.sent-1640995200).div(604800).toNumber(),a=1e4,(i=[]).push(this._tokenLock.percentageLock(t)),i.push(this._tokenLock.percentageLock(t+1).catch((function(e){return a}))),e.next=10,Promise.all(i).then((function(e){return e.map((function(e){return e.toString()}))}));case 10:return o=e.sent,e.abrupt("return",{vestingStart:1640995200,currentUnlockPortion:new n(a).minus(o[0]).div(a).toNumber(),nextUnlockPortion:new n(a).minus(o[1]).div(a).toNumber()});case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),a.getUserDetails=function(){var e=d(m.mark((function e(t){var r,a,i,o,s,u,c,p,d,l,y,h,w,b,v,x,g,k,T,A,E,_=this;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=L.auTokens.length,a=[],o=[],s=new n(0),u=[],c=function(){var e=d.value,n={};a.push(n),n.market=e.underlying;var r=new ie(_._networkConnection,e.address,e.underlying);o.push(r.getUserDepositBalance(t).then((function(e){n.depositBalance=e}))),o.push(r.getUserBorrowBalance(t).then((function(e){n.borrowBalance=e}))),o.push(r.getCollateralRatio().then((function(e){n.collateralRatio=e.toNumber()}))),u.push(te(r.underlying.address,_._networkConnection.provider))},p=f(L.auTokens);!(d=p()).done;)c();return o.push(this._comptroller.getAssetsIn(t).then((function(e){i=e}))),e.next=10,Promise.all(o);case 10:return e.next=12,Promise.all(u);case 12:for(l=e.sent,y=[],h=function(){var e=L.auTokens[w];a[w].isCollateral=void 0!==i.find((function(t){return R(e.address,t)})),y.push(re(a[w].depositBalance,_._networkConnection.provider,l[w]))},w=0;w<r;w++)h();return e.next=18,Promise.all(y);case 18:return s=e.sent.reduce((function(e,t,n){return a[n].isCollateral?e.plus(t.multipliedBy(a[n].collateralRatio)):e}),new n(0)),(o=[]).push(this._comptroller.getAccountLiquidity(t)),o.push(this._auriLens.callStatic.getRewardBalancesMetadata(this._comptroller.address,this._auriFairLaunch.address,t,[0])),o.push(this._tokenLock.lockedAmounts(t)),e.next=26,Promise.all(o);case 26:for(b=(x=e.sent)[1],v=x[2],g=s.minus(new n(x[0][1].toString()).div(P(18))),k=s.multipliedBy(C),T=k.lte(g)?new n(0):k.minus(g),w=0;w<r;w++)E=new ie(this._networkConnection,(A=L.auTokens[w]).address,A.underlying),a[w].maxWithdrawableAmount=new I(E.underlying,T.div(l[w]).toFixed(18));return e.abrupt("return",{markets:a,borrowLimit:{currency:"USD",amount:k.toFixed(6)},accruedPly:new I(D,b.plyAccrued.toString()),lockedPly:new I(D,v.toString()),borrowableAmount:{currency:"USD",amount:T.toFixed(6)}});case 35:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),a.getPlyAuroraPoolDetails=function(){var e=d(m.mark((function e(){var t,n,r,a,i;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=[]).push(this._auriFairLaunch.getPoolInfo(0).then((function(e){t=e.totalStake,n=e.rewardPerSecond}))),e.next=4,Promise.all(r);case 4:return(r=[]).push(re(new I(D,n.toString()),this._networkConnection.provider).then((function(e){return a=e}))),r.push(re(new I(U,t.toString()),this._networkConnection.provider).then((function(e){return i=e}))),e.next=9,Promise.all(r);case 9:return e.abrupt("return",{totalStakedLiquidity:new I(U,t.toString()),apy:F(a,i,31536e3).toFixed(6)});case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),a.getTokenPrice=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,te(t.address,this._networkConnection.provider);case 2:return e.abrupt("return",{currency:"USD",amount:e.sent.toFixed(6)});case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),a.stakeBalanceOf=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._auriFairLaunch.getUserInfo(0,t);case 2:return e.abrupt("return",new I(U,e.sent.amount.toString()));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t}(w),ce=function(e){function t(){return e.apply(this,arguments)||this}l(t,e);var n=t.prototype;return n.claim=function(){var e=d(m.mark((function e(){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._auriLens.connect(this._networkConnection.signer).claimRewards(this._comptroller.address,this._auriFairLaunch.address,[0]));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n.stake=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._auriFairLaunch.connect(this._networkConnection.signer).deposit(0,t.rawAmount(),!1));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.unstake=function(){var e=d(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._auriFairLaunch.connect(this._networkConnection.signer).withdraw(0,t.rawAmount()));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t}(ue),pe=function(e){function t(){return e.call(this)||this}return l(t,e),t.prototype.read=function(e){return new ue(e)},t.defaultProvider=function(){return new r.ethers.providers.JsonRpcProvider("https://api.avax.network/ext/bc/C/rpc")},t}(v),de=new O("0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",6),le=new O("0x8729438eb15e2c8b576fcc6aecda6a148776c0f5",18),ye=new O("0xE530dC2095Ef5653205CF5ea79F8979a7028065c",18),fe=new I(de,"123.456",!1),he=new I(de,"0"),me=new I(de,"456.123",!1),we=new I(de,"1000.123",!1),be={market:"0xbeb5d47a3f720ec0a390d04b4d41ed7d9688bc7f",depositBalance:me,borrowBalance:he,isCollateral:!0,maxWithdrawableAmount:fe};exports.AURORA_CHAINID=1313161554,exports.AURORA_DEFAULT_PROVIDER=k,exports.AURORA_DEFAULT_PROVIDER_URL="https://mainnet.aurora.dev",exports.AURORA_DEFAULT_SIGNER=A,exports.AURPLYToken=U,exports.AVAX_DEFAULT_PROVIDER=g,exports.AVAX_DEFAULT_PROVIDER_URL="https://api.avax.network/ext/bc/C/rpc",exports.AurPlyPid=0,exports.BORROW_LIMIT_BUFFER=C,exports.BlockchainEntity=v,exports.BlockchainEntityRead=w,exports.BlockchainEntityReadWrite=b,exports.DECIMAL_PRECISION=6,exports.ETHAddress=T,exports.MoneyMarket=se,exports.MoneyMarketRead=ie,exports.MoneyMarketReadWrite=oe,exports.ONE_DAY=86400,exports.ONE_YEAR=31536e3,exports.PLYToken=D,exports.REWARDCLAIMSTART=1640995200,exports.SDK=pe,exports.SdkRead=ue,exports.SdkReadWrite=ce,exports.Token=O,exports.TokenAmount=I,exports.calcLMRewardApr=F,exports.decimalFactor=P,exports.dummyAddress="0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE",exports.dummyMarketAddress="0xbeb5d47a3f720ec0a390d04b4d41ed7d9688bc7f",exports.dummyPly=le,exports.dummyPlyAurora=ye,exports.dummyToken=de,exports.dummyTokenAmount=fe,exports.dummyTokenAmount2=me,exports.dummyTokenAmount3=we,exports.dummyUserMarketDetails=be,exports.dummyZeroTokenAmount=he,exports.fetchLPPositions=K,exports.fetchLPPrice=Q,exports.fetchPrice=te,exports.fetchPriceFromCoingecko=V,exports.fetchPriceFromCoingeckoAPI=W,exports.fetchPriceFromOracle=Z,exports.fetchUnderlyingTokensPrices=function(e){return ee.apply(this,arguments)},exports.fetchValuation=re,exports.formatObject=function(e){return JSON.stringify(e,null," ")},exports.getCurrentTimestamp=S,exports.getDecimal=M,exports.isSameAddress=R,exports.networkAddresses=L,exports.validateAndParseAddress=B;
|
|
2
2
|
//# sourceMappingURL=sdk.cjs.production.min.js.map
|