@xoxno/sdk-js 1.0.178 → 1.0.179

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.
@@ -30,12 +30,6 @@ export interface TransferOwnershipArgs {
30
30
  newOwner: string;
31
31
  liveUntilLedger: number;
32
32
  }
33
- export interface UpdatePoolCapsArgs {
34
- hubId: number;
35
- asset: string;
36
- supplyCap: string;
37
- borrowCap: string;
38
- }
39
33
  export interface ConfigureMarketOracleArgs {
40
34
  hubId: number;
41
35
  asset: string;
@@ -99,8 +93,6 @@ export declare function buildStellarSetLiquidityPoolTemplateTx(opts: StellarBuil
99
93
  }): BuiltStellarTx;
100
94
  /** set_position_limits(limits: PositionLimits) — #[only_owner] */
101
95
  export declare function buildStellarSetPositionLimitsTx(opts: StellarBuilderOptions, args: PositionLimitsDto): BuiltStellarTx;
102
- /** update_pool_caps(asset, supply_cap, borrow_cap) — #[only_owner] */
103
- export declare function buildStellarUpdatePoolCapsTx(opts: StellarBuilderOptions, args: UpdatePoolCapsArgs): BuiltStellarTx;
104
96
  /** approve_token(token: Address) — #[only_owner] */
105
97
  export declare function buildStellarApproveTokenTx(opts: StellarBuilderOptions, args: {
106
98
  token: string;
@@ -26,7 +26,7 @@
26
26
  * XDR still needs `rpc.Server.prepareTransaction` before signing.
27
27
  */
28
28
  import type { PositionLimitsDto } from '@xoxno/types';
29
- import { type ConfigureMarketOracleArgs, type CreateLiquidityPoolArgs, type RoleGrantArgs, type TransferOwnershipArgs, type UpdatePoolCapsArgs, type UpgradeLiquidityPoolParamsArgs } from './admin';
29
+ import { type ConfigureMarketOracleArgs, type CreateLiquidityPoolArgs, type RoleGrantArgs, type TransferOwnershipArgs, type UpgradeLiquidityPoolParamsArgs } from './admin';
30
30
  import type { BuiltStellarTx, StellarBuilderOptions } from './lending';
31
31
  /**
32
32
  * A `salt: BytesN<32>` for a governance proposal/execution. Accepts a 32-byte
@@ -67,8 +67,6 @@ export declare function buildStellarProposeSetPositionLimitsTx(opts: StellarBuil
67
67
  export declare function buildStellarProposeSetMinBorrowCollatTx(opts: StellarBuilderOptions, args: {
68
68
  floorWad: string;
69
69
  }, salt: StellarGovernanceSalt): BuiltStellarTx;
70
- /** propose(UpdatePoolCaps(PoolCapsArgs)) */
71
- export declare function buildStellarProposeUpdatePoolCapsTx(opts: StellarBuilderOptions, args: UpdatePoolCapsArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
72
70
  /** propose(ApproveToken(token)) */
73
71
  export declare function buildStellarProposeApproveTokenTx(opts: StellarBuilderOptions, args: {
74
72
  token: string;
@@ -130,12 +130,12 @@ export interface StellarReserve {
130
130
  suppliedShort: number;
131
131
  borrowedShort: number;
132
132
  availableLiquidityShort: number;
133
+ isFlashloanable: boolean;
134
+ flashloanFeeBps: number;
133
135
  supplyCapShort: number;
134
136
  borrowCapShort: number;
135
137
  depositCapFilledPct: number;
136
138
  borrowCapFilledPct: number;
137
- isFlashloanable: boolean;
138
- flashloanFeeBps: number;
139
139
  collateralFactorBps: number;
140
140
  liquidationThresholdBps: number;
141
141
  liquidationPenaltyBps: number;
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "undefined"!=typeof globalThis&&void 0===globalThis.self&&(globalThis.self=globalThis),(()=>{"use strict";var e={454(e,t,r){r.d(t,{STELLAR_AGGREGATOR_ROUTER:()=>u,STELLAR_GOVERNANCE:()=>n,STELLAR_GOVERNANCE_ZERO_PREDECESSOR:()=>Ye,STELLAR_LENDING_CONTROLLER:()=>o,STELLAR_LENDING_TOPICS:()=>ur,STELLAR_NETWORK_PASSPHRASE:()=>l,STELLAR_QUOTE_URL:()=>a,STELLAR_SOROBAN_RPC_URL:()=>i,SYNTHETIC_EVENT_ORDER_STRIDE:()=>ar,XOXNO_LENDING_STELLAR_TICKER:()=>ir,buildSameTokenRepaySwapSteps:()=>Pr,buildStellarAcceptOwnershipTx:()=>Ce,buildStellarAddRewardsTx:()=>Ke,buildStellarApproveTokenTx:()=>De,buildStellarBatchSwapTx:()=>fr,buildStellarBorrowBatchTx:()=>G,buildStellarBorrowTx:()=>N,buildStellarCctpForwardTx:()=>Er,buildStellarClaimRevenueTx:()=>Ze,buildStellarCreateLiquidityPoolTx:()=>Fe,buildStellarDisableTokenOracleTx:()=>je,buildStellarExecuteStrategyTx:()=>Tr,buildStellarFlashLoanTx:()=>V,buildStellarGovernanceExecuteGovernanceUpgradeTx:()=>Mt,buildStellarGovernanceExecuteGrantGovernanceRoleTx:()=>Ct,buildStellarGovernanceExecuteRevokeGovernanceRoleTx:()=>Ut,buildStellarGovernanceExecuteTransferGovOwnTx:()=>Gt,buildStellarGovernanceExecuteTx:()=>It,buildStellarGovernanceExecuteUpdateDelayTx:()=>Lt,buildStellarGrantRoleTx:()=>Ie,buildStellarLendingIdentifier:()=>lr,buildStellarLiquidateTx:()=>z,buildStellarMigrateFromBlendTx:()=>j,buildStellarMigrateTx:()=>Ee,buildStellarMultiplyTx:()=>H,buildStellarPauseTx:()=>ke,buildStellarProposeApproveBlendPoolTx:()=>St,buildStellarProposeApproveTokenTx:()=>yt,buildStellarProposeConfigureMarketOracleTx:()=>wt,buildStellarProposeCreateLiquidityPoolTx:()=>Tt,buildStellarProposeDeployPoolTx:()=>mt,buildStellarProposeDisableTokenOracleTx:()=>vt,buildStellarProposeEditOracleToleranceTx:()=>At,buildStellarProposeGovernanceUpgradeTx:()=>Pt,buildStellarProposeGrantGovernanceRoleTx:()=>Et,buildStellarProposeMigrateControllerTx:()=>qt,buildStellarProposeRevokeBlendPoolTx:()=>gt,buildStellarProposeRevokeGovernanceRoleTx:()=>kt,buildStellarProposeRevokeTokenTx:()=>bt,buildStellarProposeSetAccumulatorTx:()=>lt,buildStellarProposeSetAggregatorTx:()=>at,buildStellarProposeSetMinBorrowCollatTx:()=>dt,buildStellarProposeSetPoolTemplateTx:()=>st,buildStellarProposeSetPositionLimitsTx:()=>pt,buildStellarProposeTransferCtrlOwnershipTx:()=>_t,buildStellarProposeTransferGovOwnTx:()=>Ot,buildStellarProposeUpdateDelayTx:()=>Rt,buildStellarProposeUpdatePoolCapsTx:()=>ct,buildStellarProposeUpgradeControllerTx:()=>xt,buildStellarProposeUpgradePoolParamsTx:()=>ft,buildStellarProposeUpgradePoolTx:()=>ht,buildStellarRenewAccountTx:()=>Xe,buildStellarRepayBatchTx:()=>D,buildStellarRepayDebtWithCollateralTx:()=>Q,buildStellarRepayTx:()=>W,buildStellarRevokeRoleTx:()=>Me,buildStellarRevokeTokenTx:()=>We,buildStellarSetAccumulatorTx:()=>Ge,buildStellarSetAggregatorTx:()=>Ue,buildStellarSetLiquidityPoolTemplateTx:()=>Ne,buildStellarSetMarketOracleConfigTx:()=>ze,buildStellarSetOracleToleranceTx:()=>Ve,buildStellarSetPositionLimitsTx:()=>Be,buildStellarSupplyBatchTx:()=>C,buildStellarSupplyTx:()=>U,buildStellarSwapCollateralTx:()=>F,buildStellarSwapDebtTx:()=>X,buildStellarTransferOwnershipTx:()=>Le,buildStellarUnpauseTx:()=>Oe,buildStellarUpdateAccountThresholdTx:()=>Je,buildStellarUpdateIndexesTx:()=>He,buildStellarUpdatePoolCapsTx:()=>$e,buildStellarUpgradeControllerTx:()=>Re,buildStellarUpgradeLiquidityPoolParamsTx:()=>Qe,buildStellarWithdrawBatchTx:()=>B,buildStellarWithdrawTx:()=>$,buildTx:()=>L,decodeStellarLendingEvent:()=>nr,encodeInterestRateModel:()=>ve,encodeMarketOracleConfigInput:()=>Pe,encodeMarketParamsRaw:()=>xe,encodeOracleSourceConfigInput:()=>Ae,encodePositionLimits:()=>qe,encodeStrategyPayloadToRouteXdr:()=>gr,extractEventOrder:()=>sr,getStellarAccountPositions:()=>ye,getStellarAggregatorQuote:()=>br,getStellarAggregatorRouter:()=>p,getStellarAsset:()=>ie,getStellarAssetGraph:()=>Se,getStellarAssetMarkets:()=>le,getStellarAssetPage:()=>ae,getStellarAssets:()=>ee,getStellarGovernance:()=>d,getStellarGovernanceProposals:()=>be,getStellarHub:()=>se,getStellarHubGraph:()=>ge,getStellarHubs:()=>te,getStellarLendingContext:()=>Y,getStellarLendingController:()=>s,getStellarQuoteTokens:()=>Sr,getStellarReserve:()=>ue,getStellarReserveGraph:()=>fe,getStellarReserveHolders:()=>ne,getStellarReserves:()=>oe,getStellarSpoke:()=>pe,getStellarSpokeGraph:()=>Te,getStellarSpokes:()=>re,getStellarUserActivity:()=>ce,getStellarUserPositions:()=>de,mapQuoteResponseToAggregatorSwap:()=>vr,mapQuoteResponseToStrategyPayload:()=>mr,mapQuoteResponseToStrategySwap:()=>hr,mapStellarPositionActivityType:()=>dr,prepareStellarBuiltTx:()=>wr,prepareStellarTxXdr:()=>_r,stellarLendingDispatchKey:()=>$t,stellarLendingRead:()=>me,syntheticEventOrder:()=>pr,tagStellarInvokedContractError:()=>qr,toBase64Xdr:()=>Nt,toStellarPositionMode:()=>Ar});const o={mainnet:process.env.STELLAR_LENDING_CONTROLLER_MAINNET??"",testnet:process.env.STELLAR_LENDING_CONTROLLER_TESTNET??""},u={mainnet:process.env.STELLAR_AGGREGATOR_ROUTER_MAINNET??"",testnet:process.env.STELLAR_AGGREGATOR_ROUTER_TESTNET??""},n={mainnet:process.env.STELLAR_GOVERNANCE_MAINNET??"",testnet:process.env.STELLAR_GOVERNANCE_TESTNET??""},i={mainnet:"https://soroban-rpc.stellar.org",testnet:"https://soroban-testnet.stellar.org"},a={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"},l={mainnet:"Public Global Stellar Network ; September 2015",testnet:"Test SDF Network ; September 2015"};function s(e){const t=o[e];if(!t)throw new Error(`Stellar lending controller address not configured for network "${e}". Set STELLAR_LENDING_CONTROLLER_${e.toUpperCase()} env var.`);return t}function p(e){const t=u[e];if(!t)throw new Error(`Stellar aggregator router address not configured for network "${e}". Set STELLAR_AGGREGATOR_ROUTER_${e.toUpperCase()} env var.`);return t}function d(e){const t=n[e];if(!t)throw new Error(`Stellar governance address not configured for network "${e}". Set STELLAR_GOVERNANCE_${e.toUpperCase()} env var.`);return t}const c=require("@stellar/stellar-sdk"),y=["Soroswap","Aquarius","Phoenix","Sushi","CometDex"],b=e=>new c.Address(e).toScVal(),S=e=>new c.ScInt(e).toI128(),g=e=>c.xdr.ScVal.scvU32(e),T=e=>new c.ScInt("string"==typeof e?e:e.toString()).toU64(),f=e=>c.xdr.ScVal.scvBool(e),m=e=>c.xdr.ScVal.scvString(e),h=e=>c.xdr.ScVal.scvSymbol(e),v=()=>c.xdr.ScVal.scvVoid(),x=e=>c.xdr.ScVal.scvVec(e),q=(e,t=32)=>{const r=e.startsWith("0x")?e.slice(2):e,o=Buffer.from(r,"hex");if(o.length!==t)throw new Error(`Stellar builder: expected a ${t}-byte BytesN (got ${o.length} bytes from "${e}")`);return c.xdr.ScVal.scvBytes(o)},_=(e,t)=>null==e?v():t(e),w=(e,t)=>R({asset:b(t),hub_id:g(e)}),A=(e,t,r)=>c.xdr.ScVal.scvVec([w(e,t),S(r)]),P=e=>c.xdr.ScVal.scvVec(e.map((e=>A(e.hubId,e.asset,e.amount)))),R=e=>{const t=Object.keys(e).sort().map((t=>new c.xdr.ScMapEntry({key:h(t),val:e[t]})));return c.xdr.ScVal.scvMap(t)},E=e=>{const t=e.paths.map((e=>{const t=e.hops.map((e=>{return R({amount_out:S(e.amountOut),pool:b(e.pool),token_in:b(e.tokenIn),token_out:b(e.tokenOut),venue:(t=e.venue,c.xdr.ScVal.scvVec([h(t)]))});var t}));return R({hops:c.xdr.ScVal.scvVec(t),split_ppm:g(e.splitPpm)})}));return R({paths:c.xdr.ScVal.scvVec(t),referral_id:T(e.referralId??0),token_in:b(e.tokenIn),token_out:b(e.tokenOut),total_min_out:S(e.totalMinOut)})},k=e=>{const t=Buffer.from(e);if(0===t.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return c.xdr.ScVal.scvBytes(t)},O=e=>{const t=e.trim();if(t.startsWith("0x")){const e=t.slice(2);if(!((r=e).length>0&&r.length%2==0&&/^[0-9a-fA-F]+$/.test(r)))throw new Error("Stellar builder: strategy swap bytes hex string must be 0x-prefixed and even-length");return Buffer.from(e,"hex")}var r;if(!/^[A-Za-z0-9+/]+={0,2}$/.test(t))throw new Error("Stellar builder: strategy swap bytes must be base64 routeXdr or 0x-prefixed hex");const o=Buffer.from(t,"base64");if(0===o.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return o},I=e=>{if("string"==typeof e)return k(O(e));if(e instanceof Uint8Array)return k(e);if(e&&"object"==typeof e)return"routeXdr"in(r=e)&&"string"==typeof r.routeXdr?k(O(e.routeXdr)):(e=>"swapXdr"in e&&"string"==typeof e.swapXdr)(e)?k(O(e.swapXdr)):(e=>"bytes"in e&&("string"==typeof e.bytes||e.bytes instanceof Uint8Array))(e)?"string"==typeof e.bytes?k(O(e.bytes)):k(e.bytes):(t=(e=>{if(!e||"object"!=typeof e)throw new Error("Stellar builder: decoded strategy `steps` must be a StrategyPayload ({ paths, tokenIn, tokenOut, totalMinOut })");const t=e;if(!Array.isArray(t.paths)||0===t.paths.length)throw new Error("Stellar builder: `steps.paths` must be a non-empty array of strategy paths");if("string"!=typeof t.tokenIn)throw new Error("Stellar builder: `steps.tokenIn` must be a contract address");if("string"!=typeof t.tokenOut)throw new Error("Stellar builder: `steps.tokenOut` must be a contract address");if("string"!=typeof t.totalMinOut)throw new Error("Stellar builder: `steps.totalMinOut` must be an i128 decimal string");let r=0;for(const[e,o]of t.paths.entries()){if(!o||"number"!=typeof o.splitPpm||o.splitPpm<=0||!Array.isArray(o.hops)||0===o.hops.length)throw new Error(`Stellar builder: \`steps.paths[${e}]\` must have splitPpm > 0 and a non-empty hops array`);r+=o.splitPpm;for(const[t,r]of o.hops.entries())if(!r||"string"!=typeof r.amountOut||"string"!=typeof r.pool||"string"!=typeof r.tokenIn||"string"!=typeof r.tokenOut||!y.includes(r.venue))throw new Error(`Stellar builder: \`steps.paths[${e}].hops[${t}]\` must have amountOut, pool, tokenIn, tokenOut, and a valid Soroban venue`)}if(1e6!==r)throw new Error(`Stellar builder: \`steps.paths[].splitPpm\` must sum to 1_000_000, got ${r}`);return t})(e),c.xdr.ScVal.scvBytes(Buffer.from(E(t).toXDR("base64"),"base64")));var t,r;throw new Error("Stellar builder: `steps` must be opaque strategy bytes (`routeXdr`, base64/hex string, or Uint8Array)")},M=e=>{if("string"==typeof e)return(e=>{const t=e.startsWith("0x")?e.slice(2):e,r=Buffer.from(t,"hex");return c.xdr.ScVal.scvBytes(r)})(e);if(e instanceof Uint8Array)return c.xdr.ScVal.scvBytes(Buffer.from(e));throw new Error("Stellar builder: `data` must be a hex string or Uint8Array (Soroban Bytes payload)")};function L(e,t,r){const o=e.controllerAddress??s(e.network),u=new c.Contract(o),n=new c.Account(e.caller,e.sourceSequence);return{xdr:new c.TransactionBuilder(n,{fee:e.fee??c.BASE_FEE,networkPassphrase:l[e.network]}).addOperation(u.call(t,...r)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function C(e,t){const r=t.accountNonce??0,o=t.spokeId??0;return L(e,"supply",[b(e.caller),T(r),g(o),P([...t.assets])])}function U(e,t){return C(e,{accountNonce:t.accountNonce,spokeId:t.spokeId,assets:[{hubId:t.hubId,asset:t.asset,amount:t.amount}]})}function G(e,t){return L(e,"borrow",[b(e.caller),T(t.accountNonce),P([...t.borrows]),_(t.to,b)])}function N(e,t){return G(e,{accountNonce:t.accountNonce,borrows:[{hubId:t.hubId,asset:t.asset,amount:t.amount}],to:t.to})}function B(e,t){return L(e,"withdraw",[b(e.caller),T(t.accountNonce),P([...t.withdrawals]),_(t.to,b)])}function $(e,t){return B(e,{accountNonce:t.accountNonce,withdrawals:[{hubId:t.hubId,asset:t.asset,amount:t.amount}],to:t.to})}function D(e,t){return L(e,"repay",[b(e.caller),T(t.accountNonce),P([...t.payments])])}function W(e,t){return D(e,{accountNonce:t.accountNonce,payments:[{hubId:t.hubId,asset:t.asset,amount:t.amount}]})}function z(e,t){return L(e,"liquidate",[b(e.caller),T(t.accountNonce),P([...t.debtPayments])])}function V(e,t){return L(e,"flash_loan",[b(e.caller),w(t.hubId,t.asset),S(t.amount),b(t.receiver),M(t.data)])}function j(e,t){return L(e,"migrate_from_blend",[b(e.caller),T(t.accountId),g(t.spokeId),g(t.hubId),b(t.blendPool),x(t.collateralTokens.map(b)),x(t.supplyTokens.map(b)),(r=t.debtCaps.map((e=>({token:e.token,amount:e.cap}))),c.xdr.ScVal.scvVec(r.map((e=>{return t=e.token,r=e.amount,c.xdr.ScVal.scvVec([b(t),S(r)]);var t,r}))))]);var r}function H(e,t){const r=t.accountNonce??0,o=t.spokeId??0;return L(e,"multiply",[b(e.caller),T(r),g(o),w(t.collateral.hubId,t.collateral.asset),S(t.debtToFlashLoan),w(t.debt.hubId,t.debt.asset),g(t.mode),I(t.steps),_(t.initialPayment,(e=>A(e.hubId,e.asset,e.amount))),_(t.convertSwap,I)])}function X(e,t){return L(e,"swap_debt",[b(e.caller),T(t.accountNonce),w(t.existingDebt.hubId,t.existingDebt.asset),S(t.newDebtAmount),w(t.newDebt.hubId,t.newDebt.asset),I(t.steps)])}function F(e,t){return L(e,"swap_collateral",[b(e.caller),T(t.accountNonce),w(t.current.hubId,t.current.asset),S(t.fromAmount),w(t.newCollateral.hubId,t.newCollateral.asset),I(t.steps)])}function Q(e,t){return L(e,"repay_debt_with_collateral",[b(e.caller),T(t.accountNonce),w(t.collateral.hubId,t.collateral.asset),S(t.collateralAmount),w(t.debt.hubId,t.debt.asset),I(t.steps),f(t.closePosition)])}const Z="/stellar-lending",K=25,J=encodeURIComponent,Y=(e,t)=>e.fetchWithTimeout(`${Z}/context`,t),ee=(e,t)=>e.fetchWithTimeout(`${Z}/assets`,t),te=(e,t)=>e.fetchWithTimeout(`${Z}/hubs`,t),re=(e,t)=>e.fetchWithTimeout(`${Z}/spokes`,t),oe=(e,t={},r)=>{const{hubId:o,spokeId:u,asset:n}=t;return e.fetchWithTimeout(`${Z}/reserves`,{...r,params:{...void 0!==o?{hubId:o}:{},...void 0!==u?{spokeId:u}:{},...n?{asset:n}:{}}})},ue=(e,t,r,o,u)=>e.fetchWithTimeout(`${Z}/reserves/${t}/${r}/${J(o)}`,u),ne=(e,t,r,o,u,n)=>e.fetchWithTimeout(`${Z}/reserves/${t}/${r}/${J(o)}/holders`,{...n,params:{side:u}}),ie=(e,t,r)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}`,r),ae=(e,t,r,o)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}/page`,{...o,params:{...r}}),le=(e,t,r,o)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}/markets`,{...o,params:{side:r}}),se=(e,t,r)=>e.fetchWithTimeout(`${Z}/hubs/${t}`,r),pe=(e,t,r)=>e.fetchWithTimeout(`${Z}/spokes/${t}`,r),de=(e,t,r)=>e.fetchWithTimeout(`${Z}/users/${J(t)}/positions`,r),ce=(e,t,r={},o)=>{const{skip:u,top:n}=r;return e.fetchWithTimeout(`${Z}/users/${J(t)}/activity`,{...o,params:{...void 0!==u?{skip:u}:{},...void 0!==n?{top:n}:{}}})},ye=(e,t,r)=>e.fetchWithTimeout(`${Z}/accounts/${J(t)}/positions`,r),be=(e,t={},r)=>{const{top:o=K,continuationToken:u}=t;return e.fetchWithTimeout(`${Z}/governance/proposals`,{...r,params:{top:o,...u?{continuationToken:u}:{}}})},Se=(e,t,r,o)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}/graph`,{...o,params:{...r}}),ge=(e,t,r,o)=>e.fetchWithTimeout(`${Z}/hubs/${t}/graph`,{...o,params:{...r}}),Te=(e,t,r,o)=>e.fetchWithTimeout(`${Z}/spokes/${t}/graph`,{...o,params:{...r}}),fe=(e,t,r,o,u,n)=>e.fetchWithTimeout(`${Z}/reserves/${t}/${r}/${J(o)}/graph`,{...n,params:{...u}}),me=e=>({context:t=>Y(e,t),assets:t=>ee(e,t),hubs:t=>te(e,t),spokes:t=>re(e,t),reserves:(t,r)=>{return void 0===(o=t)||"hubId"in o||"spokeId"in o||"asset"in o?oe(e,t,r):oe(e,{},t);var o},reserve:(t,r,o,u)=>ue(e,t,r,o,u),reserveHolders:(t,r,o,u,n)=>ne(e,t,r,o,u,n),asset:(t,r)=>ie(e,t,r),assetMarkets:(t,r,o)=>le(e,t,r,o),hub:(t,r)=>se(e,t,r),spoke:(t,r)=>pe(e,t,r),userPositions:(t,r)=>de(e,t,r),userActivity:(t,r,o)=>ce(e,t,r,o),accountPositions:(t,r)=>ye(e,t,r),governanceProposals:(t,r)=>be(e,t,r),assetGraph:(t,r,o)=>Se(e,t,r,o),hubGraph:(t,r,o)=>ge(e,t,r,o),spokeGraph:(t,r,o)=>Te(e,t,r,o),reserveGraph:(t,r,o,u,n)=>fe(e,t,r,o,u,n)}),he={Single:0,PrimaryWithAnchor:1},ve=e=>R({base_borrow_rate:S(e.baseBorrowRateRay),max_borrow_rate:S(e.maxBorrowRateRay),max_utilization:S(e.maxUtilizationRay),mid_utilization:S(e.midUtilizationRay),optimal_utilization:S(e.optimalUtilizationRay),reserve_factor:g(e.reserveFactorBps),slope1:S(e.slope1Ray),slope2:S(e.slope2Ray),slope3:S(e.slope3Ray)}),xe=e=>R({asset_decimals:g(e.assetDecimals),asset_id:b(e.assetId),base_borrow_rate:S(e.baseBorrowRateRay),borrow_cap:S(e.borrowCap),flashloan_fee:g(e.flashloanFeeBps),is_flashloanable:f(e.isFlashloanable),max_borrow_rate:S(e.maxBorrowRateRay),max_utilization:S(e.maxUtilizationRay),mid_utilization:S(e.midUtilizationRay),optimal_utilization:S(e.optimalUtilizationRay),reserve_factor:g(e.reserveFactorBps),slope1:S(e.slope1Ray),slope2:S(e.slope2Ray),slope3:S(e.slope3Ray),supply_cap:S(e.supplyCap)}),qe=e=>R({max_borrow_positions:g(e.maxBorrowPositions),max_supply_positions:g(e.maxSupplyPositions)}),_e=e=>{const t=e.kind;switch(t){case"Stellar":return x([h("Stellar"),b(e.value)]);case"Symbol":return x([h("Symbol"),h(e.value)]);case"String":return x([h("String"),m(e.value)]);default:throw new Error(`Stellar builder: unknown oracle asset ref kind "${t}"`)}},we=(e,t)=>{if("Twap"===e){if("number"!=typeof t)throw new Error("Stellar builder: oracle source with Twap read mode requires `twapRecords`");return x([h("Twap"),g(t)])}return x([h("Spot")])},Ae=e=>{const t=e.provider;if("ReflectorSep40"===t){if(!e.asset)throw new Error("Stellar builder: Reflector oracle source requires `asset`");return x([h("Reflector"),R({asset:_e(e.asset),contract:b(e.contract),read_mode:we(e.readMode,e.twapRecords)})])}if("RedStonePriceFeed"===t){if("string"!=typeof e.feedId)throw new Error("Stellar builder: RedStone oracle source requires `feedId`");if("number"!=typeof e.maxStaleSeconds)throw new Error("Stellar builder: RedStone oracle source requires `maxStaleSeconds`");return x([h("RedStone"),R({contract:b(e.contract),feed_id:m(e.feedId),max_stale_seconds:T(e.maxStaleSeconds)})])}throw new Error(`Stellar builder: unknown oracle provider "${t}"`)},Pe=e=>{const t=he[e.strategy];if(void 0===t)throw new Error(`Stellar builder: unknown oracle strategy "${e.strategy}"`);return R({anchor:(r=e.anchor,x(null==r?[h("None")]:[h("Some"),Ae(r)])),max_price_stale_seconds:T(e.maxPriceStaleSeconds),max_sanity_price_wad:S(e.maxSanityPriceWad),min_sanity_price_wad:S(e.minSanityPriceWad),primary:Ae(e.primary),strategy:g(t),tolerance_bps:g(e.toleranceBps)});var r};function Re(e,t){return L(e,"upgrade",[q(t.wasmHash)])}function Ee(e,t){return L(e,"migrate",[g(t.newVersion)])}function ke(e){return L(e,"pause",[])}function Oe(e){return L(e,"unpause",[])}function Ie(e,t){return L(e,"grant_role",[b(t.account),h(t.role)])}function Me(e,t){return L(e,"revoke_role",[b(t.account),h(t.role)])}function Le(e,t){return L(e,"transfer_ownership",[b(t.newOwner),g(t.liveUntilLedger)])}function Ce(e){return L(e,"accept_ownership",[])}function Ue(e,t){return L(e,"set_aggregator",[b(t.aggregator)])}function Ge(e,t){return L(e,"set_accumulator",[b(t.accumulator)])}function Ne(e,t){return L(e,"set_liquidity_pool_template",[q(t.wasmHash)])}function Be(e,t){return L(e,"set_position_limits",[qe(t)])}function $e(e,t){return L(e,"update_pool_caps",[w(t.hubId,t.asset),S(t.supplyCap),S(t.borrowCap)])}function De(e,t){return L(e,"approve_token",[b(t.token)])}function We(e,t){return L(e,"revoke_token",[b(t.token)])}function ze(e,t){return L(e,"set_market_oracle_config",[w(t.hubId,t.asset),Pe(t.config)])}function Ve(e,t){return L(e,"set_oracle_tolerance",[b(t.asset),R({lower_ratio_bps:g(t.lowerRatioBps),upper_ratio_bps:g(t.upperRatioBps)})])}function je(e,t){return L(e,"disable_token_oracle",[b(t.asset)])}function He(e,t){return L(e,"update_indexes",[b(e.caller),x(t.assets.map((e=>w(e.hubId,e.asset))))])}function Xe(e,t){return L(e,"renew_account",[b(e.caller),T(t.accountNonce)])}function Fe(e,t){return L(e,"create_liquidity_pool",[g(t.hubId),b(t.asset),xe(t.params)])}function Qe(e,t){return L(e,"upgrade_liquidity_pool_params",[w(t.hubId,t.asset),ve(t.params)])}function Ze(e,t){return L(e,"claim_revenue",[b(e.caller),x(t.assets.map((e=>w(e.hubId,e.asset))))])}function Ke(e,t){return L(e,"add_rewards",[b(e.caller),P(t.rewards)])}function Je(e,t){return L(e,"update_account_threshold",[b(e.caller),f(t.hasRisks),x(t.accountNonces.map((e=>T(e))))])}const Ye="00".repeat(32),et=e=>{if("string"==typeof e)return q(e);const t=Buffer.from(e);if(32!==t.length)throw new Error(`Stellar governance builder: expected a 32-byte salt (got ${t.length} bytes)`);return c.xdr.ScVal.scvBytes(t)},tt=(e,...t)=>x([h(e),...t]),rt=e=>R({new_owner:b(e.newOwner),live_until_ledger:g(e.liveUntilLedger)}),ot=e=>R({account:b(e.account),role:h(e.role)});function ut(e,t,r){const o=e.governanceAddress??d(e.network),u=new c.Contract(o),n=new c.Account(e.caller,e.sourceSequence);return{xdr:new c.TransactionBuilder(n,{fee:e.fee??c.BASE_FEE,networkPassphrase:l[e.network]}).addOperation(u.call(t,...r)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}const nt=(e,t,r)=>ut(e,"propose",[b(e.caller),t,et(r)]),it=(e,t,r)=>ut(e,"execute_self",[v(),t,et(r)]);function at(e,t,r){return nt(e,tt("SetAggregator",b(t.aggregator)),r)}function lt(e,t,r){return nt(e,tt("SetAccumulator",b(t.accumulator)),r)}function st(e,t,r){return nt(e,tt("SetLiquidityPoolTemplate",q(t.wasmHash)),r)}function pt(e,t,r){return nt(e,tt("SetPositionLimits",qe(t)),r)}function dt(e,t,r){return nt(e,tt("SetMinBorrowCollateralUsd",S(t.floorWad)),r)}function ct(e,t,r){return nt(e,tt("UpdatePoolCaps",R({borrow_cap:S((o=t).borrowCap),hub_asset:w(o.hubId,o.asset),supply_cap:S(o.supplyCap)})),r);var o}function yt(e,t,r){return nt(e,tt("ApproveToken",b(t.token)),r)}function bt(e,t,r){return nt(e,tt("RevokeToken",b(t.token)),r)}function St(e,t,r){return nt(e,tt("ApproveBlendPool",b(t.pool)),r)}function gt(e,t,r){return nt(e,tt("RevokeBlendPool",b(t.pool)),r)}function Tt(e,t,r){return nt(e,tt("CreateLiquidityPool",R({asset:b((o=t).asset),hub_id:g(o.hubId),params:xe(o.params)})),r);var o}function ft(e,t,r){return nt(e,tt("UpgradeLiquidityPoolParams",R({hub_asset:w((o=t).hubId,o.asset),params:ve(o.params)})),r);var o}function mt(e,t){return nt(e,tt("DeployPool"),t)}function ht(e,t,r){return nt(e,tt("UpgradePool",q(t.wasmHash)),r)}function vt(e,t,r){return nt(e,tt("DisableTokenOracle",b(t.asset)),r)}function xt(e,t,r){return nt(e,tt("UpgradeController",q(t.wasmHash)),r)}function qt(e,t,r){return nt(e,tt("MigrateController",g(t.newVersion)),r)}function _t(e,t,r){return nt(e,tt("TransferCtrlOwnership",rt(t)),r)}function wt(e,t,r){return nt(e,tt("ConfigureMarketOracle",R({cfg:Pe((o=t).config),hub_asset:w(o.hubId,o.asset)})),r);var o}function At(e,t,r){return nt(e,tt("EditOracleTolerance",R({asset:b((o=t).asset),tolerance:g(o.tolerance)})),r);var o}function Pt(e,t,r){return nt(e,tt("UpgradeGov",q(t.wasmHash)),r)}function Rt(e,t,r){return nt(e,tt("UpdateGovDelay",g(t.newDelay)),r)}function Et(e,t,r){return nt(e,tt("GrantGovRole",ot(t)),r)}function kt(e,t,r){return nt(e,tt("RevokeGovRole",ot(t)),r)}function Ot(e,t,r){return nt(e,tt("TransferGovOwnership",rt(t)),r)}function It(e,t){const r=x(t.argsXdr.map((e=>c.xdr.ScVal.fromXDR(e,"base64")))),o=et(t.predecessor??Ye);return ut(e,"execute",[v(),b(t.target),h(t.functionName),r,o,et(t.salt)])}function Mt(e,t,r){return it(e,tt("UpgradeGov",q(t.wasmHash)),r)}function Lt(e,t,r){return it(e,tt("UpdateGovDelay",g(t.newDelay)),r)}function Ct(e,t,r){return it(e,tt("GrantGovRole",ot(t)),r)}function Ut(e,t,r){return it(e,tt("RevokeGovRole",ot(t)),r)}function Gt(e,t,r){return it(e,tt("TransferGovOwnership",rt(t)),r)}const Nt=e=>e.toXDR("base64"),Bt=e=>c.xdr.ScVal.fromXDR(e,"base64"),$t=e=>e.map((e=>String((0,c.scValToNative)(Bt(e))))).join(":"),Dt=e=>"bigint"==typeof e||"number"==typeof e?e.toString():String(e),Wt=e=>Number(e),zt=e=>String(e),Vt=e=>null==e?void 0:Dt(e),jt=e=>null==e?void 0:zt(e),Ht=e=>e instanceof Uint8Array?Buffer.from(e).toString("hex"):Buffer.isBuffer(e)?e.toString("hex"):String(e),Xt=["None","Multiply","Long","Short"],Ft=["Single","PrimaryWithAnchor"],Qt=["ReflectorSep40","RedStonePriceFeed"],Zt=["Spot","Twap"],Kt=["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"],Jt=e=>Array.isArray(e)?e:[],Yt=(e,t)=>{const r="Borrow"===t;return{action:(o=e[0],Kt[Wt(o)]??Dt(o)),positionType:t,hubId:Wt(e[1]),asset:zt(e[2]),scaledAmountRay:Dt(e[3]),indexRay:Dt(e[4]),amount:Dt(e[5]),liquidationThresholdBps:r?void 0:Wt(e[6]),liquidationBonusBps:r?void 0:Wt(e[7]),loanToValueBps:r?void 0:Wt(e[8]),liquidationFeesBps:r?void 0:Wt(e[9])};var o},er=e=>{return{owner:zt(e[0]),spokeId:Wt(e[1]),mode:(t=e[2],Xt[Wt(t)]??"None")};var t},tr=(e,t)=>{const r=Zt[Wt(e[`${t}_read_mode`])]??"Spot",o=e[`${t}_asset`],u=e[`${t}_symbol`],n=null!=o?{kind:"Stellar",value:zt(o)}:null!=u?{kind:"Symbol",value:zt(u)}:void 0;return{provider:Qt[Wt(e[`${t}_provider`])]??"ReflectorSep40",contractAddress:zt(e[`${t}_contract`]),asset:n,feedId:jt(e[`${t}_feed_id`]),readMode:r,twapRecords:"Twap"===r?Wt(e[`${t}_twap_records`]):void 0,decimals:Wt(e[`${t}_decimals`]),resolutionSeconds:Wt(e[`${t}_resolution_seconds`]),maxStaleSeconds:Wt(e[`${t}_max_stale_seconds`])}},rr=e=>{const t=null!==e.anchor_provider&&void 0!==e.anchor_provider;return{baseTokenId:zt(e.base_token_id),quoteTokenId:zt(e.quote_token_id),tolerance:{upperRatio:Wt(e.upper_ratio_bps??e.tolerance?.upper_ratio_bps),lowerRatio:Wt(e.lower_ratio_bps??e.tolerance?.lower_ratio_bps)},assetDecimals:Wt(e.asset_decimals),maxPriceStaleSeconds:Wt(e.max_price_stale_seconds),strategy:Ft[Wt(e.strategy)]??"Single",primary:tr(e,"primary"),anchor:t?tr(e,"anchor"):void 0,primaryQuoteToken:jt(e.primary_quote_token),anchorQuoteToken:jt(e.anchor_quote_token),minSanityPriceWad:Vt(e.min_sanity_price_wad),maxSanityPriceWad:Vt(e.max_sanity_price_wad)}},or={"market:create":e=>({topic:"market:create",data:{hubId:Wt(e.hub_id),baseAsset:zt(e.base_asset),maxBorrowRate:Dt(e.max_borrow_rate),baseBorrowRate:Dt(e.base_borrow_rate),slope1:Dt(e.slope1),slope2:Dt(e.slope2),slope3:Dt(e.slope3),midUtilization:Dt(e.mid_utilization),optimalUtilization:Dt(e.optimal_utilization),maxUtilization:Dt(e.max_utilization),reserveFactor:Wt(e.reserve_factor),marketAddress:zt(e.market_address)}}),"market:params_update":e=>({topic:"market:params_update",data:{asset:zt(e.asset),maxBorrowRateRay:Dt(e.max_borrow_rate),baseBorrowRateRay:Dt(e.base_borrow_rate),slope1Ray:Dt(e.slope1),slope2Ray:Dt(e.slope2),slope3Ray:Dt(e.slope3),midUtilizationRay:Dt(e.mid_utilization),optimalUtilizationRay:Dt(e.optimal_utilization),maxUtilizationRay:Dt(e.max_utilization),reserveFactorBps:Wt(e.reserve_factor)}}),"market:batch_state_update":e=>({topic:"market:batch_state_update",data:{updates:Jt(e).map((e=>{return t=Jt(e),{hubId:Wt(t[0]),asset:zt(t[1]),timestamp:Wt(t[2]),supplyIndexRay:Dt(t[3]),borrowIndexRay:Dt(t[4]),cash:Dt(t[5]),suppliedRay:Dt(t[6]),borrowedRay:Dt(t[7]),revenueRay:Dt(t[8])};var t}))}}),"market:batch_params_update":e=>({topic:"market:batch_params_update",data:{updates:Jt(e).map((e=>{const t=e;return{hubId:Wt(t.hub_id),asset:zt(t.asset),params:(r=t.params,{maxBorrowRateRay:Dt(r.max_borrow_rate),baseBorrowRateRay:Dt(r.base_borrow_rate),slope1Ray:Dt(r.slope1),slope2Ray:Dt(r.slope2),slope3Ray:Dt(r.slope3),midUtilizationRay:Dt(r.mid_utilization),optimalUtilizationRay:Dt(r.optimal_utilization),maxUtilizationRay:Dt(r.max_utilization),reserveFactorBps:Wt(r.reserve_factor),supplyCap:Dt(r.supply_cap),borrowCap:Dt(r.borrow_cap),isFlashloanable:Boolean(r.is_flashloanable),flashloanFeeBps:Wt(r.flashloan_fee),assetId:zt(r.asset_id),assetDecimals:Wt(r.asset_decimals)})};var r}))}}),"position:batch_update":e=>{const t=Jt(e);return{topic:"position:batch_update",data:{accountId:Dt(t[0]),accountAttributes:er(Jt(t[1])),updates:[...Jt(t[2]).map((e=>Yt(Jt(e),"Deposit"))),...Jt(t[3]).map((e=>Yt(Jt(e),"Borrow")))]}}},"position:flash_loan":e=>({topic:"position:flash_loan",data:{hubId:Wt(e.hub_id),asset:zt(e.asset),receiver:zt(e.receiver),caller:zt(e.caller),amount:Dt(e.amount),fee:Dt(e.fee)}}),"config:oracle":e=>({topic:"config:oracle",data:{asset:zt(e.asset),oracle:rr(e.oracle)}}),"position:liquidation":e=>({topic:"position:liquidation",data:{liquidator:zt(e.liquidator),accountId:Dt(e.account_id),repaidUsdWad:Dt(e.repaid_usd_wad),bonusBps:Dt(e.bonus_bps)}}),"debt:bad_debt":e=>({topic:"debt:bad_debt",data:{accountId:Dt(e.account_id),totalBorrowUsdWad:Dt(e.total_borrow_usd_wad),totalCollateralUsdWad:Dt(e.total_collateral_usd_wad)}}),"strategy:initial_payment":e=>({topic:"strategy:initial_payment",data:{token:zt(e.token),amount:Dt(e.amount),usdValueWad:Dt(e.usd_value_wad),accountId:Dt(e.account_id)}}),"strategy:fee":e=>({topic:"strategy:fee",data:{hubId:Wt(e.hub_id),asset:zt(e.asset),amount:Dt(e.amount),fee:Dt(e.fee),amountSent:Dt(e.amount_sent)}}),"config:approve_token":e=>({topic:"config:approve_token",data:{wasmHash:Ht(e.wasm_hash),approved:Boolean(e.approved)}}),"config:aggregator":e=>({topic:"config:aggregator",data:{aggregator:zt(e.aggregator)}}),"config:accumulator":e=>({topic:"config:accumulator",data:{accumulator:zt(e.accumulator)}}),"config:pool_template":e=>({topic:"config:pool_template",data:{wasmHash:Ht(e.wasm_hash)}}),"config:position_limits":e=>({topic:"config:position_limits",data:{maxSupplyPositions:Wt(e.max_supply_positions),maxBorrowPositions:Wt(e.max_borrow_positions)}}),"config:oracle_disabled":e=>({topic:"config:oracle_disabled",data:{asset:zt(e.asset)}}),"config:spoke":e=>{const t=e.spoke;return{topic:"config:spoke",data:{spokeId:Wt(t.spoke_id),isDeprecated:Boolean(t.is_deprecated),liquidationTargetHfWad:Dt(t.liquidation_target_hf_wad),healthFactorForMaxBonusWad:Dt(t.hf_for_max_bonus_wad),liquidationBonusFactorBps:Wt(t.liquidation_bonus_factor_bps)}}}},ur=Object.freeze(Object.keys(or));function nr(e,t){const r=$t(e),o=or[r];return o?o((0,c.scValToNative)(Bt(t))):null}const ir="XLENDXLM-a7c9f3",ar=1e4;function lr(e){const t=BigInt(e).toString(16),r=t.length%2==0?t:`0${t}`;return`${ir}-${r}`}function sr(e){const t=e.split("-");return t.length>=2&&parseInt(t[1],10)||0}function pr(e,t=0){return e*ar+t}function dr(e){switch(e){case"liq_repay":return"lendingLiquidateRepayDebt";case"liq_seize":return"lendingLiquidateSeizeCollateral";case"param_upd":return"lendingUpdateAccountParameters";default:return"lendingUpdateAccountPosition"}}const cr=(e,t,r)=>{const o=new URL(t,e.endsWith("/")?e:`${e}/`);if(r)for(const[e,t]of Object.entries(r))void 0!==t&&o.searchParams.set(e,String(t));return o.toString()},yr=e=>e.baseUrl??a[e.network];async function br(e,t){if(null==e.amountIn==(null==e.amountOut))throw new Error("getStellarAggregatorQuote: exactly one of `amountIn` or `amountOut` must be provided");const r=cr(yr(t),"api/v1/quote",{from:e.from,to:e.to,amountIn:e.amountIn,amountOut:e.amountOut,maxHops:e.maxHops,maxSplits:e.maxSplits,slippage:e.slippage,includePaths:e.includePaths,sender:e.sender,router:e.router,platform:e.platform,fresh:e.fresh}),o=await fetch(r,t.fetchOptions);if(!o.ok){const e=await o.text().catch((()=>""));throw new Error(`Stellar quote server responded ${o.status} ${o.statusText} for ${r} — ${e}`)}return await o.json()}async function Sr(e){const t=cr(yr(e),"api/v1/tokens"),r=await fetch(t,e.fetchOptions);if(!r.ok){const e=await r.text().catch((()=>""));throw new Error(`Stellar quote server responded ${r.status} ${r.statusText} for ${t} — ${e}`)}return await r.json()}const gr=e=>E(e).toXDR("base64");function Tr(e,t){const r=e.routerAddress??p(e.network),o=new c.Contract(r),u=new c.Account(e.caller,e.sourceSequence),n=I(((e,t)=>(e=>Boolean(e&&"object"==typeof e&&!(e instanceof Uint8Array)&&"paths"in e))(e)&&void 0===e.referralId?{...e,referralId:t??0}:e)(t,e.referralId));return{xdr:new c.TransactionBuilder(u,{fee:e.fee??c.BASE_FEE,networkPassphrase:l[e.network]}).addOperation(o.call("execute_strategy",b(e.caller),S(e.totalIn),n)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function fr(e,t){return Tr(e,t)}function mr(e,t={}){if("string"!=typeof e.amountOutMin)throw new Error("mapQuoteResponseToStrategyPayload: quote response is missing `amountOutMin`. Pass `slippage` when fetching the quote.");return{paths:e.paths?e.paths.map((e=>({hops:e.swaps.map(xr),splitPpm:e.splitPpm}))):[{hops:e.hops.map(xr),splitPpm:1e6}],referralId:t.referralId??0,tokenIn:e.from,tokenOut:e.to,totalMinOut:e.amountOutMin}}function hr(e,t={}){const r=e;return"string"==typeof r.routeXdr&&r.routeXdr.length>0?{routeXdr:r.routeXdr}:mr(e,t)}const vr=mr,xr=e=>({amountOut:e.amountOut,pool:e.address,tokenIn:e.from,tokenOut:e.to,venue:e.dex});function qr(e,t){const r=t instanceof Error?t.message:String(t);return new Error(`[xoxno-invoked:${e}] ${r}`)}async function _r(e,t,r){const o=c.TransactionBuilder.fromXDR(t,"base64");try{return(await e.prepareTransaction(o)).toXDR()}catch(e){if(r?.invokedContractId)throw qr(r.invokedContractId,e);throw e}}async function wr(e,t,r){return _r(e,t.xdr,r)}function Ar(e){if(e<=0||e>4)throw new Error(`Invalid PositionMode ${e} for Stellar — expected 1 (Normal) through 4 (Short). "None" (0) has no Stellar equivalent.`);return e-1}function Pr(e,t){return{paths:[{hops:[{amountOut:"0",pool:e,tokenIn:e,tokenOut:e,venue:"Soroswap"}],splitPpm:1e6}],referralId:0,tokenIn:e,tokenOut:e,totalMinOut:t}}const Rr=e=>{const t=e.startsWith("0x")?e.slice(2):e;if(t.length%2!=0)throw new Error("buildStellarCctpForwardTx: hex input must have even length");return Buffer.from(t,"hex")};function Er(e){const t=new c.Account(e.caller,e.sourceSequence),r=new c.Contract(e.forwarderAddress).call("mint_and_forward",c.xdr.ScVal.scvBytes(Rr(e.message)),c.xdr.ScVal.scvBytes(Rr(e.attestation)));return{xdr:new c.TransactionBuilder(t,{fee:e.fee??"10000000",networkPassphrase:l[e.network]}).addOperation(r).setTimeout(e.timeoutSeconds??120).build().toXDR()}}}},t={};function r(o){var u=t[o];if(void 0!==u)return u.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};r.r(o),r.d(o,{Chain:()=>l,STELLAR_AGGREGATOR_ROUTER:()=>T.STELLAR_AGGREGATOR_ROUTER,STELLAR_GOVERNANCE:()=>T.STELLAR_GOVERNANCE,STELLAR_GOVERNANCE_ZERO_PREDECESSOR:()=>T.STELLAR_GOVERNANCE_ZERO_PREDECESSOR,STELLAR_LENDING_CONTROLLER:()=>T.STELLAR_LENDING_CONTROLLER,STELLAR_LENDING_TOPICS:()=>T.STELLAR_LENDING_TOPICS,STELLAR_NETWORK_PASSPHRASE:()=>T.STELLAR_NETWORK_PASSPHRASE,STELLAR_QUOTE_URL:()=>T.STELLAR_QUOTE_URL,STELLAR_SOROBAN_RPC_URL:()=>T.STELLAR_SOROBAN_RPC_URL,SYNTHETIC_EVENT_ORDER_STRIDE:()=>T.SYNTHETIC_EVENT_ORDER_STRIDE,XOXNOClient:()=>s,XOXNO_LENDING_STELLAR_TICKER:()=>T.XOXNO_LENDING_STELLAR_TICKER,buildSameTokenRepaySwapSteps:()=>T.buildSameTokenRepaySwapSteps,buildSdk:()=>v,buildStellarAcceptOwnershipTx:()=>T.buildStellarAcceptOwnershipTx,buildStellarAddRewardsTx:()=>T.buildStellarAddRewardsTx,buildStellarApproveTokenTx:()=>T.buildStellarApproveTokenTx,buildStellarBatchSwapTx:()=>T.buildStellarBatchSwapTx,buildStellarBorrowBatchTx:()=>T.buildStellarBorrowBatchTx,buildStellarBorrowTx:()=>T.buildStellarBorrowTx,buildStellarCctpForwardTx:()=>T.buildStellarCctpForwardTx,buildStellarClaimRevenueTx:()=>T.buildStellarClaimRevenueTx,buildStellarCreateLiquidityPoolTx:()=>T.buildStellarCreateLiquidityPoolTx,buildStellarDisableTokenOracleTx:()=>T.buildStellarDisableTokenOracleTx,buildStellarExecuteStrategyTx:()=>T.buildStellarExecuteStrategyTx,buildStellarFlashLoanTx:()=>T.buildStellarFlashLoanTx,buildStellarGovernanceExecuteGovernanceUpgradeTx:()=>T.buildStellarGovernanceExecuteGovernanceUpgradeTx,buildStellarGovernanceExecuteGrantGovernanceRoleTx:()=>T.buildStellarGovernanceExecuteGrantGovernanceRoleTx,buildStellarGovernanceExecuteRevokeGovernanceRoleTx:()=>T.buildStellarGovernanceExecuteRevokeGovernanceRoleTx,buildStellarGovernanceExecuteTransferGovOwnTx:()=>T.buildStellarGovernanceExecuteTransferGovOwnTx,buildStellarGovernanceExecuteTx:()=>T.buildStellarGovernanceExecuteTx,buildStellarGovernanceExecuteUpdateDelayTx:()=>T.buildStellarGovernanceExecuteUpdateDelayTx,buildStellarGrantRoleTx:()=>T.buildStellarGrantRoleTx,buildStellarLendingIdentifier:()=>T.buildStellarLendingIdentifier,buildStellarLiquidateTx:()=>T.buildStellarLiquidateTx,buildStellarMigrateFromBlendTx:()=>T.buildStellarMigrateFromBlendTx,buildStellarMigrateTx:()=>T.buildStellarMigrateTx,buildStellarMultiplyTx:()=>T.buildStellarMultiplyTx,buildStellarPauseTx:()=>T.buildStellarPauseTx,buildStellarProposeApproveBlendPoolTx:()=>T.buildStellarProposeApproveBlendPoolTx,buildStellarProposeApproveTokenTx:()=>T.buildStellarProposeApproveTokenTx,buildStellarProposeConfigureMarketOracleTx:()=>T.buildStellarProposeConfigureMarketOracleTx,buildStellarProposeCreateLiquidityPoolTx:()=>T.buildStellarProposeCreateLiquidityPoolTx,buildStellarProposeDeployPoolTx:()=>T.buildStellarProposeDeployPoolTx,buildStellarProposeDisableTokenOracleTx:()=>T.buildStellarProposeDisableTokenOracleTx,buildStellarProposeEditOracleToleranceTx:()=>T.buildStellarProposeEditOracleToleranceTx,buildStellarProposeGovernanceUpgradeTx:()=>T.buildStellarProposeGovernanceUpgradeTx,buildStellarProposeGrantGovernanceRoleTx:()=>T.buildStellarProposeGrantGovernanceRoleTx,buildStellarProposeMigrateControllerTx:()=>T.buildStellarProposeMigrateControllerTx,buildStellarProposeRevokeBlendPoolTx:()=>T.buildStellarProposeRevokeBlendPoolTx,buildStellarProposeRevokeGovernanceRoleTx:()=>T.buildStellarProposeRevokeGovernanceRoleTx,buildStellarProposeRevokeTokenTx:()=>T.buildStellarProposeRevokeTokenTx,buildStellarProposeSetAccumulatorTx:()=>T.buildStellarProposeSetAccumulatorTx,buildStellarProposeSetAggregatorTx:()=>T.buildStellarProposeSetAggregatorTx,buildStellarProposeSetMinBorrowCollatTx:()=>T.buildStellarProposeSetMinBorrowCollatTx,buildStellarProposeSetPoolTemplateTx:()=>T.buildStellarProposeSetPoolTemplateTx,buildStellarProposeSetPositionLimitsTx:()=>T.buildStellarProposeSetPositionLimitsTx,buildStellarProposeTransferCtrlOwnershipTx:()=>T.buildStellarProposeTransferCtrlOwnershipTx,buildStellarProposeTransferGovOwnTx:()=>T.buildStellarProposeTransferGovOwnTx,buildStellarProposeUpdateDelayTx:()=>T.buildStellarProposeUpdateDelayTx,buildStellarProposeUpdatePoolCapsTx:()=>T.buildStellarProposeUpdatePoolCapsTx,buildStellarProposeUpgradeControllerTx:()=>T.buildStellarProposeUpgradeControllerTx,buildStellarProposeUpgradePoolParamsTx:()=>T.buildStellarProposeUpgradePoolParamsTx,buildStellarProposeUpgradePoolTx:()=>T.buildStellarProposeUpgradePoolTx,buildStellarRenewAccountTx:()=>T.buildStellarRenewAccountTx,buildStellarRepayBatchTx:()=>T.buildStellarRepayBatchTx,buildStellarRepayDebtWithCollateralTx:()=>T.buildStellarRepayDebtWithCollateralTx,buildStellarRepayTx:()=>T.buildStellarRepayTx,buildStellarRevokeRoleTx:()=>T.buildStellarRevokeRoleTx,buildStellarRevokeTokenTx:()=>T.buildStellarRevokeTokenTx,buildStellarSetAccumulatorTx:()=>T.buildStellarSetAccumulatorTx,buildStellarSetAggregatorTx:()=>T.buildStellarSetAggregatorTx,buildStellarSetLiquidityPoolTemplateTx:()=>T.buildStellarSetLiquidityPoolTemplateTx,buildStellarSetMarketOracleConfigTx:()=>T.buildStellarSetMarketOracleConfigTx,buildStellarSetOracleToleranceTx:()=>T.buildStellarSetOracleToleranceTx,buildStellarSetPositionLimitsTx:()=>T.buildStellarSetPositionLimitsTx,buildStellarSupplyBatchTx:()=>T.buildStellarSupplyBatchTx,buildStellarSupplyTx:()=>T.buildStellarSupplyTx,buildStellarSwapCollateralTx:()=>T.buildStellarSwapCollateralTx,buildStellarSwapDebtTx:()=>T.buildStellarSwapDebtTx,buildStellarTransferOwnershipTx:()=>T.buildStellarTransferOwnershipTx,buildStellarUnpauseTx:()=>T.buildStellarUnpauseTx,buildStellarUpdateAccountThresholdTx:()=>T.buildStellarUpdateAccountThresholdTx,buildStellarUpdateIndexesTx:()=>T.buildStellarUpdateIndexesTx,buildStellarUpdatePoolCapsTx:()=>T.buildStellarUpdatePoolCapsTx,buildStellarUpgradeControllerTx:()=>T.buildStellarUpgradeControllerTx,buildStellarUpgradeLiquidityPoolParamsTx:()=>T.buildStellarUpgradeLiquidityPoolParamsTx,buildStellarWithdrawBatchTx:()=>T.buildStellarWithdrawBatchTx,buildStellarWithdrawTx:()=>T.buildStellarWithdrawTx,buildTx:()=>T.buildTx,decodeStellarLendingEvent:()=>T.decodeStellarLendingEvent,encodeInterestRateModel:()=>T.encodeInterestRateModel,encodeMarketOracleConfigInput:()=>T.encodeMarketOracleConfigInput,encodeMarketParamsRaw:()=>T.encodeMarketParamsRaw,encodeOracleSourceConfigInput:()=>T.encodeOracleSourceConfigInput,encodePositionLimits:()=>T.encodePositionLimits,encodeStrategyPayloadToRouteXdr:()=>T.encodeStrategyPayloadToRouteXdr,extractEventOrder:()=>T.extractEventOrder,getStellarAccountPositions:()=>T.getStellarAccountPositions,getStellarAggregatorQuote:()=>T.getStellarAggregatorQuote,getStellarAggregatorRouter:()=>T.getStellarAggregatorRouter,getStellarAsset:()=>T.getStellarAsset,getStellarAssetGraph:()=>T.getStellarAssetGraph,getStellarAssetMarkets:()=>T.getStellarAssetMarkets,getStellarAssetPage:()=>T.getStellarAssetPage,getStellarAssets:()=>T.getStellarAssets,getStellarGovernance:()=>T.getStellarGovernance,getStellarGovernanceProposals:()=>T.getStellarGovernanceProposals,getStellarHub:()=>T.getStellarHub,getStellarHubGraph:()=>T.getStellarHubGraph,getStellarHubs:()=>T.getStellarHubs,getStellarLendingContext:()=>T.getStellarLendingContext,getStellarLendingController:()=>T.getStellarLendingController,getStellarQuoteTokens:()=>T.getStellarQuoteTokens,getStellarReserve:()=>T.getStellarReserve,getStellarReserveGraph:()=>T.getStellarReserveGraph,getStellarReserveHolders:()=>T.getStellarReserveHolders,getStellarReserves:()=>T.getStellarReserves,getStellarSpoke:()=>T.getStellarSpoke,getStellarSpokeGraph:()=>T.getStellarSpokeGraph,getStellarSpokes:()=>T.getStellarSpokes,getStellarUserActivity:()=>T.getStellarUserActivity,getStellarUserPositions:()=>T.getStellarUserPositions,isValidCollectionTicker:()=>p,isValidNftIdentifier:()=>d,mapQuoteResponseToAggregatorSwap:()=>T.mapQuoteResponseToAggregatorSwap,mapQuoteResponseToStrategyPayload:()=>T.mapQuoteResponseToStrategyPayload,mapQuoteResponseToStrategySwap:()=>T.mapQuoteResponseToStrategySwap,mapStellarPositionActivityType:()=>T.mapStellarPositionActivityType,prepareStellarBuiltTx:()=>T.prepareStellarBuiltTx,prepareStellarTxXdr:()=>T.prepareStellarTxXdr,stellarLendingDispatchKey:()=>T.stellarLendingDispatchKey,stellarLendingRead:()=>T.stellarLendingRead,syntheticEventOrder:()=>T.syntheticEventOrder,tagStellarInvokedContractError:()=>T.tagStellarInvokedContractError,toBase64Xdr:()=>T.toBase64Xdr,toStellarPositionMode:()=>T.toStellarPositionMode});const u="https://api.xoxno.com",n="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",i="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",a="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var l;!function(e){e.MAINNET="1",e.DEVNET="D"}(l||(l={}));class s{apiUrl;chain;init;config;constructor({chain:e=l.MAINNET,apiUrl:t=u,...r}={}){this.apiUrl=t??{[l.MAINNET]:u,[l.DEVNET]:"https://devnet-api.xoxno.com"}[e],this.chain=e,this.init=r,this.config=e==l.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:n,DR_SC:i,KG_SC:a,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:n,DR_SC:i,KG_SC:a,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}fetchWithTimeout=async(e,{params:t,...r}={})=>{const{next:o,cache:u,debug:n,...i}=this.init,{next:a,cache:l,debug:s,headers:p,method:d="GET",...c}=r,y=p?.Authorization,b="Bearer undefined"===y?void 0:y,S={...p,Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."PUT"===d?{}:{"Content-Type":"application/json"},...b?{Authorization:b}:{}},g=Object.entries(t??{}).flatMap((([e,t])=>Array.isArray(t)?t.map((t=>`${e}=${encodeURIComponent(t)}`)):`${e}=${encodeURIComponent(t)}`)).join("&"),T=`${this.apiUrl}${e}${g.length?`?${g}`:""}`,{revalidate:f,...m}=o??{},{revalidate:h,...v}=a??{},x="GET"!==d||b?void 0:h??f,q="GET"!==d||b||x?void 0:l??u,_={...i,...c,method:d,...Object.keys(S).length?{headers:S}:{},cache:q,next:{...m,...v,revalidate:x}};(s??n)&&console.debug("SDK fetch: ",T,_);const w=await fetch(T,_).catch((e=>{if(e instanceof Error&&!e.message.match(/^http(s?):\/\//))throw Object.assign(new Error(`${T}: ${e.message}`),{cause:e});throw e})),A=await w.text();if(!w.ok){let e;try{e=JSON.parse(A)}catch{e={message:A}}const t=[T,w.status,w.statusText,e.message].filter(Boolean).join(";;");throw new Error(t)}try{return JSON.parse(A)}catch{return A}}}const p=e=>{const t=/^0x[a-fA-F0-9]{1,64}-[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(e)),r=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(e);return t||r},d=e=>{const t=/^0x[a-fA-F0-9]{1,64}$/.test(e),r=/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,7}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(e);return t||r};class c extends Error{constructor(e){super(`Invalid collection ticker: ${e}`)}}class y extends Error{constructor(e){super(`Invalid address: ${e}`)}}Error,Error;const b=e=>!!e&&(e.startsWith("erd1")&&62===e.length||/^0x[a-fA-F0-9]{40,64}$/.test(e)||/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e)||/^G[A-Z2-7]{55}$/.test(e)),S={"/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/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:{}}}},g=["PATCH","POST","DELETE","PUT"];var T=r(454);const f=e=>e.replace(/-([a-z])/g,((e,t)=>t.toUpperCase())),m=()=>({static:{},params:{},leaves:[]});function h(e,t,r,o){const{input:u,output:n,...i}=t,a=async(t={})=>{const u={...r,...t},n=e.replace(/:([a-zA-Z_]+)/g,((e,t)=>`${u[t]}`)),i=[...e.matchAll(/:([a-zA-Z_]+)/g)].map((e=>e[1])),a=Object.fromEntries(Object.entries(u).filter((([e])=>!i.includes(e)))),l=/:address[^A-Z]/.test(e)||"address"in a,s=/:collection[^A-Z]/.test(e)||"collection"in a;if(l){const e=u.address;if(!b(e))throw new y(e)}if(s){const e=u.collection;if(Array.isArray(e)?e.some((e=>!p(e))):!p(e))throw new c(e)}const d=Object.fromEntries(Object.entries(a).map((([e,t])=>[e,t instanceof FormData?t:"filter"===e||"body"===e?JSON.stringify(t):Array.isArray(t)?t.join(","):t]))),{body:S,auth:g,method:T,headers:f,cache:m,next:h,debug:v,continuationToken:x,...q}=d,_=g?`Bearer ${g}`:void 0,w={...f,..._?{Authorization:_}:{},...x?{"X-Continuation-Token":String(x)}:{}},A={...h,tags:[...h?.tags??[],n]};return o.fetchWithTimeout(n,{method:T,params:q,body:S,headers:w,cache:m,debug:v,...A?{next:A}:{}})},l=(e={})=>a(e);for(const e of Object.keys(i))g.includes(e)&&(l[e]=t=>a({...t,method:t.method??e.toUpperCase()}));return l}function v(e){const t=function(){const e=m();for(const[t,r]of Object.entries(S)){const o=t.split("/").filter(Boolean);let u=e;for(const e of o)if(e.startsWith(":")){const t=f(e.slice(1));u=u.params[t]||=m()}else{const t=f(e);u=u.static[t]||=m()}u.leaves.push({rawPath:t,def:r})}return e}(),r=(t,o)=>{const u=t.leaves.length,n=Object.keys(t.static).length,i=Object.keys(t.params).length;let a;if(1===u&&n+i>0){const{rawPath:r,def:u}=t.leaves[0];a=h(r,u,o,e)}else{a={};for(const{rawPath:r,def:u}of t.leaves)a[f(r.split("/").pop().replace(/^:/,""))]=h(r,u,o,e)}for(const[e,u]of Object.entries(t.static)){const t=r(u,o);let n=t;if(t&&"object"==typeof t&&e in t&&"function"==typeof t[e]){const r=t[e],o=Object.fromEntries(Object.entries(t).filter((([t])=>t!==e)));1===r.length||(Object.assign(r,o),n=r)}void 0===a[e]?a[e]=n:"function"==typeof a[e]?Object.assign(a[e],n):"function"==typeof n?(Object.assign(n,a[e]),a[e]=n):Object.assign(a[e],n)}for(const[e,u]of Object.entries(t.params)){const t=t=>{const n=r(u,{...o,[e]:t});if(n&&"object"==typeof n&&1===Object.keys(n).length&&e in n&&"function"==typeof n[e]){const t=n[e],r=(...e)=>t(...e);return Object.assign(r,t)}return n};if(a[e]){const r=a[e];a[e]=e=>({...r(e),...t(e)})}else a[e]=t}return a};return r(t,{})}module.exports=o})();
1
+ "undefined"!=typeof globalThis&&void 0===globalThis.self&&(globalThis.self=globalThis),(()=>{"use strict";var e={454(e,t,r){r.d(t,{STELLAR_AGGREGATOR_ROUTER:()=>u,STELLAR_GOVERNANCE:()=>n,STELLAR_GOVERNANCE_ZERO_PREDECESSOR:()=>Je,STELLAR_LENDING_CONTROLLER:()=>o,STELLAR_LENDING_TOPICS:()=>rr,STELLAR_NETWORK_PASSPHRASE:()=>l,STELLAR_QUOTE_URL:()=>a,STELLAR_SOROBAN_RPC_URL:()=>i,SYNTHETIC_EVENT_ORDER_STRIDE:()=>nr,XOXNO_LENDING_STELLAR_TICKER:()=>ur,buildSameTokenRepaySwapSteps:()=>wr,buildStellarAcceptOwnershipTx:()=>Ce,buildStellarAddRewardsTx:()=>Ze,buildStellarApproveTokenTx:()=>$e,buildStellarBatchSwapTx:()=>gr,buildStellarBorrowBatchTx:()=>G,buildStellarBorrowTx:()=>N,buildStellarCctpForwardTx:()=>Pr,buildStellarClaimRevenueTx:()=>Qe,buildStellarCreateLiquidityPoolTx:()=>Xe,buildStellarDisableTokenOracleTx:()=>Ve,buildStellarExecuteStrategyTx:()=>Sr,buildStellarFlashLoanTx:()=>V,buildStellarGovernanceExecuteGovernanceUpgradeTx:()=>Ot,buildStellarGovernanceExecuteGrantGovernanceRoleTx:()=>Mt,buildStellarGovernanceExecuteRevokeGovernanceRoleTx:()=>Lt,buildStellarGovernanceExecuteTransferGovOwnTx:()=>Ct,buildStellarGovernanceExecuteTx:()=>kt,buildStellarGovernanceExecuteUpdateDelayTx:()=>It,buildStellarGrantRoleTx:()=>Ie,buildStellarLendingIdentifier:()=>ir,buildStellarLiquidateTx:()=>z,buildStellarMigrateFromBlendTx:()=>j,buildStellarMigrateTx:()=>Ee,buildStellarMultiplyTx:()=>H,buildStellarPauseTx:()=>ke,buildStellarProposeApproveBlendPoolTx:()=>yt,buildStellarProposeApproveTokenTx:()=>dt,buildStellarProposeConfigureMarketOracleTx:()=>qt,buildStellarProposeCreateLiquidityPoolTx:()=>St,buildStellarProposeDeployPoolTx:()=>Tt,buildStellarProposeDisableTokenOracleTx:()=>mt,buildStellarProposeEditOracleToleranceTx:()=>_t,buildStellarProposeGovernanceUpgradeTx:()=>wt,buildStellarProposeGrantGovernanceRoleTx:()=>Pt,buildStellarProposeMigrateControllerTx:()=>vt,buildStellarProposeRevokeBlendPoolTx:()=>bt,buildStellarProposeRevokeGovernanceRoleTx:()=>Rt,buildStellarProposeRevokeTokenTx:()=>ct,buildStellarProposeSetAccumulatorTx:()=>at,buildStellarProposeSetAggregatorTx:()=>it,buildStellarProposeSetMinBorrowCollatTx:()=>pt,buildStellarProposeSetPoolTemplateTx:()=>lt,buildStellarProposeSetPositionLimitsTx:()=>st,buildStellarProposeTransferCtrlOwnershipTx:()=>xt,buildStellarProposeTransferGovOwnTx:()=>Et,buildStellarProposeUpdateDelayTx:()=>At,buildStellarProposeUpgradeControllerTx:()=>ht,buildStellarProposeUpgradePoolParamsTx:()=>gt,buildStellarProposeUpgradePoolTx:()=>ft,buildStellarRenewAccountTx:()=>He,buildStellarRepayBatchTx:()=>D,buildStellarRepayDebtWithCollateralTx:()=>Q,buildStellarRepayTx:()=>W,buildStellarRevokeRoleTx:()=>Me,buildStellarRevokeTokenTx:()=>De,buildStellarSetAccumulatorTx:()=>Ge,buildStellarSetAggregatorTx:()=>Ue,buildStellarSetLiquidityPoolTemplateTx:()=>Ne,buildStellarSetMarketOracleConfigTx:()=>We,buildStellarSetOracleToleranceTx:()=>ze,buildStellarSetPositionLimitsTx:()=>Be,buildStellarSupplyBatchTx:()=>C,buildStellarSupplyTx:()=>U,buildStellarSwapCollateralTx:()=>F,buildStellarSwapDebtTx:()=>X,buildStellarTransferOwnershipTx:()=>Le,buildStellarUnpauseTx:()=>Oe,buildStellarUpdateAccountThresholdTx:()=>Ke,buildStellarUpdateIndexesTx:()=>je,buildStellarUpgradeControllerTx:()=>Re,buildStellarUpgradeLiquidityPoolParamsTx:()=>Fe,buildStellarWithdrawBatchTx:()=>B,buildStellarWithdrawTx:()=>$,buildTx:()=>L,decodeStellarLendingEvent:()=>or,encodeInterestRateModel:()=>ve,encodeMarketOracleConfigInput:()=>Pe,encodeMarketParamsRaw:()=>xe,encodeOracleSourceConfigInput:()=>Ae,encodePositionLimits:()=>qe,encodeStrategyPayloadToRouteXdr:()=>br,extractEventOrder:()=>ar,getStellarAccountPositions:()=>ye,getStellarAggregatorQuote:()=>cr,getStellarAggregatorRouter:()=>p,getStellarAsset:()=>ie,getStellarAssetGraph:()=>Se,getStellarAssetMarkets:()=>le,getStellarAssetPage:()=>ae,getStellarAssets:()=>ee,getStellarGovernance:()=>d,getStellarGovernanceProposals:()=>be,getStellarHub:()=>se,getStellarHubGraph:()=>ge,getStellarHubs:()=>te,getStellarLendingContext:()=>Y,getStellarLendingController:()=>s,getStellarQuoteTokens:()=>yr,getStellarReserve:()=>ue,getStellarReserveGraph:()=>fe,getStellarReserveHolders:()=>ne,getStellarReserves:()=>oe,getStellarSpoke:()=>pe,getStellarSpokeGraph:()=>Te,getStellarSpokes:()=>re,getStellarUserActivity:()=>ce,getStellarUserPositions:()=>de,mapQuoteResponseToAggregatorSwap:()=>mr,mapQuoteResponseToStrategyPayload:()=>Tr,mapQuoteResponseToStrategySwap:()=>fr,mapStellarPositionActivityType:()=>sr,prepareStellarBuiltTx:()=>qr,prepareStellarTxXdr:()=>xr,stellarLendingDispatchKey:()=>Nt,stellarLendingRead:()=>me,syntheticEventOrder:()=>lr,tagStellarInvokedContractError:()=>vr,toBase64Xdr:()=>Ut,toStellarPositionMode:()=>_r});const o={mainnet:process.env.STELLAR_LENDING_CONTROLLER_MAINNET??"",testnet:process.env.STELLAR_LENDING_CONTROLLER_TESTNET??""},u={mainnet:process.env.STELLAR_AGGREGATOR_ROUTER_MAINNET??"",testnet:process.env.STELLAR_AGGREGATOR_ROUTER_TESTNET??""},n={mainnet:process.env.STELLAR_GOVERNANCE_MAINNET??"",testnet:process.env.STELLAR_GOVERNANCE_TESTNET??""},i={mainnet:"https://soroban-rpc.stellar.org",testnet:"https://soroban-testnet.stellar.org"},a={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"},l={mainnet:"Public Global Stellar Network ; September 2015",testnet:"Test SDF Network ; September 2015"};function s(e){const t=o[e];if(!t)throw new Error(`Stellar lending controller address not configured for network "${e}". Set STELLAR_LENDING_CONTROLLER_${e.toUpperCase()} env var.`);return t}function p(e){const t=u[e];if(!t)throw new Error(`Stellar aggregator router address not configured for network "${e}". Set STELLAR_AGGREGATOR_ROUTER_${e.toUpperCase()} env var.`);return t}function d(e){const t=n[e];if(!t)throw new Error(`Stellar governance address not configured for network "${e}". Set STELLAR_GOVERNANCE_${e.toUpperCase()} env var.`);return t}const c=require("@stellar/stellar-sdk"),y=["Soroswap","Aquarius","Phoenix","Sushi","CometDex"],b=e=>new c.Address(e).toScVal(),S=e=>new c.ScInt(e).toI128(),g=e=>c.xdr.ScVal.scvU32(e),T=e=>new c.ScInt("string"==typeof e?e:e.toString()).toU64(),f=e=>c.xdr.ScVal.scvBool(e),m=e=>c.xdr.ScVal.scvString(e),h=e=>c.xdr.ScVal.scvSymbol(e),v=()=>c.xdr.ScVal.scvVoid(),x=e=>c.xdr.ScVal.scvVec(e),q=(e,t=32)=>{const r=e.startsWith("0x")?e.slice(2):e,o=Buffer.from(r,"hex");if(o.length!==t)throw new Error(`Stellar builder: expected a ${t}-byte BytesN (got ${o.length} bytes from "${e}")`);return c.xdr.ScVal.scvBytes(o)},_=(e,t)=>null==e?v():t(e),w=(e,t)=>R({asset:b(t),hub_id:g(e)}),A=(e,t,r)=>c.xdr.ScVal.scvVec([w(e,t),S(r)]),P=e=>c.xdr.ScVal.scvVec(e.map((e=>A(e.hubId,e.asset,e.amount)))),R=e=>{const t=Object.keys(e).sort().map((t=>new c.xdr.ScMapEntry({key:h(t),val:e[t]})));return c.xdr.ScVal.scvMap(t)},E=e=>{const t=e.paths.map((e=>{const t=e.hops.map((e=>{return R({amount_out:S(e.amountOut),pool:b(e.pool),token_in:b(e.tokenIn),token_out:b(e.tokenOut),venue:(t=e.venue,c.xdr.ScVal.scvVec([h(t)]))});var t}));return R({hops:c.xdr.ScVal.scvVec(t),split_ppm:g(e.splitPpm)})}));return R({paths:c.xdr.ScVal.scvVec(t),referral_id:T(e.referralId??0),token_in:b(e.tokenIn),token_out:b(e.tokenOut),total_min_out:S(e.totalMinOut)})},k=e=>{const t=Buffer.from(e);if(0===t.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return c.xdr.ScVal.scvBytes(t)},O=e=>{const t=e.trim();if(t.startsWith("0x")){const e=t.slice(2);if(!((r=e).length>0&&r.length%2==0&&/^[0-9a-fA-F]+$/.test(r)))throw new Error("Stellar builder: strategy swap bytes hex string must be 0x-prefixed and even-length");return Buffer.from(e,"hex")}var r;if(!/^[A-Za-z0-9+/]+={0,2}$/.test(t))throw new Error("Stellar builder: strategy swap bytes must be base64 routeXdr or 0x-prefixed hex");const o=Buffer.from(t,"base64");if(0===o.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return o},I=e=>{if("string"==typeof e)return k(O(e));if(e instanceof Uint8Array)return k(e);if(e&&"object"==typeof e)return"routeXdr"in(r=e)&&"string"==typeof r.routeXdr?k(O(e.routeXdr)):(e=>"swapXdr"in e&&"string"==typeof e.swapXdr)(e)?k(O(e.swapXdr)):(e=>"bytes"in e&&("string"==typeof e.bytes||e.bytes instanceof Uint8Array))(e)?"string"==typeof e.bytes?k(O(e.bytes)):k(e.bytes):(t=(e=>{if(!e||"object"!=typeof e)throw new Error("Stellar builder: decoded strategy `steps` must be a StrategyPayload ({ paths, tokenIn, tokenOut, totalMinOut })");const t=e;if(!Array.isArray(t.paths)||0===t.paths.length)throw new Error("Stellar builder: `steps.paths` must be a non-empty array of strategy paths");if("string"!=typeof t.tokenIn)throw new Error("Stellar builder: `steps.tokenIn` must be a contract address");if("string"!=typeof t.tokenOut)throw new Error("Stellar builder: `steps.tokenOut` must be a contract address");if("string"!=typeof t.totalMinOut)throw new Error("Stellar builder: `steps.totalMinOut` must be an i128 decimal string");let r=0;for(const[e,o]of t.paths.entries()){if(!o||"number"!=typeof o.splitPpm||o.splitPpm<=0||!Array.isArray(o.hops)||0===o.hops.length)throw new Error(`Stellar builder: \`steps.paths[${e}]\` must have splitPpm > 0 and a non-empty hops array`);r+=o.splitPpm;for(const[t,r]of o.hops.entries())if(!r||"string"!=typeof r.amountOut||"string"!=typeof r.pool||"string"!=typeof r.tokenIn||"string"!=typeof r.tokenOut||!y.includes(r.venue))throw new Error(`Stellar builder: \`steps.paths[${e}].hops[${t}]\` must have amountOut, pool, tokenIn, tokenOut, and a valid Soroban venue`)}if(1e6!==r)throw new Error(`Stellar builder: \`steps.paths[].splitPpm\` must sum to 1_000_000, got ${r}`);return t})(e),c.xdr.ScVal.scvBytes(Buffer.from(E(t).toXDR("base64"),"base64")));var t,r;throw new Error("Stellar builder: `steps` must be opaque strategy bytes (`routeXdr`, base64/hex string, or Uint8Array)")},M=e=>{if("string"==typeof e)return(e=>{const t=e.startsWith("0x")?e.slice(2):e,r=Buffer.from(t,"hex");return c.xdr.ScVal.scvBytes(r)})(e);if(e instanceof Uint8Array)return c.xdr.ScVal.scvBytes(Buffer.from(e));throw new Error("Stellar builder: `data` must be a hex string or Uint8Array (Soroban Bytes payload)")};function L(e,t,r){const o=e.controllerAddress??s(e.network),u=new c.Contract(o),n=new c.Account(e.caller,e.sourceSequence);return{xdr:new c.TransactionBuilder(n,{fee:e.fee??c.BASE_FEE,networkPassphrase:l[e.network]}).addOperation(u.call(t,...r)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function C(e,t){const r=t.accountNonce??0,o=t.spokeId??0;return L(e,"supply",[b(e.caller),T(r),g(o),P([...t.assets])])}function U(e,t){return C(e,{accountNonce:t.accountNonce,spokeId:t.spokeId,assets:[{hubId:t.hubId,asset:t.asset,amount:t.amount}]})}function G(e,t){return L(e,"borrow",[b(e.caller),T(t.accountNonce),P([...t.borrows]),_(t.to,b)])}function N(e,t){return G(e,{accountNonce:t.accountNonce,borrows:[{hubId:t.hubId,asset:t.asset,amount:t.amount}],to:t.to})}function B(e,t){return L(e,"withdraw",[b(e.caller),T(t.accountNonce),P([...t.withdrawals]),_(t.to,b)])}function $(e,t){return B(e,{accountNonce:t.accountNonce,withdrawals:[{hubId:t.hubId,asset:t.asset,amount:t.amount}],to:t.to})}function D(e,t){return L(e,"repay",[b(e.caller),T(t.accountNonce),P([...t.payments])])}function W(e,t){return D(e,{accountNonce:t.accountNonce,payments:[{hubId:t.hubId,asset:t.asset,amount:t.amount}]})}function z(e,t){return L(e,"liquidate",[b(e.caller),T(t.accountNonce),P([...t.debtPayments])])}function V(e,t){return L(e,"flash_loan",[b(e.caller),w(t.hubId,t.asset),S(t.amount),b(t.receiver),M(t.data)])}function j(e,t){return L(e,"migrate_from_blend",[b(e.caller),T(t.accountId),g(t.spokeId),g(t.hubId),b(t.blendPool),x(t.collateralTokens.map(b)),x(t.supplyTokens.map(b)),(r=t.debtCaps.map((e=>({token:e.token,amount:e.cap}))),c.xdr.ScVal.scvVec(r.map((e=>{return t=e.token,r=e.amount,c.xdr.ScVal.scvVec([b(t),S(r)]);var t,r}))))]);var r}function H(e,t){const r=t.accountNonce??0,o=t.spokeId??0;return L(e,"multiply",[b(e.caller),T(r),g(o),w(t.collateral.hubId,t.collateral.asset),S(t.debtToFlashLoan),w(t.debt.hubId,t.debt.asset),g(t.mode),I(t.steps),_(t.initialPayment,(e=>A(e.hubId,e.asset,e.amount))),_(t.convertSwap,I)])}function X(e,t){return L(e,"swap_debt",[b(e.caller),T(t.accountNonce),w(t.existingDebt.hubId,t.existingDebt.asset),S(t.newDebtAmount),w(t.newDebt.hubId,t.newDebt.asset),I(t.steps)])}function F(e,t){return L(e,"swap_collateral",[b(e.caller),T(t.accountNonce),w(t.current.hubId,t.current.asset),S(t.fromAmount),w(t.newCollateral.hubId,t.newCollateral.asset),I(t.steps)])}function Q(e,t){return L(e,"repay_debt_with_collateral",[b(e.caller),T(t.accountNonce),w(t.collateral.hubId,t.collateral.asset),S(t.collateralAmount),w(t.debt.hubId,t.debt.asset),I(t.steps),f(t.closePosition)])}const Z="/stellar-lending",K=25,J=encodeURIComponent,Y=(e,t)=>e.fetchWithTimeout(`${Z}/context`,t),ee=(e,t)=>e.fetchWithTimeout(`${Z}/assets`,t),te=(e,t)=>e.fetchWithTimeout(`${Z}/hubs`,t),re=(e,t)=>e.fetchWithTimeout(`${Z}/spokes`,t),oe=(e,t={},r)=>{const{hubId:o,spokeId:u,asset:n}=t;return e.fetchWithTimeout(`${Z}/reserves`,{...r,params:{...void 0!==o?{hubId:o}:{},...void 0!==u?{spokeId:u}:{},...n?{asset:n}:{}}})},ue=(e,t,r,o,u)=>e.fetchWithTimeout(`${Z}/reserves/${t}/${r}/${J(o)}`,u),ne=(e,t,r,o,u,n)=>e.fetchWithTimeout(`${Z}/reserves/${t}/${r}/${J(o)}/holders`,{...n,params:{side:u}}),ie=(e,t,r)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}`,r),ae=(e,t,r,o)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}/page`,{...o,params:{...r}}),le=(e,t,r,o)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}/markets`,{...o,params:{side:r}}),se=(e,t,r)=>e.fetchWithTimeout(`${Z}/hubs/${t}`,r),pe=(e,t,r)=>e.fetchWithTimeout(`${Z}/spokes/${t}`,r),de=(e,t,r)=>e.fetchWithTimeout(`${Z}/users/${J(t)}/positions`,r),ce=(e,t,r={},o)=>{const{skip:u,top:n}=r;return e.fetchWithTimeout(`${Z}/users/${J(t)}/activity`,{...o,params:{...void 0!==u?{skip:u}:{},...void 0!==n?{top:n}:{}}})},ye=(e,t,r)=>e.fetchWithTimeout(`${Z}/accounts/${J(t)}/positions`,r),be=(e,t={},r)=>{const{top:o=K,continuationToken:u}=t;return e.fetchWithTimeout(`${Z}/governance/proposals`,{...r,params:{top:o,...u?{continuationToken:u}:{}}})},Se=(e,t,r,o)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}/graph`,{...o,params:{...r}}),ge=(e,t,r,o)=>e.fetchWithTimeout(`${Z}/hubs/${t}/graph`,{...o,params:{...r}}),Te=(e,t,r,o)=>e.fetchWithTimeout(`${Z}/spokes/${t}/graph`,{...o,params:{...r}}),fe=(e,t,r,o,u,n)=>e.fetchWithTimeout(`${Z}/reserves/${t}/${r}/${J(o)}/graph`,{...n,params:{...u}}),me=e=>({context:t=>Y(e,t),assets:t=>ee(e,t),hubs:t=>te(e,t),spokes:t=>re(e,t),reserves:(t,r)=>{return void 0===(o=t)||"hubId"in o||"spokeId"in o||"asset"in o?oe(e,t,r):oe(e,{},t);var o},reserve:(t,r,o,u)=>ue(e,t,r,o,u),reserveHolders:(t,r,o,u,n)=>ne(e,t,r,o,u,n),asset:(t,r)=>ie(e,t,r),assetMarkets:(t,r,o)=>le(e,t,r,o),hub:(t,r)=>se(e,t,r),spoke:(t,r)=>pe(e,t,r),userPositions:(t,r)=>de(e,t,r),userActivity:(t,r,o)=>ce(e,t,r,o),accountPositions:(t,r)=>ye(e,t,r),governanceProposals:(t,r)=>be(e,t,r),assetGraph:(t,r,o)=>Se(e,t,r,o),hubGraph:(t,r,o)=>ge(e,t,r,o),spokeGraph:(t,r,o)=>Te(e,t,r,o),reserveGraph:(t,r,o,u,n)=>fe(e,t,r,o,u,n)}),he={Single:0,PrimaryWithAnchor:1},ve=e=>R({base_borrow_rate:S(e.baseBorrowRateRay),max_borrow_rate:S(e.maxBorrowRateRay),max_utilization:S(e.maxUtilizationRay),mid_utilization:S(e.midUtilizationRay),optimal_utilization:S(e.optimalUtilizationRay),reserve_factor:g(e.reserveFactorBps),slope1:S(e.slope1Ray),slope2:S(e.slope2Ray),slope3:S(e.slope3Ray)}),xe=e=>R({asset_decimals:g(e.assetDecimals),asset_id:b(e.assetId),base_borrow_rate:S(e.baseBorrowRateRay),flashloan_fee:g(e.flashloanFeeBps),is_flashloanable:f(e.isFlashloanable),max_borrow_rate:S(e.maxBorrowRateRay),max_utilization:S(e.maxUtilizationRay),mid_utilization:S(e.midUtilizationRay),optimal_utilization:S(e.optimalUtilizationRay),reserve_factor:g(e.reserveFactorBps),slope1:S(e.slope1Ray),slope2:S(e.slope2Ray),slope3:S(e.slope3Ray)}),qe=e=>R({max_borrow_positions:g(e.maxBorrowPositions),max_supply_positions:g(e.maxSupplyPositions)}),_e=e=>{const t=e.kind;switch(t){case"Stellar":return x([h("Stellar"),b(e.value)]);case"Symbol":return x([h("Symbol"),h(e.value)]);case"String":return x([h("String"),m(e.value)]);default:throw new Error(`Stellar builder: unknown oracle asset ref kind "${t}"`)}},we=(e,t)=>{if("Twap"===e){if("number"!=typeof t)throw new Error("Stellar builder: oracle source with Twap read mode requires `twapRecords`");return x([h("Twap"),g(t)])}return x([h("Spot")])},Ae=e=>{const t=e.provider;if("ReflectorSep40"===t){if(!e.asset)throw new Error("Stellar builder: Reflector oracle source requires `asset`");return x([h("Reflector"),R({asset:_e(e.asset),contract:b(e.contract),read_mode:we(e.readMode,e.twapRecords)})])}if("RedStonePriceFeed"===t){if("string"!=typeof e.feedId)throw new Error("Stellar builder: RedStone oracle source requires `feedId`");if("number"!=typeof e.maxStaleSeconds)throw new Error("Stellar builder: RedStone oracle source requires `maxStaleSeconds`");return x([h("RedStone"),R({contract:b(e.contract),feed_id:m(e.feedId),max_stale_seconds:T(e.maxStaleSeconds)})])}throw new Error(`Stellar builder: unknown oracle provider "${t}"`)},Pe=e=>{const t=he[e.strategy];if(void 0===t)throw new Error(`Stellar builder: unknown oracle strategy "${e.strategy}"`);return R({anchor:(r=e.anchor,x(null==r?[h("None")]:[h("Some"),Ae(r)])),max_price_stale_seconds:T(e.maxPriceStaleSeconds),max_sanity_price_wad:S(e.maxSanityPriceWad),min_sanity_price_wad:S(e.minSanityPriceWad),primary:Ae(e.primary),strategy:g(t),tolerance_bps:g(e.toleranceBps)});var r};function Re(e,t){return L(e,"upgrade",[q(t.wasmHash)])}function Ee(e,t){return L(e,"migrate",[g(t.newVersion)])}function ke(e){return L(e,"pause",[])}function Oe(e){return L(e,"unpause",[])}function Ie(e,t){return L(e,"grant_role",[b(t.account),h(t.role)])}function Me(e,t){return L(e,"revoke_role",[b(t.account),h(t.role)])}function Le(e,t){return L(e,"transfer_ownership",[b(t.newOwner),g(t.liveUntilLedger)])}function Ce(e){return L(e,"accept_ownership",[])}function Ue(e,t){return L(e,"set_aggregator",[b(t.aggregator)])}function Ge(e,t){return L(e,"set_accumulator",[b(t.accumulator)])}function Ne(e,t){return L(e,"set_liquidity_pool_template",[q(t.wasmHash)])}function Be(e,t){return L(e,"set_position_limits",[qe(t)])}function $e(e,t){return L(e,"approve_token",[b(t.token)])}function De(e,t){return L(e,"revoke_token",[b(t.token)])}function We(e,t){return L(e,"set_market_oracle_config",[w(t.hubId,t.asset),Pe(t.config)])}function ze(e,t){return L(e,"set_oracle_tolerance",[b(t.asset),R({lower_ratio_bps:g(t.lowerRatioBps),upper_ratio_bps:g(t.upperRatioBps)})])}function Ve(e,t){return L(e,"disable_token_oracle",[b(t.asset)])}function je(e,t){return L(e,"update_indexes",[b(e.caller),x(t.assets.map((e=>w(e.hubId,e.asset))))])}function He(e,t){return L(e,"renew_account",[b(e.caller),T(t.accountNonce)])}function Xe(e,t){return L(e,"create_liquidity_pool",[g(t.hubId),b(t.asset),xe(t.params)])}function Fe(e,t){return L(e,"upgrade_liquidity_pool_params",[w(t.hubId,t.asset),ve(t.params)])}function Qe(e,t){return L(e,"claim_revenue",[b(e.caller),x(t.assets.map((e=>w(e.hubId,e.asset))))])}function Ze(e,t){return L(e,"add_rewards",[b(e.caller),P(t.rewards)])}function Ke(e,t){return L(e,"update_account_threshold",[b(e.caller),f(t.hasRisks),x(t.accountNonces.map((e=>T(e))))])}const Je="00".repeat(32),Ye=e=>{if("string"==typeof e)return q(e);const t=Buffer.from(e);if(32!==t.length)throw new Error(`Stellar governance builder: expected a 32-byte salt (got ${t.length} bytes)`);return c.xdr.ScVal.scvBytes(t)},et=(e,...t)=>x([h(e),...t]),tt=e=>R({new_owner:b(e.newOwner),live_until_ledger:g(e.liveUntilLedger)}),rt=e=>R({account:b(e.account),role:h(e.role)});function ot(e,t,r){const o=e.governanceAddress??d(e.network),u=new c.Contract(o),n=new c.Account(e.caller,e.sourceSequence);return{xdr:new c.TransactionBuilder(n,{fee:e.fee??c.BASE_FEE,networkPassphrase:l[e.network]}).addOperation(u.call(t,...r)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}const ut=(e,t,r)=>ot(e,"propose",[b(e.caller),t,Ye(r)]),nt=(e,t,r)=>ot(e,"execute_self",[v(),t,Ye(r)]);function it(e,t,r){return ut(e,et("SetAggregator",b(t.aggregator)),r)}function at(e,t,r){return ut(e,et("SetAccumulator",b(t.accumulator)),r)}function lt(e,t,r){return ut(e,et("SetLiquidityPoolTemplate",q(t.wasmHash)),r)}function st(e,t,r){return ut(e,et("SetPositionLimits",qe(t)),r)}function pt(e,t,r){return ut(e,et("SetMinBorrowCollateralUsd",S(t.floorWad)),r)}function dt(e,t,r){return ut(e,et("ApproveToken",b(t.token)),r)}function ct(e,t,r){return ut(e,et("RevokeToken",b(t.token)),r)}function yt(e,t,r){return ut(e,et("ApproveBlendPool",b(t.pool)),r)}function bt(e,t,r){return ut(e,et("RevokeBlendPool",b(t.pool)),r)}function St(e,t,r){return ut(e,et("CreateLiquidityPool",R({asset:b((o=t).asset),hub_id:g(o.hubId),params:xe(o.params)})),r);var o}function gt(e,t,r){return ut(e,et("UpgradeLiquidityPoolParams",R({hub_asset:w((o=t).hubId,o.asset),params:ve(o.params)})),r);var o}function Tt(e,t){return ut(e,et("DeployPool"),t)}function ft(e,t,r){return ut(e,et("UpgradePool",q(t.wasmHash)),r)}function mt(e,t,r){return ut(e,et("DisableTokenOracle",b(t.asset)),r)}function ht(e,t,r){return ut(e,et("UpgradeController",q(t.wasmHash)),r)}function vt(e,t,r){return ut(e,et("MigrateController",g(t.newVersion)),r)}function xt(e,t,r){return ut(e,et("TransferCtrlOwnership",tt(t)),r)}function qt(e,t,r){return ut(e,et("ConfigureMarketOracle",R({cfg:Pe((o=t).config),hub_asset:w(o.hubId,o.asset)})),r);var o}function _t(e,t,r){return ut(e,et("EditOracleTolerance",R({asset:b((o=t).asset),tolerance:g(o.tolerance)})),r);var o}function wt(e,t,r){return ut(e,et("UpgradeGov",q(t.wasmHash)),r)}function At(e,t,r){return ut(e,et("UpdateGovDelay",g(t.newDelay)),r)}function Pt(e,t,r){return ut(e,et("GrantGovRole",rt(t)),r)}function Rt(e,t,r){return ut(e,et("RevokeGovRole",rt(t)),r)}function Et(e,t,r){return ut(e,et("TransferGovOwnership",tt(t)),r)}function kt(e,t){const r=x(t.argsXdr.map((e=>c.xdr.ScVal.fromXDR(e,"base64")))),o=Ye(t.predecessor??Je);return ot(e,"execute",[v(),b(t.target),h(t.functionName),r,o,Ye(t.salt)])}function Ot(e,t,r){return nt(e,et("UpgradeGov",q(t.wasmHash)),r)}function It(e,t,r){return nt(e,et("UpdateGovDelay",g(t.newDelay)),r)}function Mt(e,t,r){return nt(e,et("GrantGovRole",rt(t)),r)}function Lt(e,t,r){return nt(e,et("RevokeGovRole",rt(t)),r)}function Ct(e,t,r){return nt(e,et("TransferGovOwnership",tt(t)),r)}const Ut=e=>e.toXDR("base64"),Gt=e=>c.xdr.ScVal.fromXDR(e,"base64"),Nt=e=>e.map((e=>String((0,c.scValToNative)(Gt(e))))).join(":"),Bt=e=>"bigint"==typeof e||"number"==typeof e?e.toString():String(e),$t=e=>Number(e),Dt=e=>String(e),Wt=e=>null==e?void 0:Bt(e),zt=e=>null==e?void 0:Dt(e),Vt=e=>e instanceof Uint8Array?Buffer.from(e).toString("hex"):Buffer.isBuffer(e)?e.toString("hex"):String(e),jt=["None","Multiply","Long","Short"],Ht=["Single","PrimaryWithAnchor"],Xt=["ReflectorSep40","RedStonePriceFeed"],Ft=["Spot","Twap"],Qt=["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"],Zt=e=>Array.isArray(e)?e:[],Kt=(e,t)=>{const r="Borrow"===t;return{action:(o=e[0],Qt[$t(o)]??Bt(o)),positionType:t,hubId:$t(e[1]),asset:Dt(e[2]),scaledAmountRay:Bt(e[3]),indexRay:Bt(e[4]),amount:Bt(e[5]),liquidationThresholdBps:r?void 0:$t(e[6]),liquidationBonusBps:r?void 0:$t(e[7]),loanToValueBps:r?void 0:$t(e[8]),liquidationFeesBps:r?void 0:$t(e[9])};var o},Jt=e=>{return{owner:Dt(e[0]),spokeId:$t(e[1]),mode:(t=e[2],jt[$t(t)]??"None")};var t},Yt=(e,t)=>{const r=Ft[$t(e[`${t}_read_mode`])]??"Spot",o=e[`${t}_asset`],u=e[`${t}_symbol`],n=null!=o?{kind:"Stellar",value:Dt(o)}:null!=u?{kind:"Symbol",value:Dt(u)}:void 0;return{provider:Xt[$t(e[`${t}_provider`])]??"ReflectorSep40",contractAddress:Dt(e[`${t}_contract`]),asset:n,feedId:zt(e[`${t}_feed_id`]),readMode:r,twapRecords:"Twap"===r?$t(e[`${t}_twap_records`]):void 0,decimals:$t(e[`${t}_decimals`]),resolutionSeconds:$t(e[`${t}_resolution_seconds`]),maxStaleSeconds:$t(e[`${t}_max_stale_seconds`])}},er=e=>{const t=null!==e.anchor_provider&&void 0!==e.anchor_provider;return{baseTokenId:Dt(e.base_token_id),quoteTokenId:Dt(e.quote_token_id),tolerance:{upperRatio:$t(e.upper_ratio_bps??e.tolerance?.upper_ratio_bps),lowerRatio:$t(e.lower_ratio_bps??e.tolerance?.lower_ratio_bps)},assetDecimals:$t(e.asset_decimals),maxPriceStaleSeconds:$t(e.max_price_stale_seconds),strategy:Ht[$t(e.strategy)]??"Single",primary:Yt(e,"primary"),anchor:t?Yt(e,"anchor"):void 0,primaryQuoteToken:zt(e.primary_quote_token),anchorQuoteToken:zt(e.anchor_quote_token),minSanityPriceWad:Wt(e.min_sanity_price_wad),maxSanityPriceWad:Wt(e.max_sanity_price_wad)}},tr={"market:create":e=>({topic:"market:create",data:{hubId:$t(e.hub_id),baseAsset:Dt(e.base_asset),maxBorrowRate:Bt(e.max_borrow_rate),baseBorrowRate:Bt(e.base_borrow_rate),slope1:Bt(e.slope1),slope2:Bt(e.slope2),slope3:Bt(e.slope3),midUtilization:Bt(e.mid_utilization),optimalUtilization:Bt(e.optimal_utilization),maxUtilization:Bt(e.max_utilization),reserveFactor:$t(e.reserve_factor),marketAddress:Dt(e.market_address)}}),"market:params_update":e=>({topic:"market:params_update",data:{asset:Dt(e.asset),maxBorrowRateRay:Bt(e.max_borrow_rate),baseBorrowRateRay:Bt(e.base_borrow_rate),slope1Ray:Bt(e.slope1),slope2Ray:Bt(e.slope2),slope3Ray:Bt(e.slope3),midUtilizationRay:Bt(e.mid_utilization),optimalUtilizationRay:Bt(e.optimal_utilization),maxUtilizationRay:Bt(e.max_utilization),reserveFactorBps:$t(e.reserve_factor)}}),"market:batch_state_update":e=>({topic:"market:batch_state_update",data:{updates:Zt(e).map((e=>{return t=Zt(e),{hubId:$t(t[0]),asset:Dt(t[1]),timestamp:$t(t[2]),supplyIndexRay:Bt(t[3]),borrowIndexRay:Bt(t[4]),cash:Bt(t[5]),suppliedRay:Bt(t[6]),borrowedRay:Bt(t[7]),revenueRay:Bt(t[8])};var t}))}}),"market:batch_params_update":e=>({topic:"market:batch_params_update",data:{updates:Zt(e).map((e=>{const t=e;return{hubId:$t(t.hub_id),asset:Dt(t.asset),params:(r=t.params,{maxBorrowRateRay:Bt(r.max_borrow_rate),baseBorrowRateRay:Bt(r.base_borrow_rate),slope1Ray:Bt(r.slope1),slope2Ray:Bt(r.slope2),slope3Ray:Bt(r.slope3),midUtilizationRay:Bt(r.mid_utilization),optimalUtilizationRay:Bt(r.optimal_utilization),maxUtilizationRay:Bt(r.max_utilization),reserveFactorBps:$t(r.reserve_factor),isFlashloanable:Boolean(r.is_flashloanable),flashloanFeeBps:$t(r.flashloan_fee),assetId:Dt(r.asset_id),assetDecimals:$t(r.asset_decimals)})};var r}))}}),"position:batch_update":e=>{const t=Zt(e);return{topic:"position:batch_update",data:{accountId:Bt(t[0]),accountAttributes:Jt(Zt(t[1])),updates:[...Zt(t[2]).map((e=>Kt(Zt(e),"Deposit"))),...Zt(t[3]).map((e=>Kt(Zt(e),"Borrow")))]}}},"position:flash_loan":e=>({topic:"position:flash_loan",data:{hubId:$t(e.hub_id),asset:Dt(e.asset),receiver:Dt(e.receiver),caller:Dt(e.caller),amount:Bt(e.amount),fee:Bt(e.fee)}}),"config:oracle":e=>({topic:"config:oracle",data:{asset:Dt(e.asset),oracle:er(e.oracle)}}),"position:liquidation":e=>({topic:"position:liquidation",data:{liquidator:Dt(e.liquidator),accountId:Bt(e.account_id),repaidUsdWad:Bt(e.repaid_usd_wad),bonusBps:Bt(e.bonus_bps)}}),"debt:bad_debt":e=>({topic:"debt:bad_debt",data:{accountId:Bt(e.account_id),totalBorrowUsdWad:Bt(e.total_borrow_usd_wad),totalCollateralUsdWad:Bt(e.total_collateral_usd_wad)}}),"strategy:initial_payment":e=>({topic:"strategy:initial_payment",data:{token:Dt(e.token),amount:Bt(e.amount),usdValueWad:Bt(e.usd_value_wad),accountId:Bt(e.account_id)}}),"strategy:fee":e=>({topic:"strategy:fee",data:{hubId:$t(e.hub_id),asset:Dt(e.asset),amount:Bt(e.amount),fee:Bt(e.fee),amountSent:Bt(e.amount_sent)}}),"config:approve_token":e=>({topic:"config:approve_token",data:{wasmHash:Vt(e.wasm_hash),approved:Boolean(e.approved)}}),"config:aggregator":e=>({topic:"config:aggregator",data:{aggregator:Dt(e.aggregator)}}),"config:accumulator":e=>({topic:"config:accumulator",data:{accumulator:Dt(e.accumulator)}}),"config:pool_template":e=>({topic:"config:pool_template",data:{wasmHash:Vt(e.wasm_hash)}}),"config:position_limits":e=>({topic:"config:position_limits",data:{maxSupplyPositions:$t(e.max_supply_positions),maxBorrowPositions:$t(e.max_borrow_positions)}}),"config:oracle_disabled":e=>({topic:"config:oracle_disabled",data:{asset:Dt(e.asset)}}),"config:spoke":e=>{const t=e.spoke;return{topic:"config:spoke",data:{spokeId:$t(t.spoke_id),isDeprecated:Boolean(t.is_deprecated),liquidationTargetHfWad:Bt(t.liquidation_target_hf_wad),healthFactorForMaxBonusWad:Bt(t.hf_for_max_bonus_wad),liquidationBonusFactorBps:$t(t.liquidation_bonus_factor_bps)}}}},rr=Object.freeze(Object.keys(tr));function or(e,t){const r=Nt(e),o=tr[r];return o?o((0,c.scValToNative)(Gt(t))):null}const ur="XLENDXLM-a7c9f3",nr=1e4;function ir(e){const t=BigInt(e).toString(16),r=t.length%2==0?t:`0${t}`;return`${ur}-${r}`}function ar(e){const t=e.split("-");return t.length>=2&&parseInt(t[1],10)||0}function lr(e,t=0){return e*nr+t}function sr(e){switch(e){case"liq_repay":return"lendingLiquidateRepayDebt";case"liq_seize":return"lendingLiquidateSeizeCollateral";case"param_upd":return"lendingUpdateAccountParameters";default:return"lendingUpdateAccountPosition"}}const pr=(e,t,r)=>{const o=new URL(t,e.endsWith("/")?e:`${e}/`);if(r)for(const[e,t]of Object.entries(r))void 0!==t&&o.searchParams.set(e,String(t));return o.toString()},dr=e=>e.baseUrl??a[e.network];async function cr(e,t){if(null==e.amountIn==(null==e.amountOut))throw new Error("getStellarAggregatorQuote: exactly one of `amountIn` or `amountOut` must be provided");const r=pr(dr(t),"api/v1/quote",{from:e.from,to:e.to,amountIn:e.amountIn,amountOut:e.amountOut,maxHops:e.maxHops,maxSplits:e.maxSplits,slippage:e.slippage,includePaths:e.includePaths,sender:e.sender,router:e.router,platform:e.platform,fresh:e.fresh}),o=await fetch(r,t.fetchOptions);if(!o.ok){const e=await o.text().catch((()=>""));throw new Error(`Stellar quote server responded ${o.status} ${o.statusText} for ${r} — ${e}`)}return await o.json()}async function yr(e){const t=pr(dr(e),"api/v1/tokens"),r=await fetch(t,e.fetchOptions);if(!r.ok){const e=await r.text().catch((()=>""));throw new Error(`Stellar quote server responded ${r.status} ${r.statusText} for ${t} — ${e}`)}return await r.json()}const br=e=>E(e).toXDR("base64");function Sr(e,t){const r=e.routerAddress??p(e.network),o=new c.Contract(r),u=new c.Account(e.caller,e.sourceSequence),n=I(((e,t)=>(e=>Boolean(e&&"object"==typeof e&&!(e instanceof Uint8Array)&&"paths"in e))(e)&&void 0===e.referralId?{...e,referralId:t??0}:e)(t,e.referralId));return{xdr:new c.TransactionBuilder(u,{fee:e.fee??c.BASE_FEE,networkPassphrase:l[e.network]}).addOperation(o.call("execute_strategy",b(e.caller),S(e.totalIn),n)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function gr(e,t){return Sr(e,t)}function Tr(e,t={}){if("string"!=typeof e.amountOutMin)throw new Error("mapQuoteResponseToStrategyPayload: quote response is missing `amountOutMin`. Pass `slippage` when fetching the quote.");return{paths:e.paths?e.paths.map((e=>({hops:e.swaps.map(hr),splitPpm:e.splitPpm}))):[{hops:e.hops.map(hr),splitPpm:1e6}],referralId:t.referralId??0,tokenIn:e.from,tokenOut:e.to,totalMinOut:e.amountOutMin}}function fr(e,t={}){const r=e;return"string"==typeof r.routeXdr&&r.routeXdr.length>0?{routeXdr:r.routeXdr}:Tr(e,t)}const mr=Tr,hr=e=>({amountOut:e.amountOut,pool:e.address,tokenIn:e.from,tokenOut:e.to,venue:e.dex});function vr(e,t){const r=t instanceof Error?t.message:String(t);return new Error(`[xoxno-invoked:${e}] ${r}`)}async function xr(e,t,r){const o=c.TransactionBuilder.fromXDR(t,"base64");try{return(await e.prepareTransaction(o)).toXDR()}catch(e){if(r?.invokedContractId)throw vr(r.invokedContractId,e);throw e}}async function qr(e,t,r){return xr(e,t.xdr,r)}function _r(e){if(e<=0||e>4)throw new Error(`Invalid PositionMode ${e} for Stellar — expected 1 (Normal) through 4 (Short). "None" (0) has no Stellar equivalent.`);return e-1}function wr(e,t){return{paths:[{hops:[{amountOut:"0",pool:e,tokenIn:e,tokenOut:e,venue:"Soroswap"}],splitPpm:1e6}],referralId:0,tokenIn:e,tokenOut:e,totalMinOut:t}}const Ar=e=>{const t=e.startsWith("0x")?e.slice(2):e;if(t.length%2!=0)throw new Error("buildStellarCctpForwardTx: hex input must have even length");return Buffer.from(t,"hex")};function Pr(e){const t=new c.Account(e.caller,e.sourceSequence),r=new c.Contract(e.forwarderAddress).call("mint_and_forward",c.xdr.ScVal.scvBytes(Ar(e.message)),c.xdr.ScVal.scvBytes(Ar(e.attestation)));return{xdr:new c.TransactionBuilder(t,{fee:e.fee??"10000000",networkPassphrase:l[e.network]}).addOperation(r).setTimeout(e.timeoutSeconds??120).build().toXDR()}}}},t={};function r(o){var u=t[o];if(void 0!==u)return u.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};r.r(o),r.d(o,{Chain:()=>l,STELLAR_AGGREGATOR_ROUTER:()=>T.STELLAR_AGGREGATOR_ROUTER,STELLAR_GOVERNANCE:()=>T.STELLAR_GOVERNANCE,STELLAR_GOVERNANCE_ZERO_PREDECESSOR:()=>T.STELLAR_GOVERNANCE_ZERO_PREDECESSOR,STELLAR_LENDING_CONTROLLER:()=>T.STELLAR_LENDING_CONTROLLER,STELLAR_LENDING_TOPICS:()=>T.STELLAR_LENDING_TOPICS,STELLAR_NETWORK_PASSPHRASE:()=>T.STELLAR_NETWORK_PASSPHRASE,STELLAR_QUOTE_URL:()=>T.STELLAR_QUOTE_URL,STELLAR_SOROBAN_RPC_URL:()=>T.STELLAR_SOROBAN_RPC_URL,SYNTHETIC_EVENT_ORDER_STRIDE:()=>T.SYNTHETIC_EVENT_ORDER_STRIDE,XOXNOClient:()=>s,XOXNO_LENDING_STELLAR_TICKER:()=>T.XOXNO_LENDING_STELLAR_TICKER,buildSameTokenRepaySwapSteps:()=>T.buildSameTokenRepaySwapSteps,buildSdk:()=>v,buildStellarAcceptOwnershipTx:()=>T.buildStellarAcceptOwnershipTx,buildStellarAddRewardsTx:()=>T.buildStellarAddRewardsTx,buildStellarApproveTokenTx:()=>T.buildStellarApproveTokenTx,buildStellarBatchSwapTx:()=>T.buildStellarBatchSwapTx,buildStellarBorrowBatchTx:()=>T.buildStellarBorrowBatchTx,buildStellarBorrowTx:()=>T.buildStellarBorrowTx,buildStellarCctpForwardTx:()=>T.buildStellarCctpForwardTx,buildStellarClaimRevenueTx:()=>T.buildStellarClaimRevenueTx,buildStellarCreateLiquidityPoolTx:()=>T.buildStellarCreateLiquidityPoolTx,buildStellarDisableTokenOracleTx:()=>T.buildStellarDisableTokenOracleTx,buildStellarExecuteStrategyTx:()=>T.buildStellarExecuteStrategyTx,buildStellarFlashLoanTx:()=>T.buildStellarFlashLoanTx,buildStellarGovernanceExecuteGovernanceUpgradeTx:()=>T.buildStellarGovernanceExecuteGovernanceUpgradeTx,buildStellarGovernanceExecuteGrantGovernanceRoleTx:()=>T.buildStellarGovernanceExecuteGrantGovernanceRoleTx,buildStellarGovernanceExecuteRevokeGovernanceRoleTx:()=>T.buildStellarGovernanceExecuteRevokeGovernanceRoleTx,buildStellarGovernanceExecuteTransferGovOwnTx:()=>T.buildStellarGovernanceExecuteTransferGovOwnTx,buildStellarGovernanceExecuteTx:()=>T.buildStellarGovernanceExecuteTx,buildStellarGovernanceExecuteUpdateDelayTx:()=>T.buildStellarGovernanceExecuteUpdateDelayTx,buildStellarGrantRoleTx:()=>T.buildStellarGrantRoleTx,buildStellarLendingIdentifier:()=>T.buildStellarLendingIdentifier,buildStellarLiquidateTx:()=>T.buildStellarLiquidateTx,buildStellarMigrateFromBlendTx:()=>T.buildStellarMigrateFromBlendTx,buildStellarMigrateTx:()=>T.buildStellarMigrateTx,buildStellarMultiplyTx:()=>T.buildStellarMultiplyTx,buildStellarPauseTx:()=>T.buildStellarPauseTx,buildStellarProposeApproveBlendPoolTx:()=>T.buildStellarProposeApproveBlendPoolTx,buildStellarProposeApproveTokenTx:()=>T.buildStellarProposeApproveTokenTx,buildStellarProposeConfigureMarketOracleTx:()=>T.buildStellarProposeConfigureMarketOracleTx,buildStellarProposeCreateLiquidityPoolTx:()=>T.buildStellarProposeCreateLiquidityPoolTx,buildStellarProposeDeployPoolTx:()=>T.buildStellarProposeDeployPoolTx,buildStellarProposeDisableTokenOracleTx:()=>T.buildStellarProposeDisableTokenOracleTx,buildStellarProposeEditOracleToleranceTx:()=>T.buildStellarProposeEditOracleToleranceTx,buildStellarProposeGovernanceUpgradeTx:()=>T.buildStellarProposeGovernanceUpgradeTx,buildStellarProposeGrantGovernanceRoleTx:()=>T.buildStellarProposeGrantGovernanceRoleTx,buildStellarProposeMigrateControllerTx:()=>T.buildStellarProposeMigrateControllerTx,buildStellarProposeRevokeBlendPoolTx:()=>T.buildStellarProposeRevokeBlendPoolTx,buildStellarProposeRevokeGovernanceRoleTx:()=>T.buildStellarProposeRevokeGovernanceRoleTx,buildStellarProposeRevokeTokenTx:()=>T.buildStellarProposeRevokeTokenTx,buildStellarProposeSetAccumulatorTx:()=>T.buildStellarProposeSetAccumulatorTx,buildStellarProposeSetAggregatorTx:()=>T.buildStellarProposeSetAggregatorTx,buildStellarProposeSetMinBorrowCollatTx:()=>T.buildStellarProposeSetMinBorrowCollatTx,buildStellarProposeSetPoolTemplateTx:()=>T.buildStellarProposeSetPoolTemplateTx,buildStellarProposeSetPositionLimitsTx:()=>T.buildStellarProposeSetPositionLimitsTx,buildStellarProposeTransferCtrlOwnershipTx:()=>T.buildStellarProposeTransferCtrlOwnershipTx,buildStellarProposeTransferGovOwnTx:()=>T.buildStellarProposeTransferGovOwnTx,buildStellarProposeUpdateDelayTx:()=>T.buildStellarProposeUpdateDelayTx,buildStellarProposeUpgradeControllerTx:()=>T.buildStellarProposeUpgradeControllerTx,buildStellarProposeUpgradePoolParamsTx:()=>T.buildStellarProposeUpgradePoolParamsTx,buildStellarProposeUpgradePoolTx:()=>T.buildStellarProposeUpgradePoolTx,buildStellarRenewAccountTx:()=>T.buildStellarRenewAccountTx,buildStellarRepayBatchTx:()=>T.buildStellarRepayBatchTx,buildStellarRepayDebtWithCollateralTx:()=>T.buildStellarRepayDebtWithCollateralTx,buildStellarRepayTx:()=>T.buildStellarRepayTx,buildStellarRevokeRoleTx:()=>T.buildStellarRevokeRoleTx,buildStellarRevokeTokenTx:()=>T.buildStellarRevokeTokenTx,buildStellarSetAccumulatorTx:()=>T.buildStellarSetAccumulatorTx,buildStellarSetAggregatorTx:()=>T.buildStellarSetAggregatorTx,buildStellarSetLiquidityPoolTemplateTx:()=>T.buildStellarSetLiquidityPoolTemplateTx,buildStellarSetMarketOracleConfigTx:()=>T.buildStellarSetMarketOracleConfigTx,buildStellarSetOracleToleranceTx:()=>T.buildStellarSetOracleToleranceTx,buildStellarSetPositionLimitsTx:()=>T.buildStellarSetPositionLimitsTx,buildStellarSupplyBatchTx:()=>T.buildStellarSupplyBatchTx,buildStellarSupplyTx:()=>T.buildStellarSupplyTx,buildStellarSwapCollateralTx:()=>T.buildStellarSwapCollateralTx,buildStellarSwapDebtTx:()=>T.buildStellarSwapDebtTx,buildStellarTransferOwnershipTx:()=>T.buildStellarTransferOwnershipTx,buildStellarUnpauseTx:()=>T.buildStellarUnpauseTx,buildStellarUpdateAccountThresholdTx:()=>T.buildStellarUpdateAccountThresholdTx,buildStellarUpdateIndexesTx:()=>T.buildStellarUpdateIndexesTx,buildStellarUpgradeControllerTx:()=>T.buildStellarUpgradeControllerTx,buildStellarUpgradeLiquidityPoolParamsTx:()=>T.buildStellarUpgradeLiquidityPoolParamsTx,buildStellarWithdrawBatchTx:()=>T.buildStellarWithdrawBatchTx,buildStellarWithdrawTx:()=>T.buildStellarWithdrawTx,buildTx:()=>T.buildTx,decodeStellarLendingEvent:()=>T.decodeStellarLendingEvent,encodeInterestRateModel:()=>T.encodeInterestRateModel,encodeMarketOracleConfigInput:()=>T.encodeMarketOracleConfigInput,encodeMarketParamsRaw:()=>T.encodeMarketParamsRaw,encodeOracleSourceConfigInput:()=>T.encodeOracleSourceConfigInput,encodePositionLimits:()=>T.encodePositionLimits,encodeStrategyPayloadToRouteXdr:()=>T.encodeStrategyPayloadToRouteXdr,extractEventOrder:()=>T.extractEventOrder,getStellarAccountPositions:()=>T.getStellarAccountPositions,getStellarAggregatorQuote:()=>T.getStellarAggregatorQuote,getStellarAggregatorRouter:()=>T.getStellarAggregatorRouter,getStellarAsset:()=>T.getStellarAsset,getStellarAssetGraph:()=>T.getStellarAssetGraph,getStellarAssetMarkets:()=>T.getStellarAssetMarkets,getStellarAssetPage:()=>T.getStellarAssetPage,getStellarAssets:()=>T.getStellarAssets,getStellarGovernance:()=>T.getStellarGovernance,getStellarGovernanceProposals:()=>T.getStellarGovernanceProposals,getStellarHub:()=>T.getStellarHub,getStellarHubGraph:()=>T.getStellarHubGraph,getStellarHubs:()=>T.getStellarHubs,getStellarLendingContext:()=>T.getStellarLendingContext,getStellarLendingController:()=>T.getStellarLendingController,getStellarQuoteTokens:()=>T.getStellarQuoteTokens,getStellarReserve:()=>T.getStellarReserve,getStellarReserveGraph:()=>T.getStellarReserveGraph,getStellarReserveHolders:()=>T.getStellarReserveHolders,getStellarReserves:()=>T.getStellarReserves,getStellarSpoke:()=>T.getStellarSpoke,getStellarSpokeGraph:()=>T.getStellarSpokeGraph,getStellarSpokes:()=>T.getStellarSpokes,getStellarUserActivity:()=>T.getStellarUserActivity,getStellarUserPositions:()=>T.getStellarUserPositions,isValidCollectionTicker:()=>p,isValidNftIdentifier:()=>d,mapQuoteResponseToAggregatorSwap:()=>T.mapQuoteResponseToAggregatorSwap,mapQuoteResponseToStrategyPayload:()=>T.mapQuoteResponseToStrategyPayload,mapQuoteResponseToStrategySwap:()=>T.mapQuoteResponseToStrategySwap,mapStellarPositionActivityType:()=>T.mapStellarPositionActivityType,prepareStellarBuiltTx:()=>T.prepareStellarBuiltTx,prepareStellarTxXdr:()=>T.prepareStellarTxXdr,stellarLendingDispatchKey:()=>T.stellarLendingDispatchKey,stellarLendingRead:()=>T.stellarLendingRead,syntheticEventOrder:()=>T.syntheticEventOrder,tagStellarInvokedContractError:()=>T.tagStellarInvokedContractError,toBase64Xdr:()=>T.toBase64Xdr,toStellarPositionMode:()=>T.toStellarPositionMode});const u="https://api.xoxno.com",n="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",i="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",a="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var l;!function(e){e.MAINNET="1",e.DEVNET="D"}(l||(l={}));class s{apiUrl;chain;init;config;constructor({chain:e=l.MAINNET,apiUrl:t=u,...r}={}){this.apiUrl=t??{[l.MAINNET]:u,[l.DEVNET]:"https://devnet-api.xoxno.com"}[e],this.chain=e,this.init=r,this.config=e==l.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:n,DR_SC:i,KG_SC:a,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:n,DR_SC:i,KG_SC:a,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}fetchWithTimeout=async(e,{params:t,...r}={})=>{const{next:o,cache:u,debug:n,...i}=this.init,{next:a,cache:l,debug:s,headers:p,method:d="GET",...c}=r,y=p?.Authorization,b="Bearer undefined"===y?void 0:y,S={...p,Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."PUT"===d?{}:{"Content-Type":"application/json"},...b?{Authorization:b}:{}},g=Object.entries(t??{}).flatMap((([e,t])=>Array.isArray(t)?t.map((t=>`${e}=${encodeURIComponent(t)}`)):`${e}=${encodeURIComponent(t)}`)).join("&"),T=`${this.apiUrl}${e}${g.length?`?${g}`:""}`,{revalidate:f,...m}=o??{},{revalidate:h,...v}=a??{},x="GET"!==d||b?void 0:h??f,q="GET"!==d||b||x?void 0:l??u,_={...i,...c,method:d,...Object.keys(S).length?{headers:S}:{},cache:q,next:{...m,...v,revalidate:x}};(s??n)&&console.debug("SDK fetch: ",T,_);const w=await fetch(T,_).catch((e=>{if(e instanceof Error&&!e.message.match(/^http(s?):\/\//))throw Object.assign(new Error(`${T}: ${e.message}`),{cause:e});throw e})),A=await w.text();if(!w.ok){let e;try{e=JSON.parse(A)}catch{e={message:A}}const t=[T,w.status,w.statusText,e.message].filter(Boolean).join(";;");throw new Error(t)}try{return JSON.parse(A)}catch{return A}}}const p=e=>{const t=/^0x[a-fA-F0-9]{1,64}-[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(e)),r=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(e);return t||r},d=e=>{const t=/^0x[a-fA-F0-9]{1,64}$/.test(e),r=/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,7}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(e);return t||r};class c extends Error{constructor(e){super(`Invalid collection ticker: ${e}`)}}class y extends Error{constructor(e){super(`Invalid address: ${e}`)}}Error,Error;const b=e=>!!e&&(e.startsWith("erd1")&&62===e.length||/^0x[a-fA-F0-9]{40,64}$/.test(e)||/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e)||/^G[A-Z2-7]{55}$/.test(e)),S={"/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/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:{}}}},g=["PATCH","POST","DELETE","PUT"];var T=r(454);const f=e=>e.replace(/-([a-z])/g,((e,t)=>t.toUpperCase())),m=()=>({static:{},params:{},leaves:[]});function h(e,t,r,o){const{input:u,output:n,...i}=t,a=async(t={})=>{const u={...r,...t},n=e.replace(/:([a-zA-Z_]+)/g,((e,t)=>`${u[t]}`)),i=[...e.matchAll(/:([a-zA-Z_]+)/g)].map((e=>e[1])),a=Object.fromEntries(Object.entries(u).filter((([e])=>!i.includes(e)))),l=/:address[^A-Z]/.test(e)||"address"in a,s=/:collection[^A-Z]/.test(e)||"collection"in a;if(l){const e=u.address;if(!b(e))throw new y(e)}if(s){const e=u.collection;if(Array.isArray(e)?e.some((e=>!p(e))):!p(e))throw new c(e)}const d=Object.fromEntries(Object.entries(a).map((([e,t])=>[e,t instanceof FormData?t:"filter"===e||"body"===e?JSON.stringify(t):Array.isArray(t)?t.join(","):t]))),{body:S,auth:g,method:T,headers:f,cache:m,next:h,debug:v,continuationToken:x,...q}=d,_=g?`Bearer ${g}`:void 0,w={...f,..._?{Authorization:_}:{},...x?{"X-Continuation-Token":String(x)}:{}},A={...h,tags:[...h?.tags??[],n]};return o.fetchWithTimeout(n,{method:T,params:q,body:S,headers:w,cache:m,debug:v,...A?{next:A}:{}})},l=(e={})=>a(e);for(const e of Object.keys(i))g.includes(e)&&(l[e]=t=>a({...t,method:t.method??e.toUpperCase()}));return l}function v(e){const t=function(){const e=m();for(const[t,r]of Object.entries(S)){const o=t.split("/").filter(Boolean);let u=e;for(const e of o)if(e.startsWith(":")){const t=f(e.slice(1));u=u.params[t]||=m()}else{const t=f(e);u=u.static[t]||=m()}u.leaves.push({rawPath:t,def:r})}return e}(),r=(t,o)=>{const u=t.leaves.length,n=Object.keys(t.static).length,i=Object.keys(t.params).length;let a;if(1===u&&n+i>0){const{rawPath:r,def:u}=t.leaves[0];a=h(r,u,o,e)}else{a={};for(const{rawPath:r,def:u}of t.leaves)a[f(r.split("/").pop().replace(/^:/,""))]=h(r,u,o,e)}for(const[e,u]of Object.entries(t.static)){const t=r(u,o);let n=t;if(t&&"object"==typeof t&&e in t&&"function"==typeof t[e]){const r=t[e],o=Object.fromEntries(Object.entries(t).filter((([t])=>t!==e)));1===r.length||(Object.assign(r,o),n=r)}void 0===a[e]?a[e]=n:"function"==typeof a[e]?Object.assign(a[e],n):"function"==typeof n?(Object.assign(n,a[e]),a[e]=n):Object.assign(a[e],n)}for(const[e,u]of Object.entries(t.params)){const t=t=>{const n=r(u,{...o,[e]:t});if(n&&"object"==typeof n&&1===Object.keys(n).length&&e in n&&"function"==typeof n[e]){const t=n[e],r=(...e)=>t(...e);return Object.assign(r,t)}return n};if(a[e]){const r=a[e];a[e]=e=>({...r(e),...t(e)})}else a[e]=t}return a};return r(t,{})}module.exports=o})();