@aave/react 4.0.0-next.31 → 4.0.0-next.33
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/chunk-3TDVAQWZ.js +1664 -0
- package/dist/chunk-3TDVAQWZ.js.map +1 -0
- package/dist/chunk-6A77Z4MD.js +2 -0
- package/dist/chunk-6A77Z4MD.js.map +1 -0
- package/dist/chunk-PYBBLRVB.js +2 -0
- package/dist/chunk-PYBBLRVB.js.map +1 -0
- package/dist/chunk-Q5WBQO2R.js +2 -0
- package/dist/chunk-Q5WBQO2R.js.map +1 -0
- package/dist/chunk-SXNP4MR6.js +2 -0
- package/dist/chunk-SXNP4MR6.js.map +1 -0
- package/dist/ethers.cjs +1637 -1
- package/dist/ethers.cjs.map +1 -1
- package/dist/ethers.d.cts +2 -5
- package/dist/ethers.d.ts +2 -5
- package/dist/ethers.js +1 -1
- package/dist/ethers.js.map +1 -1
- package/dist/index.cjs +1663 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -20
- package/dist/index.d.ts +17 -20
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{misc-FhyRRjuS.d.ts → misc-B5-hfFfF.d.ts} +4 -7
- package/dist/{misc-Dv6nwSVM.d.cts → misc-B_3Pj33R.d.cts} +4 -7
- package/dist/privy.cjs +1637 -1
- package/dist/privy.cjs.map +1 -1
- package/dist/privy.d.cts +2 -5
- package/dist/privy.d.ts +2 -5
- package/dist/privy.js +1 -1
- package/dist/privy.js.map +1 -1
- package/dist/thirdweb.cjs +1637 -1
- package/dist/thirdweb.cjs.map +1 -1
- package/dist/thirdweb.d.cts +2 -5
- package/dist/thirdweb.d.ts +2 -5
- package/dist/thirdweb.js +1 -1
- package/dist/thirdweb.js.map +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/dist/viem/index.cjs +1637 -1
- package/dist/viem/index.cjs.map +1 -1
- package/dist/viem/index.d.cts +3 -6
- package/dist/viem/index.d.ts +3 -6
- package/dist/viem/index.js +1 -1
- package/dist/viem/index.js.map +1 -1
- package/dist/{writes-XDyuot3t.d.cts → writes-d5YEXauI.d.cts} +5 -5
- package/dist/{writes-XDyuot3t.d.ts → writes-d5YEXauI.d.ts} +5 -5
- package/package.json +2 -5
- package/dist/chunk-4NA4FB6K.js +0 -2
- package/dist/chunk-4NA4FB6K.js.map +0 -1
- package/dist/chunk-5DRHIJI2.js +0 -2
- package/dist/chunk-5DRHIJI2.js.map +0 -1
- package/dist/chunk-SOTTMX3H.js +0 -2
- package/dist/chunk-SOTTMX3H.js.map +0 -1
package/dist/viem/index.cjs
CHANGED
|
@@ -1,2 +1,1638 @@
|
|
|
1
|
-
'use strict';var viem=require('@aave/client/viem'),types=require('@aave/types'),F=require('react'),urql=require('urql'),client=require('@aave/client');require('@aave/core');var actions=require('@aave/client/actions'),graphql=require('@aave/graphql'),viem$1=require('viem');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var F__default=/*#__PURE__*/_interopDefault(F);var Q=F__default.default.createContext(null);function d(){let e=F.useContext(Q);return types.invariant(e,"Could not find Aave SDK context, ensure your code is wrapped in a <AaveProvider>"),e}var i={Loading:()=>({data:void 0,error:void 0,loading:true,paused:false}),Success:e=>({data:e,error:void 0,loading:false,paused:false}),Failure:e=>({data:void 0,error:e,loading:false,paused:false}),Paused:(e,t)=>({data:e,error:t,loading:false,paused:true})};function E({document:e,variables:t,suspense:a,pause:n,selector:r=types.identity,pollInterval:s=0,batch:o=true}){let[g,y]=F.useState(true),[{fetching:u,data:l,error:m},R]=urql.useQuery({query:e,variables:t,pause:n,context:F.useMemo(()=>({batch:o,suspense:a}),[o,a])});if(F.useEffect(()=>{n||u||y(false);},[u,n]),F.useEffect(()=>{if(s<=0||u||n)return;let x=setTimeout(()=>{R({requestPolicy:"network-only",batch:false});},s);return ()=>clearTimeout(x)},[u,R,s,n]),n)return i.Paused(l?r(l.value):void 0,m?client.UnexpectedError.from(m):void 0);if(!a&&g)return i.Loading();if(m){let x=client.UnexpectedError.from(m);if(a)throw x;return i.Failure(x)}return types.invariant(l,"No data returned"),i.Success(r(l.value))}var h={Idle:()=>({called:false,loading:false,data:void 0,error:void 0}),Loading:e=>({called:true,loading:true,data:e,error:void 0}),Success:e=>({called:true,loading:false,data:e,error:void 0}),Failed:e=>({called:true,loading:false,data:void 0,error:e})};function p(e,t){let[a,n]=F.useState(h.Idle()),r=F.useRef(false),s=F.useCallback(e,t);return [F.useCallback(g=>{types.invariant(!r.current,"Cannot execute a task while another is in progress."),r.current=true;let y;n(u=>(y=u,{called:true,loading:true,data:u.data,error:void 0}));try{let u=s(g);return u.match(l=>{r.current=!1,n(h.Success(l));},l=>{r.current=!1,n(h.Failed(l));}),u}catch(u){throw r.current=false,n(types.nonNullable(y)),u}},[s]),a]}var T=class e{constructor(t){this.wait=t;}static isInstanceOf(t){return t instanceof e}static ensure(t){return types.invariant(e.isInstanceOf(t),"Expected PendingTransaction"),t}};function _e(e){let t=d();return p(a=>(types.invariant(e,"Expected a WalletClient to handle the operation result."),viem.ensureChain(t,e,a).andThen(()=>viem.sendTransaction(e,a)).map(n=>new T(()=>viem.waitForTransactionResult(e,a,n)))),[t,e])}function qe(e){return p(t=>(types.invariant(e,"Expected a WalletClient to sign typed data"),viem.signTypedDataWith(e,t)),[e])}function C({suspense:e=false,pause:t=false,...a}){let n=d();return E({document:graphql.ExchangeRateQuery,variables:{request:a},suspense:e,pause:t,pollInterval:a.at?0:n.context.environment.exchangeRateInterval})}var k=55558n,le={supply:132136n+k,borrow:250551n,withdraw:195049n,repay:217889n+k,setUserSuppliesAsCollateral:240284n,updateUserPositionConditions:280000n};function de(e){let t=Object.keys(e)[0];return le[t]??types.never(`Expected gas estimate for action ${t}`)}function V(e){if("supply"in e)return graphql.decodeReserveId(e.supply.reserve).chainId;if("borrow"in e)return graphql.decodeReserveId(e.borrow.reserve).chainId;if("withdraw"in e)return graphql.decodeReserveId(e.withdraw.reserve).chainId;if("repay"in e)return graphql.decodeReserveId(e.repay.reserve).chainId;if("setUserSuppliesAsCollateral"in e)return e.setUserSuppliesAsCollateral.changes.map(({reserve:t})=>graphql.decodeReserveId(t)).reduce((t,a)=>(types.invariant(t.chainId===a.chainId&&t.spoke===a.spoke,"All reserves MUST on the same spoke"),t)).chainId;if("updateUserPositionConditions"in e)return graphql.decodeUserPositionId(e.updateUserPositionConditions.userPositionId).chainId;types.never("Expected reserve id");}function pe(e){if("activity"in e&&e.activity)return e.activity.chain.chainId;if("estimate"in e&&e.estimate)return V(e.estimate)}function ce(e){if("activity"in e&&e.activity)return e.activity.timestamp}function fe(e,t){return "activity"in t&&t.activity?types.okAsync(t.activity.chain):"estimate"in t&&t.estimate?actions.chain(e,{chainId:V(t.estimate)}).map(types.nonNullable):types.never("Expected chain")}function ye(){let e=d();return p(t=>fe(e,t).andThen(a=>{let n=viem$1.createPublicClient({chain:viem.toViemChain(a),transport:viem$1.http()});return "activity"in t?types.ResultAsync.fromPromise(n.getTransactionReceipt({hash:t.activity.txHash}),r=>client.UnexpectedError.from(r)).map(r=>({chain:t.activity.chain,gasPrice:r.effectiveGasPrice,gasUnits:r.gasUsed})):"estimate"in t&&t.estimate?types.ResultAsync.fromPromise(n.estimateFeesPerGas(),r=>client.UnexpectedError.from(r)).map(({maxFeePerGas:r})=>({chain:a,gasPrice:r,gasUnits:de(t.estimate)})):types.okAsync({chain:types.never("Expected chain"),gasPrice:0n,gasUnits:0n})}),[e])}function D(e,t){let a=e.gasPrice*e.gasUnits,n=types.bigDecimal(a).rescale(-e.chain.nativeInfo.decimals),r={__typename:"DecimalNumber",decimals:e.chain.nativeInfo.decimals,onChainValue:a,value:n};return {__typename:"NativeAmount",token:{__typename:"NativeToken",info:e.chain.nativeInfo,chain:e.chain},amount:r,exchange:{__typename:"ExchangeAmount",value:n.mul(t.value),name:t.name,symbol:t.symbol,icon:t.icon,decimals:t.decimals},exchangeRate:{__typename:"DecimalNumber",decimals:2,onChainValue:BigInt(t.value.rescale(2).toFixed(0,types.RoundingMode.Down)),value:t.value}}}var ut=(({query:e,currency:t=graphql.Currency.Usd,pause:a=false,suspense:n=false})=>{let[r,s]=ye(),o=C({from:{native:pe(e)},to:t,at:ce(e),pause:a,...n?{suspense:n}:{}});return F.useEffect(()=>{a||s.called||!e||r(e);},[r,a,s.called]),o.paused?i.Paused(s.data&&o.data?D(s.data,o.data):void 0,o.error?o.error:void 0):!s.called||s.loading||o.loading?i.Loading():s.error||o.error?i.Failure(s.error??o.error??types.never("Unknown error")):(types.invariant(s.data&&o.data,"Expected receipt, chain, and rate data"),i.Success(D(s.data,o.data)))});Object.defineProperty(exports,"viemChainsFrom",{enumerable:true,get:function(){return viem.viemChainsFrom}});exports.useNetworkFee=ut;exports.useSendTransaction=_e;exports.useSignTypedData=qe;//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var viem=require('viem'),actions=require('viem/actions'),chains=require('viem/chains'),Sl=require('react'),urql=require('urql');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Sl__default=/*#__PURE__*/_interopDefault(Sl);var Xs={withStackTrace:false},Qt=(e,n,a=Xs)=>{let t=n.isOk()?{type:"Ok",value:n.value}:{type:"Err",value:n.error},r=a.withStackTrace?new Error().stack:void 0;return {data:t,message:e,stack:r}};function Ie(e,n,a,t){function r(i){return i instanceof a?i:new a(function(s){s(i);})}return new(a||(a=Promise))(function(i,s){function o(c){try{p(t.next(c));}catch(d){s(d);}}function l(c){try{p(t.throw(c));}catch(d){s(d);}}function p(c){c.done?i(c.value):r(c.value).then(o,l);}p((t=t.apply(e,[])).next());})}function Wt(e){var n=typeof Symbol=="function"&&Symbol.iterator,a=n&&e[n],t=0;if(a)return a.call(e);if(e&&typeof e.length=="number")return {next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function fe(e){return this instanceof fe?(this.v=e,this):new fe(e)}function Ht(e,n,a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=a.apply(e,n||[]),r,i=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",s),r[Symbol.asyncIterator]=function(){return this},r;function s(m){return function(h){return Promise.resolve(h).then(m,d)}}function o(m,h){t[m]&&(r[m]=function(g){return new Promise(function(L,x){i.push([m,g,L,x])>1||l(m,g);})},h&&(r[m]=h(r[m])));}function l(m,h){try{p(t[m](h));}catch(g){f(i[0][3],g);}}function p(m){m.value instanceof fe?Promise.resolve(m.value.v).then(c,d):f(i[0][2],m);}function c(m){l("next",m);}function d(m){l("throw",m);}function f(m,h){m(h),i.shift(),i.length&&l(i[0][0],i[0][1]);}}function eo(e){var n,a;return n={},t("next"),t("throw",function(r){throw r}),t("return"),n[Symbol.iterator]=function(){return this},n;function t(r,i){n[r]=e[r]?function(s){return (a=!a)?{value:fe(e[r](s)),done:false}:i?i(s):s}:i;}}function no(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e[Symbol.asyncIterator],a;return n?n.call(e):(e=typeof Wt=="function"?Wt(e):e[Symbol.iterator](),a={},t("next"),t("throw"),t("return"),a[Symbol.asyncIterator]=function(){return this},a);function t(i){a[i]=e[i]&&function(s){return new Promise(function(o,l){s=e[i](s),r(o,l,s.done,s.value);})};}function r(i,s,o,l){Promise.resolve(l).then(function(p){i({value:p,done:o});},s);}}var D=class se{constructor(n){this._promise=n;}static fromSafePromise(n){let a=n.then(t=>new oe(t));return new se(a)}static fromPromise(n,a){let t=n.then(r=>new oe(r)).catch(r=>new ue(a(r)));return new se(t)}static fromThrowable(n,a){return (...t)=>new se(Ie(this,void 0,void 0,function*(){try{return new oe(yield n(...t))}catch(r){return new ue(a?a(r):r)}}))}static combine(n){return io(n)}static combineWithAllErrors(n){return so(n)}map(n){return new se(this._promise.then(a=>Ie(this,void 0,void 0,function*(){return a.isErr()?new ue(a.error):new oe(yield n(a.value))})))}andThrough(n){return new se(this._promise.then(a=>Ie(this,void 0,void 0,function*(){if(a.isErr())return new ue(a.error);let t=yield n(a.value);return t.isErr()?new ue(t.error):new oe(a.value)})))}andTee(n){return new se(this._promise.then(a=>Ie(this,void 0,void 0,function*(){if(a.isErr())return new ue(a.error);try{yield n(a.value);}catch{}return new oe(a.value)})))}orTee(n){return new se(this._promise.then(a=>Ie(this,void 0,void 0,function*(){if(a.isOk())return new oe(a.value);try{yield n(a.error);}catch{}return new ue(a.error)})))}mapErr(n){return new se(this._promise.then(a=>Ie(this,void 0,void 0,function*(){return a.isOk()?new oe(a.value):new ue(yield n(a.error))})))}andThen(n){return new se(this._promise.then(a=>{if(a.isErr())return new ue(a.error);let t=n(a.value);return t instanceof se?t._promise:t}))}orElse(n){return new se(this._promise.then(a=>Ie(this,void 0,void 0,function*(){return a.isErr()?n(a.error):new oe(a.value)})))}match(n,a){return this._promise.then(t=>t.match(n,a))}unwrapOr(n){return this._promise.then(a=>a.unwrapOr(n))}safeUnwrap(){return Ht(this,arguments,function*(){return yield fe(yield fe(yield*eo(no(yield fe(this._promise.then(n=>n.safeUnwrap()))))))})}then(n,a){return this._promise.then(n,a)}[Symbol.asyncIterator](){return Ht(this,arguments,function*(){let n=yield fe(this._promise);return n.isErr()&&(yield yield fe(Ne(n.error))),yield fe(n.value)})}};function ce(e){return new D(Promise.resolve(new oe(e)))}function Ne(e){return new D(Promise.resolve(new ue(e)))}var jt=e=>{let n=Se([]);for(let a of e)if(a.isErr()){n=le(a.error);break}else n.map(t=>t.push(a.value));return n},io=e=>D.fromSafePromise(Promise.all(e)).andThen(jt),Kt=e=>{let n=Se([]);for(let a of e)a.isErr()&&n.isErr()?n.error.push(a.error):a.isErr()&&n.isOk()?n=le([a.error]):a.isOk()&&n.isOk()&&n.value.push(a.value);return n},so=e=>D.fromSafePromise(Promise.all(e)).andThen(Kt),$n;(function(e){function n(r,i){return (...s)=>{try{let o=r(...s);return Se(o)}catch(o){return le(i?i(o):o)}}}e.fromThrowable=n;function a(r){return jt(r)}e.combine=a;function t(r){return Kt(r)}e.combineWithAllErrors=t;})($n||($n={}));function Se(e){return new oe(e)}function le(e){return new ue(e)}var oe=class{constructor(e){this.value=e;}isOk(){return true}isErr(){return !this.isOk()}map(e){return Se(e(this.value))}mapErr(e){return Se(this.value)}andThen(e){return e(this.value)}andThrough(e){return e(this.value).map(n=>this.value)}andTee(e){try{e(this.value);}catch{}return Se(this.value)}orTee(e){return Se(this.value)}orElse(e){return Se(this.value)}asyncAndThen(e){return e(this.value)}asyncAndThrough(e){return e(this.value).map(()=>this.value)}asyncMap(e){return D.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,n){return e(this.value)}safeUnwrap(){let e=this.value;return (function*(){return e})()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw Qt("Called `_unsafeUnwrapErr` on an Ok",this,e)}*[Symbol.iterator](){return this.value}},ue=class{constructor(e){this.error=e;}isOk(){return false}isErr(){return !this.isOk()}map(e){return le(this.error)}mapErr(e){return le(e(this.error))}andThrough(e){return le(this.error)}andTee(e){return le(this.error)}orTee(e){try{e(this.error);}catch{}return le(this.error)}andThen(e){return le(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return Ne(this.error)}asyncAndThrough(e){return Ne(this.error)}asyncMap(e){return Ne(this.error)}unwrapOr(e){return e}match(e,n){return n(this.error)}safeUnwrap(){let e=this.error;return (function*(){throw yield le(e),new Error("Do not use this generator out of `safeTry`")})()}_unsafeUnwrap(e){throw Qt("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}*[Symbol.iterator](){let e=this;return yield e,e}};$n.fromThrowable;var uo=20,lo=1,Fe=1e6,Mt=1e6,po=-7,co=21,yo=false,hn="[big.js] ",De=hn+"Invalid ",Vn=De+"decimal places",mo=De+"rounding mode",Gt=hn+"Division by zero",R={},he=void 0,fo=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function zt(){function e(n){var a=this;if(!(a instanceof e))return n===he&&arguments.length===0?zt():new e(n);if(n instanceof e)a.s=n.s,a.e=n.e,a.c=n.c.slice();else {if(typeof n!="string"){if(e.strict===true&&typeof n!="bigint")throw TypeError(De+"value");n=n===0&&1/n<0?"-0":String(n);}No(a,n);}a.constructor=e;}return e.prototype=R,e.DP=uo,e.RM=lo,e.NE=po,e.PE=co,e.strict=yo,e.roundDown=0,e.roundHalfUp=1,e.roundHalfEven=2,e.roundUp=3,e}function No(e,n){var a,t,r;if(!fo.test(n))throw Error(De+"number");for(e.s=n.charAt(0)=="-"?(n=n.slice(1),-1):1,(a=n.indexOf("."))>-1&&(n=n.replace(".","")),(t=n.search(/e/i))>0?(a<0&&(a=t),a+=+n.slice(t+1),n=n.substring(0,t)):a<0&&(a=n.length),r=n.length,t=0;t<r&&n.charAt(t)=="0";)++t;if(t==r)e.c=[e.e=0];else {for(;r>0&&n.charAt(--r)=="0";);for(e.e=a-t-1,e.c=[],a=0;t<=r;)e.c[a++]=+n.charAt(t++);}return e}function $e(e,n,a,t){var r=e.c;if(a===he&&(a=e.constructor.RM),a!==0&&a!==1&&a!==2&&a!==3)throw Error(mo);if(n<1)t=a===3&&(t||!!r[0])||n===0&&(a===1&&r[0]>=5||a===2&&(r[0]>5||r[0]===5&&(t||r[1]!==he))),r.length=1,t?(e.e=e.e-n+1,r[0]=1):r[0]=e.e=0;else if(n<r.length){if(t=a===1&&r[n]>=5||a===2&&(r[n]>5||r[n]===5&&(t||r[n+1]!==he||r[n-1]&1))||a===3&&(t||!!r[0]),r.length=n,t){for(;++r[--n]>9;)if(r[n]=0,n===0){++e.e,r.unshift(1);break}}for(n=r.length;!r[--n];)r.pop();}return e}function Ve(e,n,a){var t=e.e,r=e.c.join(""),i=r.length;if(n)r=r.charAt(0)+(i>1?"."+r.slice(1):"")+(t<0?"e":"e+")+t;else if(t<0){for(;++t;)r="0"+r;r="0."+r;}else if(t>0)if(++t>i)for(t-=i;t--;)r+="0";else t<i&&(r=r.slice(0,t)+"."+r.slice(t));else i>1&&(r=r.charAt(0)+"."+r.slice(1));return e.s<0&&a?"-"+r:r}R.abs=function(){var e=new this.constructor(this);return e.s=1,e};R.cmp=function(e){var n,a=this,t=a.c,r=(e=new a.constructor(e)).c,i=a.s,s=e.s,o=a.e,l=e.e;if(!t[0]||!r[0])return t[0]?i:r[0]?-s:0;if(i!=s)return i;if(n=i<0,o!=l)return o>l^n?1:-1;for(s=(o=t.length)<(l=r.length)?o:l,i=-1;++i<s;)if(t[i]!=r[i])return t[i]>r[i]^n?1:-1;return o==l?0:o>l^n?1:-1};R.div=function(e){var n=this,a=n.constructor,t=n.c,r=(e=new a(e)).c,i=n.s==e.s?1:-1,s=a.DP;if(s!==~~s||s<0||s>Fe)throw Error(Vn);if(!r[0])throw Error(Gt);if(!t[0])return e.s=i,e.c=[e.e=0],e;var o,l,p,c,d,f=r.slice(),m=o=r.length,h=t.length,g=t.slice(0,o),L=g.length,x=e,O=x.c=[],B=0,I=s+(x.e=n.e-e.e)+1;for(x.s=i,i=I<0?0:I,f.unshift(0);L++<o;)g.push(0);do{for(p=0;p<10;p++){if(o!=(L=g.length))c=o>L?1:-1;else for(d=-1,c=0;++d<o;)if(r[d]!=g[d]){c=r[d]>g[d]?1:-1;break}if(c<0){for(l=L==o?r:f;L;){if(g[--L]<l[L]){for(d=L;d&&!g[--d];)g[d]=9;--g[d],g[L]+=10;}g[L]-=l[L];}for(;!g[0];)g.shift();}else break}O[B++]=c?p:++p,g[0]&&c?g[L]=t[m]||0:g=[t[m]];}while((m++<h||g[0]!==he)&&i--);return !O[0]&&B!=1&&(O.shift(),x.e--,I--),B>I&&$e(x,I,a.RM,g[0]!==he),x};R.eq=function(e){return this.cmp(e)===0};R.gt=function(e){return this.cmp(e)>0};R.gte=function(e){return this.cmp(e)>-1};R.lt=function(e){return this.cmp(e)<0};R.lte=function(e){return this.cmp(e)<1};R.minus=R.sub=function(e){var n,a,t,r,i=this,s=i.constructor,o=i.s,l=(e=new s(e)).s;if(o!=l)return e.s=-l,i.plus(e);var p=i.c.slice(),c=i.e,d=e.c,f=e.e;if(!p[0]||!d[0])return d[0]?e.s=-l:p[0]?e=new s(i):e.s=1,e;if(o=c-f){for((r=o<0)?(o=-o,t=p):(f=c,t=d),t.reverse(),l=o;l--;)t.push(0);t.reverse();}else for(a=((r=p.length<d.length)?p:d).length,o=l=0;l<a;l++)if(p[l]!=d[l]){r=p[l]<d[l];break}if(r&&(t=p,p=d,d=t,e.s=-e.s),(l=(a=d.length)-(n=p.length))>0)for(;l--;)p[n++]=0;for(l=n;a>o;){if(p[--a]<d[a]){for(n=a;n&&!p[--n];)p[n]=9;--p[n],p[a]+=10;}p[a]-=d[a];}for(;p[--l]===0;)p.pop();for(;p[0]===0;)p.shift(),--f;return p[0]||(e.s=1,p=[f=0]),e.c=p,e.e=f,e};R.mod=function(e){var n,a=this,t=a.constructor,r=a.s,i=(e=new t(e)).s;if(!e.c[0])throw Error(Gt);return a.s=e.s=1,n=e.cmp(a)==1,a.s=r,e.s=i,n?new t(a):(r=t.DP,i=t.RM,t.DP=t.RM=0,a=a.div(e),t.DP=r,t.RM=i,this.minus(a.times(e)))};R.neg=function(){var e=new this.constructor(this);return e.s=-e.s,e};R.plus=R.add=function(e){var n,a,t,r=this,i=r.constructor;if(e=new i(e),r.s!=e.s)return e.s=-e.s,r.minus(e);var s=r.e,o=r.c,l=e.e,p=e.c;if(!o[0]||!p[0])return p[0]||(o[0]?e=new i(r):e.s=r.s),e;if(o=o.slice(),n=s-l){for(n>0?(l=s,t=p):(n=-n,t=o),t.reverse();n--;)t.push(0);t.reverse();}for(o.length-p.length<0&&(t=p,p=o,o=t),n=p.length,a=0;n;o[n]%=10)a=(o[--n]=o[n]+p[n]+a)/10|0;for(a&&(o.unshift(a),++l),n=o.length;o[--n]===0;)o.pop();return e.c=o,e.e=l,e};R.pow=function(e){var n=this,a=new n.constructor("1"),t=a,r=e<0;if(e!==~~e||e<-Mt||e>Mt)throw Error(De+"exponent");for(r&&(e=-e);e&1&&(t=t.times(n)),e>>=1,!!e;)n=n.times(n);return r?a.div(t):t};R.prec=function(e,n){if(e!==~~e||e<1||e>Fe)throw Error(De+"precision");return $e(new this.constructor(this),e,n)};R.round=function(e,n){if(e===he)e=0;else if(e!==~~e||e<-Fe||e>Fe)throw Error(Vn);return $e(new this.constructor(this),e+this.e+1,n)};R.sqrt=function(){var e,n,a,t=this,r=t.constructor,i=t.s,s=t.e,o=new r("0.5");if(!t.c[0])return new r(t);if(i<0)throw Error(hn+"No square root");i=Math.sqrt(+Ve(t,true,true)),i===0||i===1/0?(n=t.c.join(""),n.length+s&1||(n+="0"),i=Math.sqrt(n),s=((s+1)/2|0)-(s<0||s&1),e=new r((i==1/0?"5e":(i=i.toExponential()).slice(0,i.indexOf("e")+1))+s)):e=new r(i+""),s=e.e+(r.DP+=4);do a=e,e=o.times(a.plus(t.div(a)));while(a.c.slice(0,s).join("")!==e.c.slice(0,s).join(""));return $e(e,(r.DP-=4)+e.e+1,r.RM)};R.times=R.mul=function(e){var n,a=this,t=a.constructor,r=a.c,i=(e=new t(e)).c,s=r.length,o=i.length,l=a.e,p=e.e;if(e.s=a.s==e.s?1:-1,!r[0]||!i[0])return e.c=[e.e=0],e;for(e.e=l+p,s<o&&(n=r,r=i,i=n,p=s,s=o,o=p),n=new Array(p=s+o);p--;)n[p]=0;for(l=o;l--;){for(o=0,p=s+l;p>l;)o=n[p]+i[l]*r[p-l-1]+o,n[p--]=o%10,o=o/10|0;n[p]=o;}for(o?++e.e:n.shift(),l=n.length;!n[--l];)n.pop();return e.c=n,e};R.toExponential=function(e,n){var a=this,t=a.c[0];if(e!==he){if(e!==~~e||e<0||e>Fe)throw Error(Vn);for(a=$e(new a.constructor(a),++e,n);a.c.length<e;)a.c.push(0);}return Ve(a,true,!!t)};R.toFixed=function(e,n){var a=this,t=a.c[0];if(e!==he){if(e!==~~e||e<0||e>Fe)throw Error(Vn);for(a=$e(new a.constructor(a),e+a.e+1,n),e=e+a.e+1;a.c.length<e;)a.c.push(0);}return Ve(a,false,!!t)};R.toJSON=R.toString=function(){var e=this,n=e.constructor;return Ve(e,e.e<=n.NE||e.e>=n.PE,!!e.c[0])};typeof Symbol<"u"&&(R[Symbol.for("nodejs.util.inspect.custom")]=R.toJSON);R.toNumber=function(){var e=+Ve(this,true,true);if(this.constructor.strict===true&&!this.eq(e.toString()))throw Error(hn+"Imprecise conversion");return e};R.toPrecision=function(e,n){var a=this,t=a.constructor,r=a.c[0];if(e!==he){if(e!==~~e||e<1||e>Fe)throw Error(De+"precision");for(a=$e(new t(a),e,n);a.c.length<e;)a.c.push(0);}return Ve(a,e<=a.e||a.e<=t.NE||a.e>=t.PE,!!r)};R.valueOf=function(){var e=this,n=e.constructor;if(n.strict===true)throw Error(hn+"valueOf disallowed");return Ve(e,e.e<=n.NE||e.e>=n.PE,true)};var Yt=zt(),Je=class extends Error{name="InvariantError"};function J(e,n){if(!e)throw new Je(n)}function Oe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ea(e){return e}function We(e="Unexpected call to never()"){throw new Je(e)}function kn(e){if(e==null)throw new Je("Value should not be null or undefined");return e}function Ca(e){return /^0x[a-fA-F0-9]+$/.test(e)}function Wn(e){return J(Ca(e),`Expected a valid hex string, but got: ${e}`),e}function He(e){return J(e.length===42,`EvmAddress: invalid length ${e.length}`),Wn(e)}var _a=Wn;var Hn=Wn;He("0x0000000000000000000000000000000000000000");var en=class extends Error{asResultAsync(){return Ne(this)}asResult(){return le(this)}static from(e){if(e instanceof Error){let n=this.formatMessage(e);return new this(n,{cause:e})}return Oe(e)&&"message"in e?new this(String(e.message)):new this(String(e))}static is(e){return e instanceof this}static formatMessage(e){let n=[],a=e;for(;a instanceof Error;){if("errors"in a&&Array.isArray(a.errors)){let t=a.errors.map(r=>r instanceof Error?r.message:String(r));n.push(t.join(", "));}else n.push(a.message);a=a.cause;}return n.join(" due to ")}};Yt.strict=true;var Mn=(e=>(e[e.Down=0]="Down",e[e.HalfUp=1]="HalfUp",e[e.HalfEven=2]="HalfEven",e[e.Up=3]="Up",e))(Mn||{}),Nn=class ${value;static MAX_VAL=$.new(Number.MAX_VALUE.toString());static MIN_VAL=$.new(Number.MIN_VALUE.toString());constructor(n){this.value=new Yt(n);}valueOf(){try{return this.value.valueOf()}catch(n){throw new Je("BigDecimal cannot be converted to a number",{cause:n})}}toNumber(){throw new Je("BigDecimal cannot be converted to a number")}abs(){return new $(this.value.abs())}add(n){return new $(this.value.add(this.toBigSource(n)))}div(n){return new $(this.value.div(this.toBigSource(n)))}minus(n){return new $(this.value.minus(this.toBigSource(n)))}mod(n){return new $(this.value.mod(this.toBigSource(n)))}mul(n){return new $(this.value.mul(this.toBigSource(n)))}neg(){return new $(this.value.neg())}plus(n){return new $(this.value.plus(this.toBigSource(n)))}pow(n){return new $(this.value.pow(n))}prec(n,a){return new $(this.value.prec(n,a))}round(n,a){return new $(this.value.round(n,a))}sqrt(){return new $(this.value.sqrt())}sub(n){return new $(this.value.sub(this.toBigSource(n)))}times(n){return new $(this.value.times(this.toBigSource(n)))}cmp(n){return this.value.cmp(this.toBigSource(n))}eq(n){return this.value.eq(this.toBigSource(n))}gt(n){return this.value.gt(this.toBigSource(n))}gte(n){return this.value.gte(this.toBigSource(n))}lt(n){return this.value.lt(this.toBigSource(n))}lte(n){return this.value.lte(this.toBigSource(n))}toExponential(n,a){return this.value.toExponential(n,a)}toFixed(n,a){return this.value.toFixed(n,a)}toPrecision(n,a){return this.value.toPrecision(n,a)}toString(){return this.value.toString()}toJSON(){return this.value.toFixed()}rescale(n){return this.mul(10**n)}toDisplayString(n,a){let{rounding:t=1,minFractionDigits:r=0,trimTrailingZeros:i=false}=a??{};if(this.eq(0))return r>0?`0.${"0".repeat(r)}`:"0";let s=this.applyPrecisionWithMinFractionDigits(n,r,t);return this.formatDecimalString(s,r,i)}toApproximateNumber(){return this.gt($.MAX_VAL)?Number.MAX_VALUE:this.lt($.MAX_VAL.times(-1))?-Number.MAX_VALUE:this.abs().lt($.MIN_VAL)?this.lt("0")?-0:0:Number(this.toString())}static new(n){try{return new $(n)}catch(a){throw new Je("Invalid value for BigDecimal",{cause:a})}}static isBigDecimal(n){return n instanceof $}static min(n,a,...t){return [a,...t].reduce((r,i)=>r.lt(i)?r:i,n)}static max(n,a,...t){return [a,...t].reduce((r,i)=>r.gt(i)?r:i,n)}toBigSource(n){switch(typeof n){case "bigint":return n.toString();case "number":return n.toString();case "string":return n;default:return n.toFixed()}}getIntegerDigitCount(){let n=this.abs().toFixed(),[a]=n.split(".");return a?.length??n.length}applyPrecisionWithMinFractionDigits(n,a,t){if(this.gte(1)&&a>0){let r=this.getIntegerDigitCount(),i=r+a,s=Math.max(n,i)-r;return this.round(s,t)}return this.applyAdaptivePrecision(n,t)}formatDecimalString(n,a,t){let r=n.toFixed();return a>0&&(r=this.ensureMinFractionDigits(r,a)),t&&r.includes(".")&&(r=r.replace(/\.?0+$/,"")),r}ensureMinFractionDigits(n,a){let[t,r=""]=n.split(".");return r.length<a?`${t}.${r.padEnd(a,"0")}`:n}applyAdaptivePrecision(n,a){if(this.abs().gte(1)){let t=this.getIntegerDigitCount(),r=Math.max(0,n-t);return this.round(r,a)}return this.prec(n,a)}};function ba(e){return e instanceof Nn?e:Nn.new(e.toString())}function _e(e){let n=Number(e);return J(Number.isInteger(n)&&n>=0,`Invalid ChainId: ${e}`),n}var mr=(e=>(e.UNAUTHENTICATED="UNAUTHENTICATED",e.FORBIDDEN="FORBIDDEN",e.INTERNAL_SERVER_ERROR="INTERNAL_SERVER_ERROR",e.BAD_USER_INPUT="BAD_USER_INPUT",e.BAD_REQUEST="BAD_REQUEST",e))(mr||{});var ye=class fr extends en{name="UnexpectedError";static upgradeRequired(n){return new fr(`${n}. Check for SDK updates.`)}},Ue=class extends en{name="SigningError"},Ja=class Nr extends en{name="TransactionError";txHash;constructor(n,a,t){super(n,{cause:t}),this.txHash=a;}static new(n){let{txHash:a,request:t,link:r}=n,i=r?`Transaction failed: ${a}
|
|
2
|
+
\u2192 View on explorer: ${r}`:`Transaction failed: ${a}`;return new Nr(i,a,t)}};var je=class extends en{name="CancelError"};var ta={DOCUMENT:"Document",FRAGMENT_DEFINITION:"FragmentDefinition"},Bo=class extends Error{constructor(e,n,a,t,r,i,s){super(e),this.name="GraphQLError",this.message=e,r&&(this.path=r),n&&(this.nodes=Array.isArray(n)?n:[n]),a&&(this.source=a),t&&(this.positions=t),i&&(this.originalError=i);var o=s;if(!o&&i){var l=i.extensions;l&&typeof l=="object"&&(o=l);}this.extensions=o||{};}toJSON(){return {...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return "GraphQLError"}},T,N;function ne(e){return new Bo(`Syntax Error: Unexpected token at ${N} in ${e}`)}function hr(e){if(e.lastIndex=N,e.test(T))return T.slice(N,N=e.lastIndex)}var ra=/ +(?=[^\s])/y;function Io(e){for(var n=e.split(`
|
|
3
|
+
`),a="",t=0,r=0,i=n.length-1,s=0;s<n.length;s++)ra.lastIndex=0,ra.test(n[s])&&(s&&(!t||ra.lastIndex<t)&&(t=ra.lastIndex),r=r||s,i=s);for(var o=r;o<=i;o++)o!==r&&(a+=`
|
|
4
|
+
`),a+=n[o].slice(t).replace(/\\"""/g,'"""');return a}function b(){for(var e=0|T.charCodeAt(N++);e===9||e===10||e===13||e===32||e===35||e===44||e===65279;e=0|T.charCodeAt(N++))if(e===35)for(;(e=T.charCodeAt(N++))!==10&&e!==13;);N--;}function Da(){for(var e=N,n=0|T.charCodeAt(N++);n>=48&&n<=57||n>=65&&n<=90||n===95||n>=97&&n<=122;n=0|T.charCodeAt(N++));if(e===N-1)throw ne("Name");var a=T.slice(e,--N);return b(),a}function ae(){return {kind:"Name",value:Da()}}var Jo=/(?:"""|(?:[\s\S]*?[^\\])""")/y,Fo=/(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;function sa(e){var n;switch(T.charCodeAt(N)){case 91:N++,b();for(var a=[];T.charCodeAt(N)!==93;)a.push(sa(e));return N++,b(),{kind:"ListValue",values:a};case 123:N++,b();for(var t=[];T.charCodeAt(N)!==125;){var r=ae();if(T.charCodeAt(N++)!==58)throw ne("ObjectField");b(),t.push({kind:"ObjectField",name:r,value:sa(e)});}return N++,b(),{kind:"ObjectValue",fields:t};case 36:if(e)throw ne("Variable");return N++,{kind:"Variable",name:ae()};case 34:if(T.charCodeAt(N+1)===34&&T.charCodeAt(N+2)===34){if(N+=3,(n=hr(Jo))==null)throw ne("StringValue");return b(),{kind:"StringValue",value:Io(n.slice(0,-3)),block:true}}else {var i=N,s;N++;var o=false;for(s=0|T.charCodeAt(N++);s===92&&(N++,o=true)||s!==10&&s!==13&&s!==34&&s;s=0|T.charCodeAt(N++));if(s!==34)throw ne("StringValue");return n=T.slice(i,N),b(),{kind:"StringValue",value:o?JSON.parse(n):n.slice(1,-1),block:false}}case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:for(var l=N++,p;(p=0|T.charCodeAt(N++))>=48&&p<=57;);var c=T.slice(l,--N);if((p=T.charCodeAt(N))===46||p===69||p===101){if((n=hr(Fo))==null)throw ne("FloatValue");return b(),{kind:"FloatValue",value:c+n}}else return b(),{kind:"IntValue",value:c};case 110:if(T.charCodeAt(N+1)===117&&T.charCodeAt(N+2)===108&&T.charCodeAt(N+3)===108)return N+=4,b(),{kind:"NullValue"};break;case 116:if(T.charCodeAt(N+1)===114&&T.charCodeAt(N+2)===117&&T.charCodeAt(N+3)===101)return N+=4,b(),{kind:"BooleanValue",value:true};break;case 102:if(T.charCodeAt(N+1)===97&&T.charCodeAt(N+2)===108&&T.charCodeAt(N+3)===115&&T.charCodeAt(N+4)===101)return N+=5,b(),{kind:"BooleanValue",value:false};break}return {kind:"EnumValue",value:Da()}}function gr(e){if(T.charCodeAt(N)===40){var n=[];N++,b();do{var a=ae();if(T.charCodeAt(N++)!==58)throw ne("Argument");b(),n.push({kind:"Argument",name:a,value:sa(e)});}while(T.charCodeAt(N)!==41);return N++,b(),n}}function Re(e){if(T.charCodeAt(N)===64){var n=[];do N++,n.push({kind:"Directive",name:ae(),arguments:gr(e)});while(T.charCodeAt(N)===64);return n}}function Do(){for(var e=0;T.charCodeAt(N)===91;)e++,N++,b();var n={kind:"NamedType",name:ae()};do if(T.charCodeAt(N)===33&&(N++,b(),n={kind:"NonNullType",type:n}),e){if(T.charCodeAt(N++)!==93)throw ne("NamedType");b(),n={kind:"ListType",type:n};}while(e--);return n}function oa(){if(T.charCodeAt(N++)!==123)throw ne("SelectionSet");return b(),ua()}function ua(){var e=[];do if(T.charCodeAt(N)===46){if(T.charCodeAt(++N)!==46||T.charCodeAt(++N)!==46)throw ne("SelectionSet");switch(N++,b(),T.charCodeAt(N)){case 64:e.push({kind:"InlineFragment",typeCondition:void 0,directives:Re(false),selectionSet:oa()});break;case 111:T.charCodeAt(N+1)===110?(N+=2,b(),e.push({kind:"InlineFragment",typeCondition:{kind:"NamedType",name:ae()},directives:Re(false),selectionSet:oa()})):e.push({kind:"FragmentSpread",name:ae(),directives:Re(false)});break;case 123:N++,b(),e.push({kind:"InlineFragment",typeCondition:void 0,directives:void 0,selectionSet:ua()});break;default:e.push({kind:"FragmentSpread",name:ae(),directives:Re(false)});}}else {var n=ae(),a=void 0;T.charCodeAt(N)===58&&(N++,b(),a=n,n=ae());var t=gr(false),r=Re(false),i=void 0;T.charCodeAt(N)===123&&(N++,b(),i=ua()),e.push({kind:"Field",alias:a,name:n,arguments:t,directives:r,selectionSet:i});}while(T.charCodeAt(N)!==125);return N++,b(),{kind:"SelectionSet",selections:e}}function $o(){if(b(),T.charCodeAt(N)===40){var e=[];N++,b();do{if(T.charCodeAt(N++)!==36)throw ne("Variable");var n=ae();if(T.charCodeAt(N++)!==58)throw ne("VariableDefinition");b();var a=Do(),t=void 0;T.charCodeAt(N)===61&&(N++,b(),t=sa(true)),b(),e.push({kind:"VariableDefinition",variable:{kind:"Variable",name:n},type:a,defaultValue:t,directives:Re(true)});}while(T.charCodeAt(N)!==41);return N++,b(),e}}function Vo(){var e=ae();if(T.charCodeAt(N++)!==111||T.charCodeAt(N++)!==110)throw ne("FragmentDefinition");return b(),{kind:"FragmentDefinition",name:e,typeCondition:{kind:"NamedType",name:ae()},directives:Re(false),selectionSet:oa()}}function Wo(){var e=[];do if(T.charCodeAt(N)===123)N++,b(),e.push({kind:"OperationDefinition",operation:"query",name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:ua()});else {var n=Da();switch(n){case "fragment":e.push(Vo());break;case "query":case "mutation":case "subscription":var a,t=void 0;(a=T.charCodeAt(N))!==40&&a!==64&&a!==123&&(t=ae()),e.push({kind:"OperationDefinition",operation:n,name:t,variableDefinitions:$o(),directives:Re(false),selectionSet:oa()});break;default:throw ne("Document")}}while(N<T.length);return e}function Ho(e,n){return T=e.body?e.body:e,N=0,b(),{kind:"Document",definitions:Wo(),loc:{start:0,end:T.length,startToken:void 0,endToken:void 0,source:{body:T,name:"graphql.web",locationOffset:{line:1,column:1}}}}}var kr=0,Fa=new Set;function vr(){function e(n,a){var t=Ho(n).definitions,r=new Set;for(var i of a||[])for(var s of i.definitions)s.kind===ta.FRAGMENT_DEFINITION&&!r.has(s)&&(t.push(s),r.add(s));var o;(o=t[0].kind===ta.FRAGMENT_DEFINITION)&&t[0].directives&&(t[0].directives=t[0].directives.filter((p=>p.name.value!=="_unmask")));var l;return {kind:ta.DOCUMENT,definitions:t,get loc(){if(!l&&o){var p=n+(function(c){try{kr++;var d="";for(var f of c)if(!Fa.has(f)){Fa.add(f);var{loc:m}=f;m&&(d+=m.source.body);}return d}finally{--kr==0&&Fa.clear();}})(a||[]);return {start:0,end:p.length,source:{body:p,name:"GraphQLTada",locationOffset:{line:1,column:1}}}}return l},set loc(p){l=p;}}}return e.scalar=function(n,a){return a},e.persisted=function(n,a){return {kind:ta.DOCUMENT,definitions:a?a.definitions:[],documentId:n}},e}vr();var Tr=(e=>(e.Asc="ASC",e.Desc="DESC",e))(Tr||{}),Ar=(e=>(e.Ten="TEN",e.Fifty="FIFTY",e))(Ar||{}),$a=(e=>(e.LastDay="LAST_DAY",e.LastWeek="LAST_WEEK",e.LastMonth="LAST_MONTH",e.LastSixMonths="LAST_SIX_MONTHS",e.LastYear="LAST_YEAR",e.All="ALL",e))($a||{}),Lr=(e=>(e.SpokeBorrow="SPOKE_BORROW",e.SpokeRepay="SPOKE_REPAY",e.SpokeSupply="SPOKE_SUPPLY",e.SpokeWithdraw="SPOKE_WITHDRAW",e.SpokeUpdateUserRiskPremium="SPOKE_UPDATE_USER_RISK_PREMIUM",e.SpokeUpdateUserDynamicConfig="SPOKE_UPDATE_USER_DYNAMIC_CONFIG",e.SpokeSetUserUsingAsCollateral="SPOKE_SET_USER_USING_AS_COLLATERAL",e.SpokeSetUserPositionManager="SPOKE_SET_USER_POSITION_MANAGER",e.RenounceSpokeUserPositionManager="RENOUNCE_SPOKE_USER_POSITION_MANAGER",e.Liquidation="LIQUIDATION",e))(Lr||{}),Va=(e=>(e.TESTNET_ONLY="TESTNET_ONLY",e.MAINNET_ONLY="MAINNET_ONLY",e.ALL="ALL",e))(Va||{}),Sr=(e=>(e.Borrow="BORROW",e.Supply="SUPPLY",e.Withdraw="WITHDRAW",e.Repay="REPAY",e.Liquidated="LIQUIDATED",e.SetAsCollateral="SET_AS_COLLATERAL",e.UpdatedDynamicConfig="UPDATED_DYNAMIC_CONFIG",e.UpdatedRiskPremium="UPDATED_RISK_PREMIUM",e.TokenToTokenSwap="TOKEN_TO_TOKEN_SWAP",e.SupplySwap="SUPPLY_SWAP",e.BorrowSwap="BORROW_SWAP",e.RepayWithSupply="REPAY_WITH_SUPPLY",e.WithdrawSwap="WITHDRAW_SWAP",e))(Sr||{}),Or=(e=>(e.Highest="HIGHEST",e.Lowest="LOWEST",e.Average="AVERAGE",e))(Or||{}),wr=(e=>(e.Highest="HIGHEST",e.Lowest="LOWEST",e))(wr||{}),vn=(e=>(e.Usd="USD",e.Eur="EUR",e.Gbp="GBP",e))(vn||{}),Er=(e=>(e.Supply="SUPPLY",e.Borrow="BORROW",e.Collateral="COLLATERAL",e.All="ALL",e))(Er||{}),Cr=(e=>(e.Buy="BUY",e.Sell="SELL",e))(Cr||{}),_r=(e=>(e.Current="CURRENT",e.New="NEW",e))(_r||{}),br=(e=>(e.Repay="REPAY",e.Supply="SUPPLY",e))(br||{}),Ur=(e=>(e.Current="CURRENT",e.New="NEW",e))(Ur||{}),Rr=(e=>(e.Withdraw="WITHDRAW",e.Buy="BUY",e))(Rr||{}),Pr=(e=>(e.Cancelled="CANCELLED",e.Expired="EXPIRED",e.Fulfilled="FULFILLED",e.Open="OPEN",e.PendingSignature="PENDING_SIGNATURE",e))(Pr||{}),qr=(e=>(e.Stablecoin="STABLECOIN",e.EthCorrelated="ETH_CORRELATED",e))(qr||{}),xr=(e=>(e.AllDynamicConfig="ALL_DYNAMIC_CONFIG",e.JustRiskPremium="JUST_RISK_PREMIUM",e))(xr||{}),Br=(e=>(e.Fast="FAST",e.Accurate="ACCURATE",e))(Br||{}),u=vr(),Wa=u(`fragment DomainData on DomainData {
|
|
5
|
+
name
|
|
6
|
+
version
|
|
7
|
+
chainId
|
|
8
|
+
verifyingContract
|
|
9
|
+
}`),ge=u(`fragment DecimalNumber on DecimalNumber {
|
|
10
|
+
__typename
|
|
11
|
+
onChainValue
|
|
12
|
+
decimals
|
|
13
|
+
value
|
|
14
|
+
}`),q=u(`fragment PercentNumber on PercentNumber {
|
|
15
|
+
__typename
|
|
16
|
+
onChainValue
|
|
17
|
+
decimals
|
|
18
|
+
value
|
|
19
|
+
normalized
|
|
20
|
+
}`),Ir=u(`fragment DecimalNumberWithChange on DecimalNumberWithChange {
|
|
21
|
+
__typename
|
|
22
|
+
current {
|
|
23
|
+
...DecimalNumber
|
|
24
|
+
}
|
|
25
|
+
change(window: $timeWindow) {
|
|
26
|
+
...PercentNumber
|
|
27
|
+
}
|
|
28
|
+
}`,[ge,q]),te=u(`fragment ExchangeAmount on ExchangeAmount {
|
|
29
|
+
__typename
|
|
30
|
+
value
|
|
31
|
+
name
|
|
32
|
+
symbol
|
|
33
|
+
icon
|
|
34
|
+
decimals
|
|
35
|
+
}`),Tn=u(`fragment TokenInfo on TokenInfo {
|
|
36
|
+
__typename
|
|
37
|
+
id
|
|
38
|
+
name
|
|
39
|
+
symbol
|
|
40
|
+
icon
|
|
41
|
+
decimals
|
|
42
|
+
categories
|
|
43
|
+
}`),H=u(`fragment Chain on Chain {
|
|
44
|
+
__typename
|
|
45
|
+
name
|
|
46
|
+
icon
|
|
47
|
+
chainId
|
|
48
|
+
rpcUrl
|
|
49
|
+
explorerUrl
|
|
50
|
+
isTestnet
|
|
51
|
+
isFork
|
|
52
|
+
nativeWrappedToken
|
|
53
|
+
nativeGateway
|
|
54
|
+
signatureGateway
|
|
55
|
+
nativeInfo {
|
|
56
|
+
...TokenInfo
|
|
57
|
+
}
|
|
58
|
+
}`,[Tn]),Ee=u(`fragment Erc20Token on Erc20Token {
|
|
59
|
+
__typename
|
|
60
|
+
info {
|
|
61
|
+
...TokenInfo
|
|
62
|
+
}
|
|
63
|
+
address
|
|
64
|
+
chain {
|
|
65
|
+
...Chain
|
|
66
|
+
}
|
|
67
|
+
isWrappedNativeToken
|
|
68
|
+
}`,[Tn,H]),Ha=u(`fragment NativeToken on NativeToken {
|
|
69
|
+
__typename
|
|
70
|
+
info {
|
|
71
|
+
...TokenInfo
|
|
72
|
+
}
|
|
73
|
+
chain {
|
|
74
|
+
...Chain
|
|
75
|
+
}
|
|
76
|
+
}`,[Tn,H]),z=u(`fragment Erc20Amount on Erc20Amount {
|
|
77
|
+
__typename
|
|
78
|
+
token {
|
|
79
|
+
...Erc20Token
|
|
80
|
+
}
|
|
81
|
+
amount {
|
|
82
|
+
...DecimalNumber
|
|
83
|
+
}
|
|
84
|
+
exchange(currency: $currency){
|
|
85
|
+
...ExchangeAmount
|
|
86
|
+
}
|
|
87
|
+
exchangeRate(currency: $currency){
|
|
88
|
+
...DecimalNumber
|
|
89
|
+
}
|
|
90
|
+
}`,[Ee,ge,te]),Ma=u(`fragment NativeAmount on NativeAmount {
|
|
91
|
+
__typename
|
|
92
|
+
token {
|
|
93
|
+
...NativeToken
|
|
94
|
+
}
|
|
95
|
+
amount {
|
|
96
|
+
...DecimalNumber
|
|
97
|
+
}
|
|
98
|
+
exchange(currency: $currency){
|
|
99
|
+
...ExchangeAmount
|
|
100
|
+
}
|
|
101
|
+
exchangeRate(currency: $currency){
|
|
102
|
+
...DecimalNumber
|
|
103
|
+
}
|
|
104
|
+
}`,[Ha,ge,te]),la=u(`fragment TokenAmount on TokenAmount {
|
|
105
|
+
__typename
|
|
106
|
+
... on Erc20Amount {
|
|
107
|
+
...Erc20Amount
|
|
108
|
+
}
|
|
109
|
+
... on NativeAmount {
|
|
110
|
+
...NativeAmount
|
|
111
|
+
}
|
|
112
|
+
}`,[z,Ma]),Jr=u(`fragment Token on Token {
|
|
113
|
+
__typename
|
|
114
|
+
... on Erc20Token {
|
|
115
|
+
...Erc20Token
|
|
116
|
+
}
|
|
117
|
+
... on NativeToken {
|
|
118
|
+
...NativeToken
|
|
119
|
+
}
|
|
120
|
+
}`,[Ee,Ha]),un=u(`fragment ExchangeAmountWithChange on ExchangeAmountWithChange {
|
|
121
|
+
__typename
|
|
122
|
+
current {
|
|
123
|
+
...ExchangeAmount
|
|
124
|
+
}
|
|
125
|
+
change(window: $timeWindow){
|
|
126
|
+
...PercentNumber
|
|
127
|
+
}
|
|
128
|
+
}`,[te,q]),Fr=u(`fragment PercentNumberWithChange on PercentNumberWithChange {
|
|
129
|
+
__typename
|
|
130
|
+
current {
|
|
131
|
+
...PercentNumber
|
|
132
|
+
}
|
|
133
|
+
change(window: $timeWindow){
|
|
134
|
+
...PercentNumber
|
|
135
|
+
}
|
|
136
|
+
}`,[q]),An=u(`fragment PaginatedResultInfo on PaginatedResultInfo {
|
|
137
|
+
__typename
|
|
138
|
+
prev
|
|
139
|
+
next
|
|
140
|
+
}`),Dr=u(`fragment PercentNumberVariation on PercentNumberVariation {
|
|
141
|
+
__typename
|
|
142
|
+
current {
|
|
143
|
+
...PercentNumber
|
|
144
|
+
}
|
|
145
|
+
after {
|
|
146
|
+
...PercentNumber
|
|
147
|
+
}
|
|
148
|
+
}`,[q]),$r=u(`fragment ExchangeAmountVariation on ExchangeAmountVariation {
|
|
149
|
+
__typename
|
|
150
|
+
current {
|
|
151
|
+
...ExchangeAmount
|
|
152
|
+
}
|
|
153
|
+
after {
|
|
154
|
+
...ExchangeAmount
|
|
155
|
+
}
|
|
156
|
+
}`,[te]),Vr=u(`fragment HealthFactorWithChange on HealthFactorWithChange {
|
|
157
|
+
__typename
|
|
158
|
+
current
|
|
159
|
+
change(window: $timeWindow) {
|
|
160
|
+
...PercentNumber
|
|
161
|
+
}
|
|
162
|
+
}`,[q]),Wr=u(`fragment HealthFactorVariation on HealthFactorVariation {
|
|
163
|
+
__typename
|
|
164
|
+
current
|
|
165
|
+
after
|
|
166
|
+
}`),Hr=u(`fragment HealthFactorError on HealthFactorError {
|
|
167
|
+
__typename
|
|
168
|
+
reason
|
|
169
|
+
current
|
|
170
|
+
after
|
|
171
|
+
}`),Mr=u(`fragment HealthFactorResult on HealthFactorResult {
|
|
172
|
+
__typename
|
|
173
|
+
... on HealthFactorVariation {
|
|
174
|
+
...HealthFactorVariation
|
|
175
|
+
}
|
|
176
|
+
... on HealthFactorError {
|
|
177
|
+
...HealthFactorError
|
|
178
|
+
}
|
|
179
|
+
}`,[Wr,Hr]),ln=u(`fragment InsufficientBalanceError on InsufficientBalanceError {
|
|
180
|
+
__typename
|
|
181
|
+
required {
|
|
182
|
+
...DecimalNumber
|
|
183
|
+
}
|
|
184
|
+
available {
|
|
185
|
+
...DecimalNumber
|
|
186
|
+
}
|
|
187
|
+
}`,[ge]),Qr=u(`fragment HubSummary on HubSummary {
|
|
188
|
+
__typename
|
|
189
|
+
totalBorrowed {
|
|
190
|
+
...ExchangeAmountWithChange
|
|
191
|
+
}
|
|
192
|
+
totalBorrowCap {
|
|
193
|
+
...ExchangeAmount
|
|
194
|
+
}
|
|
195
|
+
totalSupplied {
|
|
196
|
+
...ExchangeAmountWithChange
|
|
197
|
+
}
|
|
198
|
+
totalSupplyCap {
|
|
199
|
+
...ExchangeAmount
|
|
200
|
+
}
|
|
201
|
+
utilizationRate {
|
|
202
|
+
...PercentNumber
|
|
203
|
+
}
|
|
204
|
+
}`,[te,un,q]),Ln=u(`fragment Hub on Hub {
|
|
205
|
+
__typename
|
|
206
|
+
id
|
|
207
|
+
name
|
|
208
|
+
address
|
|
209
|
+
chain {
|
|
210
|
+
...Chain
|
|
211
|
+
}
|
|
212
|
+
summary(currency: $currency) {
|
|
213
|
+
...HubSummary
|
|
214
|
+
}
|
|
215
|
+
}`,[H,Qr]),jr=u(`fragment HubAssetSummary on HubAssetSummary {
|
|
216
|
+
__typename
|
|
217
|
+
supplied {
|
|
218
|
+
...Erc20Amount
|
|
219
|
+
}
|
|
220
|
+
borrowed {
|
|
221
|
+
...Erc20Amount
|
|
222
|
+
}
|
|
223
|
+
availableLiquidity {
|
|
224
|
+
...Erc20Amount
|
|
225
|
+
}
|
|
226
|
+
supplyApy {
|
|
227
|
+
...PercentNumber
|
|
228
|
+
}
|
|
229
|
+
borrowApy {
|
|
230
|
+
...PercentNumber
|
|
231
|
+
}
|
|
232
|
+
netApy {
|
|
233
|
+
...PercentNumber
|
|
234
|
+
}
|
|
235
|
+
utilizationRate {
|
|
236
|
+
...PercentNumber
|
|
237
|
+
}
|
|
238
|
+
}`,[z,q]),Kr=u(`fragment HubAssetSettings on HubAssetSettings {
|
|
239
|
+
__typename
|
|
240
|
+
feeReceiver
|
|
241
|
+
liquidityFee {
|
|
242
|
+
...PercentNumber
|
|
243
|
+
}
|
|
244
|
+
irStrategy
|
|
245
|
+
reinvestmentController
|
|
246
|
+
}`,[q]),Gr=u(`fragment HubAssetUserState on HubAssetUserState {
|
|
247
|
+
__typename
|
|
248
|
+
balance {
|
|
249
|
+
...Erc20Amount
|
|
250
|
+
}
|
|
251
|
+
}`,[z]),pa=u(`fragment HubAsset on HubAsset {
|
|
252
|
+
__typename
|
|
253
|
+
id
|
|
254
|
+
onchainAssetId
|
|
255
|
+
hub {
|
|
256
|
+
...Hub
|
|
257
|
+
}
|
|
258
|
+
underlying {
|
|
259
|
+
...Erc20Token
|
|
260
|
+
}
|
|
261
|
+
summary {
|
|
262
|
+
...HubAssetSummary
|
|
263
|
+
}
|
|
264
|
+
settings {
|
|
265
|
+
...HubAssetSettings
|
|
266
|
+
}
|
|
267
|
+
userState {
|
|
268
|
+
...HubAssetUserState
|
|
269
|
+
}
|
|
270
|
+
}`,[Ln,Ee,jr,Kr,Gr]),zr=u(`fragment PermitTypedData on PermitTypedData {
|
|
271
|
+
__typename
|
|
272
|
+
types
|
|
273
|
+
primaryType
|
|
274
|
+
domain {
|
|
275
|
+
...DomainData
|
|
276
|
+
}
|
|
277
|
+
message
|
|
278
|
+
}`,[Wa]);var re=u(`fragment Spoke on Spoke {
|
|
279
|
+
__typename
|
|
280
|
+
id
|
|
281
|
+
name
|
|
282
|
+
address
|
|
283
|
+
chain {
|
|
284
|
+
...Chain
|
|
285
|
+
}
|
|
286
|
+
}`,[H]),Yr=u(`fragment SpokePositionManager on SpokePositionManager {
|
|
287
|
+
__typename
|
|
288
|
+
address
|
|
289
|
+
active
|
|
290
|
+
name
|
|
291
|
+
}`),Zr=u(`fragment PaginatedSpokePositionManagerResult on PaginatedSpokePositionManagerResult {
|
|
292
|
+
__typename
|
|
293
|
+
items {
|
|
294
|
+
...SpokePositionManager
|
|
295
|
+
}
|
|
296
|
+
pageInfo {
|
|
297
|
+
...PaginatedResultInfo
|
|
298
|
+
}
|
|
299
|
+
}`,[Yr,An]),Xr=u(`fragment SpokeUserPositionManager on SpokeUserPositionManager {
|
|
300
|
+
__typename
|
|
301
|
+
address
|
|
302
|
+
approvedOn
|
|
303
|
+
active
|
|
304
|
+
name
|
|
305
|
+
}`),ei=u(`fragment PaginatedSpokeUserPositionManagerResult on PaginatedSpokeUserPositionManagerResult {
|
|
306
|
+
__typename
|
|
307
|
+
items {
|
|
308
|
+
...SpokeUserPositionManager
|
|
309
|
+
}
|
|
310
|
+
pageInfo {
|
|
311
|
+
...PaginatedResultInfo
|
|
312
|
+
}
|
|
313
|
+
}`,[Xr,An]),ni=u(`fragment ReserveSettings on ReserveSettings {
|
|
314
|
+
__typename
|
|
315
|
+
collateralFactor {
|
|
316
|
+
...PercentNumber
|
|
317
|
+
}
|
|
318
|
+
maxLiquidationBonus {
|
|
319
|
+
...PercentNumber
|
|
320
|
+
}
|
|
321
|
+
liquidationFee {
|
|
322
|
+
...PercentNumber
|
|
323
|
+
}
|
|
324
|
+
collateralRisk {
|
|
325
|
+
...PercentNumber
|
|
326
|
+
}
|
|
327
|
+
borrowable
|
|
328
|
+
collateral
|
|
329
|
+
suppliable
|
|
330
|
+
latestDynamicConfigKey
|
|
331
|
+
}`,[q]),ai=u(`fragment ReserveStatus on ReserveStatus {
|
|
332
|
+
__typename
|
|
333
|
+
frozen
|
|
334
|
+
paused
|
|
335
|
+
active
|
|
336
|
+
}`),ti=u(`fragment ReserveSummary on ReserveSummary {
|
|
337
|
+
__typename
|
|
338
|
+
supplied {
|
|
339
|
+
...Erc20Amount
|
|
340
|
+
}
|
|
341
|
+
borrowed {
|
|
342
|
+
...Erc20Amount
|
|
343
|
+
}
|
|
344
|
+
supplyApy {
|
|
345
|
+
...PercentNumber
|
|
346
|
+
}
|
|
347
|
+
borrowApy {
|
|
348
|
+
...PercentNumber
|
|
349
|
+
}
|
|
350
|
+
}`,[z,q]),ri=u(`fragment ReserveUserState on ReserveUserState {
|
|
351
|
+
__typename
|
|
352
|
+
balance {
|
|
353
|
+
...Erc20Amount
|
|
354
|
+
}
|
|
355
|
+
suppliable {
|
|
356
|
+
...Erc20Amount
|
|
357
|
+
}
|
|
358
|
+
borrowable {
|
|
359
|
+
...Erc20Amount
|
|
360
|
+
}
|
|
361
|
+
borrowApy {
|
|
362
|
+
...PercentNumber
|
|
363
|
+
}
|
|
364
|
+
collateralFactor {
|
|
365
|
+
...PercentNumber
|
|
366
|
+
}
|
|
367
|
+
maxLiquidationBonus {
|
|
368
|
+
...PercentNumber
|
|
369
|
+
}
|
|
370
|
+
liquidationFee {
|
|
371
|
+
...PercentNumber
|
|
372
|
+
}
|
|
373
|
+
dynamicConfigKey
|
|
374
|
+
}`,[z,q]),Sn=u(`fragment Reserve on Reserve {
|
|
375
|
+
__typename
|
|
376
|
+
id
|
|
377
|
+
onChainId
|
|
378
|
+
spoke {
|
|
379
|
+
...Spoke
|
|
380
|
+
}
|
|
381
|
+
borrowCap
|
|
382
|
+
supplyCap
|
|
383
|
+
chain {
|
|
384
|
+
...Chain
|
|
385
|
+
}
|
|
386
|
+
summary {
|
|
387
|
+
...ReserveSummary
|
|
388
|
+
}
|
|
389
|
+
settings {
|
|
390
|
+
...ReserveSettings
|
|
391
|
+
}
|
|
392
|
+
status {
|
|
393
|
+
...ReserveStatus
|
|
394
|
+
}
|
|
395
|
+
canBorrow
|
|
396
|
+
canSupply
|
|
397
|
+
canUseAsCollateral
|
|
398
|
+
canSwapFrom
|
|
399
|
+
userState {
|
|
400
|
+
...ReserveUserState
|
|
401
|
+
}
|
|
402
|
+
asset {
|
|
403
|
+
...HubAsset
|
|
404
|
+
}
|
|
405
|
+
}`,[re,H,ti,ni,ai,ri,pa]),Ce=u(`fragment ReserveInfo on ReserveInfo {
|
|
406
|
+
__typename
|
|
407
|
+
id
|
|
408
|
+
asset {
|
|
409
|
+
...HubAsset
|
|
410
|
+
}
|
|
411
|
+
}`,[pa]),ie=u(`fragment TransactionRequest on TransactionRequest {
|
|
412
|
+
__typename
|
|
413
|
+
to
|
|
414
|
+
from
|
|
415
|
+
data
|
|
416
|
+
value
|
|
417
|
+
chainId
|
|
418
|
+
operations
|
|
419
|
+
}`),Qa=u(`fragment Erc20Approval on Erc20Approval {
|
|
420
|
+
__typename
|
|
421
|
+
byTransaction {
|
|
422
|
+
...TransactionRequest
|
|
423
|
+
}
|
|
424
|
+
bySignature {
|
|
425
|
+
...PermitTypedData
|
|
426
|
+
}
|
|
427
|
+
}`,[ie,zr]),ja=u(`fragment Erc20ApprovalRequired on Erc20ApprovalRequired {
|
|
428
|
+
__typename
|
|
429
|
+
approvals {
|
|
430
|
+
...Erc20Approval
|
|
431
|
+
}
|
|
432
|
+
reason
|
|
433
|
+
requiredAmount {
|
|
434
|
+
...DecimalNumber
|
|
435
|
+
}
|
|
436
|
+
currentAllowance {
|
|
437
|
+
...DecimalNumber
|
|
438
|
+
}
|
|
439
|
+
originalTransaction {
|
|
440
|
+
...TransactionRequest
|
|
441
|
+
}
|
|
442
|
+
}`,[ie,Qa,ge]),ii=u(`fragment PreContractActionRequired on PreContractActionRequired {
|
|
443
|
+
__typename
|
|
444
|
+
transaction {
|
|
445
|
+
...TransactionRequest
|
|
446
|
+
}
|
|
447
|
+
reason
|
|
448
|
+
originalTransaction {
|
|
449
|
+
...TransactionRequest
|
|
450
|
+
}
|
|
451
|
+
}`,[ie]),On=u(`fragment ExecutionPlan on ExecutionPlan {
|
|
452
|
+
__typename
|
|
453
|
+
... on TransactionRequest {
|
|
454
|
+
...TransactionRequest
|
|
455
|
+
}
|
|
456
|
+
... on Erc20ApprovalRequired {
|
|
457
|
+
...Erc20ApprovalRequired
|
|
458
|
+
}
|
|
459
|
+
... on PreContractActionRequired {
|
|
460
|
+
...PreContractActionRequired
|
|
461
|
+
}
|
|
462
|
+
... on InsufficientBalanceError {
|
|
463
|
+
...InsufficientBalanceError
|
|
464
|
+
}
|
|
465
|
+
}`,[ie,ja,ii,ln]),si=u(`fragment SwapQuoteCosts on SwapQuoteCosts {
|
|
466
|
+
__typename
|
|
467
|
+
networkCosts {
|
|
468
|
+
...TokenAmount
|
|
469
|
+
}
|
|
470
|
+
partnerFee {
|
|
471
|
+
...TokenAmount
|
|
472
|
+
}
|
|
473
|
+
flashloanFee {
|
|
474
|
+
...TokenAmount
|
|
475
|
+
}
|
|
476
|
+
providerFee {
|
|
477
|
+
...TokenAmount
|
|
478
|
+
}
|
|
479
|
+
}`,[la]),wn=u(`fragment SwapQuote on SwapQuote {
|
|
480
|
+
__typename
|
|
481
|
+
accuracy
|
|
482
|
+
quoteId
|
|
483
|
+
suggestedSlippage {
|
|
484
|
+
...PercentNumber
|
|
485
|
+
}
|
|
486
|
+
selectedSlippage {
|
|
487
|
+
...PercentNumber
|
|
488
|
+
}
|
|
489
|
+
buy {
|
|
490
|
+
...TokenAmount
|
|
491
|
+
}
|
|
492
|
+
sell {
|
|
493
|
+
...TokenAmount
|
|
494
|
+
}
|
|
495
|
+
costs {
|
|
496
|
+
...SwapQuoteCosts
|
|
497
|
+
}
|
|
498
|
+
finalBuy {
|
|
499
|
+
...TokenAmount
|
|
500
|
+
}
|
|
501
|
+
finalSell {
|
|
502
|
+
...TokenAmount
|
|
503
|
+
}
|
|
504
|
+
}`,[q,la,si]),En=u(`fragment SwapTypedData on SwapTypedData {
|
|
505
|
+
__typename
|
|
506
|
+
primaryType
|
|
507
|
+
types
|
|
508
|
+
domain {
|
|
509
|
+
...DomainData
|
|
510
|
+
}
|
|
511
|
+
message
|
|
512
|
+
}`,[Wa]),Ka=u(`fragment PrepareSwapOrder on PrepareSwapOrder {
|
|
513
|
+
__typename
|
|
514
|
+
newQuoteId
|
|
515
|
+
data {
|
|
516
|
+
...SwapTypedData
|
|
517
|
+
}
|
|
518
|
+
}`,[En]),oi=u(`fragment SwapByIntent on SwapByIntent {
|
|
519
|
+
__typename
|
|
520
|
+
quote {
|
|
521
|
+
...SwapQuote
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
}`,[wn]),ui=u(`fragment SwapByIntentWithApprovalRequired on SwapByIntentWithApprovalRequired {
|
|
525
|
+
__typename
|
|
526
|
+
approvals {
|
|
527
|
+
...Erc20Approval
|
|
528
|
+
}
|
|
529
|
+
quote {
|
|
530
|
+
...SwapQuote
|
|
531
|
+
}
|
|
532
|
+
}`,[Qa,wn]),li=u(`fragment SwapByTransaction on SwapByTransaction {
|
|
533
|
+
__typename
|
|
534
|
+
quote {
|
|
535
|
+
...SwapQuote
|
|
536
|
+
}
|
|
537
|
+
}`,[wn]),Ga=u(`fragment SwapReceipt on SwapReceipt {
|
|
538
|
+
__typename
|
|
539
|
+
id
|
|
540
|
+
explorerUrl
|
|
541
|
+
createdAt
|
|
542
|
+
}`),pi=u(`fragment TokenSwapQuoteResult on TokenSwapQuoteResult {
|
|
543
|
+
__typename
|
|
544
|
+
... on SwapByIntent {
|
|
545
|
+
...SwapByIntent
|
|
546
|
+
}
|
|
547
|
+
... on SwapByIntentWithApprovalRequired {
|
|
548
|
+
...SwapByIntentWithApprovalRequired
|
|
549
|
+
}
|
|
550
|
+
... on SwapByTransaction {
|
|
551
|
+
...SwapByTransaction
|
|
552
|
+
}
|
|
553
|
+
}`,[oi,ui,li]),di=u(`fragment PrepareTokenSwapResult on PrepareTokenSwapResult {
|
|
554
|
+
__typename
|
|
555
|
+
... on PrepareSwapOrder {
|
|
556
|
+
...PrepareSwapOrder
|
|
557
|
+
}
|
|
558
|
+
... on InsufficientBalanceError {
|
|
559
|
+
...InsufficientBalanceError
|
|
560
|
+
}
|
|
561
|
+
}`,[Ka,ln]),ci=u(`fragment SwapTransactionRequest on SwapTransactionRequest {
|
|
562
|
+
__typename
|
|
563
|
+
transaction {
|
|
564
|
+
...TransactionRequest
|
|
565
|
+
}
|
|
566
|
+
orderReceipt {
|
|
567
|
+
...SwapReceipt
|
|
568
|
+
}
|
|
569
|
+
}`,[ie,Ga]),yi=u(`fragment SwapExecutionPlan on SwapExecutionPlan {
|
|
570
|
+
__typename
|
|
571
|
+
... on SwapTransactionRequest {
|
|
572
|
+
...SwapTransactionRequest
|
|
573
|
+
}
|
|
574
|
+
... on SwapReceipt {
|
|
575
|
+
...SwapReceipt
|
|
576
|
+
}
|
|
577
|
+
... on InsufficientBalanceError {
|
|
578
|
+
...InsufficientBalanceError
|
|
579
|
+
}
|
|
580
|
+
}`,[ci,Ga,ln]),za=u(`fragment SwapCancelled on SwapCancelled {
|
|
581
|
+
__typename
|
|
582
|
+
swapId
|
|
583
|
+
createdAt
|
|
584
|
+
cancelledAt
|
|
585
|
+
explorerUrl
|
|
586
|
+
}`),mi=u(`fragment SwapExpired on SwapExpired {
|
|
587
|
+
__typename
|
|
588
|
+
swapId
|
|
589
|
+
createdAt
|
|
590
|
+
expiredAt
|
|
591
|
+
explorerUrl
|
|
592
|
+
}`),fi=u(`fragment PositionAmount on PositionAmount {
|
|
593
|
+
__typename
|
|
594
|
+
reserve {
|
|
595
|
+
...ReserveInfo
|
|
596
|
+
}
|
|
597
|
+
amount {
|
|
598
|
+
...Erc20Amount
|
|
599
|
+
}
|
|
600
|
+
}`,[Ce,z]),qe=u(`fragment SwapAmount on SwapAmount {
|
|
601
|
+
__typename
|
|
602
|
+
... on PositionAmount {
|
|
603
|
+
...PositionAmount
|
|
604
|
+
}
|
|
605
|
+
... on NativeAmount {
|
|
606
|
+
...NativeAmount
|
|
607
|
+
}
|
|
608
|
+
... on Erc20Amount {
|
|
609
|
+
...Erc20Amount
|
|
610
|
+
}
|
|
611
|
+
}`,[fi,Ma,z]),Ni=u(`fragment SwapOpen on SwapOpen {
|
|
612
|
+
__typename
|
|
613
|
+
swapId
|
|
614
|
+
createdAt
|
|
615
|
+
deadline
|
|
616
|
+
explorerUrl
|
|
617
|
+
desiredSell {
|
|
618
|
+
...SwapAmount
|
|
619
|
+
}
|
|
620
|
+
desiredBuy {
|
|
621
|
+
...SwapAmount
|
|
622
|
+
}
|
|
623
|
+
}`,[qe]),hi=u(`fragment SwapPendingSignature on SwapPendingSignature {
|
|
624
|
+
__typename
|
|
625
|
+
swapId
|
|
626
|
+
createdAt
|
|
627
|
+
deadline
|
|
628
|
+
explorerUrl
|
|
629
|
+
}`),ki=u(`fragment SwapFulfilled on SwapFulfilled {
|
|
630
|
+
__typename
|
|
631
|
+
swapId
|
|
632
|
+
txHash
|
|
633
|
+
desiredSell {
|
|
634
|
+
...SwapAmount
|
|
635
|
+
}
|
|
636
|
+
desiredBuy {
|
|
637
|
+
...SwapAmount
|
|
638
|
+
}
|
|
639
|
+
sold {
|
|
640
|
+
...SwapAmount
|
|
641
|
+
}
|
|
642
|
+
bought {
|
|
643
|
+
...SwapAmount
|
|
644
|
+
}
|
|
645
|
+
createdAt
|
|
646
|
+
fulfilledAt
|
|
647
|
+
explorerUrl
|
|
648
|
+
refundTxHash
|
|
649
|
+
}`,[qe]),Ya=u(`fragment SwapStatus on SwapStatus {
|
|
650
|
+
__typename
|
|
651
|
+
... on SwapOpen {
|
|
652
|
+
...SwapOpen
|
|
653
|
+
}
|
|
654
|
+
... on SwapPendingSignature {
|
|
655
|
+
...SwapPendingSignature
|
|
656
|
+
}
|
|
657
|
+
... on SwapCancelled {
|
|
658
|
+
...SwapCancelled
|
|
659
|
+
}
|
|
660
|
+
... on SwapExpired {
|
|
661
|
+
...SwapExpired
|
|
662
|
+
}
|
|
663
|
+
... on SwapFulfilled {
|
|
664
|
+
...SwapFulfilled
|
|
665
|
+
}
|
|
666
|
+
}`,[Ni,hi,za,mi,ki]),gi=u(`fragment PrepareSwapCancelResult on PrepareSwapCancelResult {
|
|
667
|
+
__typename
|
|
668
|
+
data {
|
|
669
|
+
...SwapTypedData
|
|
670
|
+
}
|
|
671
|
+
}`,[En]),vi=u(`fragment CancelSwapExecutionPlan on CancelSwapExecutionPlan {
|
|
672
|
+
__typename
|
|
673
|
+
... on TransactionRequest {
|
|
674
|
+
...TransactionRequest
|
|
675
|
+
}
|
|
676
|
+
... on SwapCancelled {
|
|
677
|
+
...SwapCancelled
|
|
678
|
+
}
|
|
679
|
+
}`,[ie,za]),Ti=u(`fragment PaginatedUserSwapsResult on PaginatedUserSwapsResult {
|
|
680
|
+
__typename
|
|
681
|
+
items {
|
|
682
|
+
...SwapStatus
|
|
683
|
+
}
|
|
684
|
+
pageInfo {
|
|
685
|
+
...PaginatedResultInfo
|
|
686
|
+
}
|
|
687
|
+
}`,[Ya,An]),Ai=u(`fragment PositionSwapAdapterContractApproval on PositionSwapAdapterContractApproval {
|
|
688
|
+
__typename
|
|
689
|
+
bySignature {
|
|
690
|
+
...SwapTypedData
|
|
691
|
+
}
|
|
692
|
+
}`,[En]),Li=u(`fragment PositionSwapPositionManagerApproval on PositionSwapPositionManagerApproval {
|
|
693
|
+
__typename
|
|
694
|
+
byTransaction {
|
|
695
|
+
...TransactionRequest
|
|
696
|
+
}
|
|
697
|
+
bySignature {
|
|
698
|
+
...SwapTypedData
|
|
699
|
+
}
|
|
700
|
+
}`,[ie,En]),Si=u(`fragment PositionSwapApproval on PositionSwapApproval {
|
|
701
|
+
__typename
|
|
702
|
+
... on PositionSwapAdapterContractApproval {
|
|
703
|
+
...PositionSwapAdapterContractApproval
|
|
704
|
+
}
|
|
705
|
+
... on PositionSwapPositionManagerApproval {
|
|
706
|
+
...PositionSwapPositionManagerApproval
|
|
707
|
+
}
|
|
708
|
+
}`,[Ai,Li]),Cn=u(`fragment PositionSwapByIntentApprovalsRequired on PositionSwapByIntentApprovalsRequired {
|
|
709
|
+
__typename
|
|
710
|
+
quote {
|
|
711
|
+
...SwapQuote
|
|
712
|
+
}
|
|
713
|
+
approvals {
|
|
714
|
+
...PositionSwapApproval
|
|
715
|
+
}
|
|
716
|
+
}`,[wn,Si]),Oi=u(`fragment SupplySwapQuoteResult on SupplySwapQuoteResult {
|
|
717
|
+
__typename
|
|
718
|
+
... on PositionSwapByIntentApprovalsRequired {
|
|
719
|
+
...PositionSwapByIntentApprovalsRequired
|
|
720
|
+
}
|
|
721
|
+
}`,[Cn]),wi=u(`fragment BorrowSwapQuoteResult on BorrowSwapQuoteResult {
|
|
722
|
+
__typename
|
|
723
|
+
... on PositionSwapByIntentApprovalsRequired {
|
|
724
|
+
...PositionSwapByIntentApprovalsRequired
|
|
725
|
+
}
|
|
726
|
+
}`,[Cn]),Ei=u(`fragment RepayWithSupplyQuoteResult on RepayWithSupplyQuoteResult {
|
|
727
|
+
__typename
|
|
728
|
+
... on PositionSwapByIntentApprovalsRequired {
|
|
729
|
+
...PositionSwapByIntentApprovalsRequired
|
|
730
|
+
}
|
|
731
|
+
}`,[Cn]),Ci=u(`fragment WithdrawSwapQuoteResult on WithdrawSwapQuoteResult {
|
|
732
|
+
__typename
|
|
733
|
+
... on PositionSwapByIntentApprovalsRequired {
|
|
734
|
+
...PositionSwapByIntentApprovalsRequired
|
|
735
|
+
}
|
|
736
|
+
}`,[Cn]),_i=u(`fragment PreparePositionSwapResult on PreparePositionSwapResult {
|
|
737
|
+
__typename
|
|
738
|
+
... on PrepareSwapOrder {
|
|
739
|
+
...PrepareSwapOrder
|
|
740
|
+
}
|
|
741
|
+
... on InsufficientBalanceError {
|
|
742
|
+
...InsufficientBalanceError
|
|
743
|
+
}
|
|
744
|
+
}`,[Ka,ln]),bi=u(`fragment UserSupplyItem on UserSupplyItem {
|
|
745
|
+
__typename
|
|
746
|
+
id
|
|
747
|
+
reserve {
|
|
748
|
+
...Reserve
|
|
749
|
+
}
|
|
750
|
+
interest {
|
|
751
|
+
...Erc20Amount
|
|
752
|
+
}
|
|
753
|
+
principal {
|
|
754
|
+
...Erc20Amount
|
|
755
|
+
}
|
|
756
|
+
withdrawable {
|
|
757
|
+
...Erc20Amount
|
|
758
|
+
}
|
|
759
|
+
isCollateral
|
|
760
|
+
createdAt
|
|
761
|
+
}`,[z,Sn]),Ui=u(`fragment UserBorrowItem on UserBorrowItem {
|
|
762
|
+
__typename
|
|
763
|
+
id
|
|
764
|
+
principal {
|
|
765
|
+
...Erc20Amount
|
|
766
|
+
}
|
|
767
|
+
interest {
|
|
768
|
+
...Erc20Amount
|
|
769
|
+
}
|
|
770
|
+
debt {
|
|
771
|
+
...Erc20Amount
|
|
772
|
+
}
|
|
773
|
+
reserve {
|
|
774
|
+
...Reserve
|
|
775
|
+
}
|
|
776
|
+
createdAt
|
|
777
|
+
}`,[z,Sn]),Ri=u(`fragment UserSummary on UserSummary {
|
|
778
|
+
__typename
|
|
779
|
+
totalPositions
|
|
780
|
+
netBalance(currency: $currency) {
|
|
781
|
+
...ExchangeAmountWithChange
|
|
782
|
+
}
|
|
783
|
+
totalCollateral(currency: $currency) {
|
|
784
|
+
...ExchangeAmount
|
|
785
|
+
}
|
|
786
|
+
totalSupplied(currency: $currency) {
|
|
787
|
+
...ExchangeAmount
|
|
788
|
+
}
|
|
789
|
+
totalDebt(currency: $currency) {
|
|
790
|
+
...ExchangeAmount
|
|
791
|
+
}
|
|
792
|
+
netApy {
|
|
793
|
+
...PercentNumber
|
|
794
|
+
}
|
|
795
|
+
netAccruedInterest(currency: $currency) {
|
|
796
|
+
...ExchangeAmount
|
|
797
|
+
}
|
|
798
|
+
lowestHealthFactor
|
|
799
|
+
}`,[un,te,q]),Za=u(`fragment UserRiskPremiumBreakdownItem on UserRiskPremiumBreakdownItem {
|
|
800
|
+
__typename
|
|
801
|
+
token {
|
|
802
|
+
...Erc20Token
|
|
803
|
+
}
|
|
804
|
+
currentRiskPremiumWeight {
|
|
805
|
+
...PercentNumber
|
|
806
|
+
}
|
|
807
|
+
latestRiskPremiumWeight {
|
|
808
|
+
...PercentNumber
|
|
809
|
+
}
|
|
810
|
+
collateral {
|
|
811
|
+
...PercentNumber
|
|
812
|
+
}
|
|
813
|
+
}`,[Ee,q]),Pi=u(`fragment UserPositionRiskPremium on UserPositionRiskPremium {
|
|
814
|
+
__typename
|
|
815
|
+
current {
|
|
816
|
+
...PercentNumber
|
|
817
|
+
}
|
|
818
|
+
latest {
|
|
819
|
+
...PercentNumber
|
|
820
|
+
}
|
|
821
|
+
breakdown {
|
|
822
|
+
...UserRiskPremiumBreakdownItem
|
|
823
|
+
}
|
|
824
|
+
}`,[q,Za]),Xa=u(`fragment UserPosition on UserPosition {
|
|
825
|
+
__typename
|
|
826
|
+
id
|
|
827
|
+
spoke {
|
|
828
|
+
...Spoke
|
|
829
|
+
}
|
|
830
|
+
user
|
|
831
|
+
createdAt
|
|
832
|
+
netApy {
|
|
833
|
+
...PercentNumber
|
|
834
|
+
}
|
|
835
|
+
netCollateral(currency: $currency) {
|
|
836
|
+
...ExchangeAmountWithChange
|
|
837
|
+
}
|
|
838
|
+
netBalance(currency: $currency) {
|
|
839
|
+
...ExchangeAmountWithChange
|
|
840
|
+
}
|
|
841
|
+
netAccruedInterest(currency: $currency) {
|
|
842
|
+
...ExchangeAmount
|
|
843
|
+
}
|
|
844
|
+
totalCollateral(currency: $currency) {
|
|
845
|
+
...ExchangeAmountWithChange
|
|
846
|
+
}
|
|
847
|
+
totalSupplied(currency: $currency) {
|
|
848
|
+
...ExchangeAmountWithChange
|
|
849
|
+
}
|
|
850
|
+
totalDebt(currency: $currency) {
|
|
851
|
+
...ExchangeAmountWithChange
|
|
852
|
+
}
|
|
853
|
+
netSupplyApy {
|
|
854
|
+
...PercentNumberWithChange
|
|
855
|
+
}
|
|
856
|
+
netBorrowApy {
|
|
857
|
+
...PercentNumberWithChange
|
|
858
|
+
}
|
|
859
|
+
healthFactor {
|
|
860
|
+
...HealthFactorWithChange
|
|
861
|
+
}
|
|
862
|
+
riskPremium {
|
|
863
|
+
...UserPositionRiskPremium
|
|
864
|
+
}
|
|
865
|
+
liquidationPrice(currency: $currency) {
|
|
866
|
+
...ExchangeAmount
|
|
867
|
+
}
|
|
868
|
+
borrowingPower(currency: $currency) {
|
|
869
|
+
...ExchangeAmount
|
|
870
|
+
}
|
|
871
|
+
canUpdateDynamicConfig
|
|
872
|
+
netBalancePercentChange(window: $timeWindow) {
|
|
873
|
+
...PercentNumber
|
|
874
|
+
}
|
|
875
|
+
averageCollateralFactor {
|
|
876
|
+
...PercentNumber
|
|
877
|
+
}
|
|
878
|
+
}`,[re,q,un,te,Fr,Vr,Pi]),qi=u(`fragment UserBalance on UserBalance {
|
|
879
|
+
__typename
|
|
880
|
+
id
|
|
881
|
+
info {
|
|
882
|
+
...TokenInfo
|
|
883
|
+
}
|
|
884
|
+
totalAmount {
|
|
885
|
+
...DecimalNumber
|
|
886
|
+
}
|
|
887
|
+
balances {
|
|
888
|
+
...TokenAmount
|
|
889
|
+
}
|
|
890
|
+
exchange(currency: $currency) {
|
|
891
|
+
...ExchangeAmount
|
|
892
|
+
}
|
|
893
|
+
highestSupplyApy: supplyApy(metric: HIGHEST) {
|
|
894
|
+
...PercentNumber
|
|
895
|
+
}
|
|
896
|
+
highestBorrowApy: borrowApy(metric: HIGHEST) {
|
|
897
|
+
...PercentNumber
|
|
898
|
+
}
|
|
899
|
+
lowestSupplyApy: supplyApy(metric: LOWEST) {
|
|
900
|
+
...PercentNumber
|
|
901
|
+
}
|
|
902
|
+
lowestBorrowApy: borrowApy(metric: LOWEST) {
|
|
903
|
+
...PercentNumber
|
|
904
|
+
}
|
|
905
|
+
highestCollateralFactor: collateralFactor(metric: HIGHEST) {
|
|
906
|
+
...PercentNumber
|
|
907
|
+
}
|
|
908
|
+
lowestCollateralFactor: collateralFactor(metric: LOWEST) {
|
|
909
|
+
...PercentNumber
|
|
910
|
+
}
|
|
911
|
+
}`,[Tn,ge,la,te,q]),xi=u(`fragment UserSummaryHistoryItem on UserSummaryHistoryItem {
|
|
912
|
+
__typename
|
|
913
|
+
netBalance(currency: $currency) {
|
|
914
|
+
...ExchangeAmount
|
|
915
|
+
}
|
|
916
|
+
borrows(currency: $currency) {
|
|
917
|
+
...ExchangeAmount
|
|
918
|
+
}
|
|
919
|
+
supplies(currency: $currency) {
|
|
920
|
+
...ExchangeAmount
|
|
921
|
+
}
|
|
922
|
+
healthFactor
|
|
923
|
+
date
|
|
924
|
+
}`,[te]),et=u(`fragment ApySample on ApySample {
|
|
925
|
+
__typename
|
|
926
|
+
date
|
|
927
|
+
avgRate {
|
|
928
|
+
...PercentNumber
|
|
929
|
+
}
|
|
930
|
+
}`,[q]);u(`query Hub($request: HubRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
931
|
+
value: hub(request: $request) {
|
|
932
|
+
...Hub
|
|
933
|
+
}
|
|
934
|
+
}`,[Ln]);u(`query Hubs($request: HubsRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
935
|
+
value: hubs(request: $request) {
|
|
936
|
+
...Hub
|
|
937
|
+
}
|
|
938
|
+
}`,[Ln]);u(`query HubAssets($request: HubAssetsRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
939
|
+
value: hubAssets(request: $request) {
|
|
940
|
+
...HubAsset
|
|
941
|
+
}
|
|
942
|
+
}`,[pa]);var Bi=u(`fragment HubSummarySample on HubSummarySample {
|
|
943
|
+
__typename
|
|
944
|
+
date
|
|
945
|
+
deposits {
|
|
946
|
+
...ExchangeAmount
|
|
947
|
+
}
|
|
948
|
+
borrows {
|
|
949
|
+
...ExchangeAmount
|
|
950
|
+
}
|
|
951
|
+
availableLiquidity {
|
|
952
|
+
...ExchangeAmount
|
|
953
|
+
}
|
|
954
|
+
utilizationRate {
|
|
955
|
+
...PercentNumber
|
|
956
|
+
}
|
|
957
|
+
}`,[te,q]);u(`query HubSummaryHistory($request: HubSummaryHistoryRequest!) {
|
|
958
|
+
value: hubSummaryHistory(request: $request) {
|
|
959
|
+
...HubSummarySample
|
|
960
|
+
}
|
|
961
|
+
}`,[Bi]);function nt(e){return new TextDecoder().decode(Uint8Array.from(atob(e),n=>n.charCodeAt(0)))}var Pe="::";function Ke(e){let n=nt(e),[a,t,r]=n.split(Pe);return {chainId:_e(Number.parseInt(a,10)),spoke:He(t),onChainId:r}}function it(e){let n=nt(e),[a,t,r]=n.split(Pe);return {chainId:_e(Number.parseInt(a,10)),spoke:He(t),user:He(r)}}var dt=u(`query Chain($request: ChainRequest!) {
|
|
962
|
+
value: chain(request: $request) {
|
|
963
|
+
...Chain
|
|
964
|
+
}
|
|
965
|
+
}`,[H]);u(`query Chains($request: ChainsRequest!) {
|
|
966
|
+
value: chains(request: $request) {
|
|
967
|
+
...Chain
|
|
968
|
+
}
|
|
969
|
+
}`,[H]);u(`query HasProcessedKnownTransaction($request: HasProcessedKnownTransactionRequest!) {
|
|
970
|
+
value: hasProcessedKnownTransaction(request: $request)
|
|
971
|
+
}`);u(`query Health {
|
|
972
|
+
value: health
|
|
973
|
+
}`);var ct=u(`query ExchangeRate($request: ExchangeRateRequest!) {
|
|
974
|
+
value: exchangeRate(request: $request) {
|
|
975
|
+
...ExchangeAmount
|
|
976
|
+
}
|
|
977
|
+
}`,[te]),Di=u(`fragment AssetPriceSample on AssetPriceSample {
|
|
978
|
+
__typename
|
|
979
|
+
date
|
|
980
|
+
price
|
|
981
|
+
}`),yt=u(`fragment AssetSampleBreakdown on AssetSampleBreakdown {
|
|
982
|
+
__typename
|
|
983
|
+
amount {
|
|
984
|
+
...DecimalNumber
|
|
985
|
+
}
|
|
986
|
+
apy {
|
|
987
|
+
...PercentNumber
|
|
988
|
+
}
|
|
989
|
+
hub {
|
|
990
|
+
...Hub
|
|
991
|
+
}
|
|
992
|
+
}`,[ge,q,Ln]),$i=u(`fragment AssetSupplySample on AssetSupplySample {
|
|
993
|
+
__typename
|
|
994
|
+
date
|
|
995
|
+
amount {
|
|
996
|
+
...DecimalNumber
|
|
997
|
+
}
|
|
998
|
+
highestApy {
|
|
999
|
+
...PercentNumber
|
|
1000
|
+
}
|
|
1001
|
+
lowestApy {
|
|
1002
|
+
...PercentNumber
|
|
1003
|
+
}
|
|
1004
|
+
averageApy {
|
|
1005
|
+
...PercentNumber
|
|
1006
|
+
}
|
|
1007
|
+
breakdown {
|
|
1008
|
+
...AssetSampleBreakdown
|
|
1009
|
+
}
|
|
1010
|
+
}`,[ge,q,yt]),Vi=u(`fragment AssetBorrowSample on AssetBorrowSample {
|
|
1011
|
+
__typename
|
|
1012
|
+
date
|
|
1013
|
+
amount {
|
|
1014
|
+
...DecimalNumber
|
|
1015
|
+
}
|
|
1016
|
+
highestApy {
|
|
1017
|
+
...PercentNumber
|
|
1018
|
+
}
|
|
1019
|
+
lowestApy {
|
|
1020
|
+
...PercentNumber
|
|
1021
|
+
}
|
|
1022
|
+
averageApy {
|
|
1023
|
+
...PercentNumber
|
|
1024
|
+
}
|
|
1025
|
+
breakdown {
|
|
1026
|
+
...AssetSampleBreakdown
|
|
1027
|
+
}
|
|
1028
|
+
}`,[ge,q,yt]),Wi=u(`fragment AssetAmountWithChange on AssetAmountWithChange {
|
|
1029
|
+
__typename
|
|
1030
|
+
amount {
|
|
1031
|
+
...DecimalNumberWithChange
|
|
1032
|
+
}
|
|
1033
|
+
exchange(currency: $currency) {
|
|
1034
|
+
...ExchangeAmountWithChange
|
|
1035
|
+
}
|
|
1036
|
+
}`,[Ir,un]),Hi=u(`fragment AssetSummary on AssetSummary {
|
|
1037
|
+
__typename
|
|
1038
|
+
totalSupplyCap {
|
|
1039
|
+
...AssetAmountWithChange
|
|
1040
|
+
}
|
|
1041
|
+
totalSupplied {
|
|
1042
|
+
...AssetAmountWithChange
|
|
1043
|
+
}
|
|
1044
|
+
totalSuppliable {
|
|
1045
|
+
...AssetAmountWithChange
|
|
1046
|
+
}
|
|
1047
|
+
totalBorrowCap {
|
|
1048
|
+
...AssetAmountWithChange
|
|
1049
|
+
}
|
|
1050
|
+
totalBorrowed {
|
|
1051
|
+
...AssetAmountWithChange
|
|
1052
|
+
}
|
|
1053
|
+
totalBorrowable {
|
|
1054
|
+
...AssetAmountWithChange
|
|
1055
|
+
}
|
|
1056
|
+
averageBorrowApy: borrowApy(metric: AVERAGE) {
|
|
1057
|
+
...PercentNumber
|
|
1058
|
+
}
|
|
1059
|
+
averageSupplyApy: supplyApy(metric: AVERAGE) {
|
|
1060
|
+
...PercentNumber
|
|
1061
|
+
}
|
|
1062
|
+
}`,[Wi,q]),Mi=u(`fragment Asset on Asset {
|
|
1063
|
+
__typename
|
|
1064
|
+
id
|
|
1065
|
+
token {
|
|
1066
|
+
...Erc20Token
|
|
1067
|
+
}
|
|
1068
|
+
summary {
|
|
1069
|
+
...AssetSummary
|
|
1070
|
+
}
|
|
1071
|
+
price(currency: $currency) {
|
|
1072
|
+
...ExchangeAmountWithChange
|
|
1073
|
+
}
|
|
1074
|
+
}`,[Ee,Hi,un]);u(`query Asset($request: AssetRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1075
|
+
value: asset(request: $request) {
|
|
1076
|
+
...Asset
|
|
1077
|
+
}
|
|
1078
|
+
}`,[Mi]);u(`query AssetPriceHistory($request: AssetPriceHistoryRequest!) {
|
|
1079
|
+
value: assetPriceHistory(request: $request) {
|
|
1080
|
+
...AssetPriceSample
|
|
1081
|
+
}
|
|
1082
|
+
}`,[Di]);u(`query AssetSupplyHistory($request: AssetSupplyHistoryRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1083
|
+
value: assetSupplyHistory(request: $request) {
|
|
1084
|
+
...AssetSupplySample
|
|
1085
|
+
}
|
|
1086
|
+
}`,[$i]);u(`query AssetBorrowHistory($request: AssetBorrowHistoryRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1087
|
+
value: assetBorrowHistory(request: $request) {
|
|
1088
|
+
...AssetBorrowSample
|
|
1089
|
+
}
|
|
1090
|
+
}`,[Vi]);var Qi=u(`fragment ProtocolHistorySample on ProtocolHistorySample {
|
|
1091
|
+
__typename
|
|
1092
|
+
date
|
|
1093
|
+
deposits {
|
|
1094
|
+
...ExchangeAmount
|
|
1095
|
+
}
|
|
1096
|
+
borrows {
|
|
1097
|
+
...ExchangeAmount
|
|
1098
|
+
}
|
|
1099
|
+
}`,[te]);u(`query ProtocolHistory($request: ProtocolHistoryRequest!) {
|
|
1100
|
+
value: protocolHistory(request: $request) {
|
|
1101
|
+
...ProtocolHistorySample
|
|
1102
|
+
}
|
|
1103
|
+
}`,[Qi]);u(`query BorrowApyHistory($request: BorrowApyHistoryRequest!) {
|
|
1104
|
+
value: borrowApyHistory(request: $request) {
|
|
1105
|
+
...ApySample
|
|
1106
|
+
}
|
|
1107
|
+
}`,[et]);u(`query SupplyApyHistory($request: SupplyApyHistoryRequest!) {
|
|
1108
|
+
value: supplyApyHistory(request: $request) {
|
|
1109
|
+
...ApySample
|
|
1110
|
+
}
|
|
1111
|
+
}`,[et]);u(`query Reserve($request: ReserveRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1112
|
+
value: reserve(request: $request) {
|
|
1113
|
+
...Reserve
|
|
1114
|
+
}
|
|
1115
|
+
}`,[Sn]);u(`query Reserves($request: ReservesRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1116
|
+
value: reserves(request: $request) {
|
|
1117
|
+
...Reserve
|
|
1118
|
+
}
|
|
1119
|
+
}`,[Sn]);u(`query Spoke($request: SpokeRequest!) {
|
|
1120
|
+
value: spoke(request: $request) {
|
|
1121
|
+
...Spoke
|
|
1122
|
+
}
|
|
1123
|
+
}`,[re]);u(`query Spokes($request: SpokesRequest!) {
|
|
1124
|
+
value: spokes(request: $request) {
|
|
1125
|
+
...Spoke
|
|
1126
|
+
}
|
|
1127
|
+
}`,[re]);u(`query SpokePositionManagers($request: SpokePositionManagersRequest!) {
|
|
1128
|
+
value: spokePositionManagers(request: $request) {
|
|
1129
|
+
...PaginatedSpokePositionManagerResult
|
|
1130
|
+
}
|
|
1131
|
+
}`,[Zr]);u(`query SpokeUserPositionManagers($request: SpokeUserPositionManagersRequest!) {
|
|
1132
|
+
value: spokeUserPositionManagers(request: $request) {
|
|
1133
|
+
...PaginatedSpokeUserPositionManagerResult
|
|
1134
|
+
}
|
|
1135
|
+
}`,[ei]);u(`query TokenSwapQuote($request: TokenSwapQuoteRequest!, $currency: Currency!) {
|
|
1136
|
+
value: tokenSwapQuote(request: $request) {
|
|
1137
|
+
...TokenSwapQuoteResult
|
|
1138
|
+
}
|
|
1139
|
+
}`,[pi]);u(`query SwappableTokens($request: SwappableTokensRequest!) {
|
|
1140
|
+
value: swappableTokens(request: $request) {
|
|
1141
|
+
...Token
|
|
1142
|
+
}
|
|
1143
|
+
}`,[Jr]);u(`query PrepareTokenSwap($request: PrepareTokenSwapRequest!) {
|
|
1144
|
+
value: prepareTokenSwap(request: $request) {
|
|
1145
|
+
...PrepareTokenSwapResult
|
|
1146
|
+
}
|
|
1147
|
+
}`,[di]);u(`query SwapStatus($request: SwapStatusRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1148
|
+
value: swapStatus(request: $request) {
|
|
1149
|
+
...SwapStatus
|
|
1150
|
+
}
|
|
1151
|
+
}`,[Ya]);u(`mutation Swap($request: SwapRequest!) {
|
|
1152
|
+
value: swap(request: $request) {
|
|
1153
|
+
...SwapExecutionPlan
|
|
1154
|
+
}
|
|
1155
|
+
}`,[yi]);u(`query PrepareSwapCancel($request: PrepareSwapCancelRequest!) {
|
|
1156
|
+
value: prepareSwapCancel(request: $request) {
|
|
1157
|
+
...PrepareSwapCancelResult
|
|
1158
|
+
}
|
|
1159
|
+
}`,[gi]);u(`mutation CancelSwap($request: CancelSwapRequest!) {
|
|
1160
|
+
value: cancelSwap(request: $request) {
|
|
1161
|
+
...CancelSwapExecutionPlan
|
|
1162
|
+
}
|
|
1163
|
+
}`,[vi]);u(`query UserSwaps($request: UserSwapsRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1164
|
+
value: userSwaps(request: $request) {
|
|
1165
|
+
...PaginatedUserSwapsResult
|
|
1166
|
+
}
|
|
1167
|
+
}`,[Ti]);u(`query SupplySwapQuote($request: SupplySwapQuoteRequest!, $currency: Currency!) {
|
|
1168
|
+
value: supplySwapQuote(request: $request) {
|
|
1169
|
+
...SupplySwapQuoteResult
|
|
1170
|
+
}
|
|
1171
|
+
}`,[Oi]);u(`query BorrowSwapQuote($request: BorrowSwapQuoteRequest!, $currency: Currency!) {
|
|
1172
|
+
value: borrowSwapQuote(request: $request) {
|
|
1173
|
+
...BorrowSwapQuoteResult
|
|
1174
|
+
}
|
|
1175
|
+
}`,[wi]);u(`query RepayWithSupplyQuote($request: RepayWithSupplyQuoteRequest!, $currency: Currency!) {
|
|
1176
|
+
value: repayWithSupplyQuote(request: $request) {
|
|
1177
|
+
...RepayWithSupplyQuoteResult
|
|
1178
|
+
}
|
|
1179
|
+
}`,[Ei]);u(`query WithdrawSwapQuote($request: WithdrawSwapQuoteRequest!, $currency: Currency!) {
|
|
1180
|
+
value: withdrawSwapQuote(request: $request) {
|
|
1181
|
+
...WithdrawSwapQuoteResult
|
|
1182
|
+
}
|
|
1183
|
+
}`,[Ci]);u(`query PreparePositionSwap($request: PreparePositionSwapRequest!) {
|
|
1184
|
+
value: preparePositionSwap(request: $request) {
|
|
1185
|
+
...PreparePositionSwapResult
|
|
1186
|
+
}
|
|
1187
|
+
}`,[_i]);u(`query Borrow($request: BorrowRequest!) {
|
|
1188
|
+
value: borrow(request: $request) {
|
|
1189
|
+
...ExecutionPlan
|
|
1190
|
+
}
|
|
1191
|
+
}`,[On]);u(`query Supply($request: SupplyRequest!) {
|
|
1192
|
+
value: supply(request: $request) {
|
|
1193
|
+
...ExecutionPlan
|
|
1194
|
+
}
|
|
1195
|
+
}`,[On]);u(`query Repay($request: RepayRequest!) {
|
|
1196
|
+
value: repay(request: $request) {
|
|
1197
|
+
...ExecutionPlan
|
|
1198
|
+
}
|
|
1199
|
+
}`,[On]);u(`query Withdraw($request: WithdrawRequest!) {
|
|
1200
|
+
value: withdraw(request: $request) {
|
|
1201
|
+
...ExecutionPlan
|
|
1202
|
+
}
|
|
1203
|
+
}`,[On]);var ji=u(`fragment LiquidatePositionExecutionPlan on LiquidatePositionExecutionPlan {
|
|
1204
|
+
__typename
|
|
1205
|
+
... on TransactionRequest {
|
|
1206
|
+
...TransactionRequest
|
|
1207
|
+
}
|
|
1208
|
+
... on Erc20ApprovalRequired {
|
|
1209
|
+
...Erc20ApprovalRequired
|
|
1210
|
+
}
|
|
1211
|
+
... on InsufficientBalanceError {
|
|
1212
|
+
...InsufficientBalanceError
|
|
1213
|
+
}
|
|
1214
|
+
}`,[ie,ja,ln]);u(`query LiquidatePosition($request: LiquidatePositionRequest!) {
|
|
1215
|
+
value: liquidatePosition(request: $request) {
|
|
1216
|
+
...LiquidatePositionExecutionPlan
|
|
1217
|
+
}
|
|
1218
|
+
}`,[ji]);u(`query SetSpokeUserPositionManager($request: SetSpokeUserPositionManagerRequest!) {
|
|
1219
|
+
value: setSpokeUserPositionManager(request: $request) {
|
|
1220
|
+
...TransactionRequest
|
|
1221
|
+
}
|
|
1222
|
+
}`,[ie]);u(`query SetUserSuppliesAsCollateral($request: SetUserSuppliesAsCollateralRequest!) {
|
|
1223
|
+
value: setUserSuppliesAsCollateral(request: $request) {
|
|
1224
|
+
...TransactionRequest
|
|
1225
|
+
}
|
|
1226
|
+
}`,[ie]);u(`query RenounceSpokeUserPositionManager($request: RenounceSpokeUserPositionManagerRequest!) {
|
|
1227
|
+
value: renounceSpokeUserPositionManager(request: $request) {
|
|
1228
|
+
...TransactionRequest
|
|
1229
|
+
}
|
|
1230
|
+
}`,[ie]);u(`query UpdateUserPositionConditions($request: UpdateUserPositionConditionsRequest!) {
|
|
1231
|
+
value: updateUserPositionConditions(request: $request) {
|
|
1232
|
+
...TransactionRequest
|
|
1233
|
+
}
|
|
1234
|
+
}`,[ie]);var Ki=u(`fragment CollateralFactorVariation on CollateralFactorVariation {
|
|
1235
|
+
__typename
|
|
1236
|
+
reserveId
|
|
1237
|
+
token {
|
|
1238
|
+
...Erc20Token
|
|
1239
|
+
}
|
|
1240
|
+
current {
|
|
1241
|
+
...PercentNumber
|
|
1242
|
+
}
|
|
1243
|
+
after {
|
|
1244
|
+
...PercentNumber
|
|
1245
|
+
}
|
|
1246
|
+
}`,[Ee,q]),Gi=u(`fragment LiquidationFeeVariation on LiquidationFeeVariation {
|
|
1247
|
+
__typename
|
|
1248
|
+
reserveId
|
|
1249
|
+
token {
|
|
1250
|
+
...Erc20Token
|
|
1251
|
+
}
|
|
1252
|
+
current {
|
|
1253
|
+
...PercentNumber
|
|
1254
|
+
}
|
|
1255
|
+
after {
|
|
1256
|
+
...PercentNumber
|
|
1257
|
+
}
|
|
1258
|
+
}`,[Ee,q]),zi=u(`fragment MaxLiquidationBonusVariation on MaxLiquidationBonusVariation {
|
|
1259
|
+
__typename
|
|
1260
|
+
reserveId
|
|
1261
|
+
token {
|
|
1262
|
+
...Erc20Token
|
|
1263
|
+
}
|
|
1264
|
+
current {
|
|
1265
|
+
...PercentNumber
|
|
1266
|
+
}
|
|
1267
|
+
after {
|
|
1268
|
+
...PercentNumber
|
|
1269
|
+
}
|
|
1270
|
+
}`,[Ee,q]),Yi=u(`fragment UserPositionConditionVariation on UserPositionConditionVariation {
|
|
1271
|
+
__typename
|
|
1272
|
+
... on CollateralFactorVariation {
|
|
1273
|
+
...CollateralFactorVariation
|
|
1274
|
+
}
|
|
1275
|
+
... on LiquidationFeeVariation {
|
|
1276
|
+
...LiquidationFeeVariation
|
|
1277
|
+
}
|
|
1278
|
+
... on MaxLiquidationBonusVariation {
|
|
1279
|
+
...MaxLiquidationBonusVariation
|
|
1280
|
+
}
|
|
1281
|
+
}`,[Ki,Gi,zi]),Zi=u(`fragment PreviewUserPosition on PreviewUserPosition {
|
|
1282
|
+
__typename
|
|
1283
|
+
id
|
|
1284
|
+
healthFactor {
|
|
1285
|
+
...HealthFactorResult
|
|
1286
|
+
}
|
|
1287
|
+
netApy {
|
|
1288
|
+
...PercentNumberVariation
|
|
1289
|
+
}
|
|
1290
|
+
riskPremium {
|
|
1291
|
+
...PercentNumberVariation
|
|
1292
|
+
}
|
|
1293
|
+
netCollateral(currency: $currency) {
|
|
1294
|
+
...ExchangeAmountVariation
|
|
1295
|
+
}
|
|
1296
|
+
netBalance(currency: $currency) {
|
|
1297
|
+
...ExchangeAmountVariation
|
|
1298
|
+
}
|
|
1299
|
+
projectedEarnings {
|
|
1300
|
+
...ExchangeAmountVariation
|
|
1301
|
+
}
|
|
1302
|
+
borrowingPower {
|
|
1303
|
+
...ExchangeAmountVariation
|
|
1304
|
+
}
|
|
1305
|
+
otherConditions {
|
|
1306
|
+
...UserPositionConditionVariation
|
|
1307
|
+
}
|
|
1308
|
+
}`,[Mr,Dr,$r,Yi]);u(`query Preview($request: PreviewRequest!, $currency: Currency! = USD) {
|
|
1309
|
+
value: preview(request: $request) {
|
|
1310
|
+
...PreviewUserPosition
|
|
1311
|
+
}
|
|
1312
|
+
}`,[Zi]);var mt=u(`fragment PercentNumberChangeSnapshot on PercentNumberChangeSnapshot {
|
|
1313
|
+
__typename
|
|
1314
|
+
before {
|
|
1315
|
+
...PercentNumber
|
|
1316
|
+
}
|
|
1317
|
+
after {
|
|
1318
|
+
...PercentNumber
|
|
1319
|
+
}
|
|
1320
|
+
}`,[q]),Xi=u(`fragment BorrowActivity on BorrowActivity {
|
|
1321
|
+
__typename
|
|
1322
|
+
id
|
|
1323
|
+
user
|
|
1324
|
+
timestamp
|
|
1325
|
+
txHash
|
|
1326
|
+
spoke {
|
|
1327
|
+
...Spoke
|
|
1328
|
+
}
|
|
1329
|
+
reserve {
|
|
1330
|
+
...ReserveInfo
|
|
1331
|
+
}
|
|
1332
|
+
borrowed {
|
|
1333
|
+
...Erc20Amount
|
|
1334
|
+
}
|
|
1335
|
+
chain {
|
|
1336
|
+
...Chain
|
|
1337
|
+
}
|
|
1338
|
+
}`,[re,z,Ce,H]),es=u(`fragment SupplyActivity on SupplyActivity {
|
|
1339
|
+
__typename
|
|
1340
|
+
id
|
|
1341
|
+
user
|
|
1342
|
+
timestamp
|
|
1343
|
+
txHash
|
|
1344
|
+
spoke {
|
|
1345
|
+
...Spoke
|
|
1346
|
+
}
|
|
1347
|
+
reserve {
|
|
1348
|
+
...ReserveInfo
|
|
1349
|
+
}
|
|
1350
|
+
supplied {
|
|
1351
|
+
...Erc20Amount
|
|
1352
|
+
}
|
|
1353
|
+
chain {
|
|
1354
|
+
...Chain
|
|
1355
|
+
}
|
|
1356
|
+
}`,[re,z,Ce,H]),ns=u(`fragment WithdrawActivity on WithdrawActivity {
|
|
1357
|
+
__typename
|
|
1358
|
+
id
|
|
1359
|
+
user
|
|
1360
|
+
timestamp
|
|
1361
|
+
txHash
|
|
1362
|
+
spoke {
|
|
1363
|
+
...Spoke
|
|
1364
|
+
}
|
|
1365
|
+
reserve {
|
|
1366
|
+
...ReserveInfo
|
|
1367
|
+
}
|
|
1368
|
+
withdrawn {
|
|
1369
|
+
...Erc20Amount
|
|
1370
|
+
}
|
|
1371
|
+
chain {
|
|
1372
|
+
...Chain
|
|
1373
|
+
}
|
|
1374
|
+
}`,[re,z,Ce,H]),as=u(`fragment RepayActivity on RepayActivity {
|
|
1375
|
+
__typename
|
|
1376
|
+
id
|
|
1377
|
+
user
|
|
1378
|
+
timestamp
|
|
1379
|
+
txHash
|
|
1380
|
+
spoke {
|
|
1381
|
+
...Spoke
|
|
1382
|
+
}
|
|
1383
|
+
reserve {
|
|
1384
|
+
...ReserveInfo
|
|
1385
|
+
}
|
|
1386
|
+
repaid {
|
|
1387
|
+
...Erc20Amount
|
|
1388
|
+
}
|
|
1389
|
+
chain {
|
|
1390
|
+
...Chain
|
|
1391
|
+
}
|
|
1392
|
+
}`,[re,z,Ce,H]),ts=u(`fragment LiquidatedActivity on LiquidatedActivity {
|
|
1393
|
+
__typename
|
|
1394
|
+
id
|
|
1395
|
+
user
|
|
1396
|
+
timestamp
|
|
1397
|
+
txHash
|
|
1398
|
+
spoke {
|
|
1399
|
+
...Spoke
|
|
1400
|
+
}
|
|
1401
|
+
collateralReserve {
|
|
1402
|
+
...ReserveInfo
|
|
1403
|
+
}
|
|
1404
|
+
debtReserve {
|
|
1405
|
+
...ReserveInfo
|
|
1406
|
+
}
|
|
1407
|
+
collateral {
|
|
1408
|
+
...Erc20Amount
|
|
1409
|
+
}
|
|
1410
|
+
debt {
|
|
1411
|
+
...Erc20Amount
|
|
1412
|
+
}
|
|
1413
|
+
liquidator
|
|
1414
|
+
chain {
|
|
1415
|
+
...Chain
|
|
1416
|
+
}
|
|
1417
|
+
}`,[re,z,Ce,H]),rs=u(`fragment UsingAsCollateralActivity on UsingAsCollateralActivity {
|
|
1418
|
+
__typename
|
|
1419
|
+
id
|
|
1420
|
+
user
|
|
1421
|
+
timestamp
|
|
1422
|
+
txHash
|
|
1423
|
+
spoke {
|
|
1424
|
+
...Spoke
|
|
1425
|
+
}
|
|
1426
|
+
reserve {
|
|
1427
|
+
...ReserveInfo
|
|
1428
|
+
}
|
|
1429
|
+
enabledAsCollateral
|
|
1430
|
+
chain {
|
|
1431
|
+
...Chain
|
|
1432
|
+
}
|
|
1433
|
+
}`,[re,Ce,H]),is=u(`fragment UpdatedDynamicConfigActivity on UpdatedDynamicConfigActivity {
|
|
1434
|
+
__typename
|
|
1435
|
+
id
|
|
1436
|
+
user
|
|
1437
|
+
timestamp
|
|
1438
|
+
txHash
|
|
1439
|
+
spoke {
|
|
1440
|
+
...Spoke
|
|
1441
|
+
}
|
|
1442
|
+
reserve {
|
|
1443
|
+
...ReserveInfo
|
|
1444
|
+
}
|
|
1445
|
+
collateralFactor {
|
|
1446
|
+
...PercentNumberChangeSnapshot
|
|
1447
|
+
}
|
|
1448
|
+
maxLiquidationBonus {
|
|
1449
|
+
...PercentNumberChangeSnapshot
|
|
1450
|
+
}
|
|
1451
|
+
liquidationFee {
|
|
1452
|
+
...PercentNumberChangeSnapshot
|
|
1453
|
+
}
|
|
1454
|
+
chain {
|
|
1455
|
+
...Chain
|
|
1456
|
+
}
|
|
1457
|
+
}`,[re,Ce,mt,H]),ss=u(`fragment UpdatedRiskPremiumActivity on UpdatedRiskPremiumActivity {
|
|
1458
|
+
__typename
|
|
1459
|
+
id
|
|
1460
|
+
user
|
|
1461
|
+
timestamp
|
|
1462
|
+
txHash
|
|
1463
|
+
spoke {
|
|
1464
|
+
...Spoke
|
|
1465
|
+
}
|
|
1466
|
+
premium {
|
|
1467
|
+
...PercentNumberChangeSnapshot
|
|
1468
|
+
}
|
|
1469
|
+
chain {
|
|
1470
|
+
...Chain
|
|
1471
|
+
}
|
|
1472
|
+
}`,[re,mt,H]),os=u(`fragment TokenSwapActivity on TokenSwapActivity {
|
|
1473
|
+
__typename
|
|
1474
|
+
id
|
|
1475
|
+
user
|
|
1476
|
+
timestamp
|
|
1477
|
+
txHash
|
|
1478
|
+
chain {
|
|
1479
|
+
...Chain
|
|
1480
|
+
}
|
|
1481
|
+
sold {
|
|
1482
|
+
...SwapAmount
|
|
1483
|
+
}
|
|
1484
|
+
bought {
|
|
1485
|
+
...SwapAmount
|
|
1486
|
+
}
|
|
1487
|
+
explorerUrl
|
|
1488
|
+
}`,[H,qe]),us=u(`fragment SupplySwapActivity on SupplySwapActivity {
|
|
1489
|
+
__typename
|
|
1490
|
+
id
|
|
1491
|
+
user
|
|
1492
|
+
timestamp
|
|
1493
|
+
txHash
|
|
1494
|
+
chain {
|
|
1495
|
+
...Chain
|
|
1496
|
+
}
|
|
1497
|
+
sold {
|
|
1498
|
+
...SwapAmount
|
|
1499
|
+
}
|
|
1500
|
+
bought {
|
|
1501
|
+
...SwapAmount
|
|
1502
|
+
}
|
|
1503
|
+
explorerUrl
|
|
1504
|
+
}`,[H,qe]),ls=u(`fragment BorrowSwapActivity on BorrowSwapActivity {
|
|
1505
|
+
__typename
|
|
1506
|
+
id
|
|
1507
|
+
user
|
|
1508
|
+
timestamp
|
|
1509
|
+
txHash
|
|
1510
|
+
chain {
|
|
1511
|
+
...Chain
|
|
1512
|
+
}
|
|
1513
|
+
sold {
|
|
1514
|
+
...SwapAmount
|
|
1515
|
+
}
|
|
1516
|
+
bought {
|
|
1517
|
+
...SwapAmount
|
|
1518
|
+
}
|
|
1519
|
+
explorerUrl
|
|
1520
|
+
}`,[H,qe]),ps=u(`fragment RepayWithSupplyActivity on RepayWithSupplyActivity {
|
|
1521
|
+
__typename
|
|
1522
|
+
id
|
|
1523
|
+
user
|
|
1524
|
+
timestamp
|
|
1525
|
+
txHash
|
|
1526
|
+
chain {
|
|
1527
|
+
...Chain
|
|
1528
|
+
}
|
|
1529
|
+
debtRepaid {
|
|
1530
|
+
...SwapAmount
|
|
1531
|
+
}
|
|
1532
|
+
supplyUsed {
|
|
1533
|
+
...SwapAmount
|
|
1534
|
+
}
|
|
1535
|
+
explorerUrl
|
|
1536
|
+
}`,[H,qe]),ds=u(`fragment WithdrawSwapActivity on WithdrawSwapActivity {
|
|
1537
|
+
__typename
|
|
1538
|
+
id
|
|
1539
|
+
user
|
|
1540
|
+
timestamp
|
|
1541
|
+
txHash
|
|
1542
|
+
chain {
|
|
1543
|
+
...Chain
|
|
1544
|
+
}
|
|
1545
|
+
withdrawn {
|
|
1546
|
+
...SwapAmount
|
|
1547
|
+
}
|
|
1548
|
+
bought {
|
|
1549
|
+
...SwapAmount
|
|
1550
|
+
}
|
|
1551
|
+
explorerUrl
|
|
1552
|
+
}`,[H,qe]),cs=u(`fragment ActivityItem on ActivityItem {
|
|
1553
|
+
__typename
|
|
1554
|
+
... on BorrowActivity {
|
|
1555
|
+
...BorrowActivity
|
|
1556
|
+
}
|
|
1557
|
+
... on SupplyActivity {
|
|
1558
|
+
...SupplyActivity
|
|
1559
|
+
}
|
|
1560
|
+
... on WithdrawActivity {
|
|
1561
|
+
...WithdrawActivity
|
|
1562
|
+
}
|
|
1563
|
+
... on RepayActivity {
|
|
1564
|
+
...RepayActivity
|
|
1565
|
+
}
|
|
1566
|
+
... on LiquidatedActivity {
|
|
1567
|
+
...LiquidatedActivity
|
|
1568
|
+
}
|
|
1569
|
+
... on UsingAsCollateralActivity {
|
|
1570
|
+
...UsingAsCollateralActivity
|
|
1571
|
+
}
|
|
1572
|
+
... on UpdatedDynamicConfigActivity {
|
|
1573
|
+
...UpdatedDynamicConfigActivity
|
|
1574
|
+
}
|
|
1575
|
+
... on UpdatedRiskPremiumActivity {
|
|
1576
|
+
...UpdatedRiskPremiumActivity
|
|
1577
|
+
}
|
|
1578
|
+
... on TokenSwapActivity {
|
|
1579
|
+
...TokenSwapActivity
|
|
1580
|
+
}
|
|
1581
|
+
... on SupplySwapActivity {
|
|
1582
|
+
...SupplySwapActivity
|
|
1583
|
+
}
|
|
1584
|
+
... on BorrowSwapActivity {
|
|
1585
|
+
...BorrowSwapActivity
|
|
1586
|
+
}
|
|
1587
|
+
... on RepayWithSupplyActivity {
|
|
1588
|
+
...RepayWithSupplyActivity
|
|
1589
|
+
}
|
|
1590
|
+
... on WithdrawSwapActivity {
|
|
1591
|
+
...WithdrawSwapActivity
|
|
1592
|
+
}
|
|
1593
|
+
}`,[Xi,es,ns,as,ts,rs,is,ss,os,us,ls,ps,ds]),ys=u(`fragment PaginatedActivitiesResult on PaginatedActivitiesResult {
|
|
1594
|
+
__typename
|
|
1595
|
+
items {
|
|
1596
|
+
...ActivityItem
|
|
1597
|
+
}
|
|
1598
|
+
pageInfo {
|
|
1599
|
+
...PaginatedResultInfo
|
|
1600
|
+
}
|
|
1601
|
+
}`,[cs,An]);u(`query Activities($request: ActivitiesRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1602
|
+
value: activities(request: $request) {
|
|
1603
|
+
...PaginatedActivitiesResult
|
|
1604
|
+
}
|
|
1605
|
+
}`,[ys]);u(`query UserSupplies($request: UserSuppliesRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1606
|
+
value: userSupplies(request: $request) {
|
|
1607
|
+
...UserSupplyItem
|
|
1608
|
+
}
|
|
1609
|
+
}`,[bi]);u(`query UserBorrows($request: UserBorrowsRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1610
|
+
value: userBorrows(request: $request) {
|
|
1611
|
+
...UserBorrowItem
|
|
1612
|
+
}
|
|
1613
|
+
}`,[Ui]);u(`query UserSummary($request: UserSummaryRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1614
|
+
value: userSummary(request: $request) {
|
|
1615
|
+
...UserSummary
|
|
1616
|
+
}
|
|
1617
|
+
}`,[Ri]);u(`query UserPositions($request: UserPositionsRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1618
|
+
value: userPositions(request: $request) {
|
|
1619
|
+
...UserPosition
|
|
1620
|
+
}
|
|
1621
|
+
}`,[Xa]);u(`query UserPosition($request: UserPositionRequest!, $currency: Currency!, $timeWindow: TimeWindow!) {
|
|
1622
|
+
value: userPosition(request: $request) {
|
|
1623
|
+
...UserPosition
|
|
1624
|
+
}
|
|
1625
|
+
}`,[Xa]);u(`query UserBalances($request: UserBalancesRequest!, $currency: Currency!) {
|
|
1626
|
+
value: userBalances(request: $request) {
|
|
1627
|
+
...UserBalance
|
|
1628
|
+
}
|
|
1629
|
+
}`,[qi]);u(`query UserSummaryHistory($request: UserSummaryHistoryRequest!, $currency: Currency!) {
|
|
1630
|
+
value: userSummaryHistory(request: $request) {
|
|
1631
|
+
...UserSummaryHistoryItem
|
|
1632
|
+
}
|
|
1633
|
+
}`,[xi]);u(`query UserRiskPremiumBreakdown($request: UserRiskPremiumBreakdownRequest!) {
|
|
1634
|
+
value: userRiskPremiumBreakdown(request: $request) {
|
|
1635
|
+
...UserRiskPremiumBreakdownItem
|
|
1636
|
+
}
|
|
1637
|
+
}`,[Za]);var ia={currency:vn.Usd,timeWindow:$a.LastDay,requestPolicy:"cache-and-network",batch:true};function _n(e,n,{batch:a=ia.batch,requestPolicy:t=ia.requestPolicy}=ia){return e.query(dt,{request:n},{batch:a,requestPolicy:t})}function ft(e){return Oe(e)&&"code"in e&&"message"in e}function Gu(e){return Oe(e)&&"name"in e&&"message"in e&&"originalError"in e?ft(e.originalError)&&"code"in e.originalError:true}function Ns(e,n){return J(e.account,"Wallet account is required to sign typed data"),D.fromPromise(e.signTypedData({account:e.account,domain:n.domain,types:n.types,primaryType:n.primaryType,message:n.message}),a=>a instanceof viem.UserRejectedRequestError?je.from(a):Ue.from(a)).map(_a)}function bn(e){switch(e.chainId){case _e(chains.mainnet.id):return chains.mainnet;case _e(chains.sepolia.id):return chains.sepolia}return viem.defineChain({id:e.chainId,name:e.name,nativeCurrency:{name:e.nativeInfo.name,symbol:e.nativeInfo.symbol,decimals:e.nativeInfo.decimals},rpcUrls:{default:{http:[e.rpcUrl]}},blockExplorers:{default:{name:`${e.name} Explorer`,url:e.explorerUrl}}})}function hs(e){return e.map(bn)}function ht(e,n,a){return D.fromPromise(n.getChainId(),t=>Ue.from(t)).andThen(t=>t===a.chainId?ce():_n(e,{chainId:a.chainId},{batch:false}).andThen(r=>(J(r,`Chain ${a.chainId} is not supported`),D.fromPromise(n.switchChain({id:a.chainId}),i=>Ue.from(i)).orElse(i=>(ft(i.cause)?i.cause.code:Gu(i.cause)?i.cause.data?.originalError?.code:void 0)===viem.SwitchChainError.code?D.fromPromise(n.addChain({chain:bn(r)}),s=>ft(s)&&s.code===viem.UserRejectedRequestError.code?je.from(s):Ue.from(s)):i.asResultAsync()))))}function zu(e,n){return D.fromPromise(actions.estimateGas(e,{account:e.account,data:n.data,to:n.to,value:BigInt(n.value)}),a=>Ue.from(a)).map(a=>a*115n/100n)}function Yu(e,n){return zu(e,n).andThen(a=>D.fromPromise(actions.sendTransaction(e,{account:e.account,data:n.data,to:n.to,value:BigInt(n.value),chain:e.chain,gas:a}),t=>{if(t instanceof viem.TransactionExecutionError){let r=t.walk(i=>i instanceof viem.UserRejectedRequestError);if(r)return je.from(r)}return Ue.from(t)})).map(Hn)}function Zu(e){return e.account!==void 0}function kt(e,n){return J(Zu(e),"Wallet client with account is required"),Yu(e,n)}function ks(e,n,a){let t=e?.blockExplorers?.default?.url,r=t&&new URL(`/tx/${n}`,t).toString();return Ja.new({txHash:n,request:a,link:r})}function gt(e,n,a){return D.fromPromise(actions.waitForTransactionReceipt(e,{hash:a,pollingInterval:100,retryCount:20,retryDelay:50}),t=>ye.from(t)).andThen(t=>{let r=Hn(t.transactionHash);switch(t.status){case "reverted":return a!==r?Ne(je.from(`Transaction replaced by ${r}`)):Ne(ks(e.chain,r,n));case "success":return ce({txHash:r,operations:n.operations})}})}function vt(e,n){return n===void 0?Ns.bind(null,e):Ns(e,n)}var wl=Sl__default.default.createContext(null);function mn(){let e=Sl.useContext(wl);return J(e,"Could not find Aave SDK context, ensure your code is wrapped in a <AaveProvider>"),e}var Le={Loading:()=>({data:void 0,error:void 0,loading:true,paused:false}),Success:e=>({data:e,error:void 0,loading:false,paused:false}),Failure:e=>({data:void 0,error:e,loading:false,paused:false}),Paused:(e,n)=>({data:e,error:n,loading:false,paused:true})};function js({document:e,variables:n,suspense:a,pause:t,selector:r=Ea,pollInterval:i=0,batch:s=true}){let[o,l]=Sl.useState(true),[{fetching:p,data:c,error:d},f]=urql.useQuery({query:e,variables:n,pause:t,context:Sl.useMemo(()=>({batch:s,suspense:a}),[s,a])});if(Sl.useEffect(()=>{t||p||l(false);},[p,t]),Sl.useEffect(()=>{if(i<=0||p||t)return;let m=setTimeout(()=>{f({requestPolicy:"network-only",batch:false});},i);return ()=>clearTimeout(m)},[p,f,i,t]),t)return Le.Paused(c?r(c.value):void 0,d?ye.from(d):void 0);if(!a&&o)return Le.Loading();if(d){let m=ye.from(d);if(a)throw m;return Le.Failure(m)}return J(c,"No data returned"),Le.Success(r(c.value))}var Dt={Idle:()=>({called:false,loading:false,data:void 0,error:void 0}),Loading:e=>({called:true,loading:true,data:e,error:void 0}),Success:e=>({called:true,loading:false,data:e,error:void 0}),Failed:e=>({called:true,loading:false,data:void 0,error:e})};function Fn(e,n){let[a,t]=Sl.useState(Dt.Idle()),r=Sl.useRef(false),i=Sl.useCallback(e,n);return [Sl.useCallback(o=>{J(!r.current,"Cannot execute a task while another is in progress."),r.current=true;let l;t(p=>(l=p,{called:true,loading:true,data:p.data,error:void 0}));try{let p=i(o);return p.match(c=>{r.current=!1,t(Dt.Success(c));},c=>{r.current=!1,t(Dt.Failed(c));}),p}catch(p){throw r.current=false,t(kn(l)),p}},[i]),a]}var wa=class e{constructor(n){this.wait=n;}static isInstanceOf(n){return n instanceof e}static tryFrom(n){return e.isInstanceOf(n)?ce(n):ye.from(n).asResultAsync()}};function Vd(e){let n=mn();return Fn(a=>(J(e,"Expected a WalletClient to handle the operation result."),ht(n,e,a).andThen(()=>kt(e,a)).map(t=>new wa(()=>gt(e,a,t)))),[n,e])}function Wd(e){return Fn(n=>(J(e,"Expected a WalletClient to sign typed data"),vt(e,n)),[e])}function Gs({suspense:e=false,pause:n=false,...a}){let t=mn();return js({document:ct,variables:{request:a},suspense:e,pause:n,pollInterval:a.at?0:t.context.environment.exchangeRateInterval})}var zs=55558n,xl={supply:132136n+zs,borrow:250551n,withdraw:195049n,repay:217889n+zs,setUserSuppliesAsCollateral:240284n,updateUserPositionConditions:280000n};function Bl(e){let n=Object.keys(e)[0];return xl[n]??We(`Expected gas estimate for action ${n}`)}function Zs(e){if("supply"in e)return Ke(e.supply.reserve).chainId;if("borrow"in e)return Ke(e.borrow.reserve).chainId;if("withdraw"in e)return Ke(e.withdraw.reserve).chainId;if("repay"in e)return Ke(e.repay.reserve).chainId;if("setUserSuppliesAsCollateral"in e)return e.setUserSuppliesAsCollateral.changes.map(({reserve:n})=>Ke(n)).reduce((n,a)=>(J(n.chainId===a.chainId&&n.spoke===a.spoke,"All reserves MUST on the same spoke"),n)).chainId;if("updateUserPositionConditions"in e)return it(e.updateUserPositionConditions.userPositionId).chainId;We("Expected reserve id");}function Il(e){if("activity"in e&&e.activity)return e.activity.chain.chainId;if("estimate"in e&&e.estimate)return Zs(e.estimate)}function Jl(e){if("activity"in e&&e.activity)return e.activity.timestamp}function Fl(e,n){return "activity"in n&&n.activity?ce(n.activity.chain):"estimate"in n&&n.estimate?_n(e,{chainId:Zs(n.estimate)}).map(kn):We("Expected chain")}function Dl(){let e=mn();return Fn(n=>Fl(e,n).andThen(a=>{let t=viem.createPublicClient({chain:bn(a),transport:viem.http()});return "activity"in n?D.fromPromise(t.getTransactionReceipt({hash:n.activity.txHash}),r=>ye.from(r)).map(r=>({chain:n.activity.chain,gasPrice:r.effectiveGasPrice,gasUnits:r.gasUsed})):"estimate"in n&&n.estimate?D.fromPromise(t.estimateFeesPerGas(),r=>ye.from(r)).map(({maxFeePerGas:r})=>({chain:a,gasPrice:r,gasUnits:Bl(n.estimate)})):ce({chain:We("Expected chain"),gasPrice:0n,gasUnits:0n})}),[e])}function Ys(e,n){let a=e.gasPrice*e.gasUnits,t=ba(a).rescale(-e.chain.nativeInfo.decimals),r={__typename:"DecimalNumber",decimals:e.chain.nativeInfo.decimals,onChainValue:a,value:t};return {__typename:"NativeAmount",token:{__typename:"NativeToken",info:e.chain.nativeInfo,chain:e.chain},amount:r,exchange:{__typename:"ExchangeAmount",value:t.mul(n.value),name:n.name,symbol:n.symbol,icon:n.icon,decimals:n.decimals},exchangeRate:{__typename:"DecimalNumber",decimals:2,onChainValue:BigInt(n.value.rescale(2).toFixed(0,Mn.Down)),value:n.value}}}var ty=(({query:e,currency:n=vn.Usd,pause:a=false,suspense:t=false})=>{let[r,i]=Dl(),s=Gs({from:{native:Il(e)},to:n,at:Jl(e),pause:a,...t?{suspense:t}:{}});return Sl.useEffect(()=>{a||i.called||!e||r(e);},[r,a,i.called]),s.paused?Le.Paused(i.data&&s.data?Ys(i.data,s.data):void 0,s.error?s.error:void 0):!i.called||i.loading||s.loading?Le.Loading():i.error||s.error?Le.Failure(i.error??s.error??We("Unknown error")):(J(i.data&&s.data,"Expected receipt, chain, and rate data"),Le.Success(Ys(i.data,s.data)))});exports.useNetworkFee=ty;exports.useSendTransaction=Vd;exports.useSignTypedData=Wd;exports.viemChainsFrom=hs;//# sourceMappingURL=index.cjs.map
|
|
2
1638
|
//# sourceMappingURL=index.cjs.map
|