@xoxno/sdk-js 1.0.190 → 1.0.191

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/index.esm.js CHANGED
@@ -1 +1 @@
1
- "undefined"!=typeof globalThis&&void 0===globalThis.self&&(globalThis.self=globalThis);import{Account as t,Address as e,BASE_FEE as o,Contract as r,ScInt as n,TransactionBuilder as u,scValToNative as i,xdr as s}from"@stellar/stellar-sdk";var a={385(a,p,l){l.d(p,{ME:()=>c,nO:()=>y,G_:()=>pe,DU:()=>d,fA:()=>Io,A$:()=>f,J9:()=>b,hS:()=>m,gR:()=>Oo,Cg:()=>Ro,VZ:()=>Jo,N0:()=>jt,B_:()=>se,eX:()=>Zt,z:()=>Wo,xD:()=>j,jR:()=>H,P2:()=>tr,W6:()=>ie,se:()=>ne,yr:()=>zo,sp:()=>J,Iu:()=>no,yu:()=>ro,$9:()=>Ze,zw:()=>Je,h_:()=>Ye,e_:()=>to,Tk:()=>Qe,BA:()=>Ke,u9:()=>io,bi:()=>uo,gc:()=>oo,ay:()=>eo,BN:()=>so,SX:()=>zt,UF:()=>Mo,Y5:()=>K,mE:()=>Y,xG:()=>Bt,s9:()=>tt,OL:()=>Dt,k6:()=>we,dj:()=>Te,kD:()=>Me,Yf:()=>Re,c5:()=>ze,N8:()=>qe,qU:()=>Le,RZ:()=>$e,ni:()=>Ae,hF:()=>We,Qk:()=>Ve,Gw:()=>He,$K:()=>De,uj:()=>ke,Od:()=>_e,X7:()=>Ue,Ub:()=>Xe,Dx:()=>Oe,OA:()=>ve,$U:()=>he,ob:()=>Ee,cY:()=>Se,$l:()=>xe,K:()=>Ie,kw:()=>Pe,VS:()=>Ge,HP:()=>Fe,YQ:()=>je,QY:()=>Be,os:()=>Ne,Ko:()=>Ce,IJ:()=>re,nw:()=>Q,Pr:()=>rt,ZE:()=>Z,ev:()=>Wt,P8:()=>Kt,aV:()=>Xt,p2:()=>Ht,Ww:()=>Ft,sV:()=>Jt,XD:()=>ee,Js:()=>Yt,Dy:()=>Qt,FZ:()=>te,Ni:()=>W,v_:()=>V,qD:()=>ot,qR:()=>et,QJ:()=>Vt,bm:()=>Gt,n_:()=>ae,v8:()=>oe,qM:()=>Ct,gH:()=>ue,O3:()=>X,Gz:()=>F,pr:()=>z,Fm:()=>Eo,MB:()=>Rt,Dn:()=>$t,pq:()=>Ot,ml:()=>Nt,Q3:()=>Mt,wf:()=>Go,Um:()=>Uo,xO:()=>qt,Lw:()=>Bo,KM:()=>h,mM:()=>bt,iE:()=>_t,zp:()=>gt,N3:()=>ft,bN:()=>pt,QV:()=>v,T_:()=>Tt,XI:()=>ht,Lt:()=>wt,KK:()=>lt,yl:()=>st,vc:()=>g,kq:()=>at,CH:()=>Do,FI:()=>yt,KG:()=>kt,nW:()=>mt,jF:()=>ct,S2:()=>vt,uS:()=>At,u_:()=>dt,O5:()=>xt,Av:()=>St,LA:()=>Ho,E6:()=>Vo,Ds:()=>jo,XV:()=>or,CU:()=>No,Vx:()=>Zo,DL:()=>Qo,ON:()=>lo,Hh:()=>Pt,oV:()=>Lo,g5:()=>Fo,L:()=>ao,Vu:()=>Ko});const d={mainnet:process.env.STELLAR_LENDING_CONTROLLER_MAINNET??"",testnet:process.env.STELLAR_LENDING_CONTROLLER_TESTNET??""},c={mainnet:process.env.STELLAR_AGGREGATOR_ROUTER_MAINNET??"",testnet:process.env.STELLAR_AGGREGATOR_ROUTER_TESTNET??""},y={mainnet:process.env.STELLAR_GOVERNANCE_MAINNET??"",testnet:process.env.STELLAR_GOVERNANCE_TESTNET??""},m={mainnet:"https://soroban-rpc.stellar.org",testnet:"https://soroban-testnet.stellar.org"},b={mainnet:process.env.STELLAR_QUOTE_URL_MAINNET??"https://stellar-swap.xoxno.com",testnet:process.env.STELLAR_QUOTE_URL_TESTNET??"https://testnet-stellar-swap.xoxno.com"},f={mainnet:"Public Global Stellar Network ; September 2015",testnet:"Test SDF Network ; September 2015"};function g(t){const e=d[t];if(!e)throw new Error(`Stellar lending controller address not configured for network "${t}". Set STELLAR_LENDING_CONTROLLER_${t.toUpperCase()} env var.`);return e}function h(t){const e=c[t];if(!e)throw new Error(`Stellar aggregator router address not configured for network "${t}". Set STELLAR_AGGREGATOR_ROUTER_${t.toUpperCase()} env var.`);return e}function v(t){const e=y[t];if(!e)throw new Error(`Stellar governance address not configured for network "${t}". Set STELLAR_GOVERNANCE_${t.toUpperCase()} env var.`);return e}const S=["Soroswap","Aquarius","Phoenix","Sushi","CometDex"],x=t=>new e(t).toScVal(),q=t=>new n(t).toI128(),T=t=>s.ScVal.scvU32(t),_=t=>new n("string"==typeof t?t:t.toString()).toU64(),w=t=>s.ScVal.scvBool(t),A=t=>s.ScVal.scvString(t),k=t=>s.ScVal.scvSymbol(t),P=()=>s.ScVal.scvVoid(),I=t=>s.ScVal.scvVec(t),E=(t,e=32)=>{const o=t.startsWith("0x")?t.slice(2):t,r=Buffer.from(o,"hex");if(r.length!==e)throw new Error(`Stellar builder: expected a ${e}-byte BytesN (got ${r.length} bytes from "${t}")`);return s.ScVal.scvBytes(r)},R=(t,e)=>null==t?P():e(t),O=(t,e)=>L({asset:x(e),hub_id:T(t)}),M=(t,e,o)=>s.ScVal.scvVec([O(t,e),q(o)]),U=t=>s.ScVal.scvVec(t.map((t=>M(t.hubId,t.asset,t.amount)))),L=t=>{const e=Object.keys(t).sort().map((e=>new s.ScMapEntry({key:k(e),val:t[e]})));return s.ScVal.scvMap(e)},N=t=>{const e=t.paths.map((t=>{const e=t.hops.map((t=>{return L({amount_out:q(t.amountOut),pool:x(t.pool),token_in:x(t.tokenIn),token_out:x(t.tokenOut),venue:(e=t.venue,s.ScVal.scvVec([k(e)]))});var e}));return L({hops:s.ScVal.scvVec(e),split_ppm:T(t.splitPpm)})}));return L({paths:s.ScVal.scvVec(e),referral_id:_(t.referralId??0),token_in:x(t.tokenIn),token_out:x(t.tokenOut),total_min_out:q(t.totalMinOut)})},$=t=>{const e=Buffer.from(t);if(0===e.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return s.ScVal.scvBytes(e)},C=()=>s.ScVal.scvBytes(Buffer.alloc(0)),B=t=>{const e=t.trim();if(e.startsWith("0x")){const t=e.slice(2);if(!((o=t).length>0&&o.length%2==0&&/^[0-9a-fA-F]+$/.test(o)))throw new Error("Stellar builder: strategy swap bytes hex string must be 0x-prefixed and even-length");return Buffer.from(t,"hex")}var o;if(!/^[A-Za-z0-9+/]+={0,2}$/.test(e))throw new Error("Stellar builder: strategy swap bytes must be base64 routeXdr or 0x-prefixed hex");const r=Buffer.from(e,"base64");if(0===r.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return r},D=t=>{if("string"==typeof t)return $(B(t));if(t instanceof Uint8Array)return 0===t.length?C():$(t);if(t&&"object"==typeof t)return"routeXdr"in(o=t)&&"string"==typeof o.routeXdr?$(B(t.routeXdr)):(t=>"swapXdr"in t&&"string"==typeof t.swapXdr)(t)?$(B(t.swapXdr)):(t=>"bytes"in t&&("string"==typeof t.bytes||t.bytes instanceof Uint8Array))(t)?"string"==typeof t.bytes?$(B(t.bytes)):0===t.bytes.length?C():$(t.bytes):(e=(t=>{if(!t||"object"!=typeof t)throw new Error("Stellar builder: decoded strategy `steps` must be a StrategyPayload ({ paths, tokenIn, tokenOut, totalMinOut })");const e=t;if(!Array.isArray(e.paths)||0===e.paths.length)throw new Error("Stellar builder: `steps.paths` must be a non-empty array of strategy paths");if("string"!=typeof e.tokenIn)throw new Error("Stellar builder: `steps.tokenIn` must be a contract address");if("string"!=typeof e.tokenOut)throw new Error("Stellar builder: `steps.tokenOut` must be a contract address");if("string"!=typeof e.totalMinOut)throw new Error("Stellar builder: `steps.totalMinOut` must be an i128 decimal string");let o=0;for(const[t,r]of e.paths.entries()){if(!r||"number"!=typeof r.splitPpm||r.splitPpm<=0||!Array.isArray(r.hops)||0===r.hops.length)throw new Error(`Stellar builder: \`steps.paths[${t}]\` must have splitPpm > 0 and a non-empty hops array`);o+=r.splitPpm;for(const[e,o]of r.hops.entries())if(!o||"string"!=typeof o.amountOut||"string"!=typeof o.pool||"string"!=typeof o.tokenIn||"string"!=typeof o.tokenOut||!S.includes(o.venue))throw new Error(`Stellar builder: \`steps.paths[${t}].hops[${e}]\` must have amountOut, pool, tokenIn, tokenOut, and a valid Soroban venue`)}if(1e6!==o)throw new Error(`Stellar builder: \`steps.paths[].splitPpm\` must sum to 1_000_000, got ${o}`);return e})(t),s.ScVal.scvBytes(Buffer.from(N(e).toXDR("base64"),"base64")));var e,o;throw new Error("Stellar builder: `steps` must be opaque strategy bytes (`routeXdr`, base64/hex string, or Uint8Array)")},G=t=>{if("string"==typeof t)return(t=>{const e=t.startsWith("0x")?t.slice(2):t,o=Buffer.from(e,"hex");return s.ScVal.scvBytes(o)})(t);if(t instanceof Uint8Array)return s.ScVal.scvBytes(Buffer.from(t));throw new Error("Stellar builder: `data` must be a hex string or Uint8Array (Soroban Bytes payload)")};function z(e,n,i){const s=e.controllerAddress??g(e.network),a=new r(s),p=new t(e.caller,e.sourceSequence);return{xdr:new u(p,{fee:e.fee??o,networkPassphrase:f[e.network]}).addOperation(a.call(n,...i)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function W(t,e){const o=e.accountNonce??0,r=e.spokeId??0;return z(t,"supply",[x(t.caller),_(o),T(r),U([...e.assets])])}function V(t,e){return W(t,{accountNonce:e.accountNonce,spokeId:e.spokeId,assets:[{hubId:e.hubId,asset:e.asset,amount:e.amount}]})}function j(t,e){return z(t,"borrow",[x(t.caller),_(e.accountNonce),U([...e.borrows]),R(e.to,x)])}function H(t,e){return j(t,{accountNonce:e.accountNonce,borrows:[{hubId:e.hubId,asset:e.asset,amount:e.amount}],to:e.to})}function X(t,e){return z(t,"withdraw",[x(t.caller),_(e.accountNonce),U([...e.withdrawals]),R(e.to,x)])}function F(t,e){return X(t,{accountNonce:e.accountNonce,withdrawals:[{hubId:e.hubId,asset:e.asset,amount:e.amount}],to:e.to})}function Q(t,e){return z(t,"repay",[x(t.caller),_(e.accountNonce),U([...e.payments])])}function Z(t,e){return Q(t,{accountNonce:e.accountNonce,payments:[{hubId:e.hubId,asset:e.asset,amount:e.amount}]})}function K(t,e){return z(t,"liquidate",[x(t.caller),_(e.accountNonce),U([...e.debtPayments])])}function J(t,e){return z(t,"flash_loan",[x(t.caller),O(e.hubId,e.asset),q(e.amount),x(e.receiver),G(e.data)])}function Y(t,e){return z(t,"migrate_from_blend",[x(t.caller),_(e.accountId),T(e.spokeId),T(e.hubId),x(e.blendPool),I(e.collateralTokens.map(x)),I(e.supplyTokens.map(x)),(o=e.debtCaps.map((t=>({token:t.token,amount:t.cap}))),s.ScVal.scvVec(o.map((t=>{return e=t.token,o=t.amount,s.ScVal.scvVec([x(e),q(o)]);var e,o}))))]);var o}function tt(t,e){const o=e.accountNonce??0,r=e.spokeId??0;return z(t,"multiply",[x(t.caller),_(o),T(r),O(e.collateral.hubId,e.collateral.asset),q(e.debtToFlashLoan),O(e.debt.hubId,e.debt.asset),T(e.mode),D(e.steps),R(e.initialPayment,(t=>M(t.hubId,t.asset,t.amount))),R(e.convertSwap,D)])}function et(t,e){return z(t,"swap_debt",[x(t.caller),_(e.accountNonce),O(e.existingDebt.hubId,e.existingDebt.asset),q(e.newDebtAmount),O(e.newDebt.hubId,e.newDebt.asset),D(e.steps)])}function ot(t,e){return z(t,"swap_collateral",[x(t.caller),_(e.accountNonce),O(e.current.hubId,e.current.asset),q(e.fromAmount),O(e.newCollateral.hubId,e.newCollateral.asset),D(e.steps)])}function rt(t,e){return z(t,"repay_debt_with_collateral",[x(t.caller),_(e.accountNonce),O(e.collateral.hubId,e.collateral.asset),q(e.collateralAmount),O(e.debt.hubId,e.debt.asset),D(e.steps),w(e.closePosition)])}const nt="/stellar-lending",ut=25,it=encodeURIComponent,st=(t,e)=>t.fetchWithTimeout(`${nt}/context`,e),at=(t,e)=>t.fetchWithTimeout(`${nt}/live-state`,e),pt=(t,e)=>t.fetchWithTimeout(`${nt}/assets`,e),lt=(t,e)=>t.fetchWithTimeout(`${nt}/hubs`,e),dt=(t,e)=>t.fetchWithTimeout(`${nt}/spokes`,e),ct=(t,e={},o)=>{const{hubId:r,spokeId:n,asset:u}=e;return t.fetchWithTimeout(`${nt}/reserves`,{...o,params:{...void 0!==r?{hubId:r}:{},...void 0!==n?{spokeId:n}:{},...u?{asset:u}:{}}})},yt=(t,e,o,r,n)=>t.fetchWithTimeout(`${nt}/reserves/${e}/${o}/${it(r)}`,n),mt=(t,e,o,r,n,u)=>t.fetchWithTimeout(`${nt}/reserves/${e}/${o}/${it(r)}/holders`,{...u,params:{side:n}}),bt=(t,e,o)=>t.fetchWithTimeout(`${nt}/assets/${it(e)}`,o),ft=(t,e,o,r)=>t.fetchWithTimeout(`${nt}/assets/${it(e)}/page`,{...r,params:{...o}}),gt=(t,e,o,r)=>t.fetchWithTimeout(`${nt}/assets/${it(e)}/markets`,{...r,params:{side:o}}),ht=(t,e,o)=>t.fetchWithTimeout(`${nt}/hubs/${e}`,o),vt=(t,e,o)=>t.fetchWithTimeout(`${nt}/spokes/${e}`,o),St=(t,e,o)=>t.fetchWithTimeout(`${nt}/users/${it(e)}/positions`,o),xt=(t,e,o={},r)=>{const{skip:n,top:u}=o;return t.fetchWithTimeout(`${nt}/users/${it(e)}/activity`,{...r,params:{...void 0!==n?{skip:n}:{},...void 0!==u?{top:u}:{}}})},qt=(t,e,o)=>t.fetchWithTimeout(`${nt}/accounts/${it(e)}/positions`,o),Tt=(t,e={},o)=>{const{top:r=ut,continuationToken:n}=e;return t.fetchWithTimeout(`${nt}/governance/proposals`,{...o,params:{top:r,...n?{continuationToken:n}:{}}})},_t=(t,e,o,r)=>t.fetchWithTimeout(`${nt}/assets/${it(e)}/graph`,{...r,params:{...o}}),wt=(t,e,o,r)=>t.fetchWithTimeout(`${nt}/hubs/${e}/graph`,{...r,params:{...o}}),At=(t,e,o,r)=>t.fetchWithTimeout(`${nt}/spokes/${e}/graph`,{...r,params:{...o}}),kt=(t,e,o,r,n,u)=>t.fetchWithTimeout(`${nt}/reserves/${e}/${o}/${it(r)}/graph`,{...u,params:{...n}}),Pt=t=>({context:e=>st(t,e),liveState:e=>at(t,e),assets:e=>pt(t,e),hubs:e=>lt(t,e),spokes:e=>dt(t,e),reserves:(e,o)=>{return void 0===(r=e)||"hubId"in r||"spokeId"in r||"asset"in r?ct(t,e,o):ct(t,{},e);var r},reserve:(e,o,r,n)=>yt(t,e,o,r,n),reserveHolders:(e,o,r,n,u)=>mt(t,e,o,r,n,u),asset:(e,o)=>bt(t,e,o),assetMarkets:(e,o,r)=>gt(t,e,o,r),hub:(e,o)=>ht(t,e,o),spoke:(e,o)=>vt(t,e,o),userPositions:(e,o)=>St(t,e,o),userActivity:(e,o,r)=>xt(t,e,o,r),accountPositions:(e,o)=>qt(t,e,o),governanceProposals:(e,o)=>Tt(t,e,o),assetGraph:(e,o,r)=>_t(t,e,o,r),hubGraph:(e,o,r)=>wt(t,e,o,r),spokeGraph:(e,o,r)=>At(t,e,o,r),reserveGraph:(e,o,r,n,u)=>kt(t,e,o,r,n,u)}),It={Single:0,PrimaryWithAnchor:1},Et="RedStonePriceFeed",Rt=t=>L({base_borrow_rate:q(t.baseBorrowRateRay),max_borrow_rate:q(t.maxBorrowRateRay),max_utilization:q(t.maxUtilizationRay),mid_utilization:q(t.midUtilizationRay),optimal_utilization:q(t.optimalUtilizationRay),reserve_factor:T(t.reserveFactorBps),slope1:q(t.slope1Ray),slope2:q(t.slope2Ray),slope3:q(t.slope3Ray)}),Ot=t=>L({asset_decimals:T(t.assetDecimals),asset_id:x(t.assetId),base_borrow_rate:q(t.baseBorrowRateRay),flashloan_fee:T(t.flashloanFeeBps),is_flashloanable:w(t.isFlashloanable),max_borrow_rate:q(t.maxBorrowRateRay),max_utilization:q(t.maxUtilizationRay),mid_utilization:q(t.midUtilizationRay),optimal_utilization:q(t.optimalUtilizationRay),reserve_factor:T(t.reserveFactorBps),slope1:q(t.slope1Ray),slope2:q(t.slope2Ray),slope3:q(t.slope3Ray)}),Mt=t=>L({max_borrow_positions:T(t.maxBorrowPositions),max_supply_positions:T(t.maxSupplyPositions)}),Ut=t=>{const e=t.kind;switch(e){case"Stellar":return I([k("Stellar"),x(t.value)]);case"Symbol":return I([k("Symbol"),k(t.value)]);case"String":return I([k("String"),A(t.value)]);default:throw new Error(`Stellar builder: unknown oracle asset ref kind "${e}"`)}},Lt=(t,e)=>{if("Twap"===t){if("number"!=typeof e)throw new Error("Stellar builder: oracle source with Twap read mode requires `twapRecords`");return I([k("Twap"),T(e)])}return I([k("Spot")])},Nt=t=>{const e=t.provider;if("ReflectorSep40"===e){if(!t.asset)throw new Error("Stellar builder: Reflector oracle source requires `asset`");return I([k("Reflector"),L({asset:Ut(t.asset),contract:x(t.contract),read_mode:Lt(t.readMode,t.twapRecords)})])}if(e===Et||"XoxnoPriceFeed"===e){const o=e===Et?"RedStone":"Xoxno";if("string"!=typeof t.feedId)throw new Error(`Stellar builder: ${o} oracle source requires \`feedId\``);if("number"!=typeof t.maxStaleSeconds)throw new Error(`Stellar builder: ${o} oracle source requires \`maxStaleSeconds\``);return I([k(o),L({contract:x(t.contract),feed_id:A(t.feedId),max_stale_seconds:_(t.maxStaleSeconds)})])}throw new Error(`Stellar builder: unknown oracle provider "${e}"`)},$t=t=>{const e=It[t.strategy];if(void 0===e)throw new Error(`Stellar builder: unknown oracle strategy "${t.strategy}"`);return L({anchor:(o=t.anchor,I(null==o?[k("None")]:[k("Some"),Nt(o)])),max_price_stale_seconds:_(t.maxPriceStaleSeconds),max_sanity_price_wad:q(t.maxSanityPriceWad),min_sanity_price_wad:q(t.minSanityPriceWad),primary:Nt(t.primary),strategy:T(e),tolerance_bps:T(t.toleranceBps)});var o};function Ct(t,e){return z(t,"upgrade",[E(e.wasmHash)])}function Bt(t,e){return z(t,"migrate",[T(e.newVersion)])}function Dt(t){return z(t,"pause",[])}function Gt(t){return z(t,"unpause",[])}function zt(t,e){return z(t,"grant_role",[x(e.account),k(e.role)])}function Wt(t,e){return z(t,"revoke_role",[x(e.account),k(e.role)])}function Vt(t,e){return z(t,"transfer_ownership",[x(e.newOwner),T(e.liveUntilLedger)])}function jt(t){return z(t,"accept_ownership",[])}function Ht(t,e){return z(t,"set_aggregator",[x(e.aggregator)])}function Xt(t,e){return z(t,"set_accumulator",[x(e.accumulator)])}function Ft(t,e){return z(t,"set_liquidity_pool_template",[E(e.wasmHash)])}function Qt(t,e){return z(t,"set_position_limits",[Mt(e)])}function Zt(t,e){return z(t,"approve_token",[x(e.token)])}function Kt(t,e){return z(t,"revoke_token",[x(e.token)])}function Jt(t,e){return z(t,"set_market_oracle_config",[O(e.hubId,e.asset),$t(e.config)])}function Yt(t,e){return z(t,"set_oracle_tolerance",[x(e.asset),L({lower_ratio_bps:T(e.lowerRatioBps),upper_ratio_bps:T(e.upperRatioBps)})])}function te(t,e){return z(t,"set_spoke_asset_flags",[T(e.spokeId),O(e.hubId,e.asset),w(e.paused),w(e.frozen)])}function ee(t,e){return z(t,"set_oracle_sanity_bounds",[x(e.asset),q(e.minPriceWad),q(e.maxPriceWad)])}function oe(t,e){return z(t,"update_indexes",[x(t.caller),I(e.assets.map((t=>O(t.hubId,t.asset))))])}function re(t,e){return z(t,"renew_account",[x(t.caller),_(e.accountNonce)])}function ne(t,e){return z(t,"create_liquidity_pool",[T(e.hubId),x(e.asset),Ot(e.params)])}function ue(t,e){return z(t,"upgrade_liquidity_pool_params",[O(e.hubId,e.asset),Rt(e.params)])}function ie(t,e){return z(t,"claim_revenue",[x(t.caller),I(e.assets.map((t=>O(t.hubId,t.asset))))])}function se(t,e){return z(t,"add_rewards",[x(t.caller),U(e.rewards)])}function ae(t,e){return z(t,"update_account_threshold",[x(t.caller),w(e.hasRisks),I(e.accountNonces.map((t=>_(t))))])}const pe="00".repeat(32),le=t=>{if("string"==typeof t)return E(t);const e=Buffer.from(t);if(32!==e.length)throw new Error(`Stellar governance builder: expected a 32-byte salt (got ${e.length} bytes)`);return s.ScVal.scvBytes(e)},de=(t,...e)=>I([k(t),...e]),ce=t=>L({new_owner:x(t.newOwner),live_until_ledger:T(t.liveUntilLedger)}),ye=t=>L({asset:x(t.asset),bonus:T(t.bonus),borrow_cap:q(t.borrowCap),can_borrow:w(t.canBorrow),can_collateral:w(t.canCollateral),frozen:w(t.frozen),hub_id:T(t.hubId),paused:w(t.paused),liquidation_fees:T(t.liquidationFees),ltv:T(t.ltv),oracle_override:I([k("None")]),spoke_id:T(t.spokeId),supply_cap:q(t.supplyCap),threshold:T(t.threshold)}),me=t=>L({account:x(t.account),role:k(t.role)});function be(e,n,i){const s=e.governanceAddress??v(e.network),a=new r(s),p=new t(e.caller,e.sourceSequence);return{xdr:new u(p,{fee:e.fee??o,networkPassphrase:f[e.network]}).addOperation(a.call(n,...i)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}const fe=(t,e,o)=>be(t,"propose",[x(t.caller),e,le(o)]),ge=(t,e,o)=>be(t,"execute_self",[P(),e,le(o)]);function he(t,e,o){return fe(t,de("SetAggregator",x(e.aggregator)),o)}function ve(t,e,o){return fe(t,de("SetAccumulator",x(e.accumulator)),o)}function Se(t,e,o){return fe(t,de("SetLiquidityPoolTemplate",E(e.wasmHash)),o)}function xe(t,e,o){return fe(t,de("SetPositionLimits",Mt(e)),o)}function qe(t,e){return fe(t,de("CreateHub"),e)}function Te(t,e){return fe(t,de("AddSpoke"),e)}function _e(t,e,o){return fe(t,de("RemoveSpoke",T(e.spokeId)),o)}function we(t,e,o){return fe(t,de("AddAssetToSpoke",ye(e)),o)}function Ae(t,e,o){return fe(t,de("EditAssetInSpoke",ye(e)),o)}function ke(t,e,o){return fe(t,de("RemoveAssetFromSpoke",L({hub_asset:O((r=e).hubId,r.asset),spoke_id:T(r.spokeId)})),o);var r}function Pe(t,e,o){return fe(t,de("SetSpokeLiquidationCurve",L({hf_for_max_bonus_wad:q((r=e).hfForMaxBonusWad),liquidation_bonus_factor_bps:T(r.liquidationBonusFactorBps),spoke_id:T(r.spokeId),target_hf_wad:q(r.targetHfWad)})),o);var r}function Ie(t,e,o){return fe(t,de("SetPositionManager",x(e.manager),w(e.isActive)),o)}function Ee(t,e,o){return fe(t,de("SetMinBorrowCollateralUsd",q(e.floorWad)),o)}function Re(t,e,o){return fe(t,de("ApproveToken",x(e.token)),o)}function Oe(t,e,o){return fe(t,de("RevokeToken",x(e.token)),o)}function Me(t,e,o){return fe(t,de("ApproveBlendPool",x(e.pool)),o)}function Ue(t,e,o){return fe(t,de("RevokeBlendPool",x(e.pool)),o)}function Le(t,e,o){return fe(t,de("CreateLiquidityPool",L({asset:x((r=e).asset),hub_id:T(r.hubId),params:Ot(r.params)})),o);var r}function Ne(t,e,o){return fe(t,de("UpgradeLiquidityPoolParams",L({hub_asset:O((r=e).hubId,r.asset),params:Rt(r.params)})),o);var r}function $e(t,e){return fe(t,de("DeployPool"),e)}function Ce(t,e,o){return fe(t,de("UpgradePool",E(e.wasmHash)),o)}function Be(t,e,o){return fe(t,de("UpgradeController",E(e.wasmHash)),o)}function De(t,e,o){return fe(t,de("MigrateController",T(e.newVersion)),o)}function Ge(t,e,o){return fe(t,de("TransferCtrlOwnership",ce(e)),o)}function ze(t,e,o){return fe(t,de("ConfigureMarketOracle",L({cfg:$t((r=e).config),hub_asset:O(r.hubId,r.asset)})),o);var r}function We(t,e,o){return fe(t,de("EditOracleTolerance",L({asset:x((r=e).asset),tolerance:T(r.tolerance)})),o);var r}function Ve(t,e,o){return fe(t,de("UpgradeGov",E(e.wasmHash)),o)}function je(t,e,o){return fe(t,de("UpdateGovDelay",T(e.newDelay)),o)}function He(t,e,o){return fe(t,de("GrantGovRole",me(e)),o)}function Xe(t,e,o){return fe(t,de("RevokeGovRole",me(e)),o)}function Fe(t,e,o){return fe(t,de("TransferGovOwnership",ce(e)),o)}function Qe(t,e){const o=I(e.argsXdr.map((t=>s.ScVal.fromXDR(t,"base64")))),r=le(e.predecessor??pe);return be(t,"execute",[P(),x(e.target),k(e.functionName),o,r,le(e.salt)])}function Ze(t,e,o){return ge(t,de("UpgradeGov",E(e.wasmHash)),o)}function Ke(t,e,o){return ge(t,de("UpdateGovDelay",T(e.newDelay)),o)}function Je(t,e,o){return ge(t,de("GrantGovRole",me(e)),o)}function Ye(t,e,o){return ge(t,de("RevokeGovRole",me(e)),o)}function to(t,e,o){return ge(t,de("TransferGovOwnership",ce(e)),o)}function eo(t,e){return be(t,"set_spoke_asset_flags",[x(t.caller),T(e.spokeId),O(e.hubId,e.asset),w(e.paused),w(e.frozen)])}function oo(t,e){return be(t,"set_oracle_sanity_bounds",[x(t.caller),x(e.asset),q(e.minPriceWad),q(e.maxPriceWad)])}function ro(t){return be(t,"create_hub",[x(t.caller)])}function no(t){return be(t,"add_spoke",[x(t.caller)])}function uo(t,e){return be(t,"revoke_role_immediate",[x(e.account),k(e.role)])}function io(t){return be(t,"pause",[])}function so(t){return be(t,"unpause",[])}const ao=t=>t.toXDR("base64"),po=t=>s.ScVal.fromXDR(t,"base64"),lo=t=>t.map((t=>String(i(po(t))))).join(":"),co=t=>"bigint"==typeof t||"number"==typeof t?t.toString():String(t),yo=t=>Number(t),mo=t=>String(t),bo=t=>null==t?void 0:co(t),fo=t=>null==t?void 0:mo(t),go=t=>t instanceof Uint8Array?Buffer.from(t).toString("hex"):Buffer.isBuffer(t)?t.toString("hex"):String(t),ho=["None","Multiply","Long","Short"],vo=["Single","PrimaryWithAnchor"],So=["ReflectorSep40","RedStonePriceFeed"],xo=["Spot","Twap"],qo=["supply","borrow","withdraw","repay","liq_repay","liq_seize","multiply","param_upd","sw_debt_r","sw_col_wd","rp_col_wd","rp_col_r","close_wd"],To=t=>Array.isArray(t)?t:[],_o=(t,e)=>{const o="Borrow"===e;return{action:(r=t[0],qo[yo(r)]??co(r)),positionType:e,hubId:yo(t[1]),asset:mo(t[2]),scaledAmountRay:co(t[3]),indexRay:co(t[4]),amount:co(t[5]),liquidationThresholdBps:o?void 0:yo(t[6]),liquidationBonusBps:o?void 0:yo(t[7]),loanToValueBps:o?void 0:yo(t[8]),liquidationFeesBps:o?void 0:yo(t[9])};var r},wo=t=>{return{owner:mo(t[0]),spokeId:yo(t[1]),mode:(e=t[2],ho[yo(e)]??"None")};var e},Ao=(t,e)=>{const o=xo[yo(t[`${e}_read_mode`])]??"Spot",r=t[`${e}_asset`],n=t[`${e}_symbol`],u=null!=r?{kind:"Stellar",value:mo(r)}:null!=n?{kind:"Symbol",value:mo(n)}:void 0;return{provider:So[yo(t[`${e}_provider`])]??"ReflectorSep40",contractAddress:mo(t[`${e}_contract`]),asset:u,feedId:fo(t[`${e}_feed_id`]),readMode:o,twapRecords:"Twap"===o?yo(t[`${e}_twap_records`]):void 0,decimals:yo(t[`${e}_decimals`]),resolutionSeconds:yo(t[`${e}_resolution_seconds`]),maxStaleSeconds:yo(t[`${e}_max_stale_seconds`])}},ko=t=>{const e=null!==t.anchor_provider&&void 0!==t.anchor_provider;return{baseTokenId:mo(t.base_token_id),quoteTokenId:mo(t.quote_token_id),tolerance:{upperRatio:yo(t.upper_ratio_bps??t.tolerance?.upper_ratio_bps),lowerRatio:yo(t.lower_ratio_bps??t.tolerance?.lower_ratio_bps)},assetDecimals:yo(t.asset_decimals),maxPriceStaleSeconds:yo(t.max_price_stale_seconds),strategy:vo[yo(t.strategy)]??"Single",primary:Ao(t,"primary"),anchor:e?Ao(t,"anchor"):void 0,primaryQuoteToken:fo(t.primary_quote_token),anchorQuoteToken:fo(t.anchor_quote_token),minSanityPriceWad:bo(t.min_sanity_price_wad),maxSanityPriceWad:bo(t.max_sanity_price_wad)}},Po={"market:create":t=>({topic:"market:create",data:{hubId:yo(t.hub_id),baseAsset:mo(t.base_asset),maxBorrowRate:co(t.max_borrow_rate),baseBorrowRate:co(t.base_borrow_rate),slope1:co(t.slope1),slope2:co(t.slope2),slope3:co(t.slope3),midUtilization:co(t.mid_utilization),optimalUtilization:co(t.optimal_utilization),maxUtilization:co(t.max_utilization),reserveFactor:yo(t.reserve_factor),marketAddress:mo(t.market_address)}}),"market:params_update":t=>({topic:"market:params_update",data:{asset:mo(t.asset),maxBorrowRateRay:co(t.max_borrow_rate),baseBorrowRateRay:co(t.base_borrow_rate),slope1Ray:co(t.slope1),slope2Ray:co(t.slope2),slope3Ray:co(t.slope3),midUtilizationRay:co(t.mid_utilization),optimalUtilizationRay:co(t.optimal_utilization),maxUtilizationRay:co(t.max_utilization),reserveFactorBps:yo(t.reserve_factor)}}),"market:batch_state_update":t=>({topic:"market:batch_state_update",data:{updates:To(t).map((t=>{return e=To(t),{hubId:yo(e[0]),asset:mo(e[1]),timestamp:yo(e[2]),supplyIndexRay:co(e[3]),borrowIndexRay:co(e[4]),cash:co(e[5]),suppliedRay:co(e[6]),borrowedRay:co(e[7]),revenueRay:co(e[8])};var e}))}}),"market:batch_params_update":t=>({topic:"market:batch_params_update",data:{updates:To(t).map((t=>{const e=t;return{hubId:yo(e.hub_id),asset:mo(e.asset),params:(o=e.params,{maxBorrowRateRay:co(o.max_borrow_rate),baseBorrowRateRay:co(o.base_borrow_rate),slope1Ray:co(o.slope1),slope2Ray:co(o.slope2),slope3Ray:co(o.slope3),midUtilizationRay:co(o.mid_utilization),optimalUtilizationRay:co(o.optimal_utilization),maxUtilizationRay:co(o.max_utilization),reserveFactorBps:yo(o.reserve_factor),isFlashloanable:Boolean(o.is_flashloanable),flashloanFeeBps:yo(o.flashloan_fee),assetId:mo(o.asset_id),assetDecimals:yo(o.asset_decimals)})};var o}))}}),"position:batch_update":t=>{const e=To(t);return{topic:"position:batch_update",data:{accountId:co(e[0]),accountAttributes:wo(To(e[1])),updates:[...To(e[2]).map((t=>_o(To(t),"Deposit"))),...To(e[3]).map((t=>_o(To(t),"Borrow")))]}}},"position:flash_loan":t=>({topic:"position:flash_loan",data:{hubId:yo(t.hub_id),asset:mo(t.asset),receiver:mo(t.receiver),caller:mo(t.caller),amount:co(t.amount),fee:co(t.fee)}}),"config:oracle":t=>({topic:"config:oracle",data:{asset:mo(t.asset),oracle:ko(t.oracle)}}),"position:liquidation":t=>({topic:"position:liquidation",data:{liquidator:mo(t.liquidator),accountId:co(t.account_id),repaidUsdWad:co(t.repaid_usd_wad),bonusBps:co(t.bonus_bps)}}),"debt:bad_debt":t=>({topic:"debt:bad_debt",data:{accountId:co(t.account_id),totalBorrowUsdWad:co(t.total_borrow_usd_wad),totalCollateralUsdWad:co(t.total_collateral_usd_wad)}}),"strategy:initial_payment":t=>({topic:"strategy:initial_payment",data:{token:mo(t.token),amount:co(t.amount),usdValueWad:co(t.usd_value_wad),accountId:co(t.account_id)}}),"strategy:fee":t=>({topic:"strategy:fee",data:{hubId:yo(t.hub_id),asset:mo(t.asset),amount:co(t.amount),fee:co(t.fee),amountSent:co(t.amount_sent)}}),"config:approve_token":t=>({topic:"config:approve_token",data:{wasmHash:go(t.wasm_hash),approved:Boolean(t.approved)}}),"config:aggregator":t=>({topic:"config:aggregator",data:{aggregator:mo(t.aggregator)}}),"config:accumulator":t=>({topic:"config:accumulator",data:{accumulator:mo(t.accumulator)}}),"config:pool_template":t=>({topic:"config:pool_template",data:{wasmHash:go(t.wasm_hash)}}),"config:position_limits":t=>({topic:"config:position_limits",data:{maxSupplyPositions:yo(t.max_supply_positions),maxBorrowPositions:yo(t.max_borrow_positions)}}),"config:oracle_disabled":t=>({topic:"config:oracle_disabled",data:{asset:mo(t.asset)}}),"config:spoke":t=>{const e=t.spoke;return{topic:"config:spoke",data:{spokeId:yo(e.spoke_id),isDeprecated:Boolean(e.is_deprecated),liquidationTargetHfWad:co(e.liquidation_target_hf_wad),healthFactorForMaxBonusWad:co(e.hf_for_max_bonus_wad),liquidationBonusFactorBps:yo(e.liquidation_bonus_factor_bps)}}}},Io=Object.freeze(Object.keys(Po));function Eo(t,e){const o=lo(t),r=Po[o];return r?r(i(po(e))):null}const Ro="XLENDXLM-a7c9f3",Oo=1e4;function Mo(t){const e=BigInt(t).toString(16),o=e.length%2==0?e:`0${e}`;return`${Ro}-${o}`}function Uo(t){const e=t.split("-");return e.length>=2&&parseInt(e[1],10)||0}function Lo(t,e=0){return t*Oo+e}function No(t){switch(t){case"liq_repay":return"lendingLiquidateRepayDebt";case"liq_seize":return"lendingLiquidateSeizeCollateral";case"param_upd":return"lendingUpdateAccountParameters";default:return"lendingUpdateAccountPosition"}}const $o=(t,e,o)=>{const r=new URL(e,t.endsWith("/")?t:`${t}/`);if(o)for(const[t,e]of Object.entries(o))void 0!==e&&r.searchParams.set(t,String(e));return r.toString()},Co=t=>t.baseUrl??b[t.network];async function Bo(t,e){if(null==t.amountIn==(null==t.amountOut))throw new Error("getStellarAggregatorQuote: exactly one of `amountIn` or `amountOut` must be provided");const o=$o(Co(e),"api/v1/quote",{from:t.from,to:t.to,amountIn:t.amountIn,amountOut:t.amountOut,maxHops:t.maxHops,maxSplits:t.maxSplits,slippage:t.slippage,includePaths:t.includePaths,sender:t.sender,router:t.router,platform:t.platform,fresh:t.fresh}),r=await fetch(o,e.fetchOptions);if(!r.ok){const t=await r.text().catch((()=>""));throw new Error(`Stellar quote server responded ${r.status} ${r.statusText} for ${o} — ${t}`)}return await r.json()}async function Do(t){const e=$o(Co(t),"api/v1/tokens"),o=await fetch(e,t.fetchOptions);if(!o.ok){const t=await o.text().catch((()=>""));throw new Error(`Stellar quote server responded ${o.status} ${o.statusText} for ${e} — ${t}`)}return await o.json()}const Go=t=>N(t).toXDR("base64");function zo(e,n){const i=e.routerAddress??h(e.network),s=new r(i),a=new t(e.caller,e.sourceSequence),p=D(((t,e)=>(t=>Boolean(t&&"object"==typeof t&&!(t instanceof Uint8Array)&&"paths"in t))(t)&&void 0===t.referralId?{...t,referralId:e??0}:t)(n,e.referralId));return{xdr:new u(a,{fee:e.fee??o,networkPassphrase:f[e.network]}).addOperation(s.call("execute_strategy",x(e.caller),q(e.totalIn),p)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function Wo(t,e){return zo(t,e)}function Vo(t,e={}){if("string"!=typeof t.amountOutMin)throw new Error("mapQuoteResponseToStrategyPayload: quote response is missing `amountOutMin`. Pass `slippage` when fetching the quote.");return{paths:t.paths?t.paths.map((t=>({hops:t.swaps.map(Xo),splitPpm:t.splitPpm}))):[{hops:t.hops.map(Xo),splitPpm:1e6}],referralId:e.referralId??0,tokenIn:t.from,tokenOut:t.to,totalMinOut:t.amountOutMin}}function jo(t,e={}){const o=t;return"string"==typeof o.routeXdr&&o.routeXdr.length>0?{routeXdr:o.routeXdr}:Vo(t,e)}const Ho=Vo,Xo=t=>({amountOut:t.amountOut,pool:t.address,tokenIn:t.from,tokenOut:t.to,venue:t.dex});function Fo(t,e){const o=e instanceof Error?e.message:String(e);return new Error(`[xoxno-invoked:${t}] ${o}`)}async function Qo(t,e,o){const r=u.fromXDR(e,"base64");try{return(await t.prepareTransaction(r)).toXDR()}catch(t){if(o?.invokedContractId)throw Fo(o.invokedContractId,t);throw t}}async function Zo(t,e,o){return Qo(t,e.xdr,o)}function Ko(t){if(t<=0||t>4)throw new Error(`Invalid PositionMode ${t} for Stellar — expected 1 (Normal) through 4 (Short). "None" (0) has no Stellar equivalent.`);return t-1}function Jo(t,e){return new Uint8Array(0)}const Yo=t=>{const e=t.startsWith("0x")?t.slice(2):t;if(e.length%2!=0)throw new Error("buildStellarCctpForwardTx: hex input must have even length");return Buffer.from(e,"hex")};function tr(e){const o=new t(e.caller,e.sourceSequence),n=new r(e.forwarderAddress).call("mint_and_forward",s.ScVal.scvBytes(Yo(e.message)),s.ScVal.scvBytes(Yo(e.attestation)));return{xdr:new u(o,{fee:e.fee??"10000000",networkPassphrase:f[e.network]}).addOperation(n).setTimeout(e.timeoutSeconds??120).build().toXDR()}}const er={1:{name:"AssetNotSupported",message:"This asset is not supported by the protocol."},2:{name:"AssetAlreadySupported",message:"This asset is already supported."},3:{name:"InvalidTicker",message:"Invalid asset ticker."},6:{name:"InvalidAsset",message:"Invalid asset address."},10:{name:"InvalidPoolTemplate",message:"The liquidity pool template hash is invalid."},11:{name:"InvalidExchangeSrc",message:"The oracle configuration is invalid."},12:{name:"PairNotActive",message:"No oracle is configured for this asset."},32:{name:"OwnerNotSet",message:"The contract owner has not been set."},39:{name:"InvalidTimelockDelay",message:"The timelock delay is out of the allowed range."},41:{name:"InvalidRole",message:"The caller does not hold the required role."},43:{name:"HubNotActive",message:"This hub is not active."},44:{name:"NotAuthorized",message:"The caller is not authorized to perform this action."},46:{name:"OperationNotCancellable",message:"This governance operation cannot be cancelled."},113:{name:"InvalidLiqThreshold",message:"LTV, liquidation threshold, or bonus is out of bounds."},116:{name:"InvalidBorrowParams",message:"Supply or borrow cap configuration is invalid."},117:{name:"InvalidUtilRange",message:"Interest-rate utilization breakpoints are invalid."},132:{name:"AssetDecimalsTooHigh",message:"Asset decimals exceed the protocol maximum (27)."},300:{name:"SpokeNotFound",message:"This spoke does not exist."},301:{name:"SpokeDeprecated",message:"This spoke has been deprecated."},307:{name:"AssetNotInSpoke",message:"This asset is not listed on the spoke."},308:{name:"AssetAlreadyInSpoke",message:"This asset is already listed in the spoke."},309:{name:"SpokeAssetInUse",message:"This spoke asset still has live positions; drain usage before removal."},315:{name:"SpokeAssetPaused",message:"This spoke asset is paused."},316:{name:"SpokeAssetFrozen",message:"This spoke asset is frozen."},220:{name:"InvalidOracleBase",message:"The oracle quote asset/market is missing or invalid."},221:{name:"InvalidOracleDecimals",message:"The oracle decimals value is invalid."},224:{name:"InvalidSanityBounds",message:"Oracle sanity bounds are invalid (require 0 < min < max)."},225:{name:"OracleCycleDetected",message:"A cycle was detected in the oracle quote chain."}};function or(t){const e=t.match(/Error\(Contract,\s*#(\d+)\)/);if(!e)return null;const o=Number(e[1]),r=er[o];return r?{code:o,...r}:null}}},p={};function l(t){var e=p[t];if(void 0!==e)return e.exports;var o=p[t]={exports:{}};return a[t](o,o.exports,l),o.exports}l.d=(t,e)=>{for(var o in e)l.o(e,o)&&!l.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},l.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const d="https://api.xoxno.com",c="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",y="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",m="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var b;!function(t){t.MAINNET="1",t.DEVNET="D"}(b||(b={}));class f{apiUrl;chain;init;config;constructor({chain:t=b.MAINNET,apiUrl:e=d,...o}={}){this.apiUrl=e??{[b.MAINNET]:d,[b.DEVNET]:"https://devnet-api.xoxno.com"}[t],this.chain=t,this.init=o,this.config=t==b.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:c,DR_SC:y,KG_SC:m,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{mediaUrl:"https://devnet-media.xoxno.com",gatewayUrl:"https://devnet-gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4",FM_SC:c,DR_SC:y,KG_SC:m,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}fetchWithTimeout=async(t,{params:e,...o}={})=>{const{next:r,cache:n,debug:u,...i}=this.init,{next:s,cache:a,debug:p,headers:l,method:d="GET",...c}=o,y=l?.Authorization,m="Bearer undefined"===y?void 0:y,b={...l,Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."PUT"===d?{}:{"Content-Type":"application/json"},...m?{Authorization:m}:{}},f=Object.entries(e??{}).flatMap((([t,e])=>Array.isArray(e)?e.map((e=>`${t}=${encodeURIComponent(e)}`)):`${t}=${encodeURIComponent(e)}`)).join("&"),g=`${this.apiUrl}${t}${f.length?`?${f}`:""}`,{revalidate:h,...v}=r??{},{revalidate:S,...x}=s??{},q="GET"!==d||m?void 0:S??h,T="GET"!==d||m||q?void 0:a??n,_={...i,...c,method:d,...Object.keys(b).length?{headers:b}:{},cache:T,next:{...v,...x,revalidate:q}};(p??u)&&console.debug("SDK fetch: ",g,_);const w=await fetch(g,_).catch((t=>{if(t instanceof Error&&!t.message.match(/^http(s?):\/\//))throw Object.assign(new Error(`${g}: ${t.message}`),{cause:t});throw t})),A=await w.text();if(!w.ok){let t;try{t=JSON.parse(A)}catch{t={message:A}}const e=[g,w.status,w.statusText,t.message].filter(Boolean).join(";;");throw new Error(e)}try{return JSON.parse(A)}catch{return A}}}const g=t=>{const e=/^0x[a-fA-F0-9]{1,64}-[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(t)),o=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t);return e||o},h=t=>{const e=/^0x[a-fA-F0-9]{1,64}$/.test(t),o=/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,7}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(t);return e||o};class v extends Error{constructor(t){super(`Invalid collection ticker: ${t}`)}}class S extends Error{constructor(t){super(`Invalid address: ${t}`)}}Error,Error;const x=t=>!!t&&(t.startsWith("erd1")&&62===t.length||/^0x[a-fA-F0-9]{40,64}$/.test(t)||/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(t)||/^G[A-Z2-7]{55}$/.test(t)),q={"/liquid/xoxno/rate":{input:{},output:{}},"/liquid/xoxno/liquid-supply":{input:{},output:{}},"/liquid/xoxno/staked":{input:{},output:{}},"/user/login":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/:address/network-account":{input:{},output:{}},"/user/:address/token-inventory":{input:{},output:{}},"/user/network-account":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/me/profile":{input:{},output:{},securityMode:"requiredAny"},"/user/:address/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me":{input:{},output:{},securityMode:"requiredAny"},"/user/me/settings":{input:{},output:{},securityMode:"optionalAny"},"/user/me/settings/notification-preferences":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"optionalAny"}},"/user/me/settings/email":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredJwt"}},"/user/me/settings/phone":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me/settings/billing":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me/settings/verify-email":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/buy/signature":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/upload-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/reset-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/reset-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:tag/creator/is-registered":{input:{},output:{}},"/user/:address/creator/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/upload-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/reset-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/reset-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/favorite/collections":{input:{},output:{}},"/user/favorite/:favoriteId":{input:{},output:{},securityMode:"requiredAny"},"/user/:address/follow":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/favorite/users":{input:{},output:{}},"/tokens":{input:{},output:{}},"/tokens/swap":{input:{},output:{}},"/stellar/tokens":{input:{},output:{}},"/tokens/restricted":{input:{},output:{}},"/tokens/usd-price":{input:{},output:{}},"/tokens/egld/fiat-price":{input:{},output:{}},"/tokens/xoxno/info":{input:{},output:{}},"/liquid/xoxno/stats":{input:{},output:{}},"/liquid/egld/stats":{input:{},output:{}},"/liquid/sui/stats":{input:{},output:{}},"/analytics/marketplace-unique-users":{input:{},output:{}},"/liquid/egld/rate":{input:{},output:{}},"/liquid/egld/liquid-supply":{input:{},output:{}},"/liquid/egld/staked":{input:{},output:{}},"/liquid/egld/pending-fees":{input:{},output:{}},"/liquid/egld/pending-undelegate":{input:{},output:{}},"/liquid/egld/pending-delegate":{input:{},output:{}},"/liquid/egld/execute-delegate":{input:{},output:{}},"/liquid/egld/execute-undelegate":{input:{},output:{}},"/liquid/egld/execute-undelegate-providers":{input:{},output:{}},"/liquid/egld/protocol-apr":{input:{},output:{}},"/liquid/egld/providers":{input:{},output:{}},"/user/:address/delegation":{input:{},output:{}},"/lending/market/:token/profile":{input:{},output:{}},"/lending/market/query":{input:{},output:{}},"/lending/governance/proposals":{input:{},output:{}},"/lending/governance/proposal/:id":{input:{},output:{}},"/user/lending/:address":{input:{},output:{}},"/lending/market/indexes":{input:{},output:{}},"/user/lending/position/:identifier":{input:{},output:{}},"/lending/pnl":{input:{},output:{}},"/user/lending/pnl/:address":{input:{},output:{}},"/user/lending/summary/:identifier":{input:{},output:{}},"/user/lending/image/:nonce":{input:{},output:{}},"/lending/market/emode-categories":{input:{},output:{}},"/lending/market/:token/emode-categories":{input:{},output:{}},"/lending/market/:token/analytics":{input:{},output:{}},"/lending/stats/history":{input:{},output:{}},"/lending/market/:token/average":{input:{},output:{}},"/lending/leaderboard":{input:{},output:{}},"/lending/leaderboard/liquidate":{input:{},output:{}},"/lending/leaderboard/clean-bad-debt":{input:{},output:{}},"/lending/stats":{input:{},output:{}},"/lending/market/prices":{input:{},output:{}},"/nft/query":{input:{},output:{}},"/nft/:identifier/like":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/inventory-summary":{input:{},output:{}},"/user/:address/offers":{input:{},output:{}},"/nft/offer/query":{input:{},output:{}},"/nft/offer/:identifier":{input:{},output:{}},"/user/:address/favorite/nfts":{input:{},output:{}},"/collection/:collection/attributes":{input:{},output:{}},"/nft/:identifier/offers":{input:{},output:{}},"/collection/:collection/ranks":{input:{},output:{}},"/collection/:collection/listings":{input:{},output:{}},"/nft/pinned":{input:{},output:{}},"/nft/sign-withdraw":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/sign-offer":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/sign-mint":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/nft/:identifier":{input:{},output:{}},"/collection/:collection/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/floor-price":{input:{},output:{}},"/collection/floor-price":{input:{},output:{}},"/collection/pinned":{input:{},output:{}},"/collection/pinned-drops":{input:{},output:{}},"/collection/:collection/pinned-drops":{input:{},output:{}},"/collection/:collection/pinned":{input:{},output:{}},"/collection/:collection/follow":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/query":{input:{},output:{}},"/collection/drops/query":{input:{},output:{}},"/collection/:collection/drop-info":{input:{},output:{},securityMode:"optionalAny"},"/collection/:creatorTag/:collectionTag/drop-info":{input:{},output:{},securityMode:"optionalAny"},"/collection/:collection/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/upload-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/reset-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/reset-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/holders":{input:{},output:{}},"/collection/:collection/holders/export":{input:{},output:{}},"/collection/:collection/owner":{input:{},output:{}},"/collection/:collection/stats":{input:{},output:{}},"/collection/stats/query":{input:{},output:{}},"/collection/global-offer/query":{input:{},output:{}},"/user/:address/creator/listing":{input:{},output:{}},"/user/:address/creator/details":{input:{},output:{}},"/launchpad/:scAddress/shareholders/royalties":{input:{},output:{}},"/launchpad/:scAddress/shareholders/collection/:collectionTag":{input:{},output:{}},"/pool/:poolId/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/pool/:poolId/whitelist":{input:{},output:{}},"/pool/:poolId/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/staking/available-pools":{input:{},output:{}},"/user/:address/staking/owned-collections":{input:{},output:{}},"/user/:address/staking/owned-pools":{input:{},output:{}},"/user/:address/staking/summary":{input:{},output:{}},"/user/:address/staking/creator":{input:{},output:{}},"/user/:address/staking/collection/:collection":{input:{},output:{}},"/user/:address/staking/pool/:poolId/nfts":{input:{},output:{}},"/collection/:collection/staking/summary":{input:{},output:{},securityMode:"optionalAny"},"/collection/:collection/staking/delegators":{input:{},output:{}},"/collection/staking/explore":{input:{},output:{}},"/user/:creatorTag/owned-services":{input:{},output:{}},"/search":{input:{},output:{}},"/user/search":{input:{},output:{}},"/collection/search":{input:{},output:{}},"/collection/drops/search":{input:{},output:{}},"/nft/search/query":{input:{},output:{}},"/lending/market-sc":{input:{},output:{}},"/lending/active-accounts":{input:{},output:{}},"/lending/account/:nonce/attributes":{input:{},output:{}},"/lending/account/:nonce/positions":{input:{},output:{}},"/lending/market/:token/price/egld":{input:{},output:{}},"/faucet":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/stellar-lending/assets":{input:{},output:{}},"/stellar-lending/context":{input:{},output:{}},"/stellar-lending/live-state":{input:{},output:{}},"/stellar-lending/hubs":{input:{},output:{}},"/stellar-lending/spokes":{input:{},output:{}},"/stellar-lending/reserves":{input:{},output:{}},"/stellar-lending/reserves/:spokeId/:hubId/:asset":{input:{},output:{}},"/stellar-lending/reserves/:spokeId/:hubId/:asset/holders":{input:{},output:{}},"/stellar-lending/hubs/:hubId/holders":{input:{},output:{}},"/stellar-lending/spokes/:spokeId/holders":{input:{},output:{}},"/stellar-lending/assets/:asset":{input:{},output:{}},"/stellar-lending/assets/:asset/page":{input:{},output:{}},"/stellar-lending/assets/:asset/markets":{input:{},output:{}},"/stellar-lending/hubs/:hubId":{input:{},output:{}},"/stellar-lending/spokes/:spokeId":{input:{},output:{}},"/stellar-lending/users/:owner/positions":{input:{},output:{}},"/stellar-lending/users/:owner/activity":{input:{},output:{}},"/stellar-lending/accounts/:accountId/positions":{input:{},output:{}},"/stellar-lending/governance/proposals":{input:{},output:{}},"/stellar-lending/assets/:asset/graph":{input:{},output:{}},"/stellar-lending/hubs/:hubId/graph":{input:{},output:{}},"/stellar-lending/spokes/:spokeId/graph":{input:{},output:{}},"/stellar-lending/reserves/:spokeId/:hubId/:asset/graph":{input:{},output:{}},"/stellar-lending/stats/history":{input:{},output:{}},"/stellar-lending/pnl":{input:{},output:{}},"/stellar-lending/positions":{input:{},output:{}},"/stellar-lending/users/:accountId/history":{input:{},output:{}},"/stellar-lending/pnl/scope":{input:{},output:{}},"/stellar-lending/revenue":{input:{},output:{}},"/stellar-lending/revenue/fees":{input:{},output:{}},"/stellar-lending/participants":{input:{},output:{}},"/stellar-lending/liquidations":{input:{},output:{}},"/stellar-lending/liquidations/leaderboard":{input:{},output:{}},"/stellar-lending/volume":{input:{},output:{}},"/stellar-lending/active-users":{input:{},output:{}},"/stellar-lending/distribution":{input:{},output:{}},"/stellar-lending/rate-spread":{input:{},output:{}},"/stellar-lending/defillama":{input:{},output:{}},"/user/notifications":{input:{},output:{},securityMode:"requiredAny"},"/user/notifications/unread-count":{input:{},output:{},securityMode:"requiredAny"},"/user/notifications/clear":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/notifications/read":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/device/register":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/mobile/device/:deviceId":{input:{},output:{},securityMode:"requiredWeb2",DELETE:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/mobile/history":{input:{},output:{},securityMode:"requiredAny"},"/mobile/history/unread-count":{input:{},output:{},securityMode:"requiredAny"},"/mobile/history/:notificationId/read":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/history/read-all":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/history/clear-all":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/history/clear-id/:notificationId":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/event/:eventId/update":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/event/:eventId/reminder":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/creator/marketing":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/user/:userId/direct":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/stellar/challenge":{input:{},output:{}},"/user/native-token":{input:{},output:{}},"/user/web2":{input:{},output:{},securityMode:"requiredWeb2"},"/user/web2/session-cookie":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/wallet":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/wallet-switch":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/wallet-link":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/:index/wallet-link":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/shards":{input:{},output:{},securityMode:"requiredWeb2"},"/activity/query":{input:{},output:{}},"/activity/:identifier":{input:{},output:{}},"/analytics/volume":{input:{},output:{}},"/collection/:collection/analytics/volume":{input:{},output:{}},"/collections/analytics/volume":{input:{},output:{}},"/user/:address/analytics/volume":{input:{},output:{}},"/analytics/overview":{input:{},output:{}},"/user/stats":{input:{},output:{}},"/user/xoxno-drop":{input:{},output:{}},"/user/me/xoxno-drop":{input:{},output:{},securityMode:"requiredAny"},"/transactions/:txHash":{input:{},output:{}},"/transactions/:txHash/status":{input:{},output:{}},"/transaction/cost":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/transactions":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/transactions/batch":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/chat/message":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/conversation":{input:{},output:{},securityMode:"requiredAny"},"/user/chat/conversation/:conversationId":{input:{},output:{},securityMode:"requiredAny",DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/conversation-summary":{input:{},output:{},securityMode:"requiredAny"},"/user/chat/conversation/:conversationId/message/:messageId":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/block":{input:{},output:{},securityMode:"requiredAny"},"/user/chat/block/:address":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/token":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/hatom/user/:address":{input:{},output:{}},"/countries":{input:{},output:{}},"/event":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId":{input:{},output:{},securityMode:"optionalAny",PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/profile/query":{input:{},output:{}},"/event/:eventId/profile":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/background":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/description":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/description/image":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/description/image/:imageId":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/register":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/ticket":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/ticket/:ticketId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"},POST:{input:{},output:{},body:{}}},"/event/:eventId/stage":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/stage/:stageId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/calculate-prices":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/event/:eventId/validate-discount":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/:address/creator/events":{input:{},output:{},securityMode:"optionalAny"},"/event/:eventId/invite":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/invite/query":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/invite/:inviteId":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/voucher/query":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/questions":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/question":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/question/:questionId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/guest/query":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/guest/:address":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/guest-export":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/role":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},securityMode:"requiredAny"},"/event/:eventId/role/:roleId":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/guest":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/roleOf/:address":{input:{},output:{},securityMode:"requiredAny"},"/user/me/event":{input:{},output:{},securityMode:"requiredAny"},"/user/me/events/past":{input:{},output:{},securityMode:"requiredAny"},"/user/me/events/hosted":{input:{},output:{},securityMode:"requiredAny"},"/user/me/events/upcoming":{input:{},output:{},securityMode:"requiredAny"},"/user/me/event/badge":{input:{},output:{},securityMode:"requiredAny"},"/user/me/event/badge/payload":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/scan":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/voucher":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/voucher/:voucherCode":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/manual-check-in":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/answered-questions/:address":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/guest/approve":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/google-pass/:address":{input:{},output:{}},"/event/profile/location":{input:{},output:{}},"/event/:eventId/referral-config":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referral-config/:configId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referral-configs":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/referral":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referral/:referralCode":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referrals":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/referrals/self-serviced":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/notify-attendees":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/notify/global-broadcast":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/blend/:address":{input:{},output:{}},"/stellar/aggregator/quote":{input:{},output:{}},"/perp/exchange/acceptTerms":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/perp/exchange/sendAsset":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/perp/exchange/sendExternalAsset":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/perp/exchange/deposit":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/perp/exchange/withdraw":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/perp/exchange/order":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/tradingview/bars/:symbol":{input:{},output:{}},"/tradingview/coin/:symbol":{input:{},output:{}},"/perp/coin/:symbol":{input:{},output:{}},"/perp/coin/spot/:symbol":{input:{},output:{}},"/perp/coins":{input:{},output:{}},"/perp/legal-check/:address":{input:{},output:{}},"/perp/coins/spot":{input:{},output:{}},"/perp/orderbook/:symbol":{input:{},output:{}},"/perp/trades/:symbol":{input:{},output:{}},"/perp/stats/spot/:symbol":{input:{},output:{}},"/perp/stats/:symbol":{input:{},output:{}},"/perp/subscribe":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/perp/unsubscribe":{input:{},output:{},POST:{input:{},output:{},body:{}}}},T=["PATCH","POST","DELETE","PUT"];var _=l(385);const w=t=>t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase()));function A(t,e,o,r){const{input:n,output:u,...i}=e,s=async(e={})=>{const n={...o,...e},u=t.replace(/:([a-zA-Z_]+)/g,((t,e)=>`${n[e]}`)),i=[...t.matchAll(/:([a-zA-Z_]+)/g)].map((t=>t[1])),s=Object.fromEntries(Object.entries(n).filter((([t])=>!i.includes(t)))),a=/:address[^A-Z]/.test(t)||"address"in s,p=/:collection[^A-Z]/.test(t)||"collection"in s;if(a){const t=n.address;if(!x(t))throw new S(t)}if(p){const t=n.collection;if(Array.isArray(t)?t.some((t=>!g(t))):!g(t))throw new v(t)}const l=Object.fromEntries(Object.entries(s).map((([t,e])=>[t,e instanceof FormData?e:"filter"===t||"body"===t?JSON.stringify(e):Array.isArray(e)?e.join(","):e]))),{body:d,auth:c,method:y,headers:m,cache:b,next:f,debug:h,continuationToken:q,...T}=l,_=c?`Bearer ${c}`:void 0,w={...m,..._?{Authorization:_}:{},...q?{"X-Continuation-Token":String(q)}:{}},A={...f,tags:[...f?.tags??[],u]};return r.fetchWithTimeout(u,{method:y,params:T,body:d,headers:w,cache:b,debug:h,...A?{next:A}:{}})},a=(t={})=>s(t);for(const t of Object.keys(i))T.includes(t)&&(a[t]=e=>s({...e,method:e.method??t.toUpperCase()}));return a}function k(t){const e=function(){const t={static:{},params:{},leaves:[]};for(const[e,o]of Object.entries(q)){const r=e.split("/").filter(Boolean);let n=t;for(const t of r)if(t.startsWith(":")){const e=w(t.slice(1));n=n.params[e]||={static:{},params:{},leaves:[]}}else{const e=w(t);n=n.static[e]||={static:{},params:{},leaves:[]}}n.leaves.push({rawPath:e,def:o})}return t}(),o=(e,r)=>{const n=e.leaves.length,u=Object.keys(e.static).length,i=Object.keys(e.params).length;let s;if(1===n&&u+i>0){const{rawPath:o,def:n}=e.leaves[0];s=A(o,n,r,t)}else{s={};for(const{rawPath:o,def:n}of e.leaves)s[w(o.split("/").pop().replace(/^:/,""))]=A(o,n,r,t)}for(const[t,n]of Object.entries(e.static)){const e=o(n,r);let u=e;if(e&&"object"==typeof e&&t in e&&"function"==typeof e[t]){const o=e[t],r=Object.fromEntries(Object.entries(e).filter((([e])=>e!==t)));1===o.length||(Object.assign(o,r),u=o)}void 0===s[t]?s[t]=u:"function"==typeof s[t]?Object.assign(s[t],u):"function"==typeof u?(Object.assign(u,s[t]),s[t]=u):Object.assign(s[t],u)}for(const[t,n]of Object.entries(e.params)){const e=e=>{const u=o(n,{...r,[t]:e});if(u&&"object"==typeof u&&1===Object.keys(u).length&&t in u&&"function"==typeof u[t]){const e=u[t],o=(...t)=>e(...t);return Object.assign(o,e)}return u};if(s[t]){const o=s[t];s[t]=t=>({...o(t),...e(t)})}else s[t]=e}return s};return o(e,{})}export{b as Chain,f as XOXNOClient,k as buildSdk,g as isValidCollectionTicker,h as isValidNftIdentifier};export const STELLAR_AGGREGATOR_ROUTER=_.ME;export const STELLAR_GOVERNANCE=_.nO;export const STELLAR_GOVERNANCE_ZERO_PREDECESSOR=_.G_;export const STELLAR_LENDING_CONTROLLER=_.DU;export const STELLAR_LENDING_TOPICS=_.fA;export const STELLAR_NETWORK_PASSPHRASE=_.A$;export const STELLAR_QUOTE_URL=_.J9;export const STELLAR_SOROBAN_RPC_URL=_.hS;export const SYNTHETIC_EVENT_ORDER_STRIDE=_.gR;export const XOXNO_LENDING_STELLAR_TICKER=_.Cg;export const buildSameTokenRepaySwapSteps=_.VZ;export const buildStellarAcceptOwnershipTx=_.N0;export const buildStellarAddRewardsTx=_.B_;export const buildStellarApproveTokenTx=_.eX;export const buildStellarBatchSwapTx=_.z;export const buildStellarBorrowBatchTx=_.xD;export const buildStellarBorrowTx=_.jR;export const buildStellarCctpForwardTx=_.P2;export const buildStellarClaimRevenueTx=_.W6;export const buildStellarCreateLiquidityPoolTx=_.se;export const buildStellarExecuteStrategyTx=_.yr;export const buildStellarFlashLoanTx=_.sp;export const buildStellarGovernanceAddSpokeImmediateTx=_.Iu;export const buildStellarGovernanceCreateHubImmediateTx=_.yu;export const buildStellarGovernanceExecuteGovernanceUpgradeTx=_.$9;export const buildStellarGovernanceExecuteGrantGovernanceRoleTx=_.zw;export const buildStellarGovernanceExecuteRevokeGovernanceRoleTx=_.h_;export const buildStellarGovernanceExecuteTransferGovOwnTx=_.e_;export const buildStellarGovernanceExecuteTx=_.Tk;export const buildStellarGovernanceExecuteUpdateDelayTx=_.BA;export const buildStellarGovernancePauseTx=_.u9;export const buildStellarGovernanceRevokeRoleImmediateTx=_.bi;export const buildStellarGovernanceSetOracleSanityBoundsImmediateTx=_.gc;export const buildStellarGovernanceSetSpokeAssetFlagsImmediateTx=_.ay;export const buildStellarGovernanceUnpauseTx=_.BN;export const buildStellarGrantRoleTx=_.SX;export const buildStellarLendingIdentifier=_.UF;export const buildStellarLiquidateTx=_.Y5;export const buildStellarMigrateFromBlendTx=_.mE;export const buildStellarMigrateTx=_.xG;export const buildStellarMultiplyTx=_.s9;export const buildStellarPauseTx=_.OL;export const buildStellarProposeAddAssetToSpokeTx=_.k6;export const buildStellarProposeAddSpokeTx=_.dj;export const buildStellarProposeApproveBlendPoolTx=_.kD;export const buildStellarProposeApproveTokenTx=_.Yf;export const buildStellarProposeConfigureMarketOracleTx=_.c5;export const buildStellarProposeCreateHubTx=_.N8;export const buildStellarProposeCreateLiquidityPoolTx=_.qU;export const buildStellarProposeDeployPoolTx=_.RZ;export const buildStellarProposeEditAssetInSpokeTx=_.ni;export const buildStellarProposeEditOracleToleranceTx=_.hF;export const buildStellarProposeGovernanceUpgradeTx=_.Qk;export const buildStellarProposeGrantGovernanceRoleTx=_.Gw;export const buildStellarProposeMigrateControllerTx=_.$K;export const buildStellarProposeRemoveAssetFromSpokeTx=_.uj;export const buildStellarProposeRemoveSpokeTx=_.Od;export const buildStellarProposeRevokeBlendPoolTx=_.X7;export const buildStellarProposeRevokeGovernanceRoleTx=_.Ub;export const buildStellarProposeRevokeTokenTx=_.Dx;export const buildStellarProposeSetAccumulatorTx=_.OA;export const buildStellarProposeSetAggregatorTx=_.$U;export const buildStellarProposeSetMinBorrowCollatTx=_.ob;export const buildStellarProposeSetPoolTemplateTx=_.cY;export const buildStellarProposeSetPositionLimitsTx=_.$l;export const buildStellarProposeSetPositionManagerTx=_.K;export const buildStellarProposeSetSpokeLiquidationCurveTx=_.kw;export const buildStellarProposeTransferCtrlOwnershipTx=_.VS;export const buildStellarProposeTransferGovOwnTx=_.HP;export const buildStellarProposeUpdateDelayTx=_.YQ;export const buildStellarProposeUpgradeControllerTx=_.QY;export const buildStellarProposeUpgradePoolParamsTx=_.os;export const buildStellarProposeUpgradePoolTx=_.Ko;export const buildStellarRenewAccountTx=_.IJ;export const buildStellarRepayBatchTx=_.nw;export const buildStellarRepayDebtWithCollateralTx=_.Pr;export const buildStellarRepayTx=_.ZE;export const buildStellarRevokeRoleTx=_.ev;export const buildStellarRevokeTokenTx=_.P8;export const buildStellarSetAccumulatorTx=_.aV;export const buildStellarSetAggregatorTx=_.p2;export const buildStellarSetLiquidityPoolTemplateTx=_.Ww;export const buildStellarSetMarketOracleConfigTx=_.sV;export const buildStellarSetOracleSanityBoundsTx=_.XD;export const buildStellarSetOracleToleranceTx=_.Js;export const buildStellarSetPositionLimitsTx=_.Dy;export const buildStellarSetSpokeAssetFlagsTx=_.FZ;export const buildStellarSupplyBatchTx=_.Ni;export const buildStellarSupplyTx=_.v_;export const buildStellarSwapCollateralTx=_.qD;export const buildStellarSwapDebtTx=_.qR;export const buildStellarTransferOwnershipTx=_.QJ;export const buildStellarUnpauseTx=_.bm;export const buildStellarUpdateAccountThresholdTx=_.n_;export const buildStellarUpdateIndexesTx=_.v8;export const buildStellarUpgradeControllerTx=_.qM;export const buildStellarUpgradeLiquidityPoolParamsTx=_.gH;export const buildStellarWithdrawBatchTx=_.O3;export const buildStellarWithdrawTx=_.Gz;export const buildTx=_.pr;export const decodeStellarLendingEvent=_.Fm;export const encodeInterestRateModel=_.MB;export const encodeMarketOracleConfigInput=_.Dn;export const encodeMarketParamsRaw=_.pq;export const encodeOracleSourceConfigInput=_.ml;export const encodePositionLimits=_.Q3;export const encodeStrategyPayloadToRouteXdr=_.wf;export const extractEventOrder=_.Um;export const getStellarAccountPositions=_.xO;export const getStellarAggregatorQuote=_.Lw;export const getStellarAggregatorRouter=_.KM;export const getStellarAsset=_.mM;export const getStellarAssetGraph=_.iE;export const getStellarAssetMarkets=_.zp;export const getStellarAssetPage=_.N3;export const getStellarAssets=_.bN;export const getStellarGovernance=_.QV;export const getStellarGovernanceProposals=_.T_;export const getStellarHub=_.XI;export const getStellarHubGraph=_.Lt;export const getStellarHubs=_.KK;export const getStellarLendingContext=_.yl;export const getStellarLendingController=_.vc;export const getStellarLendingLiveState=_.kq;export const getStellarQuoteTokens=_.CH;export const getStellarReserve=_.FI;export const getStellarReserveGraph=_.KG;export const getStellarReserveHolders=_.nW;export const getStellarReserves=_.jF;export const getStellarSpoke=_.S2;export const getStellarSpokeGraph=_.uS;export const getStellarSpokes=_.u_;export const getStellarUserActivity=_.O5;export const getStellarUserPositions=_.Av;export const mapQuoteResponseToAggregatorSwap=_.LA;export const mapQuoteResponseToStrategyPayload=_.E6;export const mapQuoteResponseToStrategySwap=_.Ds;export const mapSorobanError=_.XV;export const mapStellarPositionActivityType=_.CU;export const prepareStellarBuiltTx=_.Vx;export const prepareStellarTxXdr=_.DL;export const stellarLendingDispatchKey=_.ON;export const stellarLendingRead=_.Hh;export const syntheticEventOrder=_.oV;export const tagStellarInvokedContractError=_.g5;export const toBase64Xdr=_.L;export const toStellarPositionMode=_.Vu;
1
+ "undefined"!=typeof globalThis&&void 0===globalThis.self&&(globalThis.self=globalThis);import{Account as t,Address as e,BASE_FEE as o,Contract as r,ScInt as n,TransactionBuilder as u,scValToNative as i,xdr as s}from"@stellar/stellar-sdk";var a={385(a,p,l){l.d(p,{ME:()=>c,nO:()=>y,G_:()=>pe,DU:()=>d,fA:()=>Io,A$:()=>f,J9:()=>b,hS:()=>m,gR:()=>Oo,Cg:()=>Ro,VZ:()=>Jo,N0:()=>jt,B_:()=>se,eX:()=>Zt,z:()=>Wo,xD:()=>j,jR:()=>H,P2:()=>tr,W6:()=>ie,se:()=>ne,yr:()=>zo,sp:()=>J,Iu:()=>no,yu:()=>ro,$9:()=>Ze,zw:()=>Je,h_:()=>Ye,e_:()=>to,Tk:()=>Qe,BA:()=>Ke,u9:()=>io,bi:()=>uo,gc:()=>oo,ay:()=>eo,SX:()=>zt,UF:()=>Mo,Y5:()=>K,mE:()=>Y,xG:()=>Bt,s9:()=>tt,OL:()=>Dt,k6:()=>we,dj:()=>Te,kD:()=>Me,Yf:()=>Re,c5:()=>ze,N8:()=>qe,qU:()=>Le,RZ:()=>Ne,ni:()=>Ae,hF:()=>We,Qk:()=>Ve,Gw:()=>He,$K:()=>De,uj:()=>ke,Od:()=>_e,X7:()=>Ue,Ub:()=>Fe,Dx:()=>Oe,OA:()=>ve,$U:()=>he,ob:()=>Ee,cY:()=>Se,$l:()=>xe,K:()=>Ie,kw:()=>Pe,VS:()=>Ge,HP:()=>Xe,xQ:()=>so,YQ:()=>je,QY:()=>Be,os:()=>$e,Ko:()=>Ce,IJ:()=>re,nw:()=>Q,Pr:()=>rt,ZE:()=>Z,ev:()=>Wt,P8:()=>Kt,aV:()=>Ft,p2:()=>Ht,Ww:()=>Xt,sV:()=>Jt,XD:()=>ee,Js:()=>Yt,Dy:()=>Qt,FZ:()=>te,Ni:()=>W,v_:()=>V,qD:()=>ot,qR:()=>et,QJ:()=>Vt,bm:()=>Gt,n_:()=>ae,v8:()=>oe,qM:()=>Ct,gH:()=>ue,O3:()=>F,Gz:()=>X,pr:()=>z,Fm:()=>Eo,MB:()=>Rt,Dn:()=>Nt,pq:()=>Ot,ml:()=>$t,Q3:()=>Mt,wf:()=>Go,Um:()=>Uo,xO:()=>qt,Lw:()=>Bo,KM:()=>h,mM:()=>bt,iE:()=>_t,zp:()=>gt,N3:()=>ft,bN:()=>pt,QV:()=>v,T_:()=>Tt,XI:()=>ht,Lt:()=>wt,KK:()=>lt,yl:()=>st,vc:()=>g,kq:()=>at,CH:()=>Do,FI:()=>yt,KG:()=>kt,nW:()=>mt,jF:()=>ct,S2:()=>vt,uS:()=>At,u_:()=>dt,O5:()=>xt,Av:()=>St,LA:()=>Ho,E6:()=>Vo,Ds:()=>jo,XV:()=>or,CU:()=>$o,Vx:()=>Zo,DL:()=>Qo,ON:()=>lo,Hh:()=>Pt,oV:()=>Lo,g5:()=>Xo,L:()=>ao,Vu:()=>Ko});const d={mainnet:process.env.STELLAR_LENDING_CONTROLLER_MAINNET??"",testnet:process.env.STELLAR_LENDING_CONTROLLER_TESTNET??""},c={mainnet:process.env.STELLAR_AGGREGATOR_ROUTER_MAINNET??"",testnet:process.env.STELLAR_AGGREGATOR_ROUTER_TESTNET??""},y={mainnet:process.env.STELLAR_GOVERNANCE_MAINNET??"",testnet:process.env.STELLAR_GOVERNANCE_TESTNET??""},m={mainnet:"https://soroban-rpc.stellar.org",testnet:"https://soroban-testnet.stellar.org"},b={mainnet:process.env.STELLAR_QUOTE_URL_MAINNET??"https://stellar-swap.xoxno.com",testnet:process.env.STELLAR_QUOTE_URL_TESTNET??"https://testnet-stellar-swap.xoxno.com"},f={mainnet:"Public Global Stellar Network ; September 2015",testnet:"Test SDF Network ; September 2015"};function g(t){const e=d[t];if(!e)throw new Error(`Stellar lending controller address not configured for network "${t}". Set STELLAR_LENDING_CONTROLLER_${t.toUpperCase()} env var.`);return e}function h(t){const e=c[t];if(!e)throw new Error(`Stellar aggregator router address not configured for network "${t}". Set STELLAR_AGGREGATOR_ROUTER_${t.toUpperCase()} env var.`);return e}function v(t){const e=y[t];if(!e)throw new Error(`Stellar governance address not configured for network "${t}". Set STELLAR_GOVERNANCE_${t.toUpperCase()} env var.`);return e}const S=["Soroswap","Aquarius","Phoenix","Sushi","CometDex"],x=t=>new e(t).toScVal(),q=t=>new n(t).toI128(),T=t=>s.ScVal.scvU32(t),_=t=>new n("string"==typeof t?t:t.toString()).toU64(),w=t=>s.ScVal.scvBool(t),A=t=>s.ScVal.scvString(t),k=t=>s.ScVal.scvSymbol(t),P=()=>s.ScVal.scvVoid(),I=t=>s.ScVal.scvVec(t),E=(t,e=32)=>{const o=t.startsWith("0x")?t.slice(2):t,r=Buffer.from(o,"hex");if(r.length!==e)throw new Error(`Stellar builder: expected a ${e}-byte BytesN (got ${r.length} bytes from "${t}")`);return s.ScVal.scvBytes(r)},R=(t,e)=>null==t?P():e(t),O=(t,e)=>L({asset:x(e),hub_id:T(t)}),M=(t,e,o)=>s.ScVal.scvVec([O(t,e),q(o)]),U=t=>s.ScVal.scvVec(t.map((t=>M(t.hubId,t.asset,t.amount)))),L=t=>{const e=Object.keys(t).sort().map((e=>new s.ScMapEntry({key:k(e),val:t[e]})));return s.ScVal.scvMap(e)},$=t=>{const e=t.paths.map((t=>{const e=t.hops.map((t=>{return L({amount_out:q(t.amountOut),pool:x(t.pool),token_in:x(t.tokenIn),token_out:x(t.tokenOut),venue:(e=t.venue,s.ScVal.scvVec([k(e)]))});var e}));return L({hops:s.ScVal.scvVec(e),split_ppm:T(t.splitPpm)})}));return L({paths:s.ScVal.scvVec(e),referral_id:_(t.referralId??0),token_in:x(t.tokenIn),token_out:x(t.tokenOut),total_min_out:q(t.totalMinOut)})},N=t=>{const e=Buffer.from(t);if(0===e.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return s.ScVal.scvBytes(e)},C=()=>s.ScVal.scvBytes(Buffer.alloc(0)),B=t=>{const e=t.trim();if(e.startsWith("0x")){const t=e.slice(2);if(!((o=t).length>0&&o.length%2==0&&/^[0-9a-fA-F]+$/.test(o)))throw new Error("Stellar builder: strategy swap bytes hex string must be 0x-prefixed and even-length");return Buffer.from(t,"hex")}var o;if(!/^[A-Za-z0-9+/]+={0,2}$/.test(e))throw new Error("Stellar builder: strategy swap bytes must be base64 routeXdr or 0x-prefixed hex");const r=Buffer.from(e,"base64");if(0===r.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return r},D=t=>{if("string"==typeof t)return N(B(t));if(t instanceof Uint8Array)return 0===t.length?C():N(t);if(t&&"object"==typeof t)return"routeXdr"in(o=t)&&"string"==typeof o.routeXdr?N(B(t.routeXdr)):(t=>"swapXdr"in t&&"string"==typeof t.swapXdr)(t)?N(B(t.swapXdr)):(t=>"bytes"in t&&("string"==typeof t.bytes||t.bytes instanceof Uint8Array))(t)?"string"==typeof t.bytes?N(B(t.bytes)):0===t.bytes.length?C():N(t.bytes):(e=(t=>{if(!t||"object"!=typeof t)throw new Error("Stellar builder: decoded strategy `steps` must be a StrategyPayload ({ paths, tokenIn, tokenOut, totalMinOut })");const e=t;if(!Array.isArray(e.paths)||0===e.paths.length)throw new Error("Stellar builder: `steps.paths` must be a non-empty array of strategy paths");if("string"!=typeof e.tokenIn)throw new Error("Stellar builder: `steps.tokenIn` must be a contract address");if("string"!=typeof e.tokenOut)throw new Error("Stellar builder: `steps.tokenOut` must be a contract address");if("string"!=typeof e.totalMinOut)throw new Error("Stellar builder: `steps.totalMinOut` must be an i128 decimal string");let o=0;for(const[t,r]of e.paths.entries()){if(!r||"number"!=typeof r.splitPpm||r.splitPpm<=0||!Array.isArray(r.hops)||0===r.hops.length)throw new Error(`Stellar builder: \`steps.paths[${t}]\` must have splitPpm > 0 and a non-empty hops array`);o+=r.splitPpm;for(const[e,o]of r.hops.entries())if(!o||"string"!=typeof o.amountOut||"string"!=typeof o.pool||"string"!=typeof o.tokenIn||"string"!=typeof o.tokenOut||!S.includes(o.venue))throw new Error(`Stellar builder: \`steps.paths[${t}].hops[${e}]\` must have amountOut, pool, tokenIn, tokenOut, and a valid Soroban venue`)}if(1e6!==o)throw new Error(`Stellar builder: \`steps.paths[].splitPpm\` must sum to 1_000_000, got ${o}`);return e})(t),s.ScVal.scvBytes(Buffer.from($(e).toXDR("base64"),"base64")));var e,o;throw new Error("Stellar builder: `steps` must be opaque strategy bytes (`routeXdr`, base64/hex string, or Uint8Array)")},G=t=>{if("string"==typeof t)return(t=>{const e=t.startsWith("0x")?t.slice(2):t,o=Buffer.from(e,"hex");return s.ScVal.scvBytes(o)})(t);if(t instanceof Uint8Array)return s.ScVal.scvBytes(Buffer.from(t));throw new Error("Stellar builder: `data` must be a hex string or Uint8Array (Soroban Bytes payload)")};function z(e,n,i){const s=e.controllerAddress??g(e.network),a=new r(s),p=new t(e.caller,e.sourceSequence);return{xdr:new u(p,{fee:e.fee??o,networkPassphrase:f[e.network]}).addOperation(a.call(n,...i)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function W(t,e){const o=e.accountNonce??0,r=e.spokeId??0;return z(t,"supply",[x(t.caller),_(o),T(r),U([...e.assets])])}function V(t,e){return W(t,{accountNonce:e.accountNonce,spokeId:e.spokeId,assets:[{hubId:e.hubId,asset:e.asset,amount:e.amount}]})}function j(t,e){return z(t,"borrow",[x(t.caller),_(e.accountNonce),U([...e.borrows]),R(e.to,x)])}function H(t,e){return j(t,{accountNonce:e.accountNonce,borrows:[{hubId:e.hubId,asset:e.asset,amount:e.amount}],to:e.to})}function F(t,e){return z(t,"withdraw",[x(t.caller),_(e.accountNonce),U([...e.withdrawals]),R(e.to,x)])}function X(t,e){return F(t,{accountNonce:e.accountNonce,withdrawals:[{hubId:e.hubId,asset:e.asset,amount:e.amount}],to:e.to})}function Q(t,e){return z(t,"repay",[x(t.caller),_(e.accountNonce),U([...e.payments])])}function Z(t,e){return Q(t,{accountNonce:e.accountNonce,payments:[{hubId:e.hubId,asset:e.asset,amount:e.amount}]})}function K(t,e){return z(t,"liquidate",[x(t.caller),_(e.accountNonce),U([...e.debtPayments])])}function J(t,e){return z(t,"flash_loan",[x(t.caller),O(e.hubId,e.asset),q(e.amount),x(e.receiver),G(e.data)])}function Y(t,e){return z(t,"migrate_from_blend",[x(t.caller),_(e.accountId),T(e.spokeId),T(e.hubId),x(e.blendPool),I(e.collateralTokens.map(x)),I(e.supplyTokens.map(x)),(o=e.debtCaps.map((t=>({token:t.token,amount:t.cap}))),s.ScVal.scvVec(o.map((t=>{return e=t.token,o=t.amount,s.ScVal.scvVec([x(e),q(o)]);var e,o}))))]);var o}function tt(t,e){const o=e.accountNonce??0,r=e.spokeId??0;return z(t,"multiply",[x(t.caller),_(o),T(r),O(e.collateral.hubId,e.collateral.asset),q(e.debtToFlashLoan),O(e.debt.hubId,e.debt.asset),T(e.mode),D(e.steps),R(e.initialPayment,(t=>M(t.hubId,t.asset,t.amount))),R(e.convertSwap,D)])}function et(t,e){return z(t,"swap_debt",[x(t.caller),_(e.accountNonce),O(e.existingDebt.hubId,e.existingDebt.asset),q(e.newDebtAmount),O(e.newDebt.hubId,e.newDebt.asset),D(e.steps)])}function ot(t,e){return z(t,"swap_collateral",[x(t.caller),_(e.accountNonce),O(e.current.hubId,e.current.asset),q(e.fromAmount),O(e.newCollateral.hubId,e.newCollateral.asset),D(e.steps)])}function rt(t,e){return z(t,"repay_debt_with_collateral",[x(t.caller),_(e.accountNonce),O(e.collateral.hubId,e.collateral.asset),q(e.collateralAmount),O(e.debt.hubId,e.debt.asset),D(e.steps),w(e.closePosition)])}const nt="/stellar-lending",ut=25,it=encodeURIComponent,st=(t,e)=>t.fetchWithTimeout(`${nt}/context`,e),at=(t,e)=>t.fetchWithTimeout(`${nt}/live-state`,e),pt=(t,e)=>t.fetchWithTimeout(`${nt}/assets`,e),lt=(t,e)=>t.fetchWithTimeout(`${nt}/hubs`,e),dt=(t,e)=>t.fetchWithTimeout(`${nt}/spokes`,e),ct=(t,e={},o)=>{const{hubId:r,spokeId:n,asset:u}=e;return t.fetchWithTimeout(`${nt}/reserves`,{...o,params:{...void 0!==r?{hubId:r}:{},...void 0!==n?{spokeId:n}:{},...u?{asset:u}:{}}})},yt=(t,e,o,r,n)=>t.fetchWithTimeout(`${nt}/reserves/${e}/${o}/${it(r)}`,n),mt=(t,e,o,r,n,u)=>t.fetchWithTimeout(`${nt}/reserves/${e}/${o}/${it(r)}/holders`,{...u,params:{side:n}}),bt=(t,e,o)=>t.fetchWithTimeout(`${nt}/assets/${it(e)}`,o),ft=(t,e,o,r)=>t.fetchWithTimeout(`${nt}/assets/${it(e)}/page`,{...r,params:{...o}}),gt=(t,e,o,r)=>t.fetchWithTimeout(`${nt}/assets/${it(e)}/markets`,{...r,params:{side:o}}),ht=(t,e,o)=>t.fetchWithTimeout(`${nt}/hubs/${e}`,o),vt=(t,e,o)=>t.fetchWithTimeout(`${nt}/spokes/${e}`,o),St=(t,e,o)=>t.fetchWithTimeout(`${nt}/users/${it(e)}/positions`,o),xt=(t,e,o={},r)=>{const{skip:n,top:u}=o;return t.fetchWithTimeout(`${nt}/users/${it(e)}/activity`,{...r,params:{...void 0!==n?{skip:n}:{},...void 0!==u?{top:u}:{}}})},qt=(t,e,o)=>t.fetchWithTimeout(`${nt}/accounts/${it(e)}/positions`,o),Tt=(t,e={},o)=>{const{top:r=ut,continuationToken:n}=e;return t.fetchWithTimeout(`${nt}/governance/proposals`,{...o,params:{top:r,...n?{continuationToken:n}:{}}})},_t=(t,e,o,r)=>t.fetchWithTimeout(`${nt}/assets/${it(e)}/graph`,{...r,params:{...o}}),wt=(t,e,o,r)=>t.fetchWithTimeout(`${nt}/hubs/${e}/graph`,{...r,params:{...o}}),At=(t,e,o,r)=>t.fetchWithTimeout(`${nt}/spokes/${e}/graph`,{...r,params:{...o}}),kt=(t,e,o,r,n,u)=>t.fetchWithTimeout(`${nt}/reserves/${e}/${o}/${it(r)}/graph`,{...u,params:{...n}}),Pt=t=>({context:e=>st(t,e),liveState:e=>at(t,e),assets:e=>pt(t,e),hubs:e=>lt(t,e),spokes:e=>dt(t,e),reserves:(e,o)=>{return void 0===(r=e)||"hubId"in r||"spokeId"in r||"asset"in r?ct(t,e,o):ct(t,{},e);var r},reserve:(e,o,r,n)=>yt(t,e,o,r,n),reserveHolders:(e,o,r,n,u)=>mt(t,e,o,r,n,u),asset:(e,o)=>bt(t,e,o),assetMarkets:(e,o,r)=>gt(t,e,o,r),hub:(e,o)=>ht(t,e,o),spoke:(e,o)=>vt(t,e,o),userPositions:(e,o)=>St(t,e,o),userActivity:(e,o,r)=>xt(t,e,o,r),accountPositions:(e,o)=>qt(t,e,o),governanceProposals:(e,o)=>Tt(t,e,o),assetGraph:(e,o,r)=>_t(t,e,o,r),hubGraph:(e,o,r)=>wt(t,e,o,r),spokeGraph:(e,o,r)=>At(t,e,o,r),reserveGraph:(e,o,r,n,u)=>kt(t,e,o,r,n,u)}),It={Single:0,PrimaryWithAnchor:1},Et="RedStonePriceFeed",Rt=t=>L({base_borrow_rate:q(t.baseBorrowRateRay),max_borrow_rate:q(t.maxBorrowRateRay),max_utilization:q(t.maxUtilizationRay),mid_utilization:q(t.midUtilizationRay),optimal_utilization:q(t.optimalUtilizationRay),reserve_factor:T(t.reserveFactorBps),slope1:q(t.slope1Ray),slope2:q(t.slope2Ray),slope3:q(t.slope3Ray)}),Ot=t=>L({asset_decimals:T(t.assetDecimals),asset_id:x(t.assetId),base_borrow_rate:q(t.baseBorrowRateRay),flashloan_fee:T(t.flashloanFeeBps),is_flashloanable:w(t.isFlashloanable),max_borrow_rate:q(t.maxBorrowRateRay),max_utilization:q(t.maxUtilizationRay),mid_utilization:q(t.midUtilizationRay),optimal_utilization:q(t.optimalUtilizationRay),reserve_factor:T(t.reserveFactorBps),slope1:q(t.slope1Ray),slope2:q(t.slope2Ray),slope3:q(t.slope3Ray)}),Mt=t=>L({max_borrow_positions:T(t.maxBorrowPositions),max_supply_positions:T(t.maxSupplyPositions)}),Ut=t=>{const e=t.kind;switch(e){case"Stellar":return I([k("Stellar"),x(t.value)]);case"Symbol":return I([k("Symbol"),k(t.value)]);case"String":return I([k("String"),A(t.value)]);default:throw new Error(`Stellar builder: unknown oracle asset ref kind "${e}"`)}},Lt=(t,e)=>{if("Twap"===t){if("number"!=typeof e)throw new Error("Stellar builder: oracle source with Twap read mode requires `twapRecords`");return I([k("Twap"),T(e)])}return I([k("Spot")])},$t=t=>{const e=t.provider;if("ReflectorSep40"===e){if(!t.asset)throw new Error("Stellar builder: Reflector oracle source requires `asset`");return I([k("Reflector"),L({asset:Ut(t.asset),contract:x(t.contract),read_mode:Lt(t.readMode,t.twapRecords)})])}if(e===Et||"XoxnoPriceFeed"===e){const o=e===Et?"RedStone":"Xoxno";if("string"!=typeof t.feedId)throw new Error(`Stellar builder: ${o} oracle source requires \`feedId\``);if("number"!=typeof t.maxStaleSeconds)throw new Error(`Stellar builder: ${o} oracle source requires \`maxStaleSeconds\``);return I([k(o),L({contract:x(t.contract),feed_id:A(t.feedId),max_stale_seconds:_(t.maxStaleSeconds)})])}throw new Error(`Stellar builder: unknown oracle provider "${e}"`)},Nt=t=>{const e=It[t.strategy];if(void 0===e)throw new Error(`Stellar builder: unknown oracle strategy "${t.strategy}"`);return L({anchor:(o=t.anchor,I(null==o?[k("None")]:[k("Some"),$t(o)])),max_price_stale_seconds:_(t.maxPriceStaleSeconds),max_sanity_price_wad:q(t.maxSanityPriceWad),min_sanity_price_wad:q(t.minSanityPriceWad),primary:$t(t.primary),strategy:T(e),tolerance_bps:T(t.toleranceBps)});var o};function Ct(t,e){return z(t,"upgrade",[E(e.wasmHash)])}function Bt(t,e){return z(t,"migrate",[T(e.newVersion)])}function Dt(t){return z(t,"pause",[])}function Gt(t){return z(t,"unpause",[])}function zt(t,e){return z(t,"grant_role",[x(e.account),k(e.role)])}function Wt(t,e){return z(t,"revoke_role",[x(e.account),k(e.role)])}function Vt(t,e){return z(t,"transfer_ownership",[x(e.newOwner),T(e.liveUntilLedger)])}function jt(t){return z(t,"accept_ownership",[])}function Ht(t,e){return z(t,"set_aggregator",[x(e.aggregator)])}function Ft(t,e){return z(t,"set_accumulator",[x(e.accumulator)])}function Xt(t,e){return z(t,"set_liquidity_pool_template",[E(e.wasmHash)])}function Qt(t,e){return z(t,"set_position_limits",[Mt(e)])}function Zt(t,e){return z(t,"approve_token",[x(e.token)])}function Kt(t,e){return z(t,"revoke_token",[x(e.token)])}function Jt(t,e){return z(t,"set_market_oracle_config",[O(e.hubId,e.asset),Nt(e.config)])}function Yt(t,e){return z(t,"set_oracle_tolerance",[x(e.asset),L({lower_ratio_bps:T(e.lowerRatioBps),upper_ratio_bps:T(e.upperRatioBps)})])}function te(t,e){return z(t,"set_spoke_asset_flags",[T(e.spokeId),O(e.hubId,e.asset),w(e.paused),w(e.frozen)])}function ee(t,e){return z(t,"set_oracle_sanity_bounds",[x(e.asset),q(e.minPriceWad),q(e.maxPriceWad)])}function oe(t,e){return z(t,"update_indexes",[x(t.caller),I(e.assets.map((t=>O(t.hubId,t.asset))))])}function re(t,e){return z(t,"renew_account",[x(t.caller),_(e.accountNonce)])}function ne(t,e){return z(t,"create_liquidity_pool",[T(e.hubId),x(e.asset),Ot(e.params)])}function ue(t,e){return z(t,"upgrade_liquidity_pool_params",[O(e.hubId,e.asset),Rt(e.params)])}function ie(t,e){return z(t,"claim_revenue",[x(t.caller),I(e.assets.map((t=>O(t.hubId,t.asset))))])}function se(t,e){return z(t,"add_rewards",[x(t.caller),U(e.rewards)])}function ae(t,e){return z(t,"update_account_threshold",[x(t.caller),w(e.hasRisks),I(e.accountNonces.map((t=>_(t))))])}const pe="00".repeat(32),le=t=>{if("string"==typeof t)return E(t);const e=Buffer.from(t);if(32!==e.length)throw new Error(`Stellar governance builder: expected a 32-byte salt (got ${e.length} bytes)`);return s.ScVal.scvBytes(e)},de=(t,...e)=>I([k(t),...e]),ce=t=>L({new_owner:x(t.newOwner),live_until_ledger:T(t.liveUntilLedger)}),ye=t=>L({asset:x(t.asset),bonus:T(t.bonus),borrow_cap:q(t.borrowCap),can_borrow:w(t.canBorrow),can_collateral:w(t.canCollateral),frozen:w(t.frozen),hub_id:T(t.hubId),paused:w(t.paused),liquidation_fees:T(t.liquidationFees),ltv:T(t.ltv),oracle_override:I([k("None")]),spoke_id:T(t.spokeId),supply_cap:q(t.supplyCap),threshold:T(t.threshold)}),me=t=>L({account:x(t.account),role:k(t.role)});function be(e,n,i){const s=e.governanceAddress??v(e.network),a=new r(s),p=new t(e.caller,e.sourceSequence);return{xdr:new u(p,{fee:e.fee??o,networkPassphrase:f[e.network]}).addOperation(a.call(n,...i)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}const fe=(t,e,o)=>be(t,"propose",[x(t.caller),e,le(o)]),ge=(t,e,o)=>be(t,"execute_self",[P(),e,le(o)]);function he(t,e,o){return fe(t,de("SetAggregator",x(e.aggregator)),o)}function ve(t,e,o){return fe(t,de("SetAccumulator",x(e.accumulator)),o)}function Se(t,e,o){return fe(t,de("SetLiquidityPoolTemplate",E(e.wasmHash)),o)}function xe(t,e,o){return fe(t,de("SetPositionLimits",Mt(e)),o)}function qe(t,e){return fe(t,de("CreateHub"),e)}function Te(t,e){return fe(t,de("AddSpoke"),e)}function _e(t,e,o){return fe(t,de("RemoveSpoke",T(e.spokeId)),o)}function we(t,e,o){return fe(t,de("AddAssetToSpoke",ye(e)),o)}function Ae(t,e,o){return fe(t,de("EditAssetInSpoke",ye(e)),o)}function ke(t,e,o){return fe(t,de("RemoveAssetFromSpoke",L({hub_asset:O((r=e).hubId,r.asset),spoke_id:T(r.spokeId)})),o);var r}function Pe(t,e,o){return fe(t,de("SetSpokeLiquidationCurve",L({hf_for_max_bonus_wad:q((r=e).hfForMaxBonusWad),liquidation_bonus_factor_bps:T(r.liquidationBonusFactorBps),spoke_id:T(r.spokeId),target_hf_wad:q(r.targetHfWad)})),o);var r}function Ie(t,e,o){return fe(t,de("SetPositionManager",x(e.manager),w(e.isActive)),o)}function Ee(t,e,o){return fe(t,de("SetMinBorrowCollateralUsd",q(e.floorWad)),o)}function Re(t,e,o){return fe(t,de("ApproveToken",x(e.token)),o)}function Oe(t,e,o){return fe(t,de("RevokeToken",x(e.token)),o)}function Me(t,e,o){return fe(t,de("ApproveBlendPool",x(e.pool)),o)}function Ue(t,e,o){return fe(t,de("RevokeBlendPool",x(e.pool)),o)}function Le(t,e,o){return fe(t,de("CreateLiquidityPool",L({asset:x((r=e).asset),hub_id:T(r.hubId),params:Ot(r.params)})),o);var r}function $e(t,e,o){return fe(t,de("UpgradeLiquidityPoolParams",L({hub_asset:O((r=e).hubId,r.asset),params:Rt(r.params)})),o);var r}function Ne(t,e){return fe(t,de("DeployPool"),e)}function Ce(t,e,o){return fe(t,de("UpgradePool",E(e.wasmHash)),o)}function Be(t,e,o){return fe(t,de("UpgradeController",E(e.wasmHash)),o)}function De(t,e,o){return fe(t,de("MigrateController",T(e.newVersion)),o)}function Ge(t,e,o){return fe(t,de("TransferCtrlOwnership",ce(e)),o)}function ze(t,e,o){return fe(t,de("ConfigureMarketOracle",L({cfg:Nt((r=e).config),hub_asset:O(r.hubId,r.asset)})),o);var r}function We(t,e,o){return fe(t,de("EditOracleTolerance",L({asset:x((r=e).asset),tolerance:T(r.tolerance)})),o);var r}function Ve(t,e,o){return fe(t,de("UpgradeGov",E(e.wasmHash)),o)}function je(t,e,o){return fe(t,de("UpdateGovDelay",T(e.newDelay)),o)}function He(t,e,o){return fe(t,de("GrantGovRole",me(e)),o)}function Fe(t,e,o){return fe(t,de("RevokeGovRole",me(e)),o)}function Xe(t,e,o){return fe(t,de("TransferGovOwnership",ce(e)),o)}function Qe(t,e){const o=I(e.argsXdr.map((t=>s.ScVal.fromXDR(t,"base64")))),r=le(e.predecessor??pe);return be(t,"execute",[P(),x(e.target),k(e.functionName),o,r,le(e.salt)])}function Ze(t,e,o){return ge(t,de("UpgradeGov",E(e.wasmHash)),o)}function Ke(t,e,o){return ge(t,de("UpdateGovDelay",T(e.newDelay)),o)}function Je(t,e,o){return ge(t,de("GrantGovRole",me(e)),o)}function Ye(t,e,o){return ge(t,de("RevokeGovRole",me(e)),o)}function to(t,e,o){return ge(t,de("TransferGovOwnership",ce(e)),o)}function eo(t,e){return be(t,"set_spoke_asset_flags",[x(t.caller),T(e.spokeId),O(e.hubId,e.asset),w(e.paused),w(e.frozen)])}function oo(t,e){return be(t,"set_oracle_sanity_bounds",[x(t.caller),x(e.asset),q(e.minPriceWad),q(e.maxPriceWad)])}function ro(t){return be(t,"create_hub",[x(t.caller)])}function no(t){return be(t,"add_spoke",[x(t.caller)])}function uo(t,e){return be(t,"revoke_role_immediate",[x(e.account),k(e.role)])}function io(t){return be(t,"pause",[x(t.caller)])}function so(t,e){return fe(t,de("Unpause"),e)}const ao=t=>t.toXDR("base64"),po=t=>s.ScVal.fromXDR(t,"base64"),lo=t=>t.map((t=>String(i(po(t))))).join(":"),co=t=>"bigint"==typeof t||"number"==typeof t?t.toString():String(t),yo=t=>Number(t),mo=t=>String(t),bo=t=>null==t?void 0:co(t),fo=t=>null==t?void 0:mo(t),go=t=>t instanceof Uint8Array?Buffer.from(t).toString("hex"):Buffer.isBuffer(t)?t.toString("hex"):String(t),ho=["None","Multiply","Long","Short"],vo=["Single","PrimaryWithAnchor"],So=["ReflectorSep40","RedStonePriceFeed"],xo=["Spot","Twap"],qo=["supply","borrow","withdraw","repay","liq_repay","liq_seize","multiply","param_upd","sw_debt_r","sw_col_wd","rp_col_wd","rp_col_r","close_wd"],To=t=>Array.isArray(t)?t:[],_o=(t,e)=>{const o="Borrow"===e;return{action:(r=t[0],qo[yo(r)]??co(r)),positionType:e,hubId:yo(t[1]),asset:mo(t[2]),scaledAmountRay:co(t[3]),indexRay:co(t[4]),amount:co(t[5]),liquidationThresholdBps:o?void 0:yo(t[6]),liquidationBonusBps:o?void 0:yo(t[7]),loanToValueBps:o?void 0:yo(t[8]),liquidationFeesBps:o?void 0:yo(t[9])};var r},wo=t=>{return{owner:mo(t[0]),spokeId:yo(t[1]),mode:(e=t[2],ho[yo(e)]??"None")};var e},Ao=(t,e)=>{const o=xo[yo(t[`${e}_read_mode`])]??"Spot",r=t[`${e}_asset`],n=t[`${e}_symbol`],u=null!=r?{kind:"Stellar",value:mo(r)}:null!=n?{kind:"Symbol",value:mo(n)}:void 0;return{provider:So[yo(t[`${e}_provider`])]??"ReflectorSep40",contractAddress:mo(t[`${e}_contract`]),asset:u,feedId:fo(t[`${e}_feed_id`]),readMode:o,twapRecords:"Twap"===o?yo(t[`${e}_twap_records`]):void 0,decimals:yo(t[`${e}_decimals`]),resolutionSeconds:yo(t[`${e}_resolution_seconds`]),maxStaleSeconds:yo(t[`${e}_max_stale_seconds`])}},ko=t=>{const e=null!==t.anchor_provider&&void 0!==t.anchor_provider;return{baseTokenId:mo(t.base_token_id),quoteTokenId:mo(t.quote_token_id),tolerance:{upperRatio:yo(t.upper_ratio_bps??t.tolerance?.upper_ratio_bps),lowerRatio:yo(t.lower_ratio_bps??t.tolerance?.lower_ratio_bps)},assetDecimals:yo(t.asset_decimals),maxPriceStaleSeconds:yo(t.max_price_stale_seconds),strategy:vo[yo(t.strategy)]??"Single",primary:Ao(t,"primary"),anchor:e?Ao(t,"anchor"):void 0,primaryQuoteToken:fo(t.primary_quote_token),anchorQuoteToken:fo(t.anchor_quote_token),minSanityPriceWad:bo(t.min_sanity_price_wad),maxSanityPriceWad:bo(t.max_sanity_price_wad)}},Po={"market:create":t=>({topic:"market:create",data:{hubId:yo(t.hub_id),baseAsset:mo(t.base_asset),maxBorrowRate:co(t.max_borrow_rate),baseBorrowRate:co(t.base_borrow_rate),slope1:co(t.slope1),slope2:co(t.slope2),slope3:co(t.slope3),midUtilization:co(t.mid_utilization),optimalUtilization:co(t.optimal_utilization),maxUtilization:co(t.max_utilization),reserveFactor:yo(t.reserve_factor),marketAddress:mo(t.market_address)}}),"market:params_update":t=>({topic:"market:params_update",data:{asset:mo(t.asset),maxBorrowRateRay:co(t.max_borrow_rate),baseBorrowRateRay:co(t.base_borrow_rate),slope1Ray:co(t.slope1),slope2Ray:co(t.slope2),slope3Ray:co(t.slope3),midUtilizationRay:co(t.mid_utilization),optimalUtilizationRay:co(t.optimal_utilization),maxUtilizationRay:co(t.max_utilization),reserveFactorBps:yo(t.reserve_factor)}}),"market:batch_state_update":t=>({topic:"market:batch_state_update",data:{updates:To(t).map((t=>{return e=To(t),{hubId:yo(e[0]),asset:mo(e[1]),timestamp:yo(e[2]),supplyIndexRay:co(e[3]),borrowIndexRay:co(e[4]),cash:co(e[5]),suppliedRay:co(e[6]),borrowedRay:co(e[7]),revenueRay:co(e[8])};var e}))}}),"market:batch_params_update":t=>({topic:"market:batch_params_update",data:{updates:To(t).map((t=>{const e=t;return{hubId:yo(e.hub_id),asset:mo(e.asset),params:(o=e.params,{maxBorrowRateRay:co(o.max_borrow_rate),baseBorrowRateRay:co(o.base_borrow_rate),slope1Ray:co(o.slope1),slope2Ray:co(o.slope2),slope3Ray:co(o.slope3),midUtilizationRay:co(o.mid_utilization),optimalUtilizationRay:co(o.optimal_utilization),maxUtilizationRay:co(o.max_utilization),reserveFactorBps:yo(o.reserve_factor),isFlashloanable:Boolean(o.is_flashloanable),flashloanFeeBps:yo(o.flashloan_fee),assetId:mo(o.asset_id),assetDecimals:yo(o.asset_decimals)})};var o}))}}),"position:batch_update":t=>{const e=To(t);return{topic:"position:batch_update",data:{accountId:co(e[0]),accountAttributes:wo(To(e[1])),updates:[...To(e[2]).map((t=>_o(To(t),"Deposit"))),...To(e[3]).map((t=>_o(To(t),"Borrow")))]}}},"position:flash_loan":t=>({topic:"position:flash_loan",data:{hubId:yo(t.hub_id),asset:mo(t.asset),receiver:mo(t.receiver),caller:mo(t.caller),amount:co(t.amount),fee:co(t.fee)}}),"config:oracle":t=>({topic:"config:oracle",data:{asset:mo(t.asset),oracle:ko(t.oracle)}}),"position:liquidation":t=>({topic:"position:liquidation",data:{liquidator:mo(t.liquidator),accountId:co(t.account_id),repaidUsdWad:co(t.repaid_usd_wad),bonusBps:co(t.bonus_bps)}}),"debt:bad_debt":t=>({topic:"debt:bad_debt",data:{accountId:co(t.account_id),totalBorrowUsdWad:co(t.total_borrow_usd_wad),totalCollateralUsdWad:co(t.total_collateral_usd_wad)}}),"strategy:initial_payment":t=>({topic:"strategy:initial_payment",data:{token:mo(t.token),amount:co(t.amount),usdValueWad:co(t.usd_value_wad),accountId:co(t.account_id)}}),"strategy:fee":t=>({topic:"strategy:fee",data:{hubId:yo(t.hub_id),asset:mo(t.asset),amount:co(t.amount),fee:co(t.fee),amountSent:co(t.amount_sent)}}),"config:approve_token":t=>({topic:"config:approve_token",data:{wasmHash:go(t.wasm_hash),approved:Boolean(t.approved)}}),"config:aggregator":t=>({topic:"config:aggregator",data:{aggregator:mo(t.aggregator)}}),"config:accumulator":t=>({topic:"config:accumulator",data:{accumulator:mo(t.accumulator)}}),"config:pool_template":t=>({topic:"config:pool_template",data:{wasmHash:go(t.wasm_hash)}}),"config:position_limits":t=>({topic:"config:position_limits",data:{maxSupplyPositions:yo(t.max_supply_positions),maxBorrowPositions:yo(t.max_borrow_positions)}}),"config:oracle_disabled":t=>({topic:"config:oracle_disabled",data:{asset:mo(t.asset)}}),"config:spoke":t=>{const e=t.spoke;return{topic:"config:spoke",data:{spokeId:yo(e.spoke_id),isDeprecated:Boolean(e.is_deprecated),liquidationTargetHfWad:co(e.liquidation_target_hf_wad),healthFactorForMaxBonusWad:co(e.hf_for_max_bonus_wad),liquidationBonusFactorBps:yo(e.liquidation_bonus_factor_bps)}}}},Io=Object.freeze(Object.keys(Po));function Eo(t,e){const o=lo(t),r=Po[o];return r?r(i(po(e))):null}const Ro="XLENDXLM-a7c9f3",Oo=1e4;function Mo(t){const e=BigInt(t).toString(16),o=e.length%2==0?e:`0${e}`;return`${Ro}-${o}`}function Uo(t){const e=t.split("-");return e.length>=2&&parseInt(e[1],10)||0}function Lo(t,e=0){return t*Oo+e}function $o(t){switch(t){case"liq_repay":return"lendingLiquidateRepayDebt";case"liq_seize":return"lendingLiquidateSeizeCollateral";case"param_upd":return"lendingUpdateAccountParameters";default:return"lendingUpdateAccountPosition"}}const No=(t,e,o)=>{const r=new URL(e,t.endsWith("/")?t:`${t}/`);if(o)for(const[t,e]of Object.entries(o))void 0!==e&&r.searchParams.set(t,String(e));return r.toString()},Co=t=>t.baseUrl??b[t.network];async function Bo(t,e){if(null==t.amountIn==(null==t.amountOut))throw new Error("getStellarAggregatorQuote: exactly one of `amountIn` or `amountOut` must be provided");const o=No(Co(e),"api/v1/quote",{from:t.from,to:t.to,amountIn:t.amountIn,amountOut:t.amountOut,maxHops:t.maxHops,maxSplits:t.maxSplits,slippage:t.slippage,includePaths:t.includePaths,sender:t.sender,router:t.router,platform:t.platform,fresh:t.fresh}),r=await fetch(o,e.fetchOptions);if(!r.ok){const t=await r.text().catch((()=>""));throw new Error(`Stellar quote server responded ${r.status} ${r.statusText} for ${o} — ${t}`)}return await r.json()}async function Do(t){const e=No(Co(t),"api/v1/tokens"),o=await fetch(e,t.fetchOptions);if(!o.ok){const t=await o.text().catch((()=>""));throw new Error(`Stellar quote server responded ${o.status} ${o.statusText} for ${e} — ${t}`)}return await o.json()}const Go=t=>$(t).toXDR("base64");function zo(e,n){const i=e.routerAddress??h(e.network),s=new r(i),a=new t(e.caller,e.sourceSequence),p=D(((t,e)=>(t=>Boolean(t&&"object"==typeof t&&!(t instanceof Uint8Array)&&"paths"in t))(t)&&void 0===t.referralId?{...t,referralId:e??0}:t)(n,e.referralId));return{xdr:new u(a,{fee:e.fee??o,networkPassphrase:f[e.network]}).addOperation(s.call("execute_strategy",x(e.caller),q(e.totalIn),p)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function Wo(t,e){return zo(t,e)}function Vo(t,e={}){if("string"!=typeof t.amountOutMin)throw new Error("mapQuoteResponseToStrategyPayload: quote response is missing `amountOutMin`. Pass `slippage` when fetching the quote.");return{paths:t.paths?t.paths.map((t=>({hops:t.swaps.map(Fo),splitPpm:t.splitPpm}))):[{hops:t.hops.map(Fo),splitPpm:1e6}],referralId:e.referralId??0,tokenIn:t.from,tokenOut:t.to,totalMinOut:t.amountOutMin}}function jo(t,e={}){const o=t;return"string"==typeof o.routeXdr&&o.routeXdr.length>0?{routeXdr:o.routeXdr}:Vo(t,e)}const Ho=Vo,Fo=t=>({amountOut:t.amountOut,pool:t.address,tokenIn:t.from,tokenOut:t.to,venue:t.dex});function Xo(t,e){const o=e instanceof Error?e.message:String(e);return new Error(`[xoxno-invoked:${t}] ${o}`)}async function Qo(t,e,o){const r=u.fromXDR(e,"base64");try{return(await t.prepareTransaction(r)).toXDR()}catch(t){if(o?.invokedContractId)throw Xo(o.invokedContractId,t);throw t}}async function Zo(t,e,o){return Qo(t,e.xdr,o)}function Ko(t){if(t<=0||t>4)throw new Error(`Invalid PositionMode ${t} for Stellar — expected 1 (Normal) through 4 (Short). "None" (0) has no Stellar equivalent.`);return t-1}function Jo(t,e){return new Uint8Array(0)}const Yo=t=>{const e=t.startsWith("0x")?t.slice(2):t;if(e.length%2!=0)throw new Error("buildStellarCctpForwardTx: hex input must have even length");return Buffer.from(e,"hex")};function tr(e){const o=new t(e.caller,e.sourceSequence),n=new r(e.forwarderAddress).call("mint_and_forward",s.ScVal.scvBytes(Yo(e.message)),s.ScVal.scvBytes(Yo(e.attestation)));return{xdr:new u(o,{fee:e.fee??"10000000",networkPassphrase:f[e.network]}).addOperation(n).setTimeout(e.timeoutSeconds??120).build().toXDR()}}const er={1:{name:"AssetNotSupported",message:"This asset is not supported by the protocol."},2:{name:"AssetAlreadySupported",message:"This asset is already supported."},3:{name:"InvalidTicker",message:"Invalid asset ticker."},6:{name:"InvalidAsset",message:"Invalid asset address."},10:{name:"InvalidPoolTemplate",message:"The liquidity pool template hash is invalid."},11:{name:"InvalidExchangeSrc",message:"The oracle configuration is invalid."},12:{name:"PairNotActive",message:"No oracle is configured for this asset."},32:{name:"OwnerNotSet",message:"The contract owner has not been set."},39:{name:"InvalidTimelockDelay",message:"The timelock delay is out of the allowed range."},41:{name:"InvalidRole",message:"The caller does not hold the required role."},43:{name:"HubNotActive",message:"This hub is not active."},44:{name:"NotAuthorized",message:"The caller is not authorized to perform this action."},46:{name:"OperationNotCancellable",message:"This governance operation cannot be cancelled."},113:{name:"InvalidLiqThreshold",message:"LTV, liquidation threshold, or bonus is out of bounds."},116:{name:"InvalidBorrowParams",message:"Supply or borrow cap configuration is invalid."},117:{name:"InvalidUtilRange",message:"Interest-rate utilization breakpoints are invalid."},132:{name:"AssetDecimalsTooHigh",message:"Asset decimals exceed the protocol maximum (27)."},300:{name:"SpokeNotFound",message:"This spoke does not exist."},301:{name:"SpokeDeprecated",message:"This spoke has been deprecated."},307:{name:"AssetNotInSpoke",message:"This asset is not listed on the spoke."},308:{name:"AssetAlreadyInSpoke",message:"This asset is already listed in the spoke."},309:{name:"SpokeAssetInUse",message:"This spoke asset still has live positions; drain usage before removal."},315:{name:"SpokeAssetPaused",message:"This spoke asset is paused."},316:{name:"SpokeAssetFrozen",message:"This spoke asset is frozen."},317:{name:"SpokeAssetFlagRelaxation",message:"Guardian flag updates may only tighten; clearing a flag requires the timelocked edit."},220:{name:"InvalidOracleBase",message:"The oracle quote asset/market is missing or invalid."},221:{name:"InvalidOracleDecimals",message:"The oracle decimals value is invalid."},224:{name:"InvalidSanityBounds",message:"Oracle sanity bounds are invalid (require 0 < min < max)."},225:{name:"OracleCycleDetected",message:"A cycle was detected in the oracle quote chain."}};function or(t){const e=t.match(/Error\(Contract,\s*#(\d+)\)/);if(!e)return null;const o=Number(e[1]),r=er[o];return r?{code:o,...r}:null}}},p={};function l(t){var e=p[t];if(void 0!==e)return e.exports;var o=p[t]={exports:{}};return a[t](o,o.exports,l),o.exports}l.d=(t,e)=>{for(var o in e)l.o(e,o)&&!l.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},l.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const d="https://api.xoxno.com",c="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",y="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",m="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var b;!function(t){t.MAINNET="1",t.DEVNET="D"}(b||(b={}));class f{apiUrl;chain;init;config;constructor({chain:t=b.MAINNET,apiUrl:e=d,...o}={}){this.apiUrl=e??{[b.MAINNET]:d,[b.DEVNET]:"https://devnet-api.xoxno.com"}[t],this.chain=t,this.init=o,this.config=t==b.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:c,DR_SC:y,KG_SC:m,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{mediaUrl:"https://devnet-media.xoxno.com",gatewayUrl:"https://devnet-gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4",FM_SC:c,DR_SC:y,KG_SC:m,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}fetchWithTimeout=async(t,{params:e,...o}={})=>{const{next:r,cache:n,debug:u,...i}=this.init,{next:s,cache:a,debug:p,headers:l,method:d="GET",...c}=o,y=l?.Authorization,m="Bearer undefined"===y?void 0:y,b={...l,Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."PUT"===d?{}:{"Content-Type":"application/json"},...m?{Authorization:m}:{}},f=Object.entries(e??{}).flatMap((([t,e])=>Array.isArray(e)?e.map((e=>`${t}=${encodeURIComponent(e)}`)):`${t}=${encodeURIComponent(e)}`)).join("&"),g=`${this.apiUrl}${t}${f.length?`?${f}`:""}`,{revalidate:h,...v}=r??{},{revalidate:S,...x}=s??{},q="GET"!==d||m?void 0:S??h,T="GET"!==d||m||q?void 0:a??n,_={...i,...c,method:d,...Object.keys(b).length?{headers:b}:{},cache:T,next:{...v,...x,revalidate:q}};(p??u)&&console.debug("SDK fetch: ",g,_);const w=await fetch(g,_).catch((t=>{if(t instanceof Error&&!t.message.match(/^http(s?):\/\//))throw Object.assign(new Error(`${g}: ${t.message}`),{cause:t});throw t})),A=await w.text();if(!w.ok){let t;try{t=JSON.parse(A)}catch{t={message:A}}const e=[g,w.status,w.statusText,t.message].filter(Boolean).join(";;");throw new Error(e)}try{return JSON.parse(A)}catch{return A}}}const g=t=>{const e=/^0x[a-fA-F0-9]{1,64}-[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(t)),o=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t);return e||o},h=t=>{const e=/^0x[a-fA-F0-9]{1,64}$/.test(t),o=/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,7}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(t);return e||o};class v extends Error{constructor(t){super(`Invalid collection ticker: ${t}`)}}class S extends Error{constructor(t){super(`Invalid address: ${t}`)}}Error,Error;const x=t=>!!t&&(t.startsWith("erd1")&&62===t.length||/^0x[a-fA-F0-9]{40,64}$/.test(t)||/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(t)||/^G[A-Z2-7]{55}$/.test(t)),q={"/liquid/xoxno/rate":{input:{},output:{}},"/liquid/xoxno/liquid-supply":{input:{},output:{}},"/liquid/xoxno/staked":{input:{},output:{}},"/user/login":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/:address/network-account":{input:{},output:{}},"/user/:address/token-inventory":{input:{},output:{}},"/user/network-account":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/me/profile":{input:{},output:{},securityMode:"requiredAny"},"/user/:address/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me":{input:{},output:{},securityMode:"requiredAny"},"/user/me/settings":{input:{},output:{},securityMode:"optionalAny"},"/user/me/settings/notification-preferences":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"optionalAny"}},"/user/me/settings/email":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredJwt"}},"/user/me/settings/phone":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me/settings/billing":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/me/settings/verify-email":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/buy/signature":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/upload-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/reset-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/reset-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:tag/creator/is-registered":{input:{},output:{}},"/user/:address/creator/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/upload-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/reset-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/creator/reset-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/favorite/collections":{input:{},output:{}},"/user/favorite/:favoriteId":{input:{},output:{},securityMode:"requiredAny"},"/user/:address/follow":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/favorite/users":{input:{},output:{}},"/tokens":{input:{},output:{}},"/tokens/swap":{input:{},output:{}},"/stellar/tokens":{input:{},output:{}},"/tokens/restricted":{input:{},output:{}},"/tokens/usd-price":{input:{},output:{}},"/tokens/egld/fiat-price":{input:{},output:{}},"/tokens/xoxno/info":{input:{},output:{}},"/liquid/xoxno/stats":{input:{},output:{}},"/liquid/egld/stats":{input:{},output:{}},"/liquid/sui/stats":{input:{},output:{}},"/analytics/marketplace-unique-users":{input:{},output:{}},"/liquid/egld/rate":{input:{},output:{}},"/liquid/egld/liquid-supply":{input:{},output:{}},"/liquid/egld/staked":{input:{},output:{}},"/liquid/egld/pending-fees":{input:{},output:{}},"/liquid/egld/pending-undelegate":{input:{},output:{}},"/liquid/egld/pending-delegate":{input:{},output:{}},"/liquid/egld/execute-delegate":{input:{},output:{}},"/liquid/egld/execute-undelegate":{input:{},output:{}},"/liquid/egld/execute-undelegate-providers":{input:{},output:{}},"/liquid/egld/protocol-apr":{input:{},output:{}},"/liquid/egld/providers":{input:{},output:{}},"/user/:address/delegation":{input:{},output:{}},"/lending/market/:token/profile":{input:{},output:{}},"/lending/market/query":{input:{},output:{}},"/lending/governance/proposals":{input:{},output:{}},"/lending/governance/proposal/:id":{input:{},output:{}},"/user/lending/:address":{input:{},output:{}},"/lending/market/indexes":{input:{},output:{}},"/user/lending/position/:identifier":{input:{},output:{}},"/lending/pnl":{input:{},output:{}},"/user/lending/pnl/:address":{input:{},output:{}},"/user/lending/summary/:identifier":{input:{},output:{}},"/user/lending/image/:nonce":{input:{},output:{}},"/lending/market/emode-categories":{input:{},output:{}},"/lending/market/:token/emode-categories":{input:{},output:{}},"/lending/market/:token/analytics":{input:{},output:{}},"/lending/stats/history":{input:{},output:{}},"/lending/market/:token/average":{input:{},output:{}},"/lending/leaderboard":{input:{},output:{}},"/lending/leaderboard/liquidate":{input:{},output:{}},"/lending/leaderboard/clean-bad-debt":{input:{},output:{}},"/lending/stats":{input:{},output:{}},"/lending/market/prices":{input:{},output:{}},"/nft/query":{input:{},output:{}},"/nft/:identifier/like":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/inventory-summary":{input:{},output:{}},"/user/:address/offers":{input:{},output:{}},"/nft/offer/query":{input:{},output:{}},"/nft/offer/:identifier":{input:{},output:{}},"/user/:address/favorite/nfts":{input:{},output:{}},"/collection/:collection/attributes":{input:{},output:{}},"/nft/:identifier/offers":{input:{},output:{}},"/collection/:collection/ranks":{input:{},output:{}},"/collection/:collection/listings":{input:{},output:{}},"/nft/pinned":{input:{},output:{}},"/nft/sign-withdraw":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/sign-offer":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/sign-mint":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/nft/:identifier":{input:{},output:{}},"/collection/:collection/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/floor-price":{input:{},output:{}},"/collection/floor-price":{input:{},output:{}},"/collection/pinned":{input:{},output:{}},"/collection/pinned-drops":{input:{},output:{}},"/collection/:collection/pinned-drops":{input:{},output:{}},"/collection/:collection/pinned":{input:{},output:{}},"/collection/:collection/follow":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/query":{input:{},output:{}},"/collection/drops/query":{input:{},output:{}},"/collection/:collection/drop-info":{input:{},output:{},securityMode:"optionalAny"},"/collection/:creatorTag/:collectionTag/drop-info":{input:{},output:{},securityMode:"optionalAny"},"/collection/:collection/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/upload-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/reset-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/reset-banner":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/collection/:collection/holders":{input:{},output:{}},"/collection/:collection/holders/export":{input:{},output:{}},"/collection/:collection/owner":{input:{},output:{}},"/collection/:collection/stats":{input:{},output:{}},"/collection/stats/query":{input:{},output:{}},"/collection/global-offer/query":{input:{},output:{}},"/user/:address/creator/listing":{input:{},output:{}},"/user/:address/creator/details":{input:{},output:{}},"/launchpad/:scAddress/shareholders/royalties":{input:{},output:{}},"/launchpad/:scAddress/shareholders/collection/:collectionTag":{input:{},output:{}},"/pool/:poolId/profile":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/pool/:poolId/whitelist":{input:{},output:{}},"/pool/:poolId/upload-picture":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/:address/staking/available-pools":{input:{},output:{}},"/user/:address/staking/owned-collections":{input:{},output:{}},"/user/:address/staking/owned-pools":{input:{},output:{}},"/user/:address/staking/summary":{input:{},output:{}},"/user/:address/staking/creator":{input:{},output:{}},"/user/:address/staking/collection/:collection":{input:{},output:{}},"/user/:address/staking/pool/:poolId/nfts":{input:{},output:{}},"/collection/:collection/staking/summary":{input:{},output:{},securityMode:"optionalAny"},"/collection/:collection/staking/delegators":{input:{},output:{}},"/collection/staking/explore":{input:{},output:{}},"/user/:creatorTag/owned-services":{input:{},output:{}},"/search":{input:{},output:{}},"/user/search":{input:{},output:{}},"/collection/search":{input:{},output:{}},"/collection/drops/search":{input:{},output:{}},"/nft/search/query":{input:{},output:{}},"/lending/market-sc":{input:{},output:{}},"/lending/active-accounts":{input:{},output:{}},"/lending/account/:nonce/attributes":{input:{},output:{}},"/lending/account/:nonce/positions":{input:{},output:{}},"/lending/market/:token/price/egld":{input:{},output:{}},"/faucet":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/stellar-lending/assets":{input:{},output:{}},"/stellar-lending/context":{input:{},output:{}},"/stellar-lending/live-state":{input:{},output:{}},"/stellar-lending/hubs":{input:{},output:{}},"/stellar-lending/spokes":{input:{},output:{}},"/stellar-lending/reserves":{input:{},output:{}},"/stellar-lending/reserves/:spokeId/:hubId/:asset":{input:{},output:{}},"/stellar-lending/reserves/:spokeId/:hubId/:asset/holders":{input:{},output:{}},"/stellar-lending/hubs/:hubId/holders":{input:{},output:{}},"/stellar-lending/spokes/:spokeId/holders":{input:{},output:{}},"/stellar-lending/assets/:asset":{input:{},output:{}},"/stellar-lending/assets/:asset/page":{input:{},output:{}},"/stellar-lending/assets/:asset/markets":{input:{},output:{}},"/stellar-lending/hubs/:hubId":{input:{},output:{}},"/stellar-lending/spokes/:spokeId":{input:{},output:{}},"/stellar-lending/users/:owner/positions":{input:{},output:{}},"/stellar-lending/users/:owner/activity":{input:{},output:{}},"/stellar-lending/accounts/:accountId/positions":{input:{},output:{}},"/stellar-lending/governance/proposals":{input:{},output:{}},"/stellar-lending/assets/:asset/graph":{input:{},output:{}},"/stellar-lending/hubs/:hubId/graph":{input:{},output:{}},"/stellar-lending/spokes/:spokeId/graph":{input:{},output:{}},"/stellar-lending/reserves/:spokeId/:hubId/:asset/graph":{input:{},output:{}},"/stellar-lending/stats/history":{input:{},output:{}},"/stellar-lending/pnl":{input:{},output:{}},"/stellar-lending/positions":{input:{},output:{}},"/stellar-lending/users/:accountId/history":{input:{},output:{}},"/stellar-lending/pnl/scope":{input:{},output:{}},"/stellar-lending/revenue":{input:{},output:{}},"/stellar-lending/revenue/fees":{input:{},output:{}},"/stellar-lending/participants":{input:{},output:{}},"/stellar-lending/liquidations":{input:{},output:{}},"/stellar-lending/liquidations/leaderboard":{input:{},output:{}},"/stellar-lending/volume":{input:{},output:{}},"/stellar-lending/active-users":{input:{},output:{}},"/stellar-lending/distribution":{input:{},output:{}},"/stellar-lending/rate-spread":{input:{},output:{}},"/stellar-lending/defillama":{input:{},output:{}},"/user/notifications":{input:{},output:{},securityMode:"requiredAny"},"/user/notifications/unread-count":{input:{},output:{},securityMode:"requiredAny"},"/user/notifications/clear":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/notifications/read":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/device/register":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/mobile/device/:deviceId":{input:{},output:{},securityMode:"requiredWeb2",DELETE:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/mobile/history":{input:{},output:{},securityMode:"requiredAny"},"/mobile/history/unread-count":{input:{},output:{},securityMode:"requiredAny"},"/mobile/history/:notificationId/read":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/history/read-all":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/history/clear-all":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/mobile/history/clear-id/:notificationId":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/event/:eventId/update":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/event/:eventId/reminder":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/creator/marketing":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/eventNotifications/user/:userId/direct":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/stellar/challenge":{input:{},output:{}},"/user/native-token":{input:{},output:{}},"/user/web2":{input:{},output:{},securityMode:"requiredWeb2"},"/user/web2/session-cookie":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/wallet":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/wallet-switch":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/wallet-link":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/:index/wallet-link":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredWeb2"}},"/user/web2/shards":{input:{},output:{},securityMode:"requiredWeb2"},"/activity/query":{input:{},output:{}},"/activity/:identifier":{input:{},output:{}},"/analytics/volume":{input:{},output:{}},"/collection/:collection/analytics/volume":{input:{},output:{}},"/collections/analytics/volume":{input:{},output:{}},"/user/:address/analytics/volume":{input:{},output:{}},"/analytics/overview":{input:{},output:{}},"/user/stats":{input:{},output:{}},"/user/xoxno-drop":{input:{},output:{}},"/user/me/xoxno-drop":{input:{},output:{},securityMode:"requiredAny"},"/transactions/:txHash":{input:{},output:{}},"/transactions/:txHash/status":{input:{},output:{}},"/transaction/cost":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/transactions":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/transactions/batch":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/chat/message":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/conversation":{input:{},output:{},securityMode:"requiredAny"},"/user/chat/conversation/:conversationId":{input:{},output:{},securityMode:"requiredAny",DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/conversation-summary":{input:{},output:{},securityMode:"requiredAny"},"/user/chat/conversation/:conversationId/message/:messageId":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/block":{input:{},output:{},securityMode:"requiredAny"},"/user/chat/block/:address":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/chat/token":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/hatom/user/:address":{input:{},output:{}},"/countries":{input:{},output:{}},"/event":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId":{input:{},output:{},securityMode:"optionalAny",PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/profile/query":{input:{},output:{}},"/event/:eventId/profile":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/background":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/description":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/description/image":{input:{},output:{},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/description/image/:imageId":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/register":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/ticket":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/ticket/:ticketId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},PUT:{input:{},output:{},body:{},securityMode:"requiredAny"},POST:{input:{},output:{},body:{}}},"/event/:eventId/stage":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/stage/:stageId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/calculate-prices":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/event/:eventId/validate-discount":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/user/:address/creator/events":{input:{},output:{},securityMode:"optionalAny"},"/event/:eventId/invite":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/invite/query":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/invite/:inviteId":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/voucher/query":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/questions":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/question":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/question/:questionId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/guest/query":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/guest/:address":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/guest-export":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/role":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},securityMode:"requiredAny"},"/event/:eventId/role/:roleId":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/guest":{input:{},output:{},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/roleOf/:address":{input:{},output:{},securityMode:"requiredAny"},"/user/me/event":{input:{},output:{},securityMode:"requiredAny"},"/user/me/events/past":{input:{},output:{},securityMode:"requiredAny"},"/user/me/events/hosted":{input:{},output:{},securityMode:"requiredAny"},"/user/me/events/upcoming":{input:{},output:{},securityMode:"requiredAny"},"/user/me/event/badge":{input:{},output:{},securityMode:"requiredAny"},"/user/me/event/badge/payload":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/scan":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/voucher":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/voucher/:voucherCode":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/manual-check-in":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/answered-questions/:address":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/guest/approve":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/google-pass/:address":{input:{},output:{}},"/event/profile/location":{input:{},output:{}},"/event/:eventId/referral-config":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referral-config/:configId":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referral-configs":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/referral":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referral/:referralCode":{input:{},output:{},PATCH:{input:{},output:{},body:{},securityMode:"requiredAny"},DELETE:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/event/:eventId/referrals":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/referrals/self-serviced":{input:{},output:{},securityMode:"requiredAny"},"/event/:eventId/notify-attendees":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/notify/global-broadcast":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/user/blend/:address":{input:{},output:{}},"/stellar/aggregator/quote":{input:{},output:{}},"/perp/exchange/acceptTerms":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/perp/exchange/sendAsset":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/perp/exchange/sendExternalAsset":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/perp/exchange/deposit":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/perp/exchange/withdraw":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/perp/exchange/order":{input:{},output:{},POST:{input:{},output:{},body:{},securityMode:"requiredAny"}},"/tradingview/bars/:symbol":{input:{},output:{}},"/tradingview/coin/:symbol":{input:{},output:{}},"/perp/coin/:symbol":{input:{},output:{}},"/perp/coin/spot/:symbol":{input:{},output:{}},"/perp/coins":{input:{},output:{}},"/perp/legal-check/:address":{input:{},output:{}},"/perp/coins/spot":{input:{},output:{}},"/perp/orderbook/:symbol":{input:{},output:{}},"/perp/trades/:symbol":{input:{},output:{}},"/perp/stats/spot/:symbol":{input:{},output:{}},"/perp/stats/:symbol":{input:{},output:{}},"/perp/subscribe":{input:{},output:{},POST:{input:{},output:{},body:{}}},"/perp/unsubscribe":{input:{},output:{},POST:{input:{},output:{},body:{}}}},T=["PATCH","POST","DELETE","PUT"];var _=l(385);const w=t=>t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase()));function A(t,e,o,r){const{input:n,output:u,...i}=e,s=async(e={})=>{const n={...o,...e},u=t.replace(/:([a-zA-Z_]+)/g,((t,e)=>`${n[e]}`)),i=[...t.matchAll(/:([a-zA-Z_]+)/g)].map((t=>t[1])),s=Object.fromEntries(Object.entries(n).filter((([t])=>!i.includes(t)))),a=/:address[^A-Z]/.test(t)||"address"in s,p=/:collection[^A-Z]/.test(t)||"collection"in s;if(a){const t=n.address;if(!x(t))throw new S(t)}if(p){const t=n.collection;if(Array.isArray(t)?t.some((t=>!g(t))):!g(t))throw new v(t)}const l=Object.fromEntries(Object.entries(s).map((([t,e])=>[t,e instanceof FormData?e:"filter"===t||"body"===t?JSON.stringify(e):Array.isArray(e)?e.join(","):e]))),{body:d,auth:c,method:y,headers:m,cache:b,next:f,debug:h,continuationToken:q,...T}=l,_=c?`Bearer ${c}`:void 0,w={...m,..._?{Authorization:_}:{},...q?{"X-Continuation-Token":String(q)}:{}},A={...f,tags:[...f?.tags??[],u]};return r.fetchWithTimeout(u,{method:y,params:T,body:d,headers:w,cache:b,debug:h,...A?{next:A}:{}})},a=(t={})=>s(t);for(const t of Object.keys(i))T.includes(t)&&(a[t]=e=>s({...e,method:e.method??t.toUpperCase()}));return a}function k(t){const e=function(){const t={static:{},params:{},leaves:[]};for(const[e,o]of Object.entries(q)){const r=e.split("/").filter(Boolean);let n=t;for(const t of r)if(t.startsWith(":")){const e=w(t.slice(1));n=n.params[e]||={static:{},params:{},leaves:[]}}else{const e=w(t);n=n.static[e]||={static:{},params:{},leaves:[]}}n.leaves.push({rawPath:e,def:o})}return t}(),o=(e,r)=>{const n=e.leaves.length,u=Object.keys(e.static).length,i=Object.keys(e.params).length;let s;if(1===n&&u+i>0){const{rawPath:o,def:n}=e.leaves[0];s=A(o,n,r,t)}else{s={};for(const{rawPath:o,def:n}of e.leaves)s[w(o.split("/").pop().replace(/^:/,""))]=A(o,n,r,t)}for(const[t,n]of Object.entries(e.static)){const e=o(n,r);let u=e;if(e&&"object"==typeof e&&t in e&&"function"==typeof e[t]){const o=e[t],r=Object.fromEntries(Object.entries(e).filter((([e])=>e!==t)));1===o.length||(Object.assign(o,r),u=o)}void 0===s[t]?s[t]=u:"function"==typeof s[t]?Object.assign(s[t],u):"function"==typeof u?(Object.assign(u,s[t]),s[t]=u):Object.assign(s[t],u)}for(const[t,n]of Object.entries(e.params)){const e=e=>{const u=o(n,{...r,[t]:e});if(u&&"object"==typeof u&&1===Object.keys(u).length&&t in u&&"function"==typeof u[t]){const e=u[t],o=(...t)=>e(...t);return Object.assign(o,e)}return u};if(s[t]){const o=s[t];s[t]=t=>({...o(t),...e(t)})}else s[t]=e}return s};return o(e,{})}export{b as Chain,f as XOXNOClient,k as buildSdk,g as isValidCollectionTicker,h as isValidNftIdentifier};export const STELLAR_AGGREGATOR_ROUTER=_.ME;export const STELLAR_GOVERNANCE=_.nO;export const STELLAR_GOVERNANCE_ZERO_PREDECESSOR=_.G_;export const STELLAR_LENDING_CONTROLLER=_.DU;export const STELLAR_LENDING_TOPICS=_.fA;export const STELLAR_NETWORK_PASSPHRASE=_.A$;export const STELLAR_QUOTE_URL=_.J9;export const STELLAR_SOROBAN_RPC_URL=_.hS;export const SYNTHETIC_EVENT_ORDER_STRIDE=_.gR;export const XOXNO_LENDING_STELLAR_TICKER=_.Cg;export const buildSameTokenRepaySwapSteps=_.VZ;export const buildStellarAcceptOwnershipTx=_.N0;export const buildStellarAddRewardsTx=_.B_;export const buildStellarApproveTokenTx=_.eX;export const buildStellarBatchSwapTx=_.z;export const buildStellarBorrowBatchTx=_.xD;export const buildStellarBorrowTx=_.jR;export const buildStellarCctpForwardTx=_.P2;export const buildStellarClaimRevenueTx=_.W6;export const buildStellarCreateLiquidityPoolTx=_.se;export const buildStellarExecuteStrategyTx=_.yr;export const buildStellarFlashLoanTx=_.sp;export const buildStellarGovernanceAddSpokeImmediateTx=_.Iu;export const buildStellarGovernanceCreateHubImmediateTx=_.yu;export const buildStellarGovernanceExecuteGovernanceUpgradeTx=_.$9;export const buildStellarGovernanceExecuteGrantGovernanceRoleTx=_.zw;export const buildStellarGovernanceExecuteRevokeGovernanceRoleTx=_.h_;export const buildStellarGovernanceExecuteTransferGovOwnTx=_.e_;export const buildStellarGovernanceExecuteTx=_.Tk;export const buildStellarGovernanceExecuteUpdateDelayTx=_.BA;export const buildStellarGovernancePauseTx=_.u9;export const buildStellarGovernanceRevokeRoleImmediateTx=_.bi;export const buildStellarGovernanceSetOracleSanityBoundsImmediateTx=_.gc;export const buildStellarGovernanceSetSpokeAssetFlagsImmediateTx=_.ay;export const buildStellarGrantRoleTx=_.SX;export const buildStellarLendingIdentifier=_.UF;export const buildStellarLiquidateTx=_.Y5;export const buildStellarMigrateFromBlendTx=_.mE;export const buildStellarMigrateTx=_.xG;export const buildStellarMultiplyTx=_.s9;export const buildStellarPauseTx=_.OL;export const buildStellarProposeAddAssetToSpokeTx=_.k6;export const buildStellarProposeAddSpokeTx=_.dj;export const buildStellarProposeApproveBlendPoolTx=_.kD;export const buildStellarProposeApproveTokenTx=_.Yf;export const buildStellarProposeConfigureMarketOracleTx=_.c5;export const buildStellarProposeCreateHubTx=_.N8;export const buildStellarProposeCreateLiquidityPoolTx=_.qU;export const buildStellarProposeDeployPoolTx=_.RZ;export const buildStellarProposeEditAssetInSpokeTx=_.ni;export const buildStellarProposeEditOracleToleranceTx=_.hF;export const buildStellarProposeGovernanceUpgradeTx=_.Qk;export const buildStellarProposeGrantGovernanceRoleTx=_.Gw;export const buildStellarProposeMigrateControllerTx=_.$K;export const buildStellarProposeRemoveAssetFromSpokeTx=_.uj;export const buildStellarProposeRemoveSpokeTx=_.Od;export const buildStellarProposeRevokeBlendPoolTx=_.X7;export const buildStellarProposeRevokeGovernanceRoleTx=_.Ub;export const buildStellarProposeRevokeTokenTx=_.Dx;export const buildStellarProposeSetAccumulatorTx=_.OA;export const buildStellarProposeSetAggregatorTx=_.$U;export const buildStellarProposeSetMinBorrowCollatTx=_.ob;export const buildStellarProposeSetPoolTemplateTx=_.cY;export const buildStellarProposeSetPositionLimitsTx=_.$l;export const buildStellarProposeSetPositionManagerTx=_.K;export const buildStellarProposeSetSpokeLiquidationCurveTx=_.kw;export const buildStellarProposeTransferCtrlOwnershipTx=_.VS;export const buildStellarProposeTransferGovOwnTx=_.HP;export const buildStellarProposeUnpauseTx=_.xQ;export const buildStellarProposeUpdateDelayTx=_.YQ;export const buildStellarProposeUpgradeControllerTx=_.QY;export const buildStellarProposeUpgradePoolParamsTx=_.os;export const buildStellarProposeUpgradePoolTx=_.Ko;export const buildStellarRenewAccountTx=_.IJ;export const buildStellarRepayBatchTx=_.nw;export const buildStellarRepayDebtWithCollateralTx=_.Pr;export const buildStellarRepayTx=_.ZE;export const buildStellarRevokeRoleTx=_.ev;export const buildStellarRevokeTokenTx=_.P8;export const buildStellarSetAccumulatorTx=_.aV;export const buildStellarSetAggregatorTx=_.p2;export const buildStellarSetLiquidityPoolTemplateTx=_.Ww;export const buildStellarSetMarketOracleConfigTx=_.sV;export const buildStellarSetOracleSanityBoundsTx=_.XD;export const buildStellarSetOracleToleranceTx=_.Js;export const buildStellarSetPositionLimitsTx=_.Dy;export const buildStellarSetSpokeAssetFlagsTx=_.FZ;export const buildStellarSupplyBatchTx=_.Ni;export const buildStellarSupplyTx=_.v_;export const buildStellarSwapCollateralTx=_.qD;export const buildStellarSwapDebtTx=_.qR;export const buildStellarTransferOwnershipTx=_.QJ;export const buildStellarUnpauseTx=_.bm;export const buildStellarUpdateAccountThresholdTx=_.n_;export const buildStellarUpdateIndexesTx=_.v8;export const buildStellarUpgradeControllerTx=_.qM;export const buildStellarUpgradeLiquidityPoolParamsTx=_.gH;export const buildStellarWithdrawBatchTx=_.O3;export const buildStellarWithdrawTx=_.Gz;export const buildTx=_.pr;export const decodeStellarLendingEvent=_.Fm;export const encodeInterestRateModel=_.MB;export const encodeMarketOracleConfigInput=_.Dn;export const encodeMarketParamsRaw=_.pq;export const encodeOracleSourceConfigInput=_.ml;export const encodePositionLimits=_.Q3;export const encodeStrategyPayloadToRouteXdr=_.wf;export const extractEventOrder=_.Um;export const getStellarAccountPositions=_.xO;export const getStellarAggregatorQuote=_.Lw;export const getStellarAggregatorRouter=_.KM;export const getStellarAsset=_.mM;export const getStellarAssetGraph=_.iE;export const getStellarAssetMarkets=_.zp;export const getStellarAssetPage=_.N3;export const getStellarAssets=_.bN;export const getStellarGovernance=_.QV;export const getStellarGovernanceProposals=_.T_;export const getStellarHub=_.XI;export const getStellarHubGraph=_.Lt;export const getStellarHubs=_.KK;export const getStellarLendingContext=_.yl;export const getStellarLendingController=_.vc;export const getStellarLendingLiveState=_.kq;export const getStellarQuoteTokens=_.CH;export const getStellarReserve=_.FI;export const getStellarReserveGraph=_.KG;export const getStellarReserveHolders=_.nW;export const getStellarReserves=_.jF;export const getStellarSpoke=_.S2;export const getStellarSpokeGraph=_.uS;export const getStellarSpokes=_.u_;export const getStellarUserActivity=_.O5;export const getStellarUserPositions=_.Av;export const mapQuoteResponseToAggregatorSwap=_.LA;export const mapQuoteResponseToStrategyPayload=_.E6;export const mapQuoteResponseToStrategySwap=_.Ds;export const mapSorobanError=_.XV;export const mapStellarPositionActivityType=_.CU;export const prepareStellarBuiltTx=_.Vx;export const prepareStellarTxXdr=_.DL;export const stellarLendingDispatchKey=_.ON;export const stellarLendingRead=_.Hh;export const syntheticEventOrder=_.oV;export const tagStellarInvokedContractError=_.g5;export const toBase64Xdr=_.L;export const toStellarPositionMode=_.Vu;
@@ -274,17 +274,18 @@ export declare function buildStellarGovernanceAddSpokeImmediateTx(opts: StellarB
274
274
  */
275
275
  export declare function buildStellarGovernanceRevokeRoleImmediateTx(opts: StellarBuilderOptions, args: RoleGrantArgs): BuiltStellarTx;
276
276
  /**
277
- * pause() — owner-gated, immediate protocol-wide brake. Forwards to the
278
- * controller's `pause`, halting supply/borrow/strategy entrypoints across
279
- * every market (exits and liquidation stay open). The tx source
280
- * (`opts.caller`) must be the governance owner. Distinct from the
281
- * controller-targeted `buildStellarPauseTx`, which an EOA cannot call because
282
- * the controller's owner is the governance contract.
277
+ * pause(caller) — GUARDIAN-gated, immediate protocol-wide brake. Forwards to
278
+ * the controller's `pause`, halting supply/borrow/strategy entrypoints across
279
+ * every market (exits and liquidation stay open). Halting is fail-safe, so the
280
+ * fast incident key acts without the owner online. `caller = opts.caller` must
281
+ * hold GUARDIAN and sign. Distinct from the controller-targeted
282
+ * `buildStellarPauseTx`, which an EOA cannot call because the controller's
283
+ * owner is the governance contract.
283
284
  */
284
285
  export declare function buildStellarGovernancePauseTx(opts: StellarBuilderOptions): BuiltStellarTx;
285
286
  /**
286
- * unpause() — owner-gated, immediate. Forwards to the controller's `unpause`,
287
- * resuming the entrypoints halted by `pause`. The tx source (`opts.caller`)
288
- * must be the governance owner.
287
+ * propose(Unpause) — resuming the controller is risk-loosening, so unlike the
288
+ * GUARDIAN-immediate `pause` it rides the timelock as a Standard-delay
289
+ * governance proposal. `proposer = opts.caller` must hold PROPOSER and sign.
289
290
  */
290
- export declare function buildStellarGovernanceUnpauseTx(opts: StellarBuilderOptions): BuiltStellarTx;
291
+ export declare function buildStellarProposeUnpauseTx(opts: StellarBuilderOptions, salt: StellarGovernanceSalt): BuiltStellarTx;