@xoxno/sdk-js 1.0.174 → 1.0.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/cjs/sdk/swagger.d.ts +5 -1
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/sdk/swagger.d.ts +5 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -758,6 +758,9 @@ sdk.stellar.aggregator.quote(...); // SoroswapQuoteResponseDto
|
|
|
758
758
|
// GET /stellar-lending/assets
|
|
759
759
|
sdk.stellarLending.assets(...); // StellarAssetListItemDto[]
|
|
760
760
|
|
|
761
|
+
// GET /stellar-lending/context
|
|
762
|
+
sdk.stellarLending.context(...); // StellarLendingContextDto
|
|
763
|
+
|
|
761
764
|
// GET /stellar-lending/hubs
|
|
762
765
|
sdk.stellarLending.hubs(...); // StellarHubListItemDto[]
|
|
763
766
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PublicOnly, RateType, LoginAccessDto, LoginRequestDto, UserNetworkInfoDto, UserTokenInventoryResponseDto, UserProfileDoc, UserProfileEditDto, UserProfileDto, UserSettingsDoc, NotificationPreferencesPostDto, SetEmailDto, SetPhoneDto, UserBillingDetails, VerifyEmailDto, TradesilvaniaSignature, SuccessDto, CreatorProfileDto, CreatorProfileDoc, CreatorProfileEditDto, CollectionStatsFilter, CollectionStatsPaginated, CheckLikeStatusResponseDto, UserFavoriteResponseDto, TokenDataDocHydrated, XoxnoInfo, XoxnoLiquidStatsDto, AnalyticsMarketplaceUniqueUsers, ProtocolAprType, ProviderDto, DelegationDataOutput, LendingMarketProfile, LendingMarketProfileFilter, LendingMarketProfileQuery, LendingGovernanceProposalFilter, LendingGovernanceProposalQuery, LendingGovernanceProposalDoc, LendingAccountProfile, LendingIndexesDto, LendingAccountPnl, LendingAccountSummary, LendingEModeCategoryProfile, LendingMarketAnalyticsGraph, LendingStatsHistory, LendingMarketAverageGraph, LendingPositionStatus, LendingOverallStats, NftDocFilter, NftPaginated, LikeNftDto, InventorySummaryDtoHydrated, NftOfferPaginated, NftOfferDocFilter, NftOfferDocHydrated, ValueFp, TraitInfo, CollectionRanksDTO, ListingsResponseDto, NftDocHydrated, SignDataDto, SignWithdrawDto, SignAcceptGlobalOfferDto, SignMintDto, NftDocFull, CollectionProfileDoc, CollectionProfileEditDto, FloorPriceDto, PinnedCollectionDto, CollectionMintProfileDocHydrated, CollectionPinnedStatusDto, FollowCollectionDto, CollectionProfileFilter, CollectionProfilePaginated, CollectionMintProfileFilter, CollectionMintProfilePaginated, CollectionMintProfileDocWithStages, CollectionHoldersDto, CollectionHoldersExportDto, CollectionOwnerDto, CollectionStatsDocHydrated, CollectionOffersFilter, GlobalOfferPaginated, CreatorDetailsDto, ShareholderDto, StakingSummary, StakingPoolDoc, StakingEditDto, OwnedCollectionsDto, UserStakingSummaryDto, StakingCreatorDoc, StakingUserPoolNfts, StakingExploreDtoHydrated, OwnedServicesDto, FilterQueryDto, GlobalSearchResourcesPaginated, LendingNftAttributes, LendingTokenPriceDto, StellarAssetListItemDto, StellarHubListItemDto, StellarSpokeListItemDto, StellarReserveListItemDto, ReserveDto, TopHoldersDto, AssetDto, AssetPageDto, AssetMarketDto, HubDto, SpokeDto, AccountPositionsDto, StellarUserActivityItemDto, GovernanceProposalsPageDto, MarketGraphDto, SpokeGraphDto, StellarStatsHistoryDto, StellarPositionsPnlDto, StellarPositionsRankDto, UserHistoryDto, PnlByScopeDto, RevenueSeriesDto, FeeRevenueSeriesDto, ParticipantCountsDto, LiquidationsSeriesDto, LiquidationsLeaderboardDto, VolumeSeriesDto, ActiveUsersSeriesDto, HolderDistributionDto, RateSpreadSeriesDto, DefiLlamaDimensionsDto, NotificationPaginated, PushNotificationCountResponse, NotificationDoc, MobileDeviceDoc, MobileDeviceRegistrationDto, PushNotificationResponse, PushNotificationDoc, NotificationSuccessResponseDto, EventNotificationDto, CreatorMarketingNotificationDto, StellarChallengeResponseDto, Web2UserDoc, SuccessWithMessageDto, NativeWalletDto, SwitchWalletDto, Web2WalletDto, Web2UserShardsDto, NftActivityFilter, NftActivityPaginated, NftActivityDocHydrated, VolumeGraph, AnalyticsVolumeDto, UserAnalyticsDto, GlobalAnalyticsOverviewResponseDto, UserStatsDto, AirdropDtoHydrated, TransactionDetailed, TransactionProcessStatus, TransactionCostData, TransactionCreate, TransactionSendResult, ChatMessageDocHydrated, SendChatMessageDto, UserConversationPaginated, ChatMessagePaginated, GlobalConversationSummaryDto, UserBlockPaginated, WebSocketTokenDto, UserInfo, EventProfile, EventProfileCreateDto, EventProfileEditDto, EventProfileFilter, EventProfileQuery, EventRegistrationResponseDto, EventGuestRegistrationDto, EventTicketProfileDoc, EventTicketProfileCreateDto, EventTicketProfileEditDto, EventStageProfileDoc, EventStageProfileCreateDto, EventStageProfileEditDto, TicketPricesResponse, TicketCalculationRequestDto, DiscountCodeValidationResponse, EventInvitationDoc, EventInvitationCreateDto, EventInvitationFilter, EventInvitationQuery, EventInvitation, EventAcceptInvitation, EventClaimInvitationDto, EventVoucherFilter, EventVoucherQuery, EventQuestionDoc, EventQuestionCreateDto, EventQuestionEditDto, EventGuestFilter, EventGuestProfileQuery, EventGuestProfile, EventGuestExport, EventUserRole, EventUserRoleCreateDto, EventUserRoleEditDto, EventUserRoleDoc, BageQRData, TicketValidationResult, EventCheckInQR, EventVoucherDoc, EventVoucherCreateDto, EventVoucherEditDto, ManualCheckInDto, AnsweredQuestionWithDetails, EventGuestApproveDto, EventCountGroupedByCountry, EventReferralConfigDoc, EventReferralConfigCreateDto, EventReferralConfigEditDto, EventReferralConfigFilter, EventReferralConfigPaginated, EventReferralDoc, EventReferralCreateDto, EventReferralEditDto, EventReferralFilter, EventReferralPaginated, BlendUserPosition, SoroswapQuoteResponseDto, PerpOrderResponse, BarDto, SymbolInfoDto, PerpCoinExtended, PerpSpotCoinExtended, PerpCoinExtendedSlim, PerpLegalCheck, PerpSpotCoinExtendedSlim, L2BookPerpResponseSingle, TradesPerpResponseSingle, ActiveSpotAssetCtx, ActivePerpAssetCtx, PerpEvent } from '@xoxno/types';
|
|
1
|
+
import type { PublicOnly, RateType, LoginAccessDto, LoginRequestDto, UserNetworkInfoDto, UserTokenInventoryResponseDto, UserProfileDoc, UserProfileEditDto, UserProfileDto, UserSettingsDoc, NotificationPreferencesPostDto, SetEmailDto, SetPhoneDto, UserBillingDetails, VerifyEmailDto, TradesilvaniaSignature, SuccessDto, CreatorProfileDto, CreatorProfileDoc, CreatorProfileEditDto, CollectionStatsFilter, CollectionStatsPaginated, CheckLikeStatusResponseDto, UserFavoriteResponseDto, TokenDataDocHydrated, XoxnoInfo, XoxnoLiquidStatsDto, AnalyticsMarketplaceUniqueUsers, ProtocolAprType, ProviderDto, DelegationDataOutput, LendingMarketProfile, LendingMarketProfileFilter, LendingMarketProfileQuery, LendingGovernanceProposalFilter, LendingGovernanceProposalQuery, LendingGovernanceProposalDoc, LendingAccountProfile, LendingIndexesDto, LendingAccountPnl, LendingAccountSummary, LendingEModeCategoryProfile, LendingMarketAnalyticsGraph, LendingStatsHistory, LendingMarketAverageGraph, LendingPositionStatus, LendingOverallStats, NftDocFilter, NftPaginated, LikeNftDto, InventorySummaryDtoHydrated, NftOfferPaginated, NftOfferDocFilter, NftOfferDocHydrated, ValueFp, TraitInfo, CollectionRanksDTO, ListingsResponseDto, NftDocHydrated, SignDataDto, SignWithdrawDto, SignAcceptGlobalOfferDto, SignMintDto, NftDocFull, CollectionProfileDoc, CollectionProfileEditDto, FloorPriceDto, PinnedCollectionDto, CollectionMintProfileDocHydrated, CollectionPinnedStatusDto, FollowCollectionDto, CollectionProfileFilter, CollectionProfilePaginated, CollectionMintProfileFilter, CollectionMintProfilePaginated, CollectionMintProfileDocWithStages, CollectionHoldersDto, CollectionHoldersExportDto, CollectionOwnerDto, CollectionStatsDocHydrated, CollectionOffersFilter, GlobalOfferPaginated, CreatorDetailsDto, ShareholderDto, StakingSummary, StakingPoolDoc, StakingEditDto, OwnedCollectionsDto, UserStakingSummaryDto, StakingCreatorDoc, StakingUserPoolNfts, StakingExploreDtoHydrated, OwnedServicesDto, FilterQueryDto, GlobalSearchResourcesPaginated, LendingNftAttributes, LendingTokenPriceDto, StellarAssetListItemDto, StellarLendingContextDto, StellarHubListItemDto, StellarSpokeListItemDto, StellarReserveListItemDto, ReserveDto, TopHoldersDto, AssetDto, AssetPageDto, AssetMarketDto, HubDto, SpokeDto, AccountPositionsDto, StellarUserActivityItemDto, GovernanceProposalsPageDto, MarketGraphDto, SpokeGraphDto, StellarStatsHistoryDto, StellarPositionsPnlDto, StellarPositionsRankDto, UserHistoryDto, PnlByScopeDto, RevenueSeriesDto, FeeRevenueSeriesDto, ParticipantCountsDto, LiquidationsSeriesDto, LiquidationsLeaderboardDto, VolumeSeriesDto, ActiveUsersSeriesDto, HolderDistributionDto, RateSpreadSeriesDto, DefiLlamaDimensionsDto, NotificationPaginated, PushNotificationCountResponse, NotificationDoc, MobileDeviceDoc, MobileDeviceRegistrationDto, PushNotificationResponse, PushNotificationDoc, NotificationSuccessResponseDto, EventNotificationDto, CreatorMarketingNotificationDto, StellarChallengeResponseDto, Web2UserDoc, SuccessWithMessageDto, NativeWalletDto, SwitchWalletDto, Web2WalletDto, Web2UserShardsDto, NftActivityFilter, NftActivityPaginated, NftActivityDocHydrated, VolumeGraph, AnalyticsVolumeDto, UserAnalyticsDto, GlobalAnalyticsOverviewResponseDto, UserStatsDto, AirdropDtoHydrated, TransactionDetailed, TransactionProcessStatus, TransactionCostData, TransactionCreate, TransactionSendResult, ChatMessageDocHydrated, SendChatMessageDto, UserConversationPaginated, ChatMessagePaginated, GlobalConversationSummaryDto, UserBlockPaginated, WebSocketTokenDto, UserInfo, EventProfile, EventProfileCreateDto, EventProfileEditDto, EventProfileFilter, EventProfileQuery, EventRegistrationResponseDto, EventGuestRegistrationDto, EventTicketProfileDoc, EventTicketProfileCreateDto, EventTicketProfileEditDto, EventStageProfileDoc, EventStageProfileCreateDto, EventStageProfileEditDto, TicketPricesResponse, TicketCalculationRequestDto, DiscountCodeValidationResponse, EventInvitationDoc, EventInvitationCreateDto, EventInvitationFilter, EventInvitationQuery, EventInvitation, EventAcceptInvitation, EventClaimInvitationDto, EventVoucherFilter, EventVoucherQuery, EventQuestionDoc, EventQuestionCreateDto, EventQuestionEditDto, EventGuestFilter, EventGuestProfileQuery, EventGuestProfile, EventGuestExport, EventUserRole, EventUserRoleCreateDto, EventUserRoleEditDto, EventUserRoleDoc, BageQRData, TicketValidationResult, EventCheckInQR, EventVoucherDoc, EventVoucherCreateDto, EventVoucherEditDto, ManualCheckInDto, AnsweredQuestionWithDetails, EventGuestApproveDto, EventCountGroupedByCountry, EventReferralConfigDoc, EventReferralConfigCreateDto, EventReferralConfigEditDto, EventReferralConfigFilter, EventReferralConfigPaginated, EventReferralDoc, EventReferralCreateDto, EventReferralEditDto, EventReferralFilter, EventReferralPaginated, BlendUserPosition, SoroswapQuoteResponseDto, PerpOrderResponse, BarDto, SymbolInfoDto, PerpCoinExtended, PerpSpotCoinExtended, PerpCoinExtendedSlim, PerpLegalCheck, PerpSpotCoinExtendedSlim, L2BookPerpResponseSingle, TradesPerpResponseSingle, ActiveSpotAssetCtx, ActivePerpAssetCtx, PerpEvent } from '@xoxno/types';
|
|
2
2
|
import type { ActivityChain, TokenCategory, LendingPositionOrderByColumn, KustoOrderDirection, OfferType, StakingStatus, UserStatsOrderByColumn } from '@xoxno/types/enums';
|
|
3
3
|
export declare const endpoints: {
|
|
4
4
|
readonly "/liquid/xoxno/rate": {
|
|
@@ -908,6 +908,10 @@ export declare const endpoints: {
|
|
|
908
908
|
readonly input: {};
|
|
909
909
|
readonly output: StellarAssetListItemDto[];
|
|
910
910
|
};
|
|
911
|
+
readonly "/stellar-lending/context": {
|
|
912
|
+
readonly input: {};
|
|
913
|
+
readonly output: StellarLendingContextDto;
|
|
914
|
+
};
|
|
911
915
|
readonly "/stellar-lending/hubs": {
|
|
912
916
|
readonly input: {};
|
|
913
917
|
readonly output: StellarHubListItemDto[];
|
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,o){o.d(t,{STELLAR_AGGREGATOR_ROUTER:()=>u,STELLAR_GOVERNANCE:()=>n,STELLAR_GOVERNANCE_ZERO_PREDECESSOR:()=>lt,STELLAR_LENDING_CONTROLLER:()=>r,STELLAR_LENDING_TOPICS:()=>vo,STELLAR_NETWORK_PASSPHRASE:()=>l,STELLAR_QUOTE_URL:()=>i,STELLAR_SOROBAN_RPC_URL:()=>a,SYNTHETIC_EVENT_ORDER_STRIDE:()=>Ao,XOXNO_LENDING_STELLAR_TICKER:()=>qo,buildSameTokenRepaySwapSteps:()=>jo,buildStellarAcceptOwnershipTx:()=>Ue,buildStellarAddAssetToEModeCategoryTx:()=>je,buildStellarAddEModeCategoryTx:()=>ze,buildStellarAddRewardsTx:()=>at,buildStellarApproveTokenTx:()=>Qe,buildStellarBatchSwapTx:()=>Uo,buildStellarBorrowBatchTx:()=>B,buildStellarBorrowTx:()=>G,buildStellarCctpForwardTx:()=>Xo,buildStellarClaimRevenueTx:()=>nt,buildStellarConfigureMarketOracleTx:()=>Ke,buildStellarCreateLiquidityPoolTx:()=>ot,buildStellarDisableTokenOracleTx:()=>Ye,buildStellarEditAssetConfigTx:()=>$e,buildStellarEditAssetInEModeCategoryTx:()=>He,buildStellarEditOracleToleranceTx:()=>Je,buildStellarExecuteStrategyTx:()=>Lo,buildStellarFlashLoanTx:()=>V,buildStellarGovernanceExecuteGovernanceUpgradeTx:()=>Qt,buildStellarGovernanceExecuteGrantGovernanceRoleTx:()=>Kt,buildStellarGovernanceExecuteRevokeGovernanceRoleTx:()=>Jt,buildStellarGovernanceExecuteTransferGovOwnTx:()=>Yt,buildStellarGovernanceExecuteTx:()=>Ft,buildStellarGovernanceExecuteUpdateDelayTx:()=>Zt,buildStellarGrantRoleTx:()=>Ie,buildStellarLendingIdentifier:()=>wo,buildStellarLiquidateTx:()=>W,buildStellarMigrateFromBlendTx:()=>j,buildStellarMigrateTx:()=>ke,buildStellarMultiplyTx:()=>H,buildStellarPauseTx:()=>Oe,buildStellarProposeAddAssetToEModeTx:()=>At,buildStellarProposeAddEModeCategoryTx:()=>_t,buildStellarProposeApproveBlendPoolTx:()=>Ot,buildStellarProposeApproveTokenTx:()=>Rt,buildStellarProposeConfigureMarketOracleTx:()=>Dt,buildStellarProposeCreateLiquidityPoolTx:()=>It,buildStellarProposeDeployPoolTx:()=>Lt,buildStellarProposeDisableTokenOracleTx:()=>Bt,buildStellarProposeEditAssetConfigTx:()=>ht,buildStellarProposeEditAssetInEModeTx:()=>wt,buildStellarProposeEditOracleToleranceTx:()=>zt,buildStellarProposeGovernanceUpgradeTx:()=>Wt,buildStellarProposeGrantGovernanceRoleTx:()=>jt,buildStellarProposeMigrateControllerTx:()=>Nt,buildStellarProposeRemoveAssetFromEModeTx:()=>Et,buildStellarProposeRemoveEModeCategoryTx:()=>qt,buildStellarProposeRevokeBlendPoolTx:()=>Mt,buildStellarProposeRevokeGovernanceRoleTx:()=>Ht,buildStellarProposeRevokeTokenTx:()=>kt,buildStellarProposeSetAccumulatorTx:()=>ft,buildStellarProposeSetAggregatorTx:()=>Tt,buildStellarProposeSetMinBorrowCollatTx:()=>vt,buildStellarProposeSetPoolTemplateTx:()=>mt,buildStellarProposeSetPositionLimitsTx:()=>xt,buildStellarProposeTransferCtrlOwnershipTx:()=>$t,buildStellarProposeTransferGovOwnTx:()=>Xt,buildStellarProposeUpdateDelayTx:()=>Vt,buildStellarProposeUpdatePoolCapsTx:()=>Pt,buildStellarProposeUpgradeControllerTx:()=>Gt,buildStellarProposeUpgradePoolParamsTx:()=>Ct,buildStellarProposeUpgradePoolTx:()=>Ut,buildStellarRemoveAssetFromEModeTx:()=>Fe,buildStellarRemoveEModeCategoryTx:()=>We,buildStellarRenewAccountTx:()=>tt,buildStellarRepayBatchTx:()=>D,buildStellarRepayDebtWithCollateralTx:()=>Q,buildStellarRepayTx:()=>z,buildStellarRevokeRoleTx:()=>Ce,buildStellarRevokeTokenTx:()=>Ze,buildStellarSetAccumulatorTx:()=>Ge,buildStellarSetAggregatorTx:()=>Be,buildStellarSetLiquidityPoolTemplateTx:()=>Ne,buildStellarSetPositionLimitsTx:()=>De,buildStellarSupplyBatchTx:()=>L,buildStellarSupplyTx:()=>U,buildStellarSwapCollateralTx:()=>F,buildStellarSwapDebtTx:()=>X,buildStellarTransferOwnershipTx:()=>Le,buildStellarUnpauseTx:()=>Me,buildStellarUpdateAccountThresholdTx:()=>it,buildStellarUpdateIndexesTx:()=>et,buildStellarUpdatePoolCapsTx:()=>Xe,buildStellarUpgradeControllerTx:()=>Re,buildStellarUpgradeLiquidityPoolParamsTx:()=>rt,buildStellarUpgradeLiquidityPoolTx:()=>ut,buildStellarWithdrawBatchTx:()=>N,buildStellarWithdrawTx:()=>$,buildTx:()=>C,decodeStellarLendingEvent:()=>_o,encodeAssetConfigRaw:()=>_e,encodeInterestRateModel:()=>xe,encodeMarketOracleConfigInput:()=>Ee,encodeMarketParamsRaw:()=>ve,encodeOracleSourceConfigInput:()=>Pe,encodePositionLimits:()=>qe,encodeStrategyPayloadToRouteXdr:()=>Co,extractEventOrder:()=>Po,getStellarAccountPositions:()=>ye,getStellarAggregatorQuote:()=>Mo,getStellarAggregatorRouter:()=>p,getStellarAsset:()=>ae,getStellarAssetGraph:()=>Se,getStellarAssetMarkets:()=>le,getStellarAssetPage:()=>ie,getStellarAssets:()=>ee,getStellarGovernance:()=>d,getStellarGovernanceProposals:()=>be,getStellarHub:()=>se,getStellarHubGraph:()=>ge,getStellarHubs:()=>te,getStellarLendingContext:()=>Y,getStellarLendingController:()=>s,getStellarQuoteTokens:()=>Io,getStellarReserve:()=>ue,getStellarReserveGraph:()=>fe,getStellarReserveHolders:()=>ne,getStellarReserves:()=>re,getStellarSpoke:()=>pe,getStellarSpokeGraph:()=>Te,getStellarSpokes:()=>oe,getStellarUserActivity:()=>ce,getStellarUserPositions:()=>de,mapQuoteResponseToAggregatorSwap:()=>No,mapQuoteResponseToStrategyPayload:()=>Bo,mapQuoteResponseToStrategySwap:()=>Go,mapStellarPositionActivityType:()=>Ro,prepareStellarBuiltTx:()=>Wo,prepareStellarTxXdr:()=>zo,stellarLendingDispatchKey:()=>oo,stellarLendingRead:()=>me,syntheticEventOrder:()=>Eo,tagStellarInvokedContractError:()=>Do,toBase64Xdr:()=>eo,toStellarPositionMode:()=>Vo});const r={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??""},a={mainnet:"https://soroban-rpc.stellar.org",testnet:"https://soroban-testnet.stellar.org"},i={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=r[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),x=()=>c.xdr.ScVal.scvVoid(),v=e=>c.xdr.ScVal.scvVec(e),_=(e,t=32)=>{const o=e.startsWith("0x")?e.slice(2):e,r=Buffer.from(o,"hex");if(r.length!==t)throw new Error(`Stellar builder: expected a ${t}-byte BytesN (got ${r.length} bytes from "${e}")`);return c.xdr.ScVal.scvBytes(r)},q=(e,t)=>null==e?x():t(e),A=(e,t)=>E({asset:b(t),hub_id:g(e)}),w=(e,t,o)=>c.xdr.ScVal.scvVec([A(e,t),S(o)]),P=e=>c.xdr.ScVal.scvVec(e.map((e=>w(e.hubId,e.asset,e.amount)))),E=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)},R=e=>{const t=e.paths.map((e=>{const t=e.hops.map((e=>{return E({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 E({hops:c.xdr.ScVal.scvVec(t),split_ppm:g(e.splitPpm)})}));return E({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(!((o=e).length>0&&o.length%2==0&&/^[0-9a-fA-F]+$/.test(o)))throw new Error("Stellar builder: strategy swap bytes hex string must be 0x-prefixed and even-length");return Buffer.from(e,"hex")}var o;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 r=Buffer.from(t,"base64");if(0===r.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return r},M=e=>{if("string"==typeof e)return k(O(e));if(e instanceof Uint8Array)return k(e);if(e&&"object"==typeof e)return"routeXdr"in(o=e)&&"string"==typeof o.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 o=0;for(const[e,r]of t.paths.entries()){if(!r||"number"!=typeof r.splitPpm||r.splitPpm<=0||!Array.isArray(r.hops)||0===r.hops.length)throw new Error(`Stellar builder: \`steps.paths[${e}]\` must have splitPpm > 0 and a non-empty hops array`);o+=r.splitPpm;for(const[t,o]of r.hops.entries())if(!o||"string"!=typeof o.amountOut||"string"!=typeof o.pool||"string"!=typeof o.tokenIn||"string"!=typeof o.tokenOut||!y.includes(o.venue))throw new Error(`Stellar builder: \`steps.paths[${e}].hops[${t}]\` must have amountOut, pool, tokenIn, tokenOut, and a valid Soroban venue`)}if(1e6!==o)throw new Error(`Stellar builder: \`steps.paths[].splitPpm\` must sum to 1_000_000, got ${o}`);return t})(e),c.xdr.ScVal.scvBytes(Buffer.from(R(t).toXDR("base64"),"base64")));var t,o;throw new Error("Stellar builder: `steps` must be opaque strategy bytes (`routeXdr`, base64/hex string, or Uint8Array)")},I=e=>{if("string"==typeof e)return(e=>{const t=e.startsWith("0x")?e.slice(2):e,o=Buffer.from(t,"hex");return c.xdr.ScVal.scvBytes(o)})(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 C(e,t,o){const r=e.controllerAddress??s(e.network),u=new c.Contract(r),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,...o)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function L(e,t){const o=t.accountNonce??0,r=t.spokeId??0;return C(e,"supply",[b(e.caller),T(o),g(r),P([...t.assets])])}function U(e,t){return L(e,{accountNonce:t.accountNonce,spokeId:t.spokeId,assets:[{hubId:t.hubId,asset:t.asset,amount:t.amount}]})}function B(e,t){return C(e,"borrow",[b(e.caller),T(t.accountNonce),P([...t.borrows]),q(t.to,b)])}function G(e,t){return B(e,{accountNonce:t.accountNonce,borrows:[{hubId:t.hubId,asset:t.asset,amount:t.amount}],to:t.to})}function N(e,t){return C(e,"withdraw",[b(e.caller),T(t.accountNonce),P([...t.withdrawals]),q(t.to,b)])}function $(e,t){return N(e,{accountNonce:t.accountNonce,withdrawals:[{hubId:t.hubId,asset:t.asset,amount:t.amount}],to:t.to})}function D(e,t){return C(e,"repay",[b(e.caller),T(t.accountNonce),P([...t.payments])])}function z(e,t){return D(e,{accountNonce:t.accountNonce,payments:[{hubId:t.hubId,asset:t.asset,amount:t.amount}]})}function W(e,t){return C(e,"liquidate",[b(e.caller),T(t.accountNonce),P([...t.debtPayments])])}function V(e,t){return C(e,"flash_loan",[b(e.caller),A(t.hubId,t.asset),S(t.amount),b(t.receiver),I(t.data)])}function j(e,t){return C(e,"migrate_from_blend",[b(e.caller),T(t.accountId),g(t.spokeId),g(t.hubId),b(t.blendPool),v(t.collateralTokens.map(b)),v(t.supplyTokens.map(b)),(o=t.debtCaps.map((e=>({token:e.token,amount:e.cap}))),c.xdr.ScVal.scvVec(o.map((e=>{return t=e.token,o=e.amount,c.xdr.ScVal.scvVec([b(t),S(o)]);var t,o}))))]);var o}function H(e,t){const o=t.accountNonce??0,r=t.spokeId??0;return C(e,"multiply",[b(e.caller),T(o),g(r),A(t.collateral.hubId,t.collateral.asset),S(t.debtToFlashLoan),A(t.debt.hubId,t.debt.asset),g(t.mode),M(t.steps),q(t.initialPayment,(e=>w(e.hubId,e.asset,e.amount))),q(t.convertSwap,M)])}function X(e,t){return C(e,"swap_debt",[b(e.caller),T(t.accountNonce),A(t.existingDebt.hubId,t.existingDebt.asset),S(t.newDebtAmount),A(t.newDebt.hubId,t.newDebt.asset),M(t.steps)])}function F(e,t){return C(e,"swap_collateral",[b(e.caller),T(t.accountNonce),A(t.current.hubId,t.current.asset),S(t.fromAmount),A(t.newCollateral.hubId,t.newCollateral.asset),M(t.steps)])}function Q(e,t){return C(e,"repay_debt_with_collateral",[b(e.caller),T(t.accountNonce),A(t.collateral.hubId,t.collateral.asset),S(t.collateralAmount),A(t.debt.hubId,t.debt.asset),M(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),oe=(e,t)=>e.fetchWithTimeout(`${Z}/spokes`,t),re=(e,t={},o)=>{const{hubId:r,spokeId:u,asset:n}=t;return e.fetchWithTimeout(`${Z}/reserves`,{...o,params:{...void 0!==r?{hubId:r}:{},...void 0!==u?{spokeId:u}:{},...n?{asset:n}:{}}})},ue=(e,t,o,r,u)=>e.fetchWithTimeout(`${Z}/reserves/${t}/${o}/${J(r)}`,u),ne=(e,t,o,r,u,n)=>e.fetchWithTimeout(`${Z}/reserves/${t}/${o}/${J(r)}/holders`,{...n,params:{side:u}}),ae=(e,t,o)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}`,o),ie=(e,t,o,r)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}/page`,{...r,params:{...o}}),le=(e,t,o,r)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}/markets`,{...r,params:{side:o}}),se=(e,t,o)=>e.fetchWithTimeout(`${Z}/hubs/${t}`,o),pe=(e,t,o)=>e.fetchWithTimeout(`${Z}/spokes/${t}`,o),de=(e,t,o)=>e.fetchWithTimeout(`${Z}/users/${J(t)}/positions`,o),ce=(e,t,o={},r)=>{const{skip:u,top:n}=o;return e.fetchWithTimeout(`${Z}/users/${J(t)}/activity`,{...r,params:{...void 0!==u?{skip:u}:{},...void 0!==n?{top:n}:{}}})},ye=(e,t,o)=>e.fetchWithTimeout(`${Z}/accounts/${J(t)}/positions`,o),be=(e,t={},o)=>{const{top:r=K,continuationToken:u}=t;return e.fetchWithTimeout(`${Z}/governance/proposals`,{...o,params:{top:r,...u?{continuationToken:u}:{}}})},Se=(e,t,o,r)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}/graph`,{...r,params:{...o}}),ge=(e,t,o,r)=>e.fetchWithTimeout(`${Z}/hubs/${t}/graph`,{...r,params:{...o}}),Te=(e,t,o,r)=>e.fetchWithTimeout(`${Z}/spokes/${t}/graph`,{...r,params:{...o}}),fe=(e,t,o,r,u,n)=>e.fetchWithTimeout(`${Z}/reserves/${t}/${o}/${J(r)}/graph`,{...n,params:{...u}}),me=e=>({context:t=>Y(e,t),assets:t=>ee(e,t),hubs:t=>te(e,t),spokes:t=>oe(e,t),reserves:(t,o)=>{return void 0===(r=t)||"hubId"in r||"spokeId"in r||"asset"in r?re(e,t,o):re(e,{},t);var r},reserve:(t,o,r,u)=>ue(e,t,o,r,u),reserveHolders:(t,o,r,u,n)=>ne(e,t,o,r,u,n),asset:(t,o)=>ae(e,t,o),assetMarkets:(t,o,r)=>le(e,t,o,r),hub:(t,o)=>se(e,t,o),spoke:(t,o)=>pe(e,t,o),userPositions:(t,o)=>de(e,t,o),userActivity:(t,o,r)=>ce(e,t,o,r),accountPositions:(t,o)=>ye(e,t,o),governanceProposals:(t,o)=>be(e,t,o),assetGraph:(t,o,r)=>Se(e,t,o,r),hubGraph:(t,o,r)=>ge(e,t,o,r),spokeGraph:(t,o,r)=>Te(e,t,o,r),reserveGraph:(t,o,r,u,n)=>fe(e,t,o,r,u,n)}),he={Single:0,PrimaryWithAnchor:1},xe=e=>E({base_borrow_rate_ray:S(e.baseBorrowRateRay),max_borrow_rate_ray:S(e.maxBorrowRateRay),max_utilization_ray:S(e.maxUtilizationRay),mid_utilization_ray:S(e.midUtilizationRay),optimal_utilization_ray:S(e.optimalUtilizationRay),reserve_factor_bps:g(e.reserveFactorBps),slope1_ray:S(e.slope1Ray),slope2_ray:S(e.slope2Ray),slope3_ray:S(e.slope3Ray)}),ve=e=>E({asset_decimals:g(e.assetDecimals),asset_id:b(e.assetId),base_borrow_rate_ray:S(e.baseBorrowRateRay),borrow_cap:S(e.borrowCap),max_borrow_rate_ray:S(e.maxBorrowRateRay),max_utilization_ray:S(e.maxUtilizationRay),mid_utilization_ray:S(e.midUtilizationRay),optimal_utilization_ray:S(e.optimalUtilizationRay),reserve_factor_bps:g(e.reserveFactorBps),slope1_ray:S(e.slope1Ray),slope2_ray:S(e.slope2Ray),slope3_ray:S(e.slope3Ray),supply_cap:S(e.supplyCap)}),_e=e=>E({asset_decimals:g(0),e_mode_categories:v(e.eModeCategories.map((e=>g(e)))),flashloan_fee_bps:g(e.flashloanFeeBps),is_borrowable:f(e.isBorrowable),is_collateralizable:f(e.isCollateralizable),is_flashloanable:f(e.isFlashloanable),liquidation_bonus_bps:g(e.liquidationBonusBps),liquidation_fees_bps:g(e.liquidationFeesBps),liquidation_threshold_bps:g(e.liquidationThresholdBps),loan_to_value_bps:g(e.loanToValueBps)}),qe=e=>E({max_borrow_positions:g(e.maxBorrowPositions),max_supply_positions:g(e.maxSupplyPositions)}),Ae=e=>{const t=e.kind;switch(t){case"Stellar":return v([h("Stellar"),b(e.value)]);case"Symbol":return v([h("Symbol"),h(e.value)]);case"String":return v([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 v([h("Twap"),g(t)])}return v([h("Spot")])},Pe=e=>{const t=e.provider;if("ReflectorSep40"===t){if(!e.asset)throw new Error("Stellar builder: Reflector oracle source requires `asset`");return v([h("Reflector"),E({asset:Ae(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 v([h("RedStone"),E({contract:b(e.contract),feed_id:m(e.feedId),max_stale_seconds:T(e.maxStaleSeconds)})])}throw new Error(`Stellar builder: unknown oracle provider "${t}"`)},Ee=e=>{const t=he[e.strategy];if(void 0===t)throw new Error(`Stellar builder: unknown oracle strategy "${e.strategy}"`);return E({anchor:(o=e.anchor,v(null==o?[h("None")]:[h("Some"),Pe(o)])),max_price_stale_seconds:T(e.maxPriceStaleSeconds),max_sanity_price_wad:S(e.maxSanityPriceWad),min_sanity_price_wad:S(e.minSanityPriceWad),primary:Pe(e.primary),strategy:g(t),tolerance_bps:g(e.toleranceBps)});var o};function Re(e,t){return C(e,"upgrade",[_(t.wasmHash)])}function ke(e,t){return C(e,"migrate",[g(t.newVersion)])}function Oe(e){return C(e,"pause",[])}function Me(e){return C(e,"unpause",[])}function Ie(e,t){return C(e,"grant_role",[b(t.account),h(t.role)])}function Ce(e,t){return C(e,"revoke_role",[b(t.account),h(t.role)])}function Le(e,t){return C(e,"transfer_ownership",[b(t.newOwner),g(t.liveUntilLedger)])}function Ue(e){return C(e,"accept_ownership",[])}function Be(e,t){return C(e,"set_aggregator",[b(t.aggregator)])}function Ge(e,t){return C(e,"set_accumulator",[b(t.accumulator)])}function Ne(e,t){return C(e,"set_liquidity_pool_template",[_(t.wasmHash)])}function $e(e,t){return C(e,"edit_asset_config",[b(t.asset),_e(t.config)])}function De(e,t){return C(e,"set_position_limits",[qe(t)])}function ze(e){return C(e,"add_e_mode_category",[])}function We(e,t){return C(e,"remove_e_mode_category",[g(t.id)])}const Ve=e=>E({asset:b(e.asset),category_id:g(e.categoryId),can_collateral:f(e.canCollateral),can_borrow:f(e.canBorrow),ltv:g(e.ltv),threshold:g(e.threshold),bonus:g(e.bonus),supply_cap:S(e.supplyCap),borrow_cap:S(e.borrowCap)});function je(e,t){return C(e,"add_asset_to_e_mode_category",[Ve(t)])}function He(e,t){return C(e,"edit_asset_in_e_mode_category",[Ve(t)])}function Xe(e,t){return C(e,"update_pool_caps",[b(t.asset),S(t.supplyCap),S(t.borrowCap)])}function Fe(e,t){return C(e,"remove_asset_from_e_mode",[b(t.asset),g(t.categoryId)])}function Qe(e,t){return C(e,"approve_token",[b(t.token)])}function Ze(e,t){return C(e,"revoke_token",[b(t.token)])}function Ke(e,t){return C(e,"configure_market_oracle",[b(e.caller),b(t.asset),Ee(t.config)])}function Je(e,t){return C(e,"edit_oracle_tolerance",[b(e.caller),b(t.asset),g(t.tolerance)])}function Ye(e,t){return C(e,"disable_token_oracle",[b(e.caller),b(t.asset)])}function et(e,t){return C(e,"update_indexes",[b(e.caller),v(t.assets.map((e=>b(e))))])}function tt(e,t){return C(e,"renew_account",[b(e.caller),T(t.accountNonce)])}function ot(e,t){return C(e,"create_liquidity_pool",[b(t.asset),ve(t.params),_e(t.config)])}function rt(e,t){return C(e,"upgrade_liquidity_pool_params",[b(t.asset),xe(t.params)])}function ut(e,t){return C(e,"upgrade_liquidity_pool",[b(t.asset),_(t.wasmHash)])}function nt(e,t){return C(e,"claim_revenue",[b(e.caller),v(t.assets.map((e=>b(e))))])}function at(e,t){return C(e,"add_rewards",[b(e.caller),v(t.rewards.map((e=>v([b(e.token),S(e.amount)]))))])}function it(e,t){return C(e,"update_account_threshold",[b(e.caller),b(t.asset),f(t.hasRisks),v(t.accountNonces.map((e=>T(e))))])}const lt="00".repeat(32),st=e=>{if("string"==typeof e)return _(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)},pt=(e,...t)=>v([h(e),...t]),dt=e=>E({asset:b(e.asset),category_id:g(e.categoryId),can_collateral:f(e.canCollateral),can_borrow:f(e.canBorrow),ltv:g(e.ltv),threshold:g(e.threshold),bonus:g(e.bonus),supply_cap:S(e.supplyCap),borrow_cap:S(e.borrowCap)}),ct=e=>E({new_owner:b(e.newOwner),live_until_ledger:g(e.liveUntilLedger)}),yt=e=>E({account:b(e.account),role:h(e.role)});function bt(e,t,o){const r=e.governanceAddress??d(e.network),u=new c.Contract(r),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,...o)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}const St=(e,t,o)=>bt(e,"propose",[b(e.caller),t,st(o)]),gt=(e,t,o)=>bt(e,"execute_self",[x(),t,st(o)]);function Tt(e,t,o){return St(e,pt("SetAggregator",b(t.aggregator)),o)}function ft(e,t,o){return St(e,pt("SetAccumulator",b(t.accumulator)),o)}function mt(e,t,o){return St(e,pt("SetLiquidityPoolTemplate",_(t.wasmHash)),o)}function ht(e,t,o){return St(e,pt("EditAssetConfig",b(t.asset),_e(t.config)),o)}function xt(e,t,o){return St(e,pt("SetPositionLimits",qe(t)),o)}function vt(e,t,o){return St(e,pt("SetMinBorrowCollateralUsd",S(t.floorWad)),o)}function _t(e,t){return St(e,pt("AddEModeCategory"),t)}function qt(e,t,o){return St(e,pt("RemoveEModeCategory",g(t.id)),o)}function At(e,t,o){return St(e,pt("AddAssetToEModeCategory",dt(t)),o)}function wt(e,t,o){return St(e,pt("EditAssetInEModeCategory",dt(t)),o)}function Pt(e,t,o){return St(e,pt("UpdatePoolCaps",E({asset:b((r=t).asset),supply_cap:S(r.supplyCap),borrow_cap:S(r.borrowCap)})),o);var r}function Et(e,t,o){return St(e,pt("RemoveAssetFromEMode",E({asset:b((r=t).asset),category_id:g(r.categoryId)})),o);var r}function Rt(e,t,o){return St(e,pt("ApproveToken",b(t.token)),o)}function kt(e,t,o){return St(e,pt("RevokeToken",b(t.token)),o)}function Ot(e,t,o){return St(e,pt("ApproveBlendPool",b(t.pool)),o)}function Mt(e,t,o){return St(e,pt("RevokeBlendPool",b(t.pool)),o)}function It(e,t,o){return St(e,pt("CreateLiquidityPool",E({asset:b((r=t).asset),params:ve(r.params),config:_e(r.config)})),o);var r}function Ct(e,t,o){return St(e,pt("UpgradeLiquidityPoolParams",E({asset:b((r=t).asset),params:xe(r.params)})),o);var r}function Lt(e,t){return St(e,pt("DeployPool"),t)}function Ut(e,t,o){return St(e,pt("UpgradePool",_(t.wasmHash)),o)}function Bt(e,t,o){return St(e,pt("DisableTokenOracle",b(t.asset)),o)}function Gt(e,t,o){return St(e,pt("UpgradeController",_(t.wasmHash)),o)}function Nt(e,t,o){return St(e,pt("MigrateController",g(t.newVersion)),o)}function $t(e,t,o){return St(e,pt("TransferCtrlOwnership",ct(t)),o)}function Dt(e,t,o){return St(e,pt("ConfigureMarketOracle",E({asset:b((r=t).asset),cfg:Ee(r.config)})),o);var r}function zt(e,t,o){return St(e,pt("EditOracleTolerance",E({asset:b((r=t).asset),tolerance:g(r.tolerance)})),o);var r}function Wt(e,t,o){return St(e,pt("UpgradeGov",_(t.wasmHash)),o)}function Vt(e,t,o){return St(e,pt("UpdateGovDelay",g(t.newDelay)),o)}function jt(e,t,o){return St(e,pt("GrantGovRole",yt(t)),o)}function Ht(e,t,o){return St(e,pt("RevokeGovRole",yt(t)),o)}function Xt(e,t,o){return St(e,pt("TransferGovOwnership",ct(t)),o)}function Ft(e,t){const o=v(t.argsXdr.map((e=>c.xdr.ScVal.fromXDR(e,"base64")))),r=st(t.predecessor??lt);return bt(e,"execute",[x(),b(t.target),h(t.functionName),o,r,st(t.salt)])}function Qt(e,t,o){return gt(e,pt("UpgradeGov",_(t.wasmHash)),o)}function Zt(e,t,o){return gt(e,pt("UpdateGovDelay",g(t.newDelay)),o)}function Kt(e,t,o){return gt(e,pt("GrantGovRole",yt(t)),o)}function Jt(e,t,o){return gt(e,pt("RevokeGovRole",yt(t)),o)}function Yt(e,t,o){return gt(e,pt("TransferGovOwnership",ct(t)),o)}const eo=e=>e.toXDR("base64"),to=e=>c.xdr.ScVal.fromXDR(e,"base64"),oo=e=>e.map((e=>String((0,c.scValToNative)(to(e))))).join(":"),ro=e=>"bigint"==typeof e||"number"==typeof e?e.toString():String(e),uo=e=>Number(e),no=e=>String(e),ao=e=>null==e?void 0:ro(e),io=e=>null==e?void 0:no(e),lo=e=>e instanceof Uint8Array?Buffer.from(e).toString("hex"):Buffer.isBuffer(e)?e.toString("hex"):String(e),so=["None","Multiply","Long","Short"],po=["Single","PrimaryWithAnchor"],co=["ReflectorSep40","RedStonePriceFeed"],yo=["Spot","Twap"],bo=["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"],So=e=>Array.isArray(e)?e:[],go=e=>({loanToValueBps:uo(e.loan_to_value_bps),liquidationThresholdBps:uo(e.liquidation_threshold_bps),liquidationBonusBps:uo(e.liquidation_bonus_bps),liquidationFeesBps:uo(e.liquidation_fees_bps),isCollateralizable:Boolean(e.is_collateralizable),isBorrowable:Boolean(e.is_borrowable),isFlashloanable:Boolean(e.is_flashloanable),flashloanFeeBps:uo(e.flashloan_fee_bps),eModeCategories:(e.e_mode_categories??[]).map(uo)}),To=(e,t)=>{const o="Borrow"===t;return{action:(r=e[0],bo[uo(r)]??ro(r)),positionType:t,asset:no(e[1]),scaledAmountRay:ro(e[2]),indexRay:ro(e[3]),amount:ro(e[4]),liquidationThresholdBps:o?void 0:uo(e[5]),liquidationBonusBps:o?void 0:uo(e[6]),loanToValueBps:o?void 0:uo(e[7])};var r},fo=e=>{return{owner:no(e[0]),eModeCategoryId:uo(e[1]),mode:(t=e[2],so[uo(t)]??"None")};var t},mo=(e,t)=>{const o=yo[uo(e[`${t}_read_mode`])]??"Spot",r=e[`${t}_asset`],u=e[`${t}_symbol`],n=null!=r?{kind:"Stellar",value:no(r)}:null!=u?{kind:"Symbol",value:no(u)}:void 0;return{provider:co[uo(e[`${t}_provider`])]??"ReflectorSep40",contractAddress:no(e[`${t}_contract`]),asset:n,feedId:io(e[`${t}_feed_id`]),readMode:o,twapRecords:"Twap"===o?uo(e[`${t}_twap_records`]):void 0,decimals:uo(e[`${t}_decimals`]),resolutionSeconds:uo(e[`${t}_resolution_seconds`]),maxStaleSeconds:uo(e[`${t}_max_stale_seconds`])}},ho=e=>{const t=null!==e.anchor_provider&&void 0!==e.anchor_provider;return{baseTokenId:no(e.base_token_id),quoteTokenId:no(e.quote_token_id),tolerance:{upperRatio:uo(e.upper_ratio_bps??e.tolerance?.upper_ratio_bps),lowerRatio:uo(e.lower_ratio_bps??e.tolerance?.lower_ratio_bps)},assetDecimals:uo(e.asset_decimals),maxPriceStaleSeconds:uo(e.max_price_stale_seconds),strategy:po[uo(e.strategy)]??"Single",primary:mo(e,"primary"),anchor:t?mo(e,"anchor"):void 0,primaryQuoteToken:io(e.primary_quote_token),anchorQuoteToken:io(e.anchor_quote_token),minSanityPriceWad:ao(e.min_sanity_price_wad),maxSanityPriceWad:ao(e.max_sanity_price_wad)}},xo={"market:create":e=>({topic:"market:create",data:{baseAsset:no(e.base_asset),maxBorrowRate:ro(e.max_borrow_rate),baseBorrowRate:ro(e.base_borrow_rate),slope1:ro(e.slope1),slope2:ro(e.slope2),slope3:ro(e.slope3),midUtilization:ro(e.mid_utilization),optimalUtilization:ro(e.optimal_utilization),maxUtilization:ao(e.max_utilization),reserveFactor:uo(e.reserve_factor),marketAddress:no(e.market_address),config:go(e.config)}}),"market:params_update":e=>({topic:"market:params_update",data:{asset:no(e.asset),maxBorrowRateRay:ro(e.max_borrow_rate_ray),baseBorrowRateRay:ro(e.base_borrow_rate_ray),slope1Ray:ro(e.slope1_ray),slope2Ray:ro(e.slope2_ray),slope3Ray:ro(e.slope3_ray),midUtilizationRay:ro(e.mid_utilization_ray),optimalUtilizationRay:ro(e.optimal_utilization_ray),maxUtilizationRay:ao(e.max_utilization_ray),reserveFactorBps:uo(e.reserve_factor_bps)}}),"market:batch_state_update":e=>({topic:"market:batch_state_update",data:{updates:So(e).map((e=>{return t=So(e),{asset:no(t[0]),timestamp:uo(t[1]),supplyIndexRay:ro(t[2]),borrowIndexRay:ro(t[3]),reservesRay:ro(t[4]),suppliedRay:ro(t[5]),borrowedRay:ro(t[6]),revenueRay:ro(t[7]),assetPriceWad:ao(t[8])};var t}))}}),"market:batch_params_update":e=>({topic:"market:batch_params_update",data:{updates:So(e).map((e=>{const t=e;return{asset:no(t.asset),params:(o=t.params,{maxBorrowRateRay:ro(o.max_borrow_rate_ray),baseBorrowRateRay:ro(o.base_borrow_rate_ray),slope1Ray:ro(o.slope1_ray),slope2Ray:ro(o.slope2_ray),slope3Ray:ro(o.slope3_ray),midUtilizationRay:ro(o.mid_utilization_ray),optimalUtilizationRay:ro(o.optimal_utilization_ray),maxUtilizationRay:ao(o.max_utilization_ray),reserveFactorBps:uo(o.reserve_factor_bps),supplyCap:ro(o.supply_cap),borrowCap:ro(o.borrow_cap),assetId:io(o.asset_id),assetDecimals:void 0===o.asset_decimals?void 0:uo(o.asset_decimals)})};var o}))}}),"position:batch_update":e=>{const t=So(e);return{topic:"position:batch_update",data:{accountId:ro(t[0]),accountAttributes:fo(So(t[1])),updates:[...So(t[2]).map((e=>To(So(e),"Deposit"))),...So(t[3]).map((e=>To(So(e),"Borrow")))]}}},"position:flash_loan":e=>({topic:"position:flash_loan",data:{asset:no(e.asset),receiver:no(e.receiver),caller:no(e.caller),amount:ro(e.amount),fee:ro(e.fee)}}),"config:asset":e=>({topic:"config:asset",data:{asset:no(e.asset),config:go(e.config)}}),"config:oracle":e=>({topic:"config:oracle",data:{asset:no(e.asset),oracle:ho(e.oracle)}}),"config:emode_category":e=>({topic:"config:emode_category",data:{category:{categoryId:uo(e.category.category_id),isDeprecated:Boolean(e.category.is_deprecated)}}}),"config:emode_asset":e=>({topic:"config:emode_asset",data:{asset:no(e.asset),config:{isCollateralizable:Boolean(e.config.is_collateralizable),isBorrowable:Boolean(e.config.is_borrowable),loanToValueBps:uo(e.config.loan_to_value_bps),liquidationThresholdBps:uo(e.config.liquidation_threshold_bps),liquidationBonusBps:uo(e.config.liquidation_bonus_bps),supplyCap:ro(e.config.supply_cap),borrowCap:ro(e.config.borrow_cap)},categoryId:uo(e.category_id)}}),"config:remove_emode_asset":e=>({topic:"config:remove_emode_asset",data:{asset:no(e.asset),categoryId:uo(e.category_id)}}),"debt:bad_debt":e=>({topic:"debt:bad_debt",data:{accountId:ro(e.account_id),totalBorrowUsdWad:ro(e.total_borrow_usd_wad),totalCollateralUsdWad:ro(e.total_collateral_usd_wad)}}),"strategy:initial_payment":e=>({topic:"strategy:initial_payment",data:{token:no(e.token),amount:ro(e.amount),usdValueWad:ro(e.usd_value_wad),accountId:ro(e.account_id)}}),"strategy:fee":e=>({topic:"strategy:fee",data:{asset:no(e.asset),amount:ro(e.amount),fee:ro(e.fee),amountSent:ro(e.amount_sent)}}),"config:approve_token":e=>({topic:"config:approve_token",data:{wasmHash:lo(e.wasm_hash),approved:Boolean(e.approved)}}),"config:aggregator":e=>({topic:"config:aggregator",data:{aggregator:no(e.aggregator)}}),"config:accumulator":e=>({topic:"config:accumulator",data:{accumulator:no(e.accumulator)}}),"config:pool_template":e=>({topic:"config:pool_template",data:{wasmHash:lo(e.wasm_hash)}}),"config:position_limits":e=>({topic:"config:position_limits",data:{maxSupplyPositions:uo(e.max_supply_positions),maxBorrowPositions:uo(e.max_borrow_positions)}}),"config:oracle_disabled":e=>({topic:"config:oracle_disabled",data:{asset:no(e.asset)}})},vo=Object.freeze(Object.keys(xo));function _o(e,t){const o=oo(e),r=xo[o];return r?r((0,c.scValToNative)(to(t))):null}const qo="XLENDXLM-a7c9f3",Ao=1e4;function wo(e){const t=BigInt(e).toString(16),o=t.length%2==0?t:`0${t}`;return`${qo}-${o}`}function Po(e){const t=e.split("-");return t.length>=2&&parseInt(t[1],10)||0}function Eo(e,t=0){return e*Ao+t}function Ro(e){switch(e){case"liq_repay":return"lendingLiquidateRepayDebt";case"liq_seize":return"lendingLiquidateSeizeCollateral";case"param_upd":return"lendingUpdateAccountParameters";default:return"lendingUpdateAccountPosition"}}const ko=(e,t,o)=>{const r=new URL(t,e.endsWith("/")?e:`${e}/`);if(o)for(const[e,t]of Object.entries(o))void 0!==t&&r.searchParams.set(e,String(t));return r.toString()},Oo=e=>e.baseUrl??i[e.network];async function Mo(e,t){if(null==e.amountIn==(null==e.amountOut))throw new Error("getStellarAggregatorQuote: exactly one of `amountIn` or `amountOut` must be provided");const o=ko(Oo(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}),r=await fetch(o,t.fetchOptions);if(!r.ok){const e=await r.text().catch((()=>""));throw new Error(`Stellar quote server responded ${r.status} ${r.statusText} for ${o} — ${e}`)}return await r.json()}async function Io(e){const t=ko(Oo(e),"api/v1/tokens"),o=await fetch(t,e.fetchOptions);if(!o.ok){const e=await o.text().catch((()=>""));throw new Error(`Stellar quote server responded ${o.status} ${o.statusText} for ${t} — ${e}`)}return await o.json()}const Co=e=>R(e).toXDR("base64");function Lo(e,t){const o=e.routerAddress??p(e.network),r=new c.Contract(o),u=new c.Account(e.caller,e.sourceSequence),n=M(((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(r.call("execute_strategy",b(e.caller),S(e.totalIn),n)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function Uo(e,t){return Lo(e,t)}function Bo(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($o),splitPpm:e.splitPpm}))):[{hops:e.hops.map($o),splitPpm:1e6}],referralId:t.referralId??0,tokenIn:e.from,tokenOut:e.to,totalMinOut:e.amountOutMin}}function Go(e,t={}){const o=e;return"string"==typeof o.routeXdr&&o.routeXdr.length>0?{routeXdr:o.routeXdr}:Bo(e,t)}const No=Bo,$o=e=>({amountOut:e.amountOut,pool:e.address,tokenIn:e.from,tokenOut:e.to,venue:e.dex});function Do(e,t){const o=t instanceof Error?t.message:String(t);return new Error(`[xoxno-invoked:${e}] ${o}`)}async function zo(e,t,o){const r=c.TransactionBuilder.fromXDR(t,"base64");try{return(await e.prepareTransaction(r)).toXDR()}catch(e){if(o?.invokedContractId)throw Do(o.invokedContractId,e);throw e}}async function Wo(e,t,o){return zo(e,t.xdr,o)}function Vo(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 jo(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 Ho=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 Xo(e){const t=new c.Account(e.caller,e.sourceSequence),o=new c.Contract(e.forwarderAddress).call("mint_and_forward",c.xdr.ScVal.scvBytes(Ho(e.message)),c.xdr.ScVal.scvBytes(Ho(e.attestation)));return{xdr:new c.TransactionBuilder(t,{fee:e.fee??"10000000",networkPassphrase:l[e.network]}).addOperation(o).setTimeout(e.timeoutSeconds??120).build().toXDR()}}}},t={};function o(r){var u=t[r];if(void 0!==u)return u.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};o.r(r),o.d(r,{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:()=>x,buildStellarAcceptOwnershipTx:()=>T.buildStellarAcceptOwnershipTx,buildStellarAddAssetToEModeCategoryTx:()=>T.buildStellarAddAssetToEModeCategoryTx,buildStellarAddEModeCategoryTx:()=>T.buildStellarAddEModeCategoryTx,buildStellarAddRewardsTx:()=>T.buildStellarAddRewardsTx,buildStellarApproveTokenTx:()=>T.buildStellarApproveTokenTx,buildStellarBatchSwapTx:()=>T.buildStellarBatchSwapTx,buildStellarBorrowBatchTx:()=>T.buildStellarBorrowBatchTx,buildStellarBorrowTx:()=>T.buildStellarBorrowTx,buildStellarCctpForwardTx:()=>T.buildStellarCctpForwardTx,buildStellarClaimRevenueTx:()=>T.buildStellarClaimRevenueTx,buildStellarConfigureMarketOracleTx:()=>T.buildStellarConfigureMarketOracleTx,buildStellarCreateLiquidityPoolTx:()=>T.buildStellarCreateLiquidityPoolTx,buildStellarDisableTokenOracleTx:()=>T.buildStellarDisableTokenOracleTx,buildStellarEditAssetConfigTx:()=>T.buildStellarEditAssetConfigTx,buildStellarEditAssetInEModeCategoryTx:()=>T.buildStellarEditAssetInEModeCategoryTx,buildStellarEditOracleToleranceTx:()=>T.buildStellarEditOracleToleranceTx,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,buildStellarProposeAddAssetToEModeTx:()=>T.buildStellarProposeAddAssetToEModeTx,buildStellarProposeAddEModeCategoryTx:()=>T.buildStellarProposeAddEModeCategoryTx,buildStellarProposeApproveBlendPoolTx:()=>T.buildStellarProposeApproveBlendPoolTx,buildStellarProposeApproveTokenTx:()=>T.buildStellarProposeApproveTokenTx,buildStellarProposeConfigureMarketOracleTx:()=>T.buildStellarProposeConfigureMarketOracleTx,buildStellarProposeCreateLiquidityPoolTx:()=>T.buildStellarProposeCreateLiquidityPoolTx,buildStellarProposeDeployPoolTx:()=>T.buildStellarProposeDeployPoolTx,buildStellarProposeDisableTokenOracleTx:()=>T.buildStellarProposeDisableTokenOracleTx,buildStellarProposeEditAssetConfigTx:()=>T.buildStellarProposeEditAssetConfigTx,buildStellarProposeEditAssetInEModeTx:()=>T.buildStellarProposeEditAssetInEModeTx,buildStellarProposeEditOracleToleranceTx:()=>T.buildStellarProposeEditOracleToleranceTx,buildStellarProposeGovernanceUpgradeTx:()=>T.buildStellarProposeGovernanceUpgradeTx,buildStellarProposeGrantGovernanceRoleTx:()=>T.buildStellarProposeGrantGovernanceRoleTx,buildStellarProposeMigrateControllerTx:()=>T.buildStellarProposeMigrateControllerTx,buildStellarProposeRemoveAssetFromEModeTx:()=>T.buildStellarProposeRemoveAssetFromEModeTx,buildStellarProposeRemoveEModeCategoryTx:()=>T.buildStellarProposeRemoveEModeCategoryTx,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,buildStellarRemoveAssetFromEModeTx:()=>T.buildStellarRemoveAssetFromEModeTx,buildStellarRemoveEModeCategoryTx:()=>T.buildStellarRemoveEModeCategoryTx,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,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,buildStellarUpgradeLiquidityPoolTx:()=>T.buildStellarUpgradeLiquidityPoolTx,buildStellarWithdrawBatchTx:()=>T.buildStellarWithdrawBatchTx,buildStellarWithdrawTx:()=>T.buildStellarWithdrawTx,buildTx:()=>T.buildTx,decodeStellarLendingEvent:()=>T.decodeStellarLendingEvent,encodeAssetConfigRaw:()=>T.encodeAssetConfigRaw,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",a="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",i="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,...o}={}){this.apiUrl=t??{[l.MAINNET]:u,[l.DEVNET]:"https://devnet-api.xoxno.com"}[e],this.chain=e,this.init=o,this.config=e==l.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:n,DR_SC:a,KG_SC:i,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:a,KG_SC:i,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}fetchWithTimeout=async(e,{params:t,...o}={})=>{const{next:r,cache:u,debug:n,...a}=this.init,{next:i,cache:l,debug:s,headers:p,method:d="GET",...c}=o,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}=r??{},{revalidate:h,...x}=i??{},v="GET"!==d||b?void 0:h??f,_="GET"!==d||b||v?void 0:l??u,q={...a,...c,method:d,...Object.keys(S).length?{headers:S}:{},cache:_,next:{...m,...x,revalidate:v}};(s??n)&&console.debug("SDK fetch: ",T,q);const A=await fetch(T,q).catch((e=>{if(e instanceof Error&&!e.message.match(/^http(s?):\/\//))throw Object.assign(new Error(`${T}: ${e.message}`),{cause:e});throw e})),w=await A.text();if(!A.ok){let e;try{e=JSON.parse(w)}catch{e={message:w}}const t=[T,A.status,A.statusText,e.message].filter(Boolean).join(";;");throw new Error(t)}try{return JSON.parse(w)}catch{return w}}}const p=e=>{const t=/^0x[a-fA-F0-9]{1,64}-[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(e)),o=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(e);return t||o},d=e=>{const t=/^0x[a-fA-F0-9]{1,64}$/.test(e),o=/^[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||o};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/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=o(454);const f=e=>e.replace(/-([a-z])/g,((e,t)=>t.toUpperCase())),m=()=>({static:{},params:{},leaves:[]});function h(e,t,o,r){const{input:u,output:n,...a}=t,i=async(t={})=>{const u={...o,...t},n=e.replace(/:([a-zA-Z_]+)/g,((e,t)=>`${u[t]}`)),a=[...e.matchAll(/:([a-zA-Z_]+)/g)].map((e=>e[1])),i=Object.fromEntries(Object.entries(u).filter((([e])=>!a.includes(e)))),l=/:address[^A-Z]/.test(e)||"address"in i,s=/:collection[^A-Z]/.test(e)||"collection"in i;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(i).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:x,continuationToken:v,..._}=d,q=g?`Bearer ${g}`:void 0,A={...f,...q?{Authorization:q}:{},...v?{"X-Continuation-Token":String(v)}:{}},w={...h,tags:[...h?.tags??[],n]};return r.fetchWithTimeout(n,{method:T,params:_,body:S,headers:A,cache:m,debug:x,...w?{next:w}:{}})},l=(e={})=>i(e);for(const e of Object.keys(a))g.includes(e)&&(l[e]=t=>i({...t,method:t.method??e.toUpperCase()}));return l}function x(e){const t=function(){const e=m();for(const[t,o]of Object.entries(S)){const r=t.split("/").filter(Boolean);let u=e;for(const e of r)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:o})}return e}(),o=(t,r)=>{const u=t.leaves.length,n=Object.keys(t.static).length,a=Object.keys(t.params).length;let i;if(1===u&&n+a>0){const{rawPath:o,def:u}=t.leaves[0];i=h(o,u,r,e)}else{i={};for(const{rawPath:o,def:u}of t.leaves)i[f(o.split("/").pop().replace(/^:/,""))]=h(o,u,r,e)}for(const[e,u]of Object.entries(t.static)){const t=o(u,r);let n=t;if(t&&"object"==typeof t&&e in t&&"function"==typeof t[e]){const o=t[e],r=Object.fromEntries(Object.entries(t).filter((([t])=>t!==e)));1===o.length||(Object.assign(o,r),n=o)}void 0===i[e]?i[e]=n:"function"==typeof i[e]?Object.assign(i[e],n):"function"==typeof n?(Object.assign(n,i[e]),i[e]=n):Object.assign(i[e],n)}for(const[e,u]of Object.entries(t.params)){const t=t=>{const n=o(u,{...r,[e]:t});if(n&&"object"==typeof n&&1===Object.keys(n).length&&e in n&&"function"==typeof n[e]){const t=n[e],o=(...e)=>t(...e);return Object.assign(o,t)}return n};if(i[e]){const o=i[e];i[e]=e=>({...o(e),...t(e)})}else i[e]=t}return i};return o(t,{})}module.exports=r})();
|
|
1
|
+
"undefined"!=typeof globalThis&&void 0===globalThis.self&&(globalThis.self=globalThis),(()=>{"use strict";var e={454(e,t,o){o.d(t,{STELLAR_AGGREGATOR_ROUTER:()=>u,STELLAR_GOVERNANCE:()=>n,STELLAR_GOVERNANCE_ZERO_PREDECESSOR:()=>lt,STELLAR_LENDING_CONTROLLER:()=>r,STELLAR_LENDING_TOPICS:()=>vo,STELLAR_NETWORK_PASSPHRASE:()=>l,STELLAR_QUOTE_URL:()=>i,STELLAR_SOROBAN_RPC_URL:()=>a,SYNTHETIC_EVENT_ORDER_STRIDE:()=>Ao,XOXNO_LENDING_STELLAR_TICKER:()=>qo,buildSameTokenRepaySwapSteps:()=>jo,buildStellarAcceptOwnershipTx:()=>Ue,buildStellarAddAssetToEModeCategoryTx:()=>je,buildStellarAddEModeCategoryTx:()=>ze,buildStellarAddRewardsTx:()=>at,buildStellarApproveTokenTx:()=>Qe,buildStellarBatchSwapTx:()=>Uo,buildStellarBorrowBatchTx:()=>B,buildStellarBorrowTx:()=>G,buildStellarCctpForwardTx:()=>Xo,buildStellarClaimRevenueTx:()=>nt,buildStellarConfigureMarketOracleTx:()=>Ke,buildStellarCreateLiquidityPoolTx:()=>ot,buildStellarDisableTokenOracleTx:()=>Ye,buildStellarEditAssetConfigTx:()=>$e,buildStellarEditAssetInEModeCategoryTx:()=>He,buildStellarEditOracleToleranceTx:()=>Je,buildStellarExecuteStrategyTx:()=>Lo,buildStellarFlashLoanTx:()=>V,buildStellarGovernanceExecuteGovernanceUpgradeTx:()=>Qt,buildStellarGovernanceExecuteGrantGovernanceRoleTx:()=>Kt,buildStellarGovernanceExecuteRevokeGovernanceRoleTx:()=>Jt,buildStellarGovernanceExecuteTransferGovOwnTx:()=>Yt,buildStellarGovernanceExecuteTx:()=>Ft,buildStellarGovernanceExecuteUpdateDelayTx:()=>Zt,buildStellarGrantRoleTx:()=>Ie,buildStellarLendingIdentifier:()=>wo,buildStellarLiquidateTx:()=>W,buildStellarMigrateFromBlendTx:()=>j,buildStellarMigrateTx:()=>ke,buildStellarMultiplyTx:()=>H,buildStellarPauseTx:()=>Oe,buildStellarProposeAddAssetToEModeTx:()=>At,buildStellarProposeAddEModeCategoryTx:()=>_t,buildStellarProposeApproveBlendPoolTx:()=>Ot,buildStellarProposeApproveTokenTx:()=>Rt,buildStellarProposeConfigureMarketOracleTx:()=>Dt,buildStellarProposeCreateLiquidityPoolTx:()=>It,buildStellarProposeDeployPoolTx:()=>Lt,buildStellarProposeDisableTokenOracleTx:()=>Bt,buildStellarProposeEditAssetConfigTx:()=>ht,buildStellarProposeEditAssetInEModeTx:()=>wt,buildStellarProposeEditOracleToleranceTx:()=>zt,buildStellarProposeGovernanceUpgradeTx:()=>Wt,buildStellarProposeGrantGovernanceRoleTx:()=>jt,buildStellarProposeMigrateControllerTx:()=>Nt,buildStellarProposeRemoveAssetFromEModeTx:()=>Et,buildStellarProposeRemoveEModeCategoryTx:()=>qt,buildStellarProposeRevokeBlendPoolTx:()=>Mt,buildStellarProposeRevokeGovernanceRoleTx:()=>Ht,buildStellarProposeRevokeTokenTx:()=>kt,buildStellarProposeSetAccumulatorTx:()=>ft,buildStellarProposeSetAggregatorTx:()=>Tt,buildStellarProposeSetMinBorrowCollatTx:()=>vt,buildStellarProposeSetPoolTemplateTx:()=>mt,buildStellarProposeSetPositionLimitsTx:()=>xt,buildStellarProposeTransferCtrlOwnershipTx:()=>$t,buildStellarProposeTransferGovOwnTx:()=>Xt,buildStellarProposeUpdateDelayTx:()=>Vt,buildStellarProposeUpdatePoolCapsTx:()=>Pt,buildStellarProposeUpgradeControllerTx:()=>Gt,buildStellarProposeUpgradePoolParamsTx:()=>Ct,buildStellarProposeUpgradePoolTx:()=>Ut,buildStellarRemoveAssetFromEModeTx:()=>Fe,buildStellarRemoveEModeCategoryTx:()=>We,buildStellarRenewAccountTx:()=>tt,buildStellarRepayBatchTx:()=>D,buildStellarRepayDebtWithCollateralTx:()=>Q,buildStellarRepayTx:()=>z,buildStellarRevokeRoleTx:()=>Ce,buildStellarRevokeTokenTx:()=>Ze,buildStellarSetAccumulatorTx:()=>Ge,buildStellarSetAggregatorTx:()=>Be,buildStellarSetLiquidityPoolTemplateTx:()=>Ne,buildStellarSetPositionLimitsTx:()=>De,buildStellarSupplyBatchTx:()=>L,buildStellarSupplyTx:()=>U,buildStellarSwapCollateralTx:()=>F,buildStellarSwapDebtTx:()=>X,buildStellarTransferOwnershipTx:()=>Le,buildStellarUnpauseTx:()=>Me,buildStellarUpdateAccountThresholdTx:()=>it,buildStellarUpdateIndexesTx:()=>et,buildStellarUpdatePoolCapsTx:()=>Xe,buildStellarUpgradeControllerTx:()=>Re,buildStellarUpgradeLiquidityPoolParamsTx:()=>rt,buildStellarUpgradeLiquidityPoolTx:()=>ut,buildStellarWithdrawBatchTx:()=>N,buildStellarWithdrawTx:()=>$,buildTx:()=>C,decodeStellarLendingEvent:()=>_o,encodeAssetConfigRaw:()=>_e,encodeInterestRateModel:()=>xe,encodeMarketOracleConfigInput:()=>Ee,encodeMarketParamsRaw:()=>ve,encodeOracleSourceConfigInput:()=>Pe,encodePositionLimits:()=>qe,encodeStrategyPayloadToRouteXdr:()=>Co,extractEventOrder:()=>Po,getStellarAccountPositions:()=>ye,getStellarAggregatorQuote:()=>Mo,getStellarAggregatorRouter:()=>p,getStellarAsset:()=>ae,getStellarAssetGraph:()=>Se,getStellarAssetMarkets:()=>le,getStellarAssetPage:()=>ie,getStellarAssets:()=>ee,getStellarGovernance:()=>d,getStellarGovernanceProposals:()=>be,getStellarHub:()=>se,getStellarHubGraph:()=>ge,getStellarHubs:()=>te,getStellarLendingContext:()=>Y,getStellarLendingController:()=>s,getStellarQuoteTokens:()=>Io,getStellarReserve:()=>ue,getStellarReserveGraph:()=>fe,getStellarReserveHolders:()=>ne,getStellarReserves:()=>re,getStellarSpoke:()=>pe,getStellarSpokeGraph:()=>Te,getStellarSpokes:()=>oe,getStellarUserActivity:()=>ce,getStellarUserPositions:()=>de,mapQuoteResponseToAggregatorSwap:()=>No,mapQuoteResponseToStrategyPayload:()=>Bo,mapQuoteResponseToStrategySwap:()=>Go,mapStellarPositionActivityType:()=>Ro,prepareStellarBuiltTx:()=>Wo,prepareStellarTxXdr:()=>zo,stellarLendingDispatchKey:()=>oo,stellarLendingRead:()=>me,syntheticEventOrder:()=>Eo,tagStellarInvokedContractError:()=>Do,toBase64Xdr:()=>eo,toStellarPositionMode:()=>Vo});const r={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??""},a={mainnet:"https://soroban-rpc.stellar.org",testnet:"https://soroban-testnet.stellar.org"},i={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=r[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),x=()=>c.xdr.ScVal.scvVoid(),v=e=>c.xdr.ScVal.scvVec(e),_=(e,t=32)=>{const o=e.startsWith("0x")?e.slice(2):e,r=Buffer.from(o,"hex");if(r.length!==t)throw new Error(`Stellar builder: expected a ${t}-byte BytesN (got ${r.length} bytes from "${e}")`);return c.xdr.ScVal.scvBytes(r)},q=(e,t)=>null==e?x():t(e),A=(e,t)=>E({asset:b(t),hub_id:g(e)}),w=(e,t,o)=>c.xdr.ScVal.scvVec([A(e,t),S(o)]),P=e=>c.xdr.ScVal.scvVec(e.map((e=>w(e.hubId,e.asset,e.amount)))),E=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)},R=e=>{const t=e.paths.map((e=>{const t=e.hops.map((e=>{return E({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 E({hops:c.xdr.ScVal.scvVec(t),split_ppm:g(e.splitPpm)})}));return E({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(!((o=e).length>0&&o.length%2==0&&/^[0-9a-fA-F]+$/.test(o)))throw new Error("Stellar builder: strategy swap bytes hex string must be 0x-prefixed and even-length");return Buffer.from(e,"hex")}var o;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 r=Buffer.from(t,"base64");if(0===r.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return r},M=e=>{if("string"==typeof e)return k(O(e));if(e instanceof Uint8Array)return k(e);if(e&&"object"==typeof e)return"routeXdr"in(o=e)&&"string"==typeof o.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 o=0;for(const[e,r]of t.paths.entries()){if(!r||"number"!=typeof r.splitPpm||r.splitPpm<=0||!Array.isArray(r.hops)||0===r.hops.length)throw new Error(`Stellar builder: \`steps.paths[${e}]\` must have splitPpm > 0 and a non-empty hops array`);o+=r.splitPpm;for(const[t,o]of r.hops.entries())if(!o||"string"!=typeof o.amountOut||"string"!=typeof o.pool||"string"!=typeof o.tokenIn||"string"!=typeof o.tokenOut||!y.includes(o.venue))throw new Error(`Stellar builder: \`steps.paths[${e}].hops[${t}]\` must have amountOut, pool, tokenIn, tokenOut, and a valid Soroban venue`)}if(1e6!==o)throw new Error(`Stellar builder: \`steps.paths[].splitPpm\` must sum to 1_000_000, got ${o}`);return t})(e),c.xdr.ScVal.scvBytes(Buffer.from(R(t).toXDR("base64"),"base64")));var t,o;throw new Error("Stellar builder: `steps` must be opaque strategy bytes (`routeXdr`, base64/hex string, or Uint8Array)")},I=e=>{if("string"==typeof e)return(e=>{const t=e.startsWith("0x")?e.slice(2):e,o=Buffer.from(t,"hex");return c.xdr.ScVal.scvBytes(o)})(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 C(e,t,o){const r=e.controllerAddress??s(e.network),u=new c.Contract(r),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,...o)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function L(e,t){const o=t.accountNonce??0,r=t.spokeId??0;return C(e,"supply",[b(e.caller),T(o),g(r),P([...t.assets])])}function U(e,t){return L(e,{accountNonce:t.accountNonce,spokeId:t.spokeId,assets:[{hubId:t.hubId,asset:t.asset,amount:t.amount}]})}function B(e,t){return C(e,"borrow",[b(e.caller),T(t.accountNonce),P([...t.borrows]),q(t.to,b)])}function G(e,t){return B(e,{accountNonce:t.accountNonce,borrows:[{hubId:t.hubId,asset:t.asset,amount:t.amount}],to:t.to})}function N(e,t){return C(e,"withdraw",[b(e.caller),T(t.accountNonce),P([...t.withdrawals]),q(t.to,b)])}function $(e,t){return N(e,{accountNonce:t.accountNonce,withdrawals:[{hubId:t.hubId,asset:t.asset,amount:t.amount}],to:t.to})}function D(e,t){return C(e,"repay",[b(e.caller),T(t.accountNonce),P([...t.payments])])}function z(e,t){return D(e,{accountNonce:t.accountNonce,payments:[{hubId:t.hubId,asset:t.asset,amount:t.amount}]})}function W(e,t){return C(e,"liquidate",[b(e.caller),T(t.accountNonce),P([...t.debtPayments])])}function V(e,t){return C(e,"flash_loan",[b(e.caller),A(t.hubId,t.asset),S(t.amount),b(t.receiver),I(t.data)])}function j(e,t){return C(e,"migrate_from_blend",[b(e.caller),T(t.accountId),g(t.spokeId),g(t.hubId),b(t.blendPool),v(t.collateralTokens.map(b)),v(t.supplyTokens.map(b)),(o=t.debtCaps.map((e=>({token:e.token,amount:e.cap}))),c.xdr.ScVal.scvVec(o.map((e=>{return t=e.token,o=e.amount,c.xdr.ScVal.scvVec([b(t),S(o)]);var t,o}))))]);var o}function H(e,t){const o=t.accountNonce??0,r=t.spokeId??0;return C(e,"multiply",[b(e.caller),T(o),g(r),A(t.collateral.hubId,t.collateral.asset),S(t.debtToFlashLoan),A(t.debt.hubId,t.debt.asset),g(t.mode),M(t.steps),q(t.initialPayment,(e=>w(e.hubId,e.asset,e.amount))),q(t.convertSwap,M)])}function X(e,t){return C(e,"swap_debt",[b(e.caller),T(t.accountNonce),A(t.existingDebt.hubId,t.existingDebt.asset),S(t.newDebtAmount),A(t.newDebt.hubId,t.newDebt.asset),M(t.steps)])}function F(e,t){return C(e,"swap_collateral",[b(e.caller),T(t.accountNonce),A(t.current.hubId,t.current.asset),S(t.fromAmount),A(t.newCollateral.hubId,t.newCollateral.asset),M(t.steps)])}function Q(e,t){return C(e,"repay_debt_with_collateral",[b(e.caller),T(t.accountNonce),A(t.collateral.hubId,t.collateral.asset),S(t.collateralAmount),A(t.debt.hubId,t.debt.asset),M(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),oe=(e,t)=>e.fetchWithTimeout(`${Z}/spokes`,t),re=(e,t={},o)=>{const{hubId:r,spokeId:u,asset:n}=t;return e.fetchWithTimeout(`${Z}/reserves`,{...o,params:{...void 0!==r?{hubId:r}:{},...void 0!==u?{spokeId:u}:{},...n?{asset:n}:{}}})},ue=(e,t,o,r,u)=>e.fetchWithTimeout(`${Z}/reserves/${t}/${o}/${J(r)}`,u),ne=(e,t,o,r,u,n)=>e.fetchWithTimeout(`${Z}/reserves/${t}/${o}/${J(r)}/holders`,{...n,params:{side:u}}),ae=(e,t,o)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}`,o),ie=(e,t,o,r)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}/page`,{...r,params:{...o}}),le=(e,t,o,r)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}/markets`,{...r,params:{side:o}}),se=(e,t,o)=>e.fetchWithTimeout(`${Z}/hubs/${t}`,o),pe=(e,t,o)=>e.fetchWithTimeout(`${Z}/spokes/${t}`,o),de=(e,t,o)=>e.fetchWithTimeout(`${Z}/users/${J(t)}/positions`,o),ce=(e,t,o={},r)=>{const{skip:u,top:n}=o;return e.fetchWithTimeout(`${Z}/users/${J(t)}/activity`,{...r,params:{...void 0!==u?{skip:u}:{},...void 0!==n?{top:n}:{}}})},ye=(e,t,o)=>e.fetchWithTimeout(`${Z}/accounts/${J(t)}/positions`,o),be=(e,t={},o)=>{const{top:r=K,continuationToken:u}=t;return e.fetchWithTimeout(`${Z}/governance/proposals`,{...o,params:{top:r,...u?{continuationToken:u}:{}}})},Se=(e,t,o,r)=>e.fetchWithTimeout(`${Z}/assets/${J(t)}/graph`,{...r,params:{...o}}),ge=(e,t,o,r)=>e.fetchWithTimeout(`${Z}/hubs/${t}/graph`,{...r,params:{...o}}),Te=(e,t,o,r)=>e.fetchWithTimeout(`${Z}/spokes/${t}/graph`,{...r,params:{...o}}),fe=(e,t,o,r,u,n)=>e.fetchWithTimeout(`${Z}/reserves/${t}/${o}/${J(r)}/graph`,{...n,params:{...u}}),me=e=>({context:t=>Y(e,t),assets:t=>ee(e,t),hubs:t=>te(e,t),spokes:t=>oe(e,t),reserves:(t,o)=>{return void 0===(r=t)||"hubId"in r||"spokeId"in r||"asset"in r?re(e,t,o):re(e,{},t);var r},reserve:(t,o,r,u)=>ue(e,t,o,r,u),reserveHolders:(t,o,r,u,n)=>ne(e,t,o,r,u,n),asset:(t,o)=>ae(e,t,o),assetMarkets:(t,o,r)=>le(e,t,o,r),hub:(t,o)=>se(e,t,o),spoke:(t,o)=>pe(e,t,o),userPositions:(t,o)=>de(e,t,o),userActivity:(t,o,r)=>ce(e,t,o,r),accountPositions:(t,o)=>ye(e,t,o),governanceProposals:(t,o)=>be(e,t,o),assetGraph:(t,o,r)=>Se(e,t,o,r),hubGraph:(t,o,r)=>ge(e,t,o,r),spokeGraph:(t,o,r)=>Te(e,t,o,r),reserveGraph:(t,o,r,u,n)=>fe(e,t,o,r,u,n)}),he={Single:0,PrimaryWithAnchor:1},xe=e=>E({base_borrow_rate_ray:S(e.baseBorrowRateRay),max_borrow_rate_ray:S(e.maxBorrowRateRay),max_utilization_ray:S(e.maxUtilizationRay),mid_utilization_ray:S(e.midUtilizationRay),optimal_utilization_ray:S(e.optimalUtilizationRay),reserve_factor_bps:g(e.reserveFactorBps),slope1_ray:S(e.slope1Ray),slope2_ray:S(e.slope2Ray),slope3_ray:S(e.slope3Ray)}),ve=e=>E({asset_decimals:g(e.assetDecimals),asset_id:b(e.assetId),base_borrow_rate_ray:S(e.baseBorrowRateRay),borrow_cap:S(e.borrowCap),max_borrow_rate_ray:S(e.maxBorrowRateRay),max_utilization_ray:S(e.maxUtilizationRay),mid_utilization_ray:S(e.midUtilizationRay),optimal_utilization_ray:S(e.optimalUtilizationRay),reserve_factor_bps:g(e.reserveFactorBps),slope1_ray:S(e.slope1Ray),slope2_ray:S(e.slope2Ray),slope3_ray:S(e.slope3Ray),supply_cap:S(e.supplyCap)}),_e=e=>E({asset_decimals:g(0),e_mode_categories:v(e.eModeCategories.map((e=>g(e)))),flashloan_fee_bps:g(e.flashloanFeeBps),is_borrowable:f(e.isBorrowable),is_collateralizable:f(e.isCollateralizable),is_flashloanable:f(e.isFlashloanable),liquidation_bonus_bps:g(e.liquidationBonusBps),liquidation_fees_bps:g(e.liquidationFeesBps),liquidation_threshold_bps:g(e.liquidationThresholdBps),loan_to_value_bps:g(e.loanToValueBps)}),qe=e=>E({max_borrow_positions:g(e.maxBorrowPositions),max_supply_positions:g(e.maxSupplyPositions)}),Ae=e=>{const t=e.kind;switch(t){case"Stellar":return v([h("Stellar"),b(e.value)]);case"Symbol":return v([h("Symbol"),h(e.value)]);case"String":return v([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 v([h("Twap"),g(t)])}return v([h("Spot")])},Pe=e=>{const t=e.provider;if("ReflectorSep40"===t){if(!e.asset)throw new Error("Stellar builder: Reflector oracle source requires `asset`");return v([h("Reflector"),E({asset:Ae(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 v([h("RedStone"),E({contract:b(e.contract),feed_id:m(e.feedId),max_stale_seconds:T(e.maxStaleSeconds)})])}throw new Error(`Stellar builder: unknown oracle provider "${t}"`)},Ee=e=>{const t=he[e.strategy];if(void 0===t)throw new Error(`Stellar builder: unknown oracle strategy "${e.strategy}"`);return E({anchor:(o=e.anchor,v(null==o?[h("None")]:[h("Some"),Pe(o)])),max_price_stale_seconds:T(e.maxPriceStaleSeconds),max_sanity_price_wad:S(e.maxSanityPriceWad),min_sanity_price_wad:S(e.minSanityPriceWad),primary:Pe(e.primary),strategy:g(t),tolerance_bps:g(e.toleranceBps)});var o};function Re(e,t){return C(e,"upgrade",[_(t.wasmHash)])}function ke(e,t){return C(e,"migrate",[g(t.newVersion)])}function Oe(e){return C(e,"pause",[])}function Me(e){return C(e,"unpause",[])}function Ie(e,t){return C(e,"grant_role",[b(t.account),h(t.role)])}function Ce(e,t){return C(e,"revoke_role",[b(t.account),h(t.role)])}function Le(e,t){return C(e,"transfer_ownership",[b(t.newOwner),g(t.liveUntilLedger)])}function Ue(e){return C(e,"accept_ownership",[])}function Be(e,t){return C(e,"set_aggregator",[b(t.aggregator)])}function Ge(e,t){return C(e,"set_accumulator",[b(t.accumulator)])}function Ne(e,t){return C(e,"set_liquidity_pool_template",[_(t.wasmHash)])}function $e(e,t){return C(e,"edit_asset_config",[b(t.asset),_e(t.config)])}function De(e,t){return C(e,"set_position_limits",[qe(t)])}function ze(e){return C(e,"add_e_mode_category",[])}function We(e,t){return C(e,"remove_e_mode_category",[g(t.id)])}const Ve=e=>E({asset:b(e.asset),category_id:g(e.categoryId),can_collateral:f(e.canCollateral),can_borrow:f(e.canBorrow),ltv:g(e.ltv),threshold:g(e.threshold),bonus:g(e.bonus),supply_cap:S(e.supplyCap),borrow_cap:S(e.borrowCap)});function je(e,t){return C(e,"add_asset_to_e_mode_category",[Ve(t)])}function He(e,t){return C(e,"edit_asset_in_e_mode_category",[Ve(t)])}function Xe(e,t){return C(e,"update_pool_caps",[b(t.asset),S(t.supplyCap),S(t.borrowCap)])}function Fe(e,t){return C(e,"remove_asset_from_e_mode",[b(t.asset),g(t.categoryId)])}function Qe(e,t){return C(e,"approve_token",[b(t.token)])}function Ze(e,t){return C(e,"revoke_token",[b(t.token)])}function Ke(e,t){return C(e,"configure_market_oracle",[b(e.caller),b(t.asset),Ee(t.config)])}function Je(e,t){return C(e,"edit_oracle_tolerance",[b(e.caller),b(t.asset),g(t.tolerance)])}function Ye(e,t){return C(e,"disable_token_oracle",[b(e.caller),b(t.asset)])}function et(e,t){return C(e,"update_indexes",[b(e.caller),v(t.assets.map((e=>b(e))))])}function tt(e,t){return C(e,"renew_account",[b(e.caller),T(t.accountNonce)])}function ot(e,t){return C(e,"create_liquidity_pool",[b(t.asset),ve(t.params),_e(t.config)])}function rt(e,t){return C(e,"upgrade_liquidity_pool_params",[b(t.asset),xe(t.params)])}function ut(e,t){return C(e,"upgrade_liquidity_pool",[b(t.asset),_(t.wasmHash)])}function nt(e,t){return C(e,"claim_revenue",[b(e.caller),v(t.assets.map((e=>b(e))))])}function at(e,t){return C(e,"add_rewards",[b(e.caller),v(t.rewards.map((e=>v([b(e.token),S(e.amount)]))))])}function it(e,t){return C(e,"update_account_threshold",[b(e.caller),b(t.asset),f(t.hasRisks),v(t.accountNonces.map((e=>T(e))))])}const lt="00".repeat(32),st=e=>{if("string"==typeof e)return _(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)},pt=(e,...t)=>v([h(e),...t]),dt=e=>E({asset:b(e.asset),category_id:g(e.categoryId),can_collateral:f(e.canCollateral),can_borrow:f(e.canBorrow),ltv:g(e.ltv),threshold:g(e.threshold),bonus:g(e.bonus),supply_cap:S(e.supplyCap),borrow_cap:S(e.borrowCap)}),ct=e=>E({new_owner:b(e.newOwner),live_until_ledger:g(e.liveUntilLedger)}),yt=e=>E({account:b(e.account),role:h(e.role)});function bt(e,t,o){const r=e.governanceAddress??d(e.network),u=new c.Contract(r),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,...o)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}const St=(e,t,o)=>bt(e,"propose",[b(e.caller),t,st(o)]),gt=(e,t,o)=>bt(e,"execute_self",[x(),t,st(o)]);function Tt(e,t,o){return St(e,pt("SetAggregator",b(t.aggregator)),o)}function ft(e,t,o){return St(e,pt("SetAccumulator",b(t.accumulator)),o)}function mt(e,t,o){return St(e,pt("SetLiquidityPoolTemplate",_(t.wasmHash)),o)}function ht(e,t,o){return St(e,pt("EditAssetConfig",b(t.asset),_e(t.config)),o)}function xt(e,t,o){return St(e,pt("SetPositionLimits",qe(t)),o)}function vt(e,t,o){return St(e,pt("SetMinBorrowCollateralUsd",S(t.floorWad)),o)}function _t(e,t){return St(e,pt("AddEModeCategory"),t)}function qt(e,t,o){return St(e,pt("RemoveEModeCategory",g(t.id)),o)}function At(e,t,o){return St(e,pt("AddAssetToEModeCategory",dt(t)),o)}function wt(e,t,o){return St(e,pt("EditAssetInEModeCategory",dt(t)),o)}function Pt(e,t,o){return St(e,pt("UpdatePoolCaps",E({asset:b((r=t).asset),supply_cap:S(r.supplyCap),borrow_cap:S(r.borrowCap)})),o);var r}function Et(e,t,o){return St(e,pt("RemoveAssetFromEMode",E({asset:b((r=t).asset),category_id:g(r.categoryId)})),o);var r}function Rt(e,t,o){return St(e,pt("ApproveToken",b(t.token)),o)}function kt(e,t,o){return St(e,pt("RevokeToken",b(t.token)),o)}function Ot(e,t,o){return St(e,pt("ApproveBlendPool",b(t.pool)),o)}function Mt(e,t,o){return St(e,pt("RevokeBlendPool",b(t.pool)),o)}function It(e,t,o){return St(e,pt("CreateLiquidityPool",E({asset:b((r=t).asset),params:ve(r.params),config:_e(r.config)})),o);var r}function Ct(e,t,o){return St(e,pt("UpgradeLiquidityPoolParams",E({asset:b((r=t).asset),params:xe(r.params)})),o);var r}function Lt(e,t){return St(e,pt("DeployPool"),t)}function Ut(e,t,o){return St(e,pt("UpgradePool",_(t.wasmHash)),o)}function Bt(e,t,o){return St(e,pt("DisableTokenOracle",b(t.asset)),o)}function Gt(e,t,o){return St(e,pt("UpgradeController",_(t.wasmHash)),o)}function Nt(e,t,o){return St(e,pt("MigrateController",g(t.newVersion)),o)}function $t(e,t,o){return St(e,pt("TransferCtrlOwnership",ct(t)),o)}function Dt(e,t,o){return St(e,pt("ConfigureMarketOracle",E({asset:b((r=t).asset),cfg:Ee(r.config)})),o);var r}function zt(e,t,o){return St(e,pt("EditOracleTolerance",E({asset:b((r=t).asset),tolerance:g(r.tolerance)})),o);var r}function Wt(e,t,o){return St(e,pt("UpgradeGov",_(t.wasmHash)),o)}function Vt(e,t,o){return St(e,pt("UpdateGovDelay",g(t.newDelay)),o)}function jt(e,t,o){return St(e,pt("GrantGovRole",yt(t)),o)}function Ht(e,t,o){return St(e,pt("RevokeGovRole",yt(t)),o)}function Xt(e,t,o){return St(e,pt("TransferGovOwnership",ct(t)),o)}function Ft(e,t){const o=v(t.argsXdr.map((e=>c.xdr.ScVal.fromXDR(e,"base64")))),r=st(t.predecessor??lt);return bt(e,"execute",[x(),b(t.target),h(t.functionName),o,r,st(t.salt)])}function Qt(e,t,o){return gt(e,pt("UpgradeGov",_(t.wasmHash)),o)}function Zt(e,t,o){return gt(e,pt("UpdateGovDelay",g(t.newDelay)),o)}function Kt(e,t,o){return gt(e,pt("GrantGovRole",yt(t)),o)}function Jt(e,t,o){return gt(e,pt("RevokeGovRole",yt(t)),o)}function Yt(e,t,o){return gt(e,pt("TransferGovOwnership",ct(t)),o)}const eo=e=>e.toXDR("base64"),to=e=>c.xdr.ScVal.fromXDR(e,"base64"),oo=e=>e.map((e=>String((0,c.scValToNative)(to(e))))).join(":"),ro=e=>"bigint"==typeof e||"number"==typeof e?e.toString():String(e),uo=e=>Number(e),no=e=>String(e),ao=e=>null==e?void 0:ro(e),io=e=>null==e?void 0:no(e),lo=e=>e instanceof Uint8Array?Buffer.from(e).toString("hex"):Buffer.isBuffer(e)?e.toString("hex"):String(e),so=["None","Multiply","Long","Short"],po=["Single","PrimaryWithAnchor"],co=["ReflectorSep40","RedStonePriceFeed"],yo=["Spot","Twap"],bo=["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"],So=e=>Array.isArray(e)?e:[],go=e=>({loanToValueBps:uo(e.loan_to_value_bps),liquidationThresholdBps:uo(e.liquidation_threshold_bps),liquidationBonusBps:uo(e.liquidation_bonus_bps),liquidationFeesBps:uo(e.liquidation_fees_bps),isCollateralizable:Boolean(e.is_collateralizable),isBorrowable:Boolean(e.is_borrowable),isFlashloanable:Boolean(e.is_flashloanable),flashloanFeeBps:uo(e.flashloan_fee_bps),eModeCategories:(e.e_mode_categories??[]).map(uo)}),To=(e,t)=>{const o="Borrow"===t;return{action:(r=e[0],bo[uo(r)]??ro(r)),positionType:t,asset:no(e[1]),scaledAmountRay:ro(e[2]),indexRay:ro(e[3]),amount:ro(e[4]),liquidationThresholdBps:o?void 0:uo(e[5]),liquidationBonusBps:o?void 0:uo(e[6]),loanToValueBps:o?void 0:uo(e[7])};var r},fo=e=>{return{owner:no(e[0]),eModeCategoryId:uo(e[1]),mode:(t=e[2],so[uo(t)]??"None")};var t},mo=(e,t)=>{const o=yo[uo(e[`${t}_read_mode`])]??"Spot",r=e[`${t}_asset`],u=e[`${t}_symbol`],n=null!=r?{kind:"Stellar",value:no(r)}:null!=u?{kind:"Symbol",value:no(u)}:void 0;return{provider:co[uo(e[`${t}_provider`])]??"ReflectorSep40",contractAddress:no(e[`${t}_contract`]),asset:n,feedId:io(e[`${t}_feed_id`]),readMode:o,twapRecords:"Twap"===o?uo(e[`${t}_twap_records`]):void 0,decimals:uo(e[`${t}_decimals`]),resolutionSeconds:uo(e[`${t}_resolution_seconds`]),maxStaleSeconds:uo(e[`${t}_max_stale_seconds`])}},ho=e=>{const t=null!==e.anchor_provider&&void 0!==e.anchor_provider;return{baseTokenId:no(e.base_token_id),quoteTokenId:no(e.quote_token_id),tolerance:{upperRatio:uo(e.upper_ratio_bps??e.tolerance?.upper_ratio_bps),lowerRatio:uo(e.lower_ratio_bps??e.tolerance?.lower_ratio_bps)},assetDecimals:uo(e.asset_decimals),maxPriceStaleSeconds:uo(e.max_price_stale_seconds),strategy:po[uo(e.strategy)]??"Single",primary:mo(e,"primary"),anchor:t?mo(e,"anchor"):void 0,primaryQuoteToken:io(e.primary_quote_token),anchorQuoteToken:io(e.anchor_quote_token),minSanityPriceWad:ao(e.min_sanity_price_wad),maxSanityPriceWad:ao(e.max_sanity_price_wad)}},xo={"market:create":e=>({topic:"market:create",data:{baseAsset:no(e.base_asset),maxBorrowRate:ro(e.max_borrow_rate),baseBorrowRate:ro(e.base_borrow_rate),slope1:ro(e.slope1),slope2:ro(e.slope2),slope3:ro(e.slope3),midUtilization:ro(e.mid_utilization),optimalUtilization:ro(e.optimal_utilization),maxUtilization:ao(e.max_utilization),reserveFactor:uo(e.reserve_factor),marketAddress:no(e.market_address),config:go(e.config)}}),"market:params_update":e=>({topic:"market:params_update",data:{asset:no(e.asset),maxBorrowRateRay:ro(e.max_borrow_rate_ray),baseBorrowRateRay:ro(e.base_borrow_rate_ray),slope1Ray:ro(e.slope1_ray),slope2Ray:ro(e.slope2_ray),slope3Ray:ro(e.slope3_ray),midUtilizationRay:ro(e.mid_utilization_ray),optimalUtilizationRay:ro(e.optimal_utilization_ray),maxUtilizationRay:ao(e.max_utilization_ray),reserveFactorBps:uo(e.reserve_factor_bps)}}),"market:batch_state_update":e=>({topic:"market:batch_state_update",data:{updates:So(e).map((e=>{return t=So(e),{asset:no(t[0]),timestamp:uo(t[1]),supplyIndexRay:ro(t[2]),borrowIndexRay:ro(t[3]),reservesRay:ro(t[4]),suppliedRay:ro(t[5]),borrowedRay:ro(t[6]),revenueRay:ro(t[7]),assetPriceWad:ao(t[8])};var t}))}}),"market:batch_params_update":e=>({topic:"market:batch_params_update",data:{updates:So(e).map((e=>{const t=e;return{asset:no(t.asset),params:(o=t.params,{maxBorrowRateRay:ro(o.max_borrow_rate_ray),baseBorrowRateRay:ro(o.base_borrow_rate_ray),slope1Ray:ro(o.slope1_ray),slope2Ray:ro(o.slope2_ray),slope3Ray:ro(o.slope3_ray),midUtilizationRay:ro(o.mid_utilization_ray),optimalUtilizationRay:ro(o.optimal_utilization_ray),maxUtilizationRay:ao(o.max_utilization_ray),reserveFactorBps:uo(o.reserve_factor_bps),supplyCap:ro(o.supply_cap),borrowCap:ro(o.borrow_cap),assetId:io(o.asset_id),assetDecimals:void 0===o.asset_decimals?void 0:uo(o.asset_decimals)})};var o}))}}),"position:batch_update":e=>{const t=So(e);return{topic:"position:batch_update",data:{accountId:ro(t[0]),accountAttributes:fo(So(t[1])),updates:[...So(t[2]).map((e=>To(So(e),"Deposit"))),...So(t[3]).map((e=>To(So(e),"Borrow")))]}}},"position:flash_loan":e=>({topic:"position:flash_loan",data:{asset:no(e.asset),receiver:no(e.receiver),caller:no(e.caller),amount:ro(e.amount),fee:ro(e.fee)}}),"config:asset":e=>({topic:"config:asset",data:{asset:no(e.asset),config:go(e.config)}}),"config:oracle":e=>({topic:"config:oracle",data:{asset:no(e.asset),oracle:ho(e.oracle)}}),"config:emode_category":e=>({topic:"config:emode_category",data:{category:{categoryId:uo(e.category.category_id),isDeprecated:Boolean(e.category.is_deprecated)}}}),"config:emode_asset":e=>({topic:"config:emode_asset",data:{asset:no(e.asset),config:{isCollateralizable:Boolean(e.config.is_collateralizable),isBorrowable:Boolean(e.config.is_borrowable),loanToValueBps:uo(e.config.loan_to_value_bps),liquidationThresholdBps:uo(e.config.liquidation_threshold_bps),liquidationBonusBps:uo(e.config.liquidation_bonus_bps),supplyCap:ro(e.config.supply_cap),borrowCap:ro(e.config.borrow_cap)},categoryId:uo(e.category_id)}}),"config:remove_emode_asset":e=>({topic:"config:remove_emode_asset",data:{asset:no(e.asset),categoryId:uo(e.category_id)}}),"debt:bad_debt":e=>({topic:"debt:bad_debt",data:{accountId:ro(e.account_id),totalBorrowUsdWad:ro(e.total_borrow_usd_wad),totalCollateralUsdWad:ro(e.total_collateral_usd_wad)}}),"strategy:initial_payment":e=>({topic:"strategy:initial_payment",data:{token:no(e.token),amount:ro(e.amount),usdValueWad:ro(e.usd_value_wad),accountId:ro(e.account_id)}}),"strategy:fee":e=>({topic:"strategy:fee",data:{asset:no(e.asset),amount:ro(e.amount),fee:ro(e.fee),amountSent:ro(e.amount_sent)}}),"config:approve_token":e=>({topic:"config:approve_token",data:{wasmHash:lo(e.wasm_hash),approved:Boolean(e.approved)}}),"config:aggregator":e=>({topic:"config:aggregator",data:{aggregator:no(e.aggregator)}}),"config:accumulator":e=>({topic:"config:accumulator",data:{accumulator:no(e.accumulator)}}),"config:pool_template":e=>({topic:"config:pool_template",data:{wasmHash:lo(e.wasm_hash)}}),"config:position_limits":e=>({topic:"config:position_limits",data:{maxSupplyPositions:uo(e.max_supply_positions),maxBorrowPositions:uo(e.max_borrow_positions)}}),"config:oracle_disabled":e=>({topic:"config:oracle_disabled",data:{asset:no(e.asset)}})},vo=Object.freeze(Object.keys(xo));function _o(e,t){const o=oo(e),r=xo[o];return r?r((0,c.scValToNative)(to(t))):null}const qo="XLENDXLM-a7c9f3",Ao=1e4;function wo(e){const t=BigInt(e).toString(16),o=t.length%2==0?t:`0${t}`;return`${qo}-${o}`}function Po(e){const t=e.split("-");return t.length>=2&&parseInt(t[1],10)||0}function Eo(e,t=0){return e*Ao+t}function Ro(e){switch(e){case"liq_repay":return"lendingLiquidateRepayDebt";case"liq_seize":return"lendingLiquidateSeizeCollateral";case"param_upd":return"lendingUpdateAccountParameters";default:return"lendingUpdateAccountPosition"}}const ko=(e,t,o)=>{const r=new URL(t,e.endsWith("/")?e:`${e}/`);if(o)for(const[e,t]of Object.entries(o))void 0!==t&&r.searchParams.set(e,String(t));return r.toString()},Oo=e=>e.baseUrl??i[e.network];async function Mo(e,t){if(null==e.amountIn==(null==e.amountOut))throw new Error("getStellarAggregatorQuote: exactly one of `amountIn` or `amountOut` must be provided");const o=ko(Oo(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}),r=await fetch(o,t.fetchOptions);if(!r.ok){const e=await r.text().catch((()=>""));throw new Error(`Stellar quote server responded ${r.status} ${r.statusText} for ${o} — ${e}`)}return await r.json()}async function Io(e){const t=ko(Oo(e),"api/v1/tokens"),o=await fetch(t,e.fetchOptions);if(!o.ok){const e=await o.text().catch((()=>""));throw new Error(`Stellar quote server responded ${o.status} ${o.statusText} for ${t} — ${e}`)}return await o.json()}const Co=e=>R(e).toXDR("base64");function Lo(e,t){const o=e.routerAddress??p(e.network),r=new c.Contract(o),u=new c.Account(e.caller,e.sourceSequence),n=M(((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(r.call("execute_strategy",b(e.caller),S(e.totalIn),n)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function Uo(e,t){return Lo(e,t)}function Bo(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($o),splitPpm:e.splitPpm}))):[{hops:e.hops.map($o),splitPpm:1e6}],referralId:t.referralId??0,tokenIn:e.from,tokenOut:e.to,totalMinOut:e.amountOutMin}}function Go(e,t={}){const o=e;return"string"==typeof o.routeXdr&&o.routeXdr.length>0?{routeXdr:o.routeXdr}:Bo(e,t)}const No=Bo,$o=e=>({amountOut:e.amountOut,pool:e.address,tokenIn:e.from,tokenOut:e.to,venue:e.dex});function Do(e,t){const o=t instanceof Error?t.message:String(t);return new Error(`[xoxno-invoked:${e}] ${o}`)}async function zo(e,t,o){const r=c.TransactionBuilder.fromXDR(t,"base64");try{return(await e.prepareTransaction(r)).toXDR()}catch(e){if(o?.invokedContractId)throw Do(o.invokedContractId,e);throw e}}async function Wo(e,t,o){return zo(e,t.xdr,o)}function Vo(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 jo(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 Ho=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 Xo(e){const t=new c.Account(e.caller,e.sourceSequence),o=new c.Contract(e.forwarderAddress).call("mint_and_forward",c.xdr.ScVal.scvBytes(Ho(e.message)),c.xdr.ScVal.scvBytes(Ho(e.attestation)));return{xdr:new c.TransactionBuilder(t,{fee:e.fee??"10000000",networkPassphrase:l[e.network]}).addOperation(o).setTimeout(e.timeoutSeconds??120).build().toXDR()}}}},t={};function o(r){var u=t[r];if(void 0!==u)return u.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};o.r(r),o.d(r,{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:()=>x,buildStellarAcceptOwnershipTx:()=>T.buildStellarAcceptOwnershipTx,buildStellarAddAssetToEModeCategoryTx:()=>T.buildStellarAddAssetToEModeCategoryTx,buildStellarAddEModeCategoryTx:()=>T.buildStellarAddEModeCategoryTx,buildStellarAddRewardsTx:()=>T.buildStellarAddRewardsTx,buildStellarApproveTokenTx:()=>T.buildStellarApproveTokenTx,buildStellarBatchSwapTx:()=>T.buildStellarBatchSwapTx,buildStellarBorrowBatchTx:()=>T.buildStellarBorrowBatchTx,buildStellarBorrowTx:()=>T.buildStellarBorrowTx,buildStellarCctpForwardTx:()=>T.buildStellarCctpForwardTx,buildStellarClaimRevenueTx:()=>T.buildStellarClaimRevenueTx,buildStellarConfigureMarketOracleTx:()=>T.buildStellarConfigureMarketOracleTx,buildStellarCreateLiquidityPoolTx:()=>T.buildStellarCreateLiquidityPoolTx,buildStellarDisableTokenOracleTx:()=>T.buildStellarDisableTokenOracleTx,buildStellarEditAssetConfigTx:()=>T.buildStellarEditAssetConfigTx,buildStellarEditAssetInEModeCategoryTx:()=>T.buildStellarEditAssetInEModeCategoryTx,buildStellarEditOracleToleranceTx:()=>T.buildStellarEditOracleToleranceTx,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,buildStellarProposeAddAssetToEModeTx:()=>T.buildStellarProposeAddAssetToEModeTx,buildStellarProposeAddEModeCategoryTx:()=>T.buildStellarProposeAddEModeCategoryTx,buildStellarProposeApproveBlendPoolTx:()=>T.buildStellarProposeApproveBlendPoolTx,buildStellarProposeApproveTokenTx:()=>T.buildStellarProposeApproveTokenTx,buildStellarProposeConfigureMarketOracleTx:()=>T.buildStellarProposeConfigureMarketOracleTx,buildStellarProposeCreateLiquidityPoolTx:()=>T.buildStellarProposeCreateLiquidityPoolTx,buildStellarProposeDeployPoolTx:()=>T.buildStellarProposeDeployPoolTx,buildStellarProposeDisableTokenOracleTx:()=>T.buildStellarProposeDisableTokenOracleTx,buildStellarProposeEditAssetConfigTx:()=>T.buildStellarProposeEditAssetConfigTx,buildStellarProposeEditAssetInEModeTx:()=>T.buildStellarProposeEditAssetInEModeTx,buildStellarProposeEditOracleToleranceTx:()=>T.buildStellarProposeEditOracleToleranceTx,buildStellarProposeGovernanceUpgradeTx:()=>T.buildStellarProposeGovernanceUpgradeTx,buildStellarProposeGrantGovernanceRoleTx:()=>T.buildStellarProposeGrantGovernanceRoleTx,buildStellarProposeMigrateControllerTx:()=>T.buildStellarProposeMigrateControllerTx,buildStellarProposeRemoveAssetFromEModeTx:()=>T.buildStellarProposeRemoveAssetFromEModeTx,buildStellarProposeRemoveEModeCategoryTx:()=>T.buildStellarProposeRemoveEModeCategoryTx,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,buildStellarRemoveAssetFromEModeTx:()=>T.buildStellarRemoveAssetFromEModeTx,buildStellarRemoveEModeCategoryTx:()=>T.buildStellarRemoveEModeCategoryTx,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,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,buildStellarUpgradeLiquidityPoolTx:()=>T.buildStellarUpgradeLiquidityPoolTx,buildStellarWithdrawBatchTx:()=>T.buildStellarWithdrawBatchTx,buildStellarWithdrawTx:()=>T.buildStellarWithdrawTx,buildTx:()=>T.buildTx,decodeStellarLendingEvent:()=>T.decodeStellarLendingEvent,encodeAssetConfigRaw:()=>T.encodeAssetConfigRaw,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",a="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",i="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,...o}={}){this.apiUrl=t??{[l.MAINNET]:u,[l.DEVNET]:"https://devnet-api.xoxno.com"}[e],this.chain=e,this.init=o,this.config=e==l.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:n,DR_SC:a,KG_SC:i,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:a,KG_SC:i,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}fetchWithTimeout=async(e,{params:t,...o}={})=>{const{next:r,cache:u,debug:n,...a}=this.init,{next:i,cache:l,debug:s,headers:p,method:d="GET",...c}=o,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}=r??{},{revalidate:h,...x}=i??{},v="GET"!==d||b?void 0:h??f,_="GET"!==d||b||v?void 0:l??u,q={...a,...c,method:d,...Object.keys(S).length?{headers:S}:{},cache:_,next:{...m,...x,revalidate:v}};(s??n)&&console.debug("SDK fetch: ",T,q);const A=await fetch(T,q).catch((e=>{if(e instanceof Error&&!e.message.match(/^http(s?):\/\//))throw Object.assign(new Error(`${T}: ${e.message}`),{cause:e});throw e})),w=await A.text();if(!A.ok){let e;try{e=JSON.parse(w)}catch{e={message:w}}const t=[T,A.status,A.statusText,e.message].filter(Boolean).join(";;");throw new Error(t)}try{return JSON.parse(w)}catch{return w}}}const p=e=>{const t=/^0x[a-fA-F0-9]{1,64}-[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(e)),o=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(e);return t||o},d=e=>{const t=/^0x[a-fA-F0-9]{1,64}$/.test(e),o=/^[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||o};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=o(454);const f=e=>e.replace(/-([a-z])/g,((e,t)=>t.toUpperCase())),m=()=>({static:{},params:{},leaves:[]});function h(e,t,o,r){const{input:u,output:n,...a}=t,i=async(t={})=>{const u={...o,...t},n=e.replace(/:([a-zA-Z_]+)/g,((e,t)=>`${u[t]}`)),a=[...e.matchAll(/:([a-zA-Z_]+)/g)].map((e=>e[1])),i=Object.fromEntries(Object.entries(u).filter((([e])=>!a.includes(e)))),l=/:address[^A-Z]/.test(e)||"address"in i,s=/:collection[^A-Z]/.test(e)||"collection"in i;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(i).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:x,continuationToken:v,..._}=d,q=g?`Bearer ${g}`:void 0,A={...f,...q?{Authorization:q}:{},...v?{"X-Continuation-Token":String(v)}:{}},w={...h,tags:[...h?.tags??[],n]};return r.fetchWithTimeout(n,{method:T,params:_,body:S,headers:A,cache:m,debug:x,...w?{next:w}:{}})},l=(e={})=>i(e);for(const e of Object.keys(a))g.includes(e)&&(l[e]=t=>i({...t,method:t.method??e.toUpperCase()}));return l}function x(e){const t=function(){const e=m();for(const[t,o]of Object.entries(S)){const r=t.split("/").filter(Boolean);let u=e;for(const e of r)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:o})}return e}(),o=(t,r)=>{const u=t.leaves.length,n=Object.keys(t.static).length,a=Object.keys(t.params).length;let i;if(1===u&&n+a>0){const{rawPath:o,def:u}=t.leaves[0];i=h(o,u,r,e)}else{i={};for(const{rawPath:o,def:u}of t.leaves)i[f(o.split("/").pop().replace(/^:/,""))]=h(o,u,r,e)}for(const[e,u]of Object.entries(t.static)){const t=o(u,r);let n=t;if(t&&"object"==typeof t&&e in t&&"function"==typeof t[e]){const o=t[e],r=Object.fromEntries(Object.entries(t).filter((([t])=>t!==e)));1===o.length||(Object.assign(o,r),n=o)}void 0===i[e]?i[e]=n:"function"==typeof i[e]?Object.assign(i[e],n):"function"==typeof n?(Object.assign(n,i[e]),i[e]=n):Object.assign(i[e],n)}for(const[e,u]of Object.entries(t.params)){const t=t=>{const n=o(u,{...r,[e]:t});if(n&&"object"==typeof n&&1===Object.keys(n).length&&e in n&&"function"==typeof n[e]){const t=n[e],o=(...e)=>t(...e);return Object.assign(o,t)}return n};if(i[e]){const o=i[e];i[e]=e=>({...o(e),...t(e)})}else i[e]=t}return i};return o(t,{})}module.exports=r})();
|
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"undefined"!=typeof globalThis&&void 0===globalThis.self&&(globalThis.self=globalThis);import{Account as t,Address as e,BASE_FEE as o,Contract as r,ScInt as n,TransactionBuilder as u,scValToNative as i,xdr as s}from"@stellar/stellar-sdk";var a={388(a,p,l){l.d(p,{ME:()=>d,nO:()=>y,G_:()=>fe,DU:()=>c,fA:()=>Po,A$:()=>g,J9:()=>f,hS:()=>b,gR:()=>Oo,Cg:()=>Ro,VZ:()=>Jo,N0:()=>Vt,Wc:()=>Jt,hu:()=>Qt,B_:()=>ye,eX:()=>oe,z:()=>Vo,xD:()=>W,jR:()=>j,P2:()=>tr,W6:()=>de,KH:()=>ne,se:()=>pe,ln:()=>ie,g:()=>Xt,jP:()=>Yt,FM:()=>ue,yr:()=>zo,sp:()=>Z,$9:()=>oo,zw:()=>no,h_:()=>uo,e_:()=>io,Tk:()=>eo,BA:()=>ro,SX:()=>Dt,UF:()=>Io,Y5:()=>K,mE:()=>J,xG:()=>$t,s9:()=>Y,OL:()=>Bt,Mq:()=>Oe,fc:()=>Me,kD:()=>Be,Yf:()=>Le,c5:()=>Fe,qU:()=>De,RZ:()=>ze,PD:()=>We,cJ:()=>ke,vM:()=>Ie,hF:()=>Qe,Qk:()=>Ke,Gw:()=>Je,$K:()=>He,cO:()=>Ue,Qy:()=>Re,X7:()=>Ne,Ub:()=>Ye,Dx:()=>$e,OA:()=>we,$U:()=>Te,ob:()=>Pe,cY:()=>Ae,$l:()=>Ee,VS:()=>Xe,HP:()=>to,YQ:()=>Ze,mK:()=>Ce,QY:()=>je,os:()=>Ge,Ko:()=>Ve,kz:()=>ee,Oy:()=>Kt,IJ:()=>ae,nw:()=>F,Pr:()=>ot,ZE:()=>Q,ev:()=>Gt,P8:()=>re,aV:()=>jt,p2:()=>Wt,Ww:()=>Ht,Dy:()=>Ft,Ni:()=>z,v_:()=>V,qD:()=>et,qR:()=>tt,QJ:()=>zt,bm:()=>Nt,n_:()=>be,v8:()=>se,Y_:()=>te,qM:()=>Lt,gH:()=>le,un:()=>ce,O3:()=>H,Gz:()=>X,pr:()=>G,Fm:()=>Mo,ns:()=>Mt,MB:()=>Et,Dn:()=>Ut,pq:()=>Pt,ml:()=>Ct,Q3:()=>Rt,wf:()=>Go,Um:()=>Co,xO:()=>xt,Lw:()=>No,KM:()=>h,mM:()=>yt,iE:()=>St,zp:()=>ft,N3:()=>bt,bN:()=>st,QV:()=>_,T_:()=>vt,XI:()=>gt,Lt:()=>qt,KK:()=>at,yl:()=>it,vc:()=>m,CH:()=>Do,FI:()=>ct,KG:()=>wt,nW:()=>dt,jF:()=>lt,S2:()=>mt,uS:()=>Tt,u_:()=>pt,O5:()=>_t,Av:()=>ht,LA:()=>Ho,E6:()=>Wo,Ds:()=>jo,CU:()=>Lo,Vx:()=>Ko,DL:()=>Qo,ON:()=>po,Hh:()=>At,oV:()=>Uo,g5:()=>Fo,L:()=>so,Vu:()=>Zo});const c={mainnet:process.env.STELLAR_LENDING_CONTROLLER_MAINNET??"",testnet:process.env.STELLAR_LENDING_CONTROLLER_TESTNET??""},d={mainnet:process.env.STELLAR_AGGREGATOR_ROUTER_MAINNET??"",testnet:process.env.STELLAR_AGGREGATOR_ROUTER_TESTNET??""},y={mainnet:process.env.STELLAR_GOVERNANCE_MAINNET??"",testnet:process.env.STELLAR_GOVERNANCE_TESTNET??""},b={mainnet:"https://soroban-rpc.stellar.org",testnet:"https://soroban-testnet.stellar.org"},f={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"},g={mainnet:"Public Global Stellar Network ; September 2015",testnet:"Test SDF Network ; September 2015"};function m(t){const e=c[t];if(!e)throw new Error(`Stellar lending controller address not configured for network "${t}". Set STELLAR_LENDING_CONTROLLER_${t.toUpperCase()} env var.`);return e}function h(t){const e=d[t];if(!e)throw new Error(`Stellar aggregator router address not configured for network "${t}". Set STELLAR_AGGREGATOR_ROUTER_${t.toUpperCase()} env var.`);return e}function _(t){const e=y[t];if(!e)throw new Error(`Stellar governance address not configured for network "${t}". Set STELLAR_GOVERNANCE_${t.toUpperCase()} env var.`);return e}const x=["Soroswap","Aquarius","Phoenix","Sushi","CometDex"],v=t=>new e(t).toScVal(),S=t=>new n(t).toI128(),q=t=>s.ScVal.scvU32(t),T=t=>new n("string"==typeof t?t:t.toString()).toU64(),w=t=>s.ScVal.scvBool(t),A=t=>s.ScVal.scvString(t),k=t=>s.ScVal.scvSymbol(t),E=()=>s.ScVal.scvVoid(),P=t=>s.ScVal.scvVec(t),M=(t,e=32)=>{const o=t.startsWith("0x")?t.slice(2):t,r=Buffer.from(o,"hex");if(r.length!==e)throw new Error(`Stellar builder: expected a ${e}-byte BytesN (got ${r.length} bytes from "${t}")`);return s.ScVal.scvBytes(r)},R=(t,e)=>null==t?E():e(t),O=(t,e)=>U({asset:v(e),hub_id:q(t)}),I=(t,e,o)=>s.ScVal.scvVec([O(t,e),S(o)]),C=t=>s.ScVal.scvVec(t.map((t=>I(t.hubId,t.asset,t.amount)))),U=t=>{const e=Object.keys(t).sort().map((e=>new s.ScMapEntry({key:k(e),val:t[e]})));return s.ScVal.scvMap(e)},L=t=>{const e=t.paths.map((t=>{const e=t.hops.map((t=>{return U({amount_out:S(t.amountOut),pool:v(t.pool),token_in:v(t.tokenIn),token_out:v(t.tokenOut),venue:(e=t.venue,s.ScVal.scvVec([k(e)]))});var e}));return U({hops:s.ScVal.scvVec(e),split_ppm:q(t.splitPpm)})}));return U({paths:s.ScVal.scvVec(e),referral_id:T(t.referralId??0),token_in:v(t.tokenIn),token_out:v(t.tokenOut),total_min_out:S(t.totalMinOut)})},$=t=>{const e=Buffer.from(t);if(0===e.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return s.ScVal.scvBytes(e)},B=t=>{const e=t.trim();if(e.startsWith("0x")){const t=e.slice(2);if(!((o=t).length>0&&o.length%2==0&&/^[0-9a-fA-F]+$/.test(o)))throw new Error("Stellar builder: strategy swap bytes hex string must be 0x-prefixed and even-length");return Buffer.from(t,"hex")}var o;if(!/^[A-Za-z0-9+/]+={0,2}$/.test(e))throw new Error("Stellar builder: strategy swap bytes must be base64 routeXdr or 0x-prefixed hex");const r=Buffer.from(e,"base64");if(0===r.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return r},N=t=>{if("string"==typeof t)return $(B(t));if(t instanceof Uint8Array)return $(t);if(t&&"object"==typeof t)return"routeXdr"in(o=t)&&"string"==typeof o.routeXdr?$(B(t.routeXdr)):(t=>"swapXdr"in t&&"string"==typeof t.swapXdr)(t)?$(B(t.swapXdr)):(t=>"bytes"in t&&("string"==typeof t.bytes||t.bytes instanceof Uint8Array))(t)?"string"==typeof t.bytes?$(B(t.bytes)):$(t.bytes):(e=(t=>{if(!t||"object"!=typeof t)throw new Error("Stellar builder: decoded strategy `steps` must be a StrategyPayload ({ paths, tokenIn, tokenOut, totalMinOut })");const e=t;if(!Array.isArray(e.paths)||0===e.paths.length)throw new Error("Stellar builder: `steps.paths` must be a non-empty array of strategy paths");if("string"!=typeof e.tokenIn)throw new Error("Stellar builder: `steps.tokenIn` must be a contract address");if("string"!=typeof e.tokenOut)throw new Error("Stellar builder: `steps.tokenOut` must be a contract address");if("string"!=typeof e.totalMinOut)throw new Error("Stellar builder: `steps.totalMinOut` must be an i128 decimal string");let o=0;for(const[t,r]of e.paths.entries()){if(!r||"number"!=typeof r.splitPpm||r.splitPpm<=0||!Array.isArray(r.hops)||0===r.hops.length)throw new Error(`Stellar builder: \`steps.paths[${t}]\` must have splitPpm > 0 and a non-empty hops array`);o+=r.splitPpm;for(const[e,o]of r.hops.entries())if(!o||"string"!=typeof o.amountOut||"string"!=typeof o.pool||"string"!=typeof o.tokenIn||"string"!=typeof o.tokenOut||!x.includes(o.venue))throw new Error(`Stellar builder: \`steps.paths[${t}].hops[${e}]\` must have amountOut, pool, tokenIn, tokenOut, and a valid Soroban venue`)}if(1e6!==o)throw new Error(`Stellar builder: \`steps.paths[].splitPpm\` must sum to 1_000_000, got ${o}`);return e})(t),s.ScVal.scvBytes(Buffer.from(L(e).toXDR("base64"),"base64")));var e,o;throw new Error("Stellar builder: `steps` must be opaque strategy bytes (`routeXdr`, base64/hex string, or Uint8Array)")},D=t=>{if("string"==typeof t)return(t=>{const e=t.startsWith("0x")?t.slice(2):t,o=Buffer.from(e,"hex");return s.ScVal.scvBytes(o)})(t);if(t instanceof Uint8Array)return s.ScVal.scvBytes(Buffer.from(t));throw new Error("Stellar builder: `data` must be a hex string or Uint8Array (Soroban Bytes payload)")};function G(e,n,i){const s=e.controllerAddress??m(e.network),a=new r(s),p=new t(e.caller,e.sourceSequence);return{xdr:new u(p,{fee:e.fee??o,networkPassphrase:g[e.network]}).addOperation(a.call(n,...i)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function z(t,e){const o=e.accountNonce??0,r=e.spokeId??0;return G(t,"supply",[v(t.caller),T(o),q(r),C([...e.assets])])}function V(t,e){return z(t,{accountNonce:e.accountNonce,spokeId:e.spokeId,assets:[{hubId:e.hubId,asset:e.asset,amount:e.amount}]})}function W(t,e){return G(t,"borrow",[v(t.caller),T(e.accountNonce),C([...e.borrows]),R(e.to,v)])}function j(t,e){return W(t,{accountNonce:e.accountNonce,borrows:[{hubId:e.hubId,asset:e.asset,amount:e.amount}],to:e.to})}function H(t,e){return G(t,"withdraw",[v(t.caller),T(e.accountNonce),C([...e.withdrawals]),R(e.to,v)])}function X(t,e){return H(t,{accountNonce:e.accountNonce,withdrawals:[{hubId:e.hubId,asset:e.asset,amount:e.amount}],to:e.to})}function F(t,e){return G(t,"repay",[v(t.caller),T(e.accountNonce),C([...e.payments])])}function Q(t,e){return F(t,{accountNonce:e.accountNonce,payments:[{hubId:e.hubId,asset:e.asset,amount:e.amount}]})}function K(t,e){return G(t,"liquidate",[v(t.caller),T(e.accountNonce),C([...e.debtPayments])])}function Z(t,e){return G(t,"flash_loan",[v(t.caller),O(e.hubId,e.asset),S(e.amount),v(e.receiver),D(e.data)])}function J(t,e){return G(t,"migrate_from_blend",[v(t.caller),T(e.accountId),q(e.spokeId),q(e.hubId),v(e.blendPool),P(e.collateralTokens.map(v)),P(e.supplyTokens.map(v)),(o=e.debtCaps.map((t=>({token:t.token,amount:t.cap}))),s.ScVal.scvVec(o.map((t=>{return e=t.token,o=t.amount,s.ScVal.scvVec([v(e),S(o)]);var e,o}))))]);var o}function Y(t,e){const o=e.accountNonce??0,r=e.spokeId??0;return G(t,"multiply",[v(t.caller),T(o),q(r),O(e.collateral.hubId,e.collateral.asset),S(e.debtToFlashLoan),O(e.debt.hubId,e.debt.asset),q(e.mode),N(e.steps),R(e.initialPayment,(t=>I(t.hubId,t.asset,t.amount))),R(e.convertSwap,N)])}function tt(t,e){return G(t,"swap_debt",[v(t.caller),T(e.accountNonce),O(e.existingDebt.hubId,e.existingDebt.asset),S(e.newDebtAmount),O(e.newDebt.hubId,e.newDebt.asset),N(e.steps)])}function et(t,e){return G(t,"swap_collateral",[v(t.caller),T(e.accountNonce),O(e.current.hubId,e.current.asset),S(e.fromAmount),O(e.newCollateral.hubId,e.newCollateral.asset),N(e.steps)])}function ot(t,e){return G(t,"repay_debt_with_collateral",[v(t.caller),T(e.accountNonce),O(e.collateral.hubId,e.collateral.asset),S(e.collateralAmount),O(e.debt.hubId,e.debt.asset),N(e.steps),w(e.closePosition)])}const rt="/stellar-lending",nt=25,ut=encodeURIComponent,it=(t,e)=>t.fetchWithTimeout(`${rt}/context`,e),st=(t,e)=>t.fetchWithTimeout(`${rt}/assets`,e),at=(t,e)=>t.fetchWithTimeout(`${rt}/hubs`,e),pt=(t,e)=>t.fetchWithTimeout(`${rt}/spokes`,e),lt=(t,e={},o)=>{const{hubId:r,spokeId:n,asset:u}=e;return t.fetchWithTimeout(`${rt}/reserves`,{...o,params:{...void 0!==r?{hubId:r}:{},...void 0!==n?{spokeId:n}:{},...u?{asset:u}:{}}})},ct=(t,e,o,r,n)=>t.fetchWithTimeout(`${rt}/reserves/${e}/${o}/${ut(r)}`,n),dt=(t,e,o,r,n,u)=>t.fetchWithTimeout(`${rt}/reserves/${e}/${o}/${ut(r)}/holders`,{...u,params:{side:n}}),yt=(t,e,o)=>t.fetchWithTimeout(`${rt}/assets/${ut(e)}`,o),bt=(t,e,o,r)=>t.fetchWithTimeout(`${rt}/assets/${ut(e)}/page`,{...r,params:{...o}}),ft=(t,e,o,r)=>t.fetchWithTimeout(`${rt}/assets/${ut(e)}/markets`,{...r,params:{side:o}}),gt=(t,e,o)=>t.fetchWithTimeout(`${rt}/hubs/${e}`,o),mt=(t,e,o)=>t.fetchWithTimeout(`${rt}/spokes/${e}`,o),ht=(t,e,o)=>t.fetchWithTimeout(`${rt}/users/${ut(e)}/positions`,o),_t=(t,e,o={},r)=>{const{skip:n,top:u}=o;return t.fetchWithTimeout(`${rt}/users/${ut(e)}/activity`,{...r,params:{...void 0!==n?{skip:n}:{},...void 0!==u?{top:u}:{}}})},xt=(t,e,o)=>t.fetchWithTimeout(`${rt}/accounts/${ut(e)}/positions`,o),vt=(t,e={},o)=>{const{top:r=nt,continuationToken:n}=e;return t.fetchWithTimeout(`${rt}/governance/proposals`,{...o,params:{top:r,...n?{continuationToken:n}:{}}})},St=(t,e,o,r)=>t.fetchWithTimeout(`${rt}/assets/${ut(e)}/graph`,{...r,params:{...o}}),qt=(t,e,o,r)=>t.fetchWithTimeout(`${rt}/hubs/${e}/graph`,{...r,params:{...o}}),Tt=(t,e,o,r)=>t.fetchWithTimeout(`${rt}/spokes/${e}/graph`,{...r,params:{...o}}),wt=(t,e,o,r,n,u)=>t.fetchWithTimeout(`${rt}/reserves/${e}/${o}/${ut(r)}/graph`,{...u,params:{...n}}),At=t=>({context:e=>it(t,e),assets:e=>st(t,e),hubs:e=>at(t,e),spokes:e=>pt(t,e),reserves:(e,o)=>{return void 0===(r=e)||"hubId"in r||"spokeId"in r||"asset"in r?lt(t,e,o):lt(t,{},e);var r},reserve:(e,o,r,n)=>ct(t,e,o,r,n),reserveHolders:(e,o,r,n,u)=>dt(t,e,o,r,n,u),asset:(e,o)=>yt(t,e,o),assetMarkets:(e,o,r)=>ft(t,e,o,r),hub:(e,o)=>gt(t,e,o),spoke:(e,o)=>mt(t,e,o),userPositions:(e,o)=>ht(t,e,o),userActivity:(e,o,r)=>_t(t,e,o,r),accountPositions:(e,o)=>xt(t,e,o),governanceProposals:(e,o)=>vt(t,e,o),assetGraph:(e,o,r)=>St(t,e,o,r),hubGraph:(e,o,r)=>qt(t,e,o,r),spokeGraph:(e,o,r)=>Tt(t,e,o,r),reserveGraph:(e,o,r,n,u)=>wt(t,e,o,r,n,u)}),kt={Single:0,PrimaryWithAnchor:1},Et=t=>U({base_borrow_rate_ray:S(t.baseBorrowRateRay),max_borrow_rate_ray:S(t.maxBorrowRateRay),max_utilization_ray:S(t.maxUtilizationRay),mid_utilization_ray:S(t.midUtilizationRay),optimal_utilization_ray:S(t.optimalUtilizationRay),reserve_factor_bps:q(t.reserveFactorBps),slope1_ray:S(t.slope1Ray),slope2_ray:S(t.slope2Ray),slope3_ray:S(t.slope3Ray)}),Pt=t=>U({asset_decimals:q(t.assetDecimals),asset_id:v(t.assetId),base_borrow_rate_ray:S(t.baseBorrowRateRay),borrow_cap:S(t.borrowCap),max_borrow_rate_ray:S(t.maxBorrowRateRay),max_utilization_ray:S(t.maxUtilizationRay),mid_utilization_ray:S(t.midUtilizationRay),optimal_utilization_ray:S(t.optimalUtilizationRay),reserve_factor_bps:q(t.reserveFactorBps),slope1_ray:S(t.slope1Ray),slope2_ray:S(t.slope2Ray),slope3_ray:S(t.slope3Ray),supply_cap:S(t.supplyCap)}),Mt=t=>U({asset_decimals:q(0),e_mode_categories:P(t.eModeCategories.map((t=>q(t)))),flashloan_fee_bps:q(t.flashloanFeeBps),is_borrowable:w(t.isBorrowable),is_collateralizable:w(t.isCollateralizable),is_flashloanable:w(t.isFlashloanable),liquidation_bonus_bps:q(t.liquidationBonusBps),liquidation_fees_bps:q(t.liquidationFeesBps),liquidation_threshold_bps:q(t.liquidationThresholdBps),loan_to_value_bps:q(t.loanToValueBps)}),Rt=t=>U({max_borrow_positions:q(t.maxBorrowPositions),max_supply_positions:q(t.maxSupplyPositions)}),Ot=t=>{const e=t.kind;switch(e){case"Stellar":return P([k("Stellar"),v(t.value)]);case"Symbol":return P([k("Symbol"),k(t.value)]);case"String":return P([k("String"),A(t.value)]);default:throw new Error(`Stellar builder: unknown oracle asset ref kind "${e}"`)}},It=(t,e)=>{if("Twap"===t){if("number"!=typeof e)throw new Error("Stellar builder: oracle source with Twap read mode requires `twapRecords`");return P([k("Twap"),q(e)])}return P([k("Spot")])},Ct=t=>{const e=t.provider;if("ReflectorSep40"===e){if(!t.asset)throw new Error("Stellar builder: Reflector oracle source requires `asset`");return P([k("Reflector"),U({asset:Ot(t.asset),contract:v(t.contract),read_mode:It(t.readMode,t.twapRecords)})])}if("RedStonePriceFeed"===e){if("string"!=typeof t.feedId)throw new Error("Stellar builder: RedStone oracle source requires `feedId`");if("number"!=typeof t.maxStaleSeconds)throw new Error("Stellar builder: RedStone oracle source requires `maxStaleSeconds`");return P([k("RedStone"),U({contract:v(t.contract),feed_id:A(t.feedId),max_stale_seconds:T(t.maxStaleSeconds)})])}throw new Error(`Stellar builder: unknown oracle provider "${e}"`)},Ut=t=>{const e=kt[t.strategy];if(void 0===e)throw new Error(`Stellar builder: unknown oracle strategy "${t.strategy}"`);return U({anchor:(o=t.anchor,P(null==o?[k("None")]:[k("Some"),Ct(o)])),max_price_stale_seconds:T(t.maxPriceStaleSeconds),max_sanity_price_wad:S(t.maxSanityPriceWad),min_sanity_price_wad:S(t.minSanityPriceWad),primary:Ct(t.primary),strategy:q(e),tolerance_bps:q(t.toleranceBps)});var o};function Lt(t,e){return G(t,"upgrade",[M(e.wasmHash)])}function $t(t,e){return G(t,"migrate",[q(e.newVersion)])}function Bt(t){return G(t,"pause",[])}function Nt(t){return G(t,"unpause",[])}function Dt(t,e){return G(t,"grant_role",[v(e.account),k(e.role)])}function Gt(t,e){return G(t,"revoke_role",[v(e.account),k(e.role)])}function zt(t,e){return G(t,"transfer_ownership",[v(e.newOwner),q(e.liveUntilLedger)])}function Vt(t){return G(t,"accept_ownership",[])}function Wt(t,e){return G(t,"set_aggregator",[v(e.aggregator)])}function jt(t,e){return G(t,"set_accumulator",[v(e.accumulator)])}function Ht(t,e){return G(t,"set_liquidity_pool_template",[M(e.wasmHash)])}function Xt(t,e){return G(t,"edit_asset_config",[v(e.asset),Mt(e.config)])}function Ft(t,e){return G(t,"set_position_limits",[Rt(e)])}function Qt(t){return G(t,"add_e_mode_category",[])}function Kt(t,e){return G(t,"remove_e_mode_category",[q(e.id)])}const Zt=t=>U({asset:v(t.asset),category_id:q(t.categoryId),can_collateral:w(t.canCollateral),can_borrow:w(t.canBorrow),ltv:q(t.ltv),threshold:q(t.threshold),bonus:q(t.bonus),supply_cap:S(t.supplyCap),borrow_cap:S(t.borrowCap)});function Jt(t,e){return G(t,"add_asset_to_e_mode_category",[Zt(e)])}function Yt(t,e){return G(t,"edit_asset_in_e_mode_category",[Zt(e)])}function te(t,e){return G(t,"update_pool_caps",[v(e.asset),S(e.supplyCap),S(e.borrowCap)])}function ee(t,e){return G(t,"remove_asset_from_e_mode",[v(e.asset),q(e.categoryId)])}function oe(t,e){return G(t,"approve_token",[v(e.token)])}function re(t,e){return G(t,"revoke_token",[v(e.token)])}function ne(t,e){return G(t,"configure_market_oracle",[v(t.caller),v(e.asset),Ut(e.config)])}function ue(t,e){return G(t,"edit_oracle_tolerance",[v(t.caller),v(e.asset),q(e.tolerance)])}function ie(t,e){return G(t,"disable_token_oracle",[v(t.caller),v(e.asset)])}function se(t,e){return G(t,"update_indexes",[v(t.caller),P(e.assets.map((t=>v(t))))])}function ae(t,e){return G(t,"renew_account",[v(t.caller),T(e.accountNonce)])}function pe(t,e){return G(t,"create_liquidity_pool",[v(e.asset),Pt(e.params),Mt(e.config)])}function le(t,e){return G(t,"upgrade_liquidity_pool_params",[v(e.asset),Et(e.params)])}function ce(t,e){return G(t,"upgrade_liquidity_pool",[v(e.asset),M(e.wasmHash)])}function de(t,e){return G(t,"claim_revenue",[v(t.caller),P(e.assets.map((t=>v(t))))])}function ye(t,e){return G(t,"add_rewards",[v(t.caller),P(e.rewards.map((t=>P([v(t.token),S(t.amount)]))))])}function be(t,e){return G(t,"update_account_threshold",[v(t.caller),v(e.asset),w(e.hasRisks),P(e.accountNonces.map((t=>T(t))))])}const fe="00".repeat(32),ge=t=>{if("string"==typeof t)return M(t);const e=Buffer.from(t);if(32!==e.length)throw new Error(`Stellar governance builder: expected a 32-byte salt (got ${e.length} bytes)`);return s.ScVal.scvBytes(e)},me=(t,...e)=>P([k(t),...e]),he=t=>U({asset:v(t.asset),category_id:q(t.categoryId),can_collateral:w(t.canCollateral),can_borrow:w(t.canBorrow),ltv:q(t.ltv),threshold:q(t.threshold),bonus:q(t.bonus),supply_cap:S(t.supplyCap),borrow_cap:S(t.borrowCap)}),_e=t=>U({new_owner:v(t.newOwner),live_until_ledger:q(t.liveUntilLedger)}),xe=t=>U({account:v(t.account),role:k(t.role)});function ve(e,n,i){const s=e.governanceAddress??_(e.network),a=new r(s),p=new t(e.caller,e.sourceSequence);return{xdr:new u(p,{fee:e.fee??o,networkPassphrase:g[e.network]}).addOperation(a.call(n,...i)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}const Se=(t,e,o)=>ve(t,"propose",[v(t.caller),e,ge(o)]),qe=(t,e,o)=>ve(t,"execute_self",[E(),e,ge(o)]);function Te(t,e,o){return Se(t,me("SetAggregator",v(e.aggregator)),o)}function we(t,e,o){return Se(t,me("SetAccumulator",v(e.accumulator)),o)}function Ae(t,e,o){return Se(t,me("SetLiquidityPoolTemplate",M(e.wasmHash)),o)}function ke(t,e,o){return Se(t,me("EditAssetConfig",v(e.asset),Mt(e.config)),o)}function Ee(t,e,o){return Se(t,me("SetPositionLimits",Rt(e)),o)}function Pe(t,e,o){return Se(t,me("SetMinBorrowCollateralUsd",S(e.floorWad)),o)}function Me(t,e){return Se(t,me("AddEModeCategory"),e)}function Re(t,e,o){return Se(t,me("RemoveEModeCategory",q(e.id)),o)}function Oe(t,e,o){return Se(t,me("AddAssetToEModeCategory",he(e)),o)}function Ie(t,e,o){return Se(t,me("EditAssetInEModeCategory",he(e)),o)}function Ce(t,e,o){return Se(t,me("UpdatePoolCaps",U({asset:v((r=e).asset),supply_cap:S(r.supplyCap),borrow_cap:S(r.borrowCap)})),o);var r}function Ue(t,e,o){return Se(t,me("RemoveAssetFromEMode",U({asset:v((r=e).asset),category_id:q(r.categoryId)})),o);var r}function Le(t,e,o){return Se(t,me("ApproveToken",v(e.token)),o)}function $e(t,e,o){return Se(t,me("RevokeToken",v(e.token)),o)}function Be(t,e,o){return Se(t,me("ApproveBlendPool",v(e.pool)),o)}function Ne(t,e,o){return Se(t,me("RevokeBlendPool",v(e.pool)),o)}function De(t,e,o){return Se(t,me("CreateLiquidityPool",U({asset:v((r=e).asset),params:Pt(r.params),config:Mt(r.config)})),o);var r}function Ge(t,e,o){return Se(t,me("UpgradeLiquidityPoolParams",U({asset:v((r=e).asset),params:Et(r.params)})),o);var r}function ze(t,e){return Se(t,me("DeployPool"),e)}function Ve(t,e,o){return Se(t,me("UpgradePool",M(e.wasmHash)),o)}function We(t,e,o){return Se(t,me("DisableTokenOracle",v(e.asset)),o)}function je(t,e,o){return Se(t,me("UpgradeController",M(e.wasmHash)),o)}function He(t,e,o){return Se(t,me("MigrateController",q(e.newVersion)),o)}function Xe(t,e,o){return Se(t,me("TransferCtrlOwnership",_e(e)),o)}function Fe(t,e,o){return Se(t,me("ConfigureMarketOracle",U({asset:v((r=e).asset),cfg:Ut(r.config)})),o);var r}function Qe(t,e,o){return Se(t,me("EditOracleTolerance",U({asset:v((r=e).asset),tolerance:q(r.tolerance)})),o);var r}function Ke(t,e,o){return Se(t,me("UpgradeGov",M(e.wasmHash)),o)}function Ze(t,e,o){return Se(t,me("UpdateGovDelay",q(e.newDelay)),o)}function Je(t,e,o){return Se(t,me("GrantGovRole",xe(e)),o)}function Ye(t,e,o){return Se(t,me("RevokeGovRole",xe(e)),o)}function to(t,e,o){return Se(t,me("TransferGovOwnership",_e(e)),o)}function eo(t,e){const o=P(e.argsXdr.map((t=>s.ScVal.fromXDR(t,"base64")))),r=ge(e.predecessor??fe);return ve(t,"execute",[E(),v(e.target),k(e.functionName),o,r,ge(e.salt)])}function oo(t,e,o){return qe(t,me("UpgradeGov",M(e.wasmHash)),o)}function ro(t,e,o){return qe(t,me("UpdateGovDelay",q(e.newDelay)),o)}function no(t,e,o){return qe(t,me("GrantGovRole",xe(e)),o)}function uo(t,e,o){return qe(t,me("RevokeGovRole",xe(e)),o)}function io(t,e,o){return qe(t,me("TransferGovOwnership",_e(e)),o)}const so=t=>t.toXDR("base64"),ao=t=>s.ScVal.fromXDR(t,"base64"),po=t=>t.map((t=>String(i(ao(t))))).join(":"),lo=t=>"bigint"==typeof t||"number"==typeof t?t.toString():String(t),co=t=>Number(t),yo=t=>String(t),bo=t=>null==t?void 0:lo(t),fo=t=>null==t?void 0:yo(t),go=t=>t instanceof Uint8Array?Buffer.from(t).toString("hex"):Buffer.isBuffer(t)?t.toString("hex"):String(t),mo=["None","Multiply","Long","Short"],ho=["Single","PrimaryWithAnchor"],_o=["ReflectorSep40","RedStonePriceFeed"],xo=["Spot","Twap"],vo=["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"],So=t=>Array.isArray(t)?t:[],qo=t=>({loanToValueBps:co(t.loan_to_value_bps),liquidationThresholdBps:co(t.liquidation_threshold_bps),liquidationBonusBps:co(t.liquidation_bonus_bps),liquidationFeesBps:co(t.liquidation_fees_bps),isCollateralizable:Boolean(t.is_collateralizable),isBorrowable:Boolean(t.is_borrowable),isFlashloanable:Boolean(t.is_flashloanable),flashloanFeeBps:co(t.flashloan_fee_bps),eModeCategories:(t.e_mode_categories??[]).map(co)}),To=(t,e)=>{const o="Borrow"===e;return{action:(r=t[0],vo[co(r)]??lo(r)),positionType:e,asset:yo(t[1]),scaledAmountRay:lo(t[2]),indexRay:lo(t[3]),amount:lo(t[4]),liquidationThresholdBps:o?void 0:co(t[5]),liquidationBonusBps:o?void 0:co(t[6]),loanToValueBps:o?void 0:co(t[7])};var r},wo=t=>{return{owner:yo(t[0]),eModeCategoryId:co(t[1]),mode:(e=t[2],mo[co(e)]??"None")};var e},Ao=(t,e)=>{const o=xo[co(t[`${e}_read_mode`])]??"Spot",r=t[`${e}_asset`],n=t[`${e}_symbol`],u=null!=r?{kind:"Stellar",value:yo(r)}:null!=n?{kind:"Symbol",value:yo(n)}:void 0;return{provider:_o[co(t[`${e}_provider`])]??"ReflectorSep40",contractAddress:yo(t[`${e}_contract`]),asset:u,feedId:fo(t[`${e}_feed_id`]),readMode:o,twapRecords:"Twap"===o?co(t[`${e}_twap_records`]):void 0,decimals:co(t[`${e}_decimals`]),resolutionSeconds:co(t[`${e}_resolution_seconds`]),maxStaleSeconds:co(t[`${e}_max_stale_seconds`])}},ko=t=>{const e=null!==t.anchor_provider&&void 0!==t.anchor_provider;return{baseTokenId:yo(t.base_token_id),quoteTokenId:yo(t.quote_token_id),tolerance:{upperRatio:co(t.upper_ratio_bps??t.tolerance?.upper_ratio_bps),lowerRatio:co(t.lower_ratio_bps??t.tolerance?.lower_ratio_bps)},assetDecimals:co(t.asset_decimals),maxPriceStaleSeconds:co(t.max_price_stale_seconds),strategy:ho[co(t.strategy)]??"Single",primary:Ao(t,"primary"),anchor:e?Ao(t,"anchor"):void 0,primaryQuoteToken:fo(t.primary_quote_token),anchorQuoteToken:fo(t.anchor_quote_token),minSanityPriceWad:bo(t.min_sanity_price_wad),maxSanityPriceWad:bo(t.max_sanity_price_wad)}},Eo={"market:create":t=>({topic:"market:create",data:{baseAsset:yo(t.base_asset),maxBorrowRate:lo(t.max_borrow_rate),baseBorrowRate:lo(t.base_borrow_rate),slope1:lo(t.slope1),slope2:lo(t.slope2),slope3:lo(t.slope3),midUtilization:lo(t.mid_utilization),optimalUtilization:lo(t.optimal_utilization),maxUtilization:bo(t.max_utilization),reserveFactor:co(t.reserve_factor),marketAddress:yo(t.market_address),config:qo(t.config)}}),"market:params_update":t=>({topic:"market:params_update",data:{asset:yo(t.asset),maxBorrowRateRay:lo(t.max_borrow_rate_ray),baseBorrowRateRay:lo(t.base_borrow_rate_ray),slope1Ray:lo(t.slope1_ray),slope2Ray:lo(t.slope2_ray),slope3Ray:lo(t.slope3_ray),midUtilizationRay:lo(t.mid_utilization_ray),optimalUtilizationRay:lo(t.optimal_utilization_ray),maxUtilizationRay:bo(t.max_utilization_ray),reserveFactorBps:co(t.reserve_factor_bps)}}),"market:batch_state_update":t=>({topic:"market:batch_state_update",data:{updates:So(t).map((t=>{return e=So(t),{asset:yo(e[0]),timestamp:co(e[1]),supplyIndexRay:lo(e[2]),borrowIndexRay:lo(e[3]),reservesRay:lo(e[4]),suppliedRay:lo(e[5]),borrowedRay:lo(e[6]),revenueRay:lo(e[7]),assetPriceWad:bo(e[8])};var e}))}}),"market:batch_params_update":t=>({topic:"market:batch_params_update",data:{updates:So(t).map((t=>{const e=t;return{asset:yo(e.asset),params:(o=e.params,{maxBorrowRateRay:lo(o.max_borrow_rate_ray),baseBorrowRateRay:lo(o.base_borrow_rate_ray),slope1Ray:lo(o.slope1_ray),slope2Ray:lo(o.slope2_ray),slope3Ray:lo(o.slope3_ray),midUtilizationRay:lo(o.mid_utilization_ray),optimalUtilizationRay:lo(o.optimal_utilization_ray),maxUtilizationRay:bo(o.max_utilization_ray),reserveFactorBps:co(o.reserve_factor_bps),supplyCap:lo(o.supply_cap),borrowCap:lo(o.borrow_cap),assetId:fo(o.asset_id),assetDecimals:void 0===o.asset_decimals?void 0:co(o.asset_decimals)})};var o}))}}),"position:batch_update":t=>{const e=So(t);return{topic:"position:batch_update",data:{accountId:lo(e[0]),accountAttributes:wo(So(e[1])),updates:[...So(e[2]).map((t=>To(So(t),"Deposit"))),...So(e[3]).map((t=>To(So(t),"Borrow")))]}}},"position:flash_loan":t=>({topic:"position:flash_loan",data:{asset:yo(t.asset),receiver:yo(t.receiver),caller:yo(t.caller),amount:lo(t.amount),fee:lo(t.fee)}}),"config:asset":t=>({topic:"config:asset",data:{asset:yo(t.asset),config:qo(t.config)}}),"config:oracle":t=>({topic:"config:oracle",data:{asset:yo(t.asset),oracle:ko(t.oracle)}}),"config:emode_category":t=>({topic:"config:emode_category",data:{category:{categoryId:co(t.category.category_id),isDeprecated:Boolean(t.category.is_deprecated)}}}),"config:emode_asset":t=>({topic:"config:emode_asset",data:{asset:yo(t.asset),config:{isCollateralizable:Boolean(t.config.is_collateralizable),isBorrowable:Boolean(t.config.is_borrowable),loanToValueBps:co(t.config.loan_to_value_bps),liquidationThresholdBps:co(t.config.liquidation_threshold_bps),liquidationBonusBps:co(t.config.liquidation_bonus_bps),supplyCap:lo(t.config.supply_cap),borrowCap:lo(t.config.borrow_cap)},categoryId:co(t.category_id)}}),"config:remove_emode_asset":t=>({topic:"config:remove_emode_asset",data:{asset:yo(t.asset),categoryId:co(t.category_id)}}),"debt:bad_debt":t=>({topic:"debt:bad_debt",data:{accountId:lo(t.account_id),totalBorrowUsdWad:lo(t.total_borrow_usd_wad),totalCollateralUsdWad:lo(t.total_collateral_usd_wad)}}),"strategy:initial_payment":t=>({topic:"strategy:initial_payment",data:{token:yo(t.token),amount:lo(t.amount),usdValueWad:lo(t.usd_value_wad),accountId:lo(t.account_id)}}),"strategy:fee":t=>({topic:"strategy:fee",data:{asset:yo(t.asset),amount:lo(t.amount),fee:lo(t.fee),amountSent:lo(t.amount_sent)}}),"config:approve_token":t=>({topic:"config:approve_token",data:{wasmHash:go(t.wasm_hash),approved:Boolean(t.approved)}}),"config:aggregator":t=>({topic:"config:aggregator",data:{aggregator:yo(t.aggregator)}}),"config:accumulator":t=>({topic:"config:accumulator",data:{accumulator:yo(t.accumulator)}}),"config:pool_template":t=>({topic:"config:pool_template",data:{wasmHash:go(t.wasm_hash)}}),"config:position_limits":t=>({topic:"config:position_limits",data:{maxSupplyPositions:co(t.max_supply_positions),maxBorrowPositions:co(t.max_borrow_positions)}}),"config:oracle_disabled":t=>({topic:"config:oracle_disabled",data:{asset:yo(t.asset)}})},Po=Object.freeze(Object.keys(Eo));function Mo(t,e){const o=po(t),r=Eo[o];return r?r(i(ao(e))):null}const Ro="XLENDXLM-a7c9f3",Oo=1e4;function Io(t){const e=BigInt(t).toString(16),o=e.length%2==0?e:`0${e}`;return`${Ro}-${o}`}function Co(t){const e=t.split("-");return e.length>=2&&parseInt(e[1],10)||0}function Uo(t,e=0){return t*Oo+e}function Lo(t){switch(t){case"liq_repay":return"lendingLiquidateRepayDebt";case"liq_seize":return"lendingLiquidateSeizeCollateral";case"param_upd":return"lendingUpdateAccountParameters";default:return"lendingUpdateAccountPosition"}}const $o=(t,e,o)=>{const r=new URL(e,t.endsWith("/")?t:`${t}/`);if(o)for(const[t,e]of Object.entries(o))void 0!==e&&r.searchParams.set(t,String(e));return r.toString()},Bo=t=>t.baseUrl??f[t.network];async function No(t,e){if(null==t.amountIn==(null==t.amountOut))throw new Error("getStellarAggregatorQuote: exactly one of `amountIn` or `amountOut` must be provided");const o=$o(Bo(e),"api/v1/quote",{from:t.from,to:t.to,amountIn:t.amountIn,amountOut:t.amountOut,maxHops:t.maxHops,maxSplits:t.maxSplits,slippage:t.slippage,includePaths:t.includePaths,sender:t.sender,router:t.router,platform:t.platform,fresh:t.fresh}),r=await fetch(o,e.fetchOptions);if(!r.ok){const t=await r.text().catch((()=>""));throw new Error(`Stellar quote server responded ${r.status} ${r.statusText} for ${o} — ${t}`)}return await r.json()}async function Do(t){const e=$o(Bo(t),"api/v1/tokens"),o=await fetch(e,t.fetchOptions);if(!o.ok){const t=await o.text().catch((()=>""));throw new Error(`Stellar quote server responded ${o.status} ${o.statusText} for ${e} — ${t}`)}return await o.json()}const Go=t=>L(t).toXDR("base64");function zo(e,n){const i=e.routerAddress??h(e.network),s=new r(i),a=new t(e.caller,e.sourceSequence),p=N(((t,e)=>(t=>Boolean(t&&"object"==typeof t&&!(t instanceof Uint8Array)&&"paths"in t))(t)&&void 0===t.referralId?{...t,referralId:e??0}:t)(n,e.referralId));return{xdr:new u(a,{fee:e.fee??o,networkPassphrase:g[e.network]}).addOperation(s.call("execute_strategy",v(e.caller),S(e.totalIn),p)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function Vo(t,e){return zo(t,e)}function Wo(t,e={}){if("string"!=typeof t.amountOutMin)throw new Error("mapQuoteResponseToStrategyPayload: quote response is missing `amountOutMin`. Pass `slippage` when fetching the quote.");return{paths:t.paths?t.paths.map((t=>({hops:t.swaps.map(Xo),splitPpm:t.splitPpm}))):[{hops:t.hops.map(Xo),splitPpm:1e6}],referralId:e.referralId??0,tokenIn:t.from,tokenOut:t.to,totalMinOut:t.amountOutMin}}function jo(t,e={}){const o=t;return"string"==typeof o.routeXdr&&o.routeXdr.length>0?{routeXdr:o.routeXdr}:Wo(t,e)}const Ho=Wo,Xo=t=>({amountOut:t.amountOut,pool:t.address,tokenIn:t.from,tokenOut:t.to,venue:t.dex});function Fo(t,e){const o=e instanceof Error?e.message:String(e);return new Error(`[xoxno-invoked:${t}] ${o}`)}async function Qo(t,e,o){const r=u.fromXDR(e,"base64");try{return(await t.prepareTransaction(r)).toXDR()}catch(t){if(o?.invokedContractId)throw Fo(o.invokedContractId,t);throw t}}async function Ko(t,e,o){return Qo(t,e.xdr,o)}function Zo(t){if(t<=0||t>4)throw new Error(`Invalid PositionMode ${t} for Stellar — expected 1 (Normal) through 4 (Short). "None" (0) has no Stellar equivalent.`);return t-1}function Jo(t,e){return{paths:[{hops:[{amountOut:"0",pool:t,tokenIn:t,tokenOut:t,venue:"Soroswap"}],splitPpm:1e6}],referralId:0,tokenIn:t,tokenOut:t,totalMinOut:e}}const Yo=t=>{const e=t.startsWith("0x")?t.slice(2):t;if(e.length%2!=0)throw new Error("buildStellarCctpForwardTx: hex input must have even length");return Buffer.from(e,"hex")};function tr(e){const o=new t(e.caller,e.sourceSequence),n=new r(e.forwarderAddress).call("mint_and_forward",s.ScVal.scvBytes(Yo(e.message)),s.ScVal.scvBytes(Yo(e.attestation)));return{xdr:new u(o,{fee:e.fee??"10000000",networkPassphrase:g[e.network]}).addOperation(n).setTimeout(e.timeoutSeconds??120).build().toXDR()}}}},p={};function l(t){var e=p[t];if(void 0!==e)return e.exports;var o=p[t]={exports:{}};return a[t](o,o.exports,l),o.exports}l.d=(t,e)=>{for(var o in e)l.o(e,o)&&!l.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},l.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const c="https://api.xoxno.com",d="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",y="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",b="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var f;!function(t){t.MAINNET="1",t.DEVNET="D"}(f||(f={}));class g{apiUrl;chain;init;config;constructor({chain:t=f.MAINNET,apiUrl:e=c,...o}={}){this.apiUrl=e??{[f.MAINNET]:c,[f.DEVNET]:"https://devnet-api.xoxno.com"}[t],this.chain=t,this.init=o,this.config=t==f.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:d,DR_SC:y,KG_SC:b,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:d,DR_SC:y,KG_SC:b,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}fetchWithTimeout=async(t,{params:e,...o}={})=>{const{next:r,cache:n,debug:u,...i}=this.init,{next:s,cache:a,debug:p,headers:l,method:c="GET",...d}=o,y=l?.Authorization,b="Bearer undefined"===y?void 0:y,f={...l,Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."PUT"===c?{}:{"Content-Type":"application/json"},...b?{Authorization:b}:{}},g=Object.entries(e??{}).flatMap((([t,e])=>Array.isArray(e)?e.map((e=>`${t}=${encodeURIComponent(e)}`)):`${t}=${encodeURIComponent(e)}`)).join("&"),m=`${this.apiUrl}${t}${g.length?`?${g}`:""}`,{revalidate:h,..._}=r??{},{revalidate:x,...v}=s??{},S="GET"!==c||b?void 0:x??h,q="GET"!==c||b||S?void 0:a??n,T={...i,...d,method:c,...Object.keys(f).length?{headers:f}:{},cache:q,next:{..._,...v,revalidate:S}};(p??u)&&console.debug("SDK fetch: ",m,T);const w=await fetch(m,T).catch((t=>{if(t instanceof Error&&!t.message.match(/^http(s?):\/\//))throw Object.assign(new Error(`${m}: ${t.message}`),{cause:t});throw t})),A=await w.text();if(!w.ok){let t;try{t=JSON.parse(A)}catch{t={message:A}}const e=[m,w.status,w.statusText,t.message].filter(Boolean).join(";;");throw new Error(e)}try{return JSON.parse(A)}catch{return A}}}const m=t=>{const e=/^0x[a-fA-F0-9]{1,64}-[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(t)),o=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t);return e||o},h=t=>{const e=/^0x[a-fA-F0-9]{1,64}$/.test(t),o=/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,7}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(t);return e||o};class _ extends Error{constructor(t){super(`Invalid collection ticker: ${t}`)}}class x extends Error{constructor(t){super(`Invalid address: ${t}`)}}Error,Error;const v=t=>!!t&&(t.startsWith("erd1")&&62===t.length||/^0x[a-fA-F0-9]{40,64}$/.test(t)||/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(t)||/^G[A-Z2-7]{55}$/.test(t)),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/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:{}}}},q=["PATCH","POST","DELETE","PUT"];var T=l(388);const w=t=>t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase()));function A(t,e,o,r){const{input:n,output:u,...i}=e,s=async(e={})=>{const n={...o,...e},u=t.replace(/:([a-zA-Z_]+)/g,((t,e)=>`${n[e]}`)),i=[...t.matchAll(/:([a-zA-Z_]+)/g)].map((t=>t[1])),s=Object.fromEntries(Object.entries(n).filter((([t])=>!i.includes(t)))),a=/:address[^A-Z]/.test(t)||"address"in s,p=/:collection[^A-Z]/.test(t)||"collection"in s;if(a){const t=n.address;if(!v(t))throw new x(t)}if(p){const t=n.collection;if(Array.isArray(t)?t.some((t=>!m(t))):!m(t))throw new _(t)}const l=Object.fromEntries(Object.entries(s).map((([t,e])=>[t,e instanceof FormData?e:"filter"===t||"body"===t?JSON.stringify(e):Array.isArray(e)?e.join(","):e]))),{body:c,auth:d,method:y,headers:b,cache:f,next:g,debug:h,continuationToken:S,...q}=l,T=d?`Bearer ${d}`:void 0,w={...b,...T?{Authorization:T}:{},...S?{"X-Continuation-Token":String(S)}:{}},A={...g,tags:[...g?.tags??[],u]};return r.fetchWithTimeout(u,{method:y,params:q,body:c,headers:w,cache:f,debug:h,...A?{next:A}:{}})},a=(t={})=>s(t);for(const t of Object.keys(i))q.includes(t)&&(a[t]=e=>s({...e,method:e.method??t.toUpperCase()}));return a}function k(t){const e=function(){const t={static:{},params:{},leaves:[]};for(const[e,o]of Object.entries(S)){const r=e.split("/").filter(Boolean);let n=t;for(const t of r)if(t.startsWith(":")){const e=w(t.slice(1));n=n.params[e]||={static:{},params:{},leaves:[]}}else{const e=w(t);n=n.static[e]||={static:{},params:{},leaves:[]}}n.leaves.push({rawPath:e,def:o})}return t}(),o=(e,r)=>{const n=e.leaves.length,u=Object.keys(e.static).length,i=Object.keys(e.params).length;let s;if(1===n&&u+i>0){const{rawPath:o,def:n}=e.leaves[0];s=A(o,n,r,t)}else{s={};for(const{rawPath:o,def:n}of e.leaves)s[w(o.split("/").pop().replace(/^:/,""))]=A(o,n,r,t)}for(const[t,n]of Object.entries(e.static)){const e=o(n,r);let u=e;if(e&&"object"==typeof e&&t in e&&"function"==typeof e[t]){const o=e[t],r=Object.fromEntries(Object.entries(e).filter((([e])=>e!==t)));1===o.length||(Object.assign(o,r),u=o)}void 0===s[t]?s[t]=u:"function"==typeof s[t]?Object.assign(s[t],u):"function"==typeof u?(Object.assign(u,s[t]),s[t]=u):Object.assign(s[t],u)}for(const[t,n]of Object.entries(e.params)){const e=e=>{const u=o(n,{...r,[t]:e});if(u&&"object"==typeof u&&1===Object.keys(u).length&&t in u&&"function"==typeof u[t]){const e=u[t],o=(...t)=>e(...t);return Object.assign(o,e)}return u};if(s[t]){const o=s[t];s[t]=t=>({...o(t),...e(t)})}else s[t]=e}return s};return o(e,{})}export{f as Chain,g as XOXNOClient,k as buildSdk,m as isValidCollectionTicker,h as isValidNftIdentifier};export const STELLAR_AGGREGATOR_ROUTER=T.ME;export const STELLAR_GOVERNANCE=T.nO;export const STELLAR_GOVERNANCE_ZERO_PREDECESSOR=T.G_;export const STELLAR_LENDING_CONTROLLER=T.DU;export const STELLAR_LENDING_TOPICS=T.fA;export const STELLAR_NETWORK_PASSPHRASE=T.A$;export const STELLAR_QUOTE_URL=T.J9;export const STELLAR_SOROBAN_RPC_URL=T.hS;export const SYNTHETIC_EVENT_ORDER_STRIDE=T.gR;export const XOXNO_LENDING_STELLAR_TICKER=T.Cg;export const buildSameTokenRepaySwapSteps=T.VZ;export const buildStellarAcceptOwnershipTx=T.N0;export const buildStellarAddAssetToEModeCategoryTx=T.Wc;export const buildStellarAddEModeCategoryTx=T.hu;export const buildStellarAddRewardsTx=T.B_;export const buildStellarApproveTokenTx=T.eX;export const buildStellarBatchSwapTx=T.z;export const buildStellarBorrowBatchTx=T.xD;export const buildStellarBorrowTx=T.jR;export const buildStellarCctpForwardTx=T.P2;export const buildStellarClaimRevenueTx=T.W6;export const buildStellarConfigureMarketOracleTx=T.KH;export const buildStellarCreateLiquidityPoolTx=T.se;export const buildStellarDisableTokenOracleTx=T.ln;export const buildStellarEditAssetConfigTx=T.g;export const buildStellarEditAssetInEModeCategoryTx=T.jP;export const buildStellarEditOracleToleranceTx=T.FM;export const buildStellarExecuteStrategyTx=T.yr;export const buildStellarFlashLoanTx=T.sp;export const buildStellarGovernanceExecuteGovernanceUpgradeTx=T.$9;export const buildStellarGovernanceExecuteGrantGovernanceRoleTx=T.zw;export const buildStellarGovernanceExecuteRevokeGovernanceRoleTx=T.h_;export const buildStellarGovernanceExecuteTransferGovOwnTx=T.e_;export const buildStellarGovernanceExecuteTx=T.Tk;export const buildStellarGovernanceExecuteUpdateDelayTx=T.BA;export const buildStellarGrantRoleTx=T.SX;export const buildStellarLendingIdentifier=T.UF;export const buildStellarLiquidateTx=T.Y5;export const buildStellarMigrateFromBlendTx=T.mE;export const buildStellarMigrateTx=T.xG;export const buildStellarMultiplyTx=T.s9;export const buildStellarPauseTx=T.OL;export const buildStellarProposeAddAssetToEModeTx=T.Mq;export const buildStellarProposeAddEModeCategoryTx=T.fc;export const buildStellarProposeApproveBlendPoolTx=T.kD;export const buildStellarProposeApproveTokenTx=T.Yf;export const buildStellarProposeConfigureMarketOracleTx=T.c5;export const buildStellarProposeCreateLiquidityPoolTx=T.qU;export const buildStellarProposeDeployPoolTx=T.RZ;export const buildStellarProposeDisableTokenOracleTx=T.PD;export const buildStellarProposeEditAssetConfigTx=T.cJ;export const buildStellarProposeEditAssetInEModeTx=T.vM;export const buildStellarProposeEditOracleToleranceTx=T.hF;export const buildStellarProposeGovernanceUpgradeTx=T.Qk;export const buildStellarProposeGrantGovernanceRoleTx=T.Gw;export const buildStellarProposeMigrateControllerTx=T.$K;export const buildStellarProposeRemoveAssetFromEModeTx=T.cO;export const buildStellarProposeRemoveEModeCategoryTx=T.Qy;export const buildStellarProposeRevokeBlendPoolTx=T.X7;export const buildStellarProposeRevokeGovernanceRoleTx=T.Ub;export const buildStellarProposeRevokeTokenTx=T.Dx;export const buildStellarProposeSetAccumulatorTx=T.OA;export const buildStellarProposeSetAggregatorTx=T.$U;export const buildStellarProposeSetMinBorrowCollatTx=T.ob;export const buildStellarProposeSetPoolTemplateTx=T.cY;export const buildStellarProposeSetPositionLimitsTx=T.$l;export const buildStellarProposeTransferCtrlOwnershipTx=T.VS;export const buildStellarProposeTransferGovOwnTx=T.HP;export const buildStellarProposeUpdateDelayTx=T.YQ;export const buildStellarProposeUpdatePoolCapsTx=T.mK;export const buildStellarProposeUpgradeControllerTx=T.QY;export const buildStellarProposeUpgradePoolParamsTx=T.os;export const buildStellarProposeUpgradePoolTx=T.Ko;export const buildStellarRemoveAssetFromEModeTx=T.kz;export const buildStellarRemoveEModeCategoryTx=T.Oy;export const buildStellarRenewAccountTx=T.IJ;export const buildStellarRepayBatchTx=T.nw;export const buildStellarRepayDebtWithCollateralTx=T.Pr;export const buildStellarRepayTx=T.ZE;export const buildStellarRevokeRoleTx=T.ev;export const buildStellarRevokeTokenTx=T.P8;export const buildStellarSetAccumulatorTx=T.aV;export const buildStellarSetAggregatorTx=T.p2;export const buildStellarSetLiquidityPoolTemplateTx=T.Ww;export const buildStellarSetPositionLimitsTx=T.Dy;export const buildStellarSupplyBatchTx=T.Ni;export const buildStellarSupplyTx=T.v_;export const buildStellarSwapCollateralTx=T.qD;export const buildStellarSwapDebtTx=T.qR;export const buildStellarTransferOwnershipTx=T.QJ;export const buildStellarUnpauseTx=T.bm;export const buildStellarUpdateAccountThresholdTx=T.n_;export const buildStellarUpdateIndexesTx=T.v8;export const buildStellarUpdatePoolCapsTx=T.Y_;export const buildStellarUpgradeControllerTx=T.qM;export const buildStellarUpgradeLiquidityPoolParamsTx=T.gH;export const buildStellarUpgradeLiquidityPoolTx=T.un;export const buildStellarWithdrawBatchTx=T.O3;export const buildStellarWithdrawTx=T.Gz;export const buildTx=T.pr;export const decodeStellarLendingEvent=T.Fm;export const encodeAssetConfigRaw=T.ns;export const encodeInterestRateModel=T.MB;export const encodeMarketOracleConfigInput=T.Dn;export const encodeMarketParamsRaw=T.pq;export const encodeOracleSourceConfigInput=T.ml;export const encodePositionLimits=T.Q3;export const encodeStrategyPayloadToRouteXdr=T.wf;export const extractEventOrder=T.Um;export const getStellarAccountPositions=T.xO;export const getStellarAggregatorQuote=T.Lw;export const getStellarAggregatorRouter=T.KM;export const getStellarAsset=T.mM;export const getStellarAssetGraph=T.iE;export const getStellarAssetMarkets=T.zp;export const getStellarAssetPage=T.N3;export const getStellarAssets=T.bN;export const getStellarGovernance=T.QV;export const getStellarGovernanceProposals=T.T_;export const getStellarHub=T.XI;export const getStellarHubGraph=T.Lt;export const getStellarHubs=T.KK;export const getStellarLendingContext=T.yl;export const getStellarLendingController=T.vc;export const getStellarQuoteTokens=T.CH;export const getStellarReserve=T.FI;export const getStellarReserveGraph=T.KG;export const getStellarReserveHolders=T.nW;export const getStellarReserves=T.jF;export const getStellarSpoke=T.S2;export const getStellarSpokeGraph=T.uS;export const getStellarSpokes=T.u_;export const getStellarUserActivity=T.O5;export const getStellarUserPositions=T.Av;export const mapQuoteResponseToAggregatorSwap=T.LA;export const mapQuoteResponseToStrategyPayload=T.E6;export const mapQuoteResponseToStrategySwap=T.Ds;export const mapStellarPositionActivityType=T.CU;export const prepareStellarBuiltTx=T.Vx;export const prepareStellarTxXdr=T.DL;export const stellarLendingDispatchKey=T.ON;export const stellarLendingRead=T.Hh;export const syntheticEventOrder=T.oV;export const tagStellarInvokedContractError=T.g5;export const toBase64Xdr=T.L;export const toStellarPositionMode=T.Vu;
|
|
1
|
+
"undefined"!=typeof globalThis&&void 0===globalThis.self&&(globalThis.self=globalThis);import{Account as t,Address as e,BASE_FEE as o,Contract as r,ScInt as n,TransactionBuilder as u,scValToNative as i,xdr as s}from"@stellar/stellar-sdk";var a={388(a,p,l){l.d(p,{ME:()=>d,nO:()=>y,G_:()=>fe,DU:()=>c,fA:()=>Po,A$:()=>g,J9:()=>f,hS:()=>b,gR:()=>Oo,Cg:()=>Ro,VZ:()=>Jo,N0:()=>Vt,Wc:()=>Jt,hu:()=>Qt,B_:()=>ye,eX:()=>oe,z:()=>Vo,xD:()=>W,jR:()=>j,P2:()=>tr,W6:()=>de,KH:()=>ne,se:()=>pe,ln:()=>ie,g:()=>Xt,jP:()=>Yt,FM:()=>ue,yr:()=>zo,sp:()=>Z,$9:()=>oo,zw:()=>no,h_:()=>uo,e_:()=>io,Tk:()=>eo,BA:()=>ro,SX:()=>Dt,UF:()=>Io,Y5:()=>K,mE:()=>J,xG:()=>$t,s9:()=>Y,OL:()=>Bt,Mq:()=>Oe,fc:()=>Me,kD:()=>Be,Yf:()=>Le,c5:()=>Fe,qU:()=>De,RZ:()=>ze,PD:()=>We,cJ:()=>ke,vM:()=>Ie,hF:()=>Qe,Qk:()=>Ke,Gw:()=>Je,$K:()=>He,cO:()=>Ue,Qy:()=>Re,X7:()=>Ne,Ub:()=>Ye,Dx:()=>$e,OA:()=>we,$U:()=>Te,ob:()=>Pe,cY:()=>Ae,$l:()=>Ee,VS:()=>Xe,HP:()=>to,YQ:()=>Ze,mK:()=>Ce,QY:()=>je,os:()=>Ge,Ko:()=>Ve,kz:()=>ee,Oy:()=>Kt,IJ:()=>ae,nw:()=>F,Pr:()=>ot,ZE:()=>Q,ev:()=>Gt,P8:()=>re,aV:()=>jt,p2:()=>Wt,Ww:()=>Ht,Dy:()=>Ft,Ni:()=>z,v_:()=>V,qD:()=>et,qR:()=>tt,QJ:()=>zt,bm:()=>Nt,n_:()=>be,v8:()=>se,Y_:()=>te,qM:()=>Lt,gH:()=>le,un:()=>ce,O3:()=>H,Gz:()=>X,pr:()=>G,Fm:()=>Mo,ns:()=>Mt,MB:()=>Et,Dn:()=>Ut,pq:()=>Pt,ml:()=>Ct,Q3:()=>Rt,wf:()=>Go,Um:()=>Co,xO:()=>xt,Lw:()=>No,KM:()=>h,mM:()=>yt,iE:()=>St,zp:()=>ft,N3:()=>bt,bN:()=>st,QV:()=>_,T_:()=>vt,XI:()=>gt,Lt:()=>qt,KK:()=>at,yl:()=>it,vc:()=>m,CH:()=>Do,FI:()=>ct,KG:()=>wt,nW:()=>dt,jF:()=>lt,S2:()=>mt,uS:()=>Tt,u_:()=>pt,O5:()=>_t,Av:()=>ht,LA:()=>Ho,E6:()=>Wo,Ds:()=>jo,CU:()=>Lo,Vx:()=>Ko,DL:()=>Qo,ON:()=>po,Hh:()=>At,oV:()=>Uo,g5:()=>Fo,L:()=>so,Vu:()=>Zo});const c={mainnet:process.env.STELLAR_LENDING_CONTROLLER_MAINNET??"",testnet:process.env.STELLAR_LENDING_CONTROLLER_TESTNET??""},d={mainnet:process.env.STELLAR_AGGREGATOR_ROUTER_MAINNET??"",testnet:process.env.STELLAR_AGGREGATOR_ROUTER_TESTNET??""},y={mainnet:process.env.STELLAR_GOVERNANCE_MAINNET??"",testnet:process.env.STELLAR_GOVERNANCE_TESTNET??""},b={mainnet:"https://soroban-rpc.stellar.org",testnet:"https://soroban-testnet.stellar.org"},f={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"},g={mainnet:"Public Global Stellar Network ; September 2015",testnet:"Test SDF Network ; September 2015"};function m(t){const e=c[t];if(!e)throw new Error(`Stellar lending controller address not configured for network "${t}". Set STELLAR_LENDING_CONTROLLER_${t.toUpperCase()} env var.`);return e}function h(t){const e=d[t];if(!e)throw new Error(`Stellar aggregator router address not configured for network "${t}". Set STELLAR_AGGREGATOR_ROUTER_${t.toUpperCase()} env var.`);return e}function _(t){const e=y[t];if(!e)throw new Error(`Stellar governance address not configured for network "${t}". Set STELLAR_GOVERNANCE_${t.toUpperCase()} env var.`);return e}const x=["Soroswap","Aquarius","Phoenix","Sushi","CometDex"],v=t=>new e(t).toScVal(),S=t=>new n(t).toI128(),q=t=>s.ScVal.scvU32(t),T=t=>new n("string"==typeof t?t:t.toString()).toU64(),w=t=>s.ScVal.scvBool(t),A=t=>s.ScVal.scvString(t),k=t=>s.ScVal.scvSymbol(t),E=()=>s.ScVal.scvVoid(),P=t=>s.ScVal.scvVec(t),M=(t,e=32)=>{const o=t.startsWith("0x")?t.slice(2):t,r=Buffer.from(o,"hex");if(r.length!==e)throw new Error(`Stellar builder: expected a ${e}-byte BytesN (got ${r.length} bytes from "${t}")`);return s.ScVal.scvBytes(r)},R=(t,e)=>null==t?E():e(t),O=(t,e)=>U({asset:v(e),hub_id:q(t)}),I=(t,e,o)=>s.ScVal.scvVec([O(t,e),S(o)]),C=t=>s.ScVal.scvVec(t.map((t=>I(t.hubId,t.asset,t.amount)))),U=t=>{const e=Object.keys(t).sort().map((e=>new s.ScMapEntry({key:k(e),val:t[e]})));return s.ScVal.scvMap(e)},L=t=>{const e=t.paths.map((t=>{const e=t.hops.map((t=>{return U({amount_out:S(t.amountOut),pool:v(t.pool),token_in:v(t.tokenIn),token_out:v(t.tokenOut),venue:(e=t.venue,s.ScVal.scvVec([k(e)]))});var e}));return U({hops:s.ScVal.scvVec(e),split_ppm:q(t.splitPpm)})}));return U({paths:s.ScVal.scvVec(e),referral_id:T(t.referralId??0),token_in:v(t.tokenIn),token_out:v(t.tokenOut),total_min_out:S(t.totalMinOut)})},$=t=>{const e=Buffer.from(t);if(0===e.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return s.ScVal.scvBytes(e)},B=t=>{const e=t.trim();if(e.startsWith("0x")){const t=e.slice(2);if(!((o=t).length>0&&o.length%2==0&&/^[0-9a-fA-F]+$/.test(o)))throw new Error("Stellar builder: strategy swap bytes hex string must be 0x-prefixed and even-length");return Buffer.from(t,"hex")}var o;if(!/^[A-Za-z0-9+/]+={0,2}$/.test(e))throw new Error("Stellar builder: strategy swap bytes must be base64 routeXdr or 0x-prefixed hex");const r=Buffer.from(e,"base64");if(0===r.length)throw new Error("Stellar builder: strategy swap bytes must be non-empty base64 routeXdr, 0x hex string, or Uint8Array");return r},N=t=>{if("string"==typeof t)return $(B(t));if(t instanceof Uint8Array)return $(t);if(t&&"object"==typeof t)return"routeXdr"in(o=t)&&"string"==typeof o.routeXdr?$(B(t.routeXdr)):(t=>"swapXdr"in t&&"string"==typeof t.swapXdr)(t)?$(B(t.swapXdr)):(t=>"bytes"in t&&("string"==typeof t.bytes||t.bytes instanceof Uint8Array))(t)?"string"==typeof t.bytes?$(B(t.bytes)):$(t.bytes):(e=(t=>{if(!t||"object"!=typeof t)throw new Error("Stellar builder: decoded strategy `steps` must be a StrategyPayload ({ paths, tokenIn, tokenOut, totalMinOut })");const e=t;if(!Array.isArray(e.paths)||0===e.paths.length)throw new Error("Stellar builder: `steps.paths` must be a non-empty array of strategy paths");if("string"!=typeof e.tokenIn)throw new Error("Stellar builder: `steps.tokenIn` must be a contract address");if("string"!=typeof e.tokenOut)throw new Error("Stellar builder: `steps.tokenOut` must be a contract address");if("string"!=typeof e.totalMinOut)throw new Error("Stellar builder: `steps.totalMinOut` must be an i128 decimal string");let o=0;for(const[t,r]of e.paths.entries()){if(!r||"number"!=typeof r.splitPpm||r.splitPpm<=0||!Array.isArray(r.hops)||0===r.hops.length)throw new Error(`Stellar builder: \`steps.paths[${t}]\` must have splitPpm > 0 and a non-empty hops array`);o+=r.splitPpm;for(const[e,o]of r.hops.entries())if(!o||"string"!=typeof o.amountOut||"string"!=typeof o.pool||"string"!=typeof o.tokenIn||"string"!=typeof o.tokenOut||!x.includes(o.venue))throw new Error(`Stellar builder: \`steps.paths[${t}].hops[${e}]\` must have amountOut, pool, tokenIn, tokenOut, and a valid Soroban venue`)}if(1e6!==o)throw new Error(`Stellar builder: \`steps.paths[].splitPpm\` must sum to 1_000_000, got ${o}`);return e})(t),s.ScVal.scvBytes(Buffer.from(L(e).toXDR("base64"),"base64")));var e,o;throw new Error("Stellar builder: `steps` must be opaque strategy bytes (`routeXdr`, base64/hex string, or Uint8Array)")},D=t=>{if("string"==typeof t)return(t=>{const e=t.startsWith("0x")?t.slice(2):t,o=Buffer.from(e,"hex");return s.ScVal.scvBytes(o)})(t);if(t instanceof Uint8Array)return s.ScVal.scvBytes(Buffer.from(t));throw new Error("Stellar builder: `data` must be a hex string or Uint8Array (Soroban Bytes payload)")};function G(e,n,i){const s=e.controllerAddress??m(e.network),a=new r(s),p=new t(e.caller,e.sourceSequence);return{xdr:new u(p,{fee:e.fee??o,networkPassphrase:g[e.network]}).addOperation(a.call(n,...i)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function z(t,e){const o=e.accountNonce??0,r=e.spokeId??0;return G(t,"supply",[v(t.caller),T(o),q(r),C([...e.assets])])}function V(t,e){return z(t,{accountNonce:e.accountNonce,spokeId:e.spokeId,assets:[{hubId:e.hubId,asset:e.asset,amount:e.amount}]})}function W(t,e){return G(t,"borrow",[v(t.caller),T(e.accountNonce),C([...e.borrows]),R(e.to,v)])}function j(t,e){return W(t,{accountNonce:e.accountNonce,borrows:[{hubId:e.hubId,asset:e.asset,amount:e.amount}],to:e.to})}function H(t,e){return G(t,"withdraw",[v(t.caller),T(e.accountNonce),C([...e.withdrawals]),R(e.to,v)])}function X(t,e){return H(t,{accountNonce:e.accountNonce,withdrawals:[{hubId:e.hubId,asset:e.asset,amount:e.amount}],to:e.to})}function F(t,e){return G(t,"repay",[v(t.caller),T(e.accountNonce),C([...e.payments])])}function Q(t,e){return F(t,{accountNonce:e.accountNonce,payments:[{hubId:e.hubId,asset:e.asset,amount:e.amount}]})}function K(t,e){return G(t,"liquidate",[v(t.caller),T(e.accountNonce),C([...e.debtPayments])])}function Z(t,e){return G(t,"flash_loan",[v(t.caller),O(e.hubId,e.asset),S(e.amount),v(e.receiver),D(e.data)])}function J(t,e){return G(t,"migrate_from_blend",[v(t.caller),T(e.accountId),q(e.spokeId),q(e.hubId),v(e.blendPool),P(e.collateralTokens.map(v)),P(e.supplyTokens.map(v)),(o=e.debtCaps.map((t=>({token:t.token,amount:t.cap}))),s.ScVal.scvVec(o.map((t=>{return e=t.token,o=t.amount,s.ScVal.scvVec([v(e),S(o)]);var e,o}))))]);var o}function Y(t,e){const o=e.accountNonce??0,r=e.spokeId??0;return G(t,"multiply",[v(t.caller),T(o),q(r),O(e.collateral.hubId,e.collateral.asset),S(e.debtToFlashLoan),O(e.debt.hubId,e.debt.asset),q(e.mode),N(e.steps),R(e.initialPayment,(t=>I(t.hubId,t.asset,t.amount))),R(e.convertSwap,N)])}function tt(t,e){return G(t,"swap_debt",[v(t.caller),T(e.accountNonce),O(e.existingDebt.hubId,e.existingDebt.asset),S(e.newDebtAmount),O(e.newDebt.hubId,e.newDebt.asset),N(e.steps)])}function et(t,e){return G(t,"swap_collateral",[v(t.caller),T(e.accountNonce),O(e.current.hubId,e.current.asset),S(e.fromAmount),O(e.newCollateral.hubId,e.newCollateral.asset),N(e.steps)])}function ot(t,e){return G(t,"repay_debt_with_collateral",[v(t.caller),T(e.accountNonce),O(e.collateral.hubId,e.collateral.asset),S(e.collateralAmount),O(e.debt.hubId,e.debt.asset),N(e.steps),w(e.closePosition)])}const rt="/stellar-lending",nt=25,ut=encodeURIComponent,it=(t,e)=>t.fetchWithTimeout(`${rt}/context`,e),st=(t,e)=>t.fetchWithTimeout(`${rt}/assets`,e),at=(t,e)=>t.fetchWithTimeout(`${rt}/hubs`,e),pt=(t,e)=>t.fetchWithTimeout(`${rt}/spokes`,e),lt=(t,e={},o)=>{const{hubId:r,spokeId:n,asset:u}=e;return t.fetchWithTimeout(`${rt}/reserves`,{...o,params:{...void 0!==r?{hubId:r}:{},...void 0!==n?{spokeId:n}:{},...u?{asset:u}:{}}})},ct=(t,e,o,r,n)=>t.fetchWithTimeout(`${rt}/reserves/${e}/${o}/${ut(r)}`,n),dt=(t,e,o,r,n,u)=>t.fetchWithTimeout(`${rt}/reserves/${e}/${o}/${ut(r)}/holders`,{...u,params:{side:n}}),yt=(t,e,o)=>t.fetchWithTimeout(`${rt}/assets/${ut(e)}`,o),bt=(t,e,o,r)=>t.fetchWithTimeout(`${rt}/assets/${ut(e)}/page`,{...r,params:{...o}}),ft=(t,e,o,r)=>t.fetchWithTimeout(`${rt}/assets/${ut(e)}/markets`,{...r,params:{side:o}}),gt=(t,e,o)=>t.fetchWithTimeout(`${rt}/hubs/${e}`,o),mt=(t,e,o)=>t.fetchWithTimeout(`${rt}/spokes/${e}`,o),ht=(t,e,o)=>t.fetchWithTimeout(`${rt}/users/${ut(e)}/positions`,o),_t=(t,e,o={},r)=>{const{skip:n,top:u}=o;return t.fetchWithTimeout(`${rt}/users/${ut(e)}/activity`,{...r,params:{...void 0!==n?{skip:n}:{},...void 0!==u?{top:u}:{}}})},xt=(t,e,o)=>t.fetchWithTimeout(`${rt}/accounts/${ut(e)}/positions`,o),vt=(t,e={},o)=>{const{top:r=nt,continuationToken:n}=e;return t.fetchWithTimeout(`${rt}/governance/proposals`,{...o,params:{top:r,...n?{continuationToken:n}:{}}})},St=(t,e,o,r)=>t.fetchWithTimeout(`${rt}/assets/${ut(e)}/graph`,{...r,params:{...o}}),qt=(t,e,o,r)=>t.fetchWithTimeout(`${rt}/hubs/${e}/graph`,{...r,params:{...o}}),Tt=(t,e,o,r)=>t.fetchWithTimeout(`${rt}/spokes/${e}/graph`,{...r,params:{...o}}),wt=(t,e,o,r,n,u)=>t.fetchWithTimeout(`${rt}/reserves/${e}/${o}/${ut(r)}/graph`,{...u,params:{...n}}),At=t=>({context:e=>it(t,e),assets:e=>st(t,e),hubs:e=>at(t,e),spokes:e=>pt(t,e),reserves:(e,o)=>{return void 0===(r=e)||"hubId"in r||"spokeId"in r||"asset"in r?lt(t,e,o):lt(t,{},e);var r},reserve:(e,o,r,n)=>ct(t,e,o,r,n),reserveHolders:(e,o,r,n,u)=>dt(t,e,o,r,n,u),asset:(e,o)=>yt(t,e,o),assetMarkets:(e,o,r)=>ft(t,e,o,r),hub:(e,o)=>gt(t,e,o),spoke:(e,o)=>mt(t,e,o),userPositions:(e,o)=>ht(t,e,o),userActivity:(e,o,r)=>_t(t,e,o,r),accountPositions:(e,o)=>xt(t,e,o),governanceProposals:(e,o)=>vt(t,e,o),assetGraph:(e,o,r)=>St(t,e,o,r),hubGraph:(e,o,r)=>qt(t,e,o,r),spokeGraph:(e,o,r)=>Tt(t,e,o,r),reserveGraph:(e,o,r,n,u)=>wt(t,e,o,r,n,u)}),kt={Single:0,PrimaryWithAnchor:1},Et=t=>U({base_borrow_rate_ray:S(t.baseBorrowRateRay),max_borrow_rate_ray:S(t.maxBorrowRateRay),max_utilization_ray:S(t.maxUtilizationRay),mid_utilization_ray:S(t.midUtilizationRay),optimal_utilization_ray:S(t.optimalUtilizationRay),reserve_factor_bps:q(t.reserveFactorBps),slope1_ray:S(t.slope1Ray),slope2_ray:S(t.slope2Ray),slope3_ray:S(t.slope3Ray)}),Pt=t=>U({asset_decimals:q(t.assetDecimals),asset_id:v(t.assetId),base_borrow_rate_ray:S(t.baseBorrowRateRay),borrow_cap:S(t.borrowCap),max_borrow_rate_ray:S(t.maxBorrowRateRay),max_utilization_ray:S(t.maxUtilizationRay),mid_utilization_ray:S(t.midUtilizationRay),optimal_utilization_ray:S(t.optimalUtilizationRay),reserve_factor_bps:q(t.reserveFactorBps),slope1_ray:S(t.slope1Ray),slope2_ray:S(t.slope2Ray),slope3_ray:S(t.slope3Ray),supply_cap:S(t.supplyCap)}),Mt=t=>U({asset_decimals:q(0),e_mode_categories:P(t.eModeCategories.map((t=>q(t)))),flashloan_fee_bps:q(t.flashloanFeeBps),is_borrowable:w(t.isBorrowable),is_collateralizable:w(t.isCollateralizable),is_flashloanable:w(t.isFlashloanable),liquidation_bonus_bps:q(t.liquidationBonusBps),liquidation_fees_bps:q(t.liquidationFeesBps),liquidation_threshold_bps:q(t.liquidationThresholdBps),loan_to_value_bps:q(t.loanToValueBps)}),Rt=t=>U({max_borrow_positions:q(t.maxBorrowPositions),max_supply_positions:q(t.maxSupplyPositions)}),Ot=t=>{const e=t.kind;switch(e){case"Stellar":return P([k("Stellar"),v(t.value)]);case"Symbol":return P([k("Symbol"),k(t.value)]);case"String":return P([k("String"),A(t.value)]);default:throw new Error(`Stellar builder: unknown oracle asset ref kind "${e}"`)}},It=(t,e)=>{if("Twap"===t){if("number"!=typeof e)throw new Error("Stellar builder: oracle source with Twap read mode requires `twapRecords`");return P([k("Twap"),q(e)])}return P([k("Spot")])},Ct=t=>{const e=t.provider;if("ReflectorSep40"===e){if(!t.asset)throw new Error("Stellar builder: Reflector oracle source requires `asset`");return P([k("Reflector"),U({asset:Ot(t.asset),contract:v(t.contract),read_mode:It(t.readMode,t.twapRecords)})])}if("RedStonePriceFeed"===e){if("string"!=typeof t.feedId)throw new Error("Stellar builder: RedStone oracle source requires `feedId`");if("number"!=typeof t.maxStaleSeconds)throw new Error("Stellar builder: RedStone oracle source requires `maxStaleSeconds`");return P([k("RedStone"),U({contract:v(t.contract),feed_id:A(t.feedId),max_stale_seconds:T(t.maxStaleSeconds)})])}throw new Error(`Stellar builder: unknown oracle provider "${e}"`)},Ut=t=>{const e=kt[t.strategy];if(void 0===e)throw new Error(`Stellar builder: unknown oracle strategy "${t.strategy}"`);return U({anchor:(o=t.anchor,P(null==o?[k("None")]:[k("Some"),Ct(o)])),max_price_stale_seconds:T(t.maxPriceStaleSeconds),max_sanity_price_wad:S(t.maxSanityPriceWad),min_sanity_price_wad:S(t.minSanityPriceWad),primary:Ct(t.primary),strategy:q(e),tolerance_bps:q(t.toleranceBps)});var o};function Lt(t,e){return G(t,"upgrade",[M(e.wasmHash)])}function $t(t,e){return G(t,"migrate",[q(e.newVersion)])}function Bt(t){return G(t,"pause",[])}function Nt(t){return G(t,"unpause",[])}function Dt(t,e){return G(t,"grant_role",[v(e.account),k(e.role)])}function Gt(t,e){return G(t,"revoke_role",[v(e.account),k(e.role)])}function zt(t,e){return G(t,"transfer_ownership",[v(e.newOwner),q(e.liveUntilLedger)])}function Vt(t){return G(t,"accept_ownership",[])}function Wt(t,e){return G(t,"set_aggregator",[v(e.aggregator)])}function jt(t,e){return G(t,"set_accumulator",[v(e.accumulator)])}function Ht(t,e){return G(t,"set_liquidity_pool_template",[M(e.wasmHash)])}function Xt(t,e){return G(t,"edit_asset_config",[v(e.asset),Mt(e.config)])}function Ft(t,e){return G(t,"set_position_limits",[Rt(e)])}function Qt(t){return G(t,"add_e_mode_category",[])}function Kt(t,e){return G(t,"remove_e_mode_category",[q(e.id)])}const Zt=t=>U({asset:v(t.asset),category_id:q(t.categoryId),can_collateral:w(t.canCollateral),can_borrow:w(t.canBorrow),ltv:q(t.ltv),threshold:q(t.threshold),bonus:q(t.bonus),supply_cap:S(t.supplyCap),borrow_cap:S(t.borrowCap)});function Jt(t,e){return G(t,"add_asset_to_e_mode_category",[Zt(e)])}function Yt(t,e){return G(t,"edit_asset_in_e_mode_category",[Zt(e)])}function te(t,e){return G(t,"update_pool_caps",[v(e.asset),S(e.supplyCap),S(e.borrowCap)])}function ee(t,e){return G(t,"remove_asset_from_e_mode",[v(e.asset),q(e.categoryId)])}function oe(t,e){return G(t,"approve_token",[v(e.token)])}function re(t,e){return G(t,"revoke_token",[v(e.token)])}function ne(t,e){return G(t,"configure_market_oracle",[v(t.caller),v(e.asset),Ut(e.config)])}function ue(t,e){return G(t,"edit_oracle_tolerance",[v(t.caller),v(e.asset),q(e.tolerance)])}function ie(t,e){return G(t,"disable_token_oracle",[v(t.caller),v(e.asset)])}function se(t,e){return G(t,"update_indexes",[v(t.caller),P(e.assets.map((t=>v(t))))])}function ae(t,e){return G(t,"renew_account",[v(t.caller),T(e.accountNonce)])}function pe(t,e){return G(t,"create_liquidity_pool",[v(e.asset),Pt(e.params),Mt(e.config)])}function le(t,e){return G(t,"upgrade_liquidity_pool_params",[v(e.asset),Et(e.params)])}function ce(t,e){return G(t,"upgrade_liquidity_pool",[v(e.asset),M(e.wasmHash)])}function de(t,e){return G(t,"claim_revenue",[v(t.caller),P(e.assets.map((t=>v(t))))])}function ye(t,e){return G(t,"add_rewards",[v(t.caller),P(e.rewards.map((t=>P([v(t.token),S(t.amount)]))))])}function be(t,e){return G(t,"update_account_threshold",[v(t.caller),v(e.asset),w(e.hasRisks),P(e.accountNonces.map((t=>T(t))))])}const fe="00".repeat(32),ge=t=>{if("string"==typeof t)return M(t);const e=Buffer.from(t);if(32!==e.length)throw new Error(`Stellar governance builder: expected a 32-byte salt (got ${e.length} bytes)`);return s.ScVal.scvBytes(e)},me=(t,...e)=>P([k(t),...e]),he=t=>U({asset:v(t.asset),category_id:q(t.categoryId),can_collateral:w(t.canCollateral),can_borrow:w(t.canBorrow),ltv:q(t.ltv),threshold:q(t.threshold),bonus:q(t.bonus),supply_cap:S(t.supplyCap),borrow_cap:S(t.borrowCap)}),_e=t=>U({new_owner:v(t.newOwner),live_until_ledger:q(t.liveUntilLedger)}),xe=t=>U({account:v(t.account),role:k(t.role)});function ve(e,n,i){const s=e.governanceAddress??_(e.network),a=new r(s),p=new t(e.caller,e.sourceSequence);return{xdr:new u(p,{fee:e.fee??o,networkPassphrase:g[e.network]}).addOperation(a.call(n,...i)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}const Se=(t,e,o)=>ve(t,"propose",[v(t.caller),e,ge(o)]),qe=(t,e,o)=>ve(t,"execute_self",[E(),e,ge(o)]);function Te(t,e,o){return Se(t,me("SetAggregator",v(e.aggregator)),o)}function we(t,e,o){return Se(t,me("SetAccumulator",v(e.accumulator)),o)}function Ae(t,e,o){return Se(t,me("SetLiquidityPoolTemplate",M(e.wasmHash)),o)}function ke(t,e,o){return Se(t,me("EditAssetConfig",v(e.asset),Mt(e.config)),o)}function Ee(t,e,o){return Se(t,me("SetPositionLimits",Rt(e)),o)}function Pe(t,e,o){return Se(t,me("SetMinBorrowCollateralUsd",S(e.floorWad)),o)}function Me(t,e){return Se(t,me("AddEModeCategory"),e)}function Re(t,e,o){return Se(t,me("RemoveEModeCategory",q(e.id)),o)}function Oe(t,e,o){return Se(t,me("AddAssetToEModeCategory",he(e)),o)}function Ie(t,e,o){return Se(t,me("EditAssetInEModeCategory",he(e)),o)}function Ce(t,e,o){return Se(t,me("UpdatePoolCaps",U({asset:v((r=e).asset),supply_cap:S(r.supplyCap),borrow_cap:S(r.borrowCap)})),o);var r}function Ue(t,e,o){return Se(t,me("RemoveAssetFromEMode",U({asset:v((r=e).asset),category_id:q(r.categoryId)})),o);var r}function Le(t,e,o){return Se(t,me("ApproveToken",v(e.token)),o)}function $e(t,e,o){return Se(t,me("RevokeToken",v(e.token)),o)}function Be(t,e,o){return Se(t,me("ApproveBlendPool",v(e.pool)),o)}function Ne(t,e,o){return Se(t,me("RevokeBlendPool",v(e.pool)),o)}function De(t,e,o){return Se(t,me("CreateLiquidityPool",U({asset:v((r=e).asset),params:Pt(r.params),config:Mt(r.config)})),o);var r}function Ge(t,e,o){return Se(t,me("UpgradeLiquidityPoolParams",U({asset:v((r=e).asset),params:Et(r.params)})),o);var r}function ze(t,e){return Se(t,me("DeployPool"),e)}function Ve(t,e,o){return Se(t,me("UpgradePool",M(e.wasmHash)),o)}function We(t,e,o){return Se(t,me("DisableTokenOracle",v(e.asset)),o)}function je(t,e,o){return Se(t,me("UpgradeController",M(e.wasmHash)),o)}function He(t,e,o){return Se(t,me("MigrateController",q(e.newVersion)),o)}function Xe(t,e,o){return Se(t,me("TransferCtrlOwnership",_e(e)),o)}function Fe(t,e,o){return Se(t,me("ConfigureMarketOracle",U({asset:v((r=e).asset),cfg:Ut(r.config)})),o);var r}function Qe(t,e,o){return Se(t,me("EditOracleTolerance",U({asset:v((r=e).asset),tolerance:q(r.tolerance)})),o);var r}function Ke(t,e,o){return Se(t,me("UpgradeGov",M(e.wasmHash)),o)}function Ze(t,e,o){return Se(t,me("UpdateGovDelay",q(e.newDelay)),o)}function Je(t,e,o){return Se(t,me("GrantGovRole",xe(e)),o)}function Ye(t,e,o){return Se(t,me("RevokeGovRole",xe(e)),o)}function to(t,e,o){return Se(t,me("TransferGovOwnership",_e(e)),o)}function eo(t,e){const o=P(e.argsXdr.map((t=>s.ScVal.fromXDR(t,"base64")))),r=ge(e.predecessor??fe);return ve(t,"execute",[E(),v(e.target),k(e.functionName),o,r,ge(e.salt)])}function oo(t,e,o){return qe(t,me("UpgradeGov",M(e.wasmHash)),o)}function ro(t,e,o){return qe(t,me("UpdateGovDelay",q(e.newDelay)),o)}function no(t,e,o){return qe(t,me("GrantGovRole",xe(e)),o)}function uo(t,e,o){return qe(t,me("RevokeGovRole",xe(e)),o)}function io(t,e,o){return qe(t,me("TransferGovOwnership",_e(e)),o)}const so=t=>t.toXDR("base64"),ao=t=>s.ScVal.fromXDR(t,"base64"),po=t=>t.map((t=>String(i(ao(t))))).join(":"),lo=t=>"bigint"==typeof t||"number"==typeof t?t.toString():String(t),co=t=>Number(t),yo=t=>String(t),bo=t=>null==t?void 0:lo(t),fo=t=>null==t?void 0:yo(t),go=t=>t instanceof Uint8Array?Buffer.from(t).toString("hex"):Buffer.isBuffer(t)?t.toString("hex"):String(t),mo=["None","Multiply","Long","Short"],ho=["Single","PrimaryWithAnchor"],_o=["ReflectorSep40","RedStonePriceFeed"],xo=["Spot","Twap"],vo=["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"],So=t=>Array.isArray(t)?t:[],qo=t=>({loanToValueBps:co(t.loan_to_value_bps),liquidationThresholdBps:co(t.liquidation_threshold_bps),liquidationBonusBps:co(t.liquidation_bonus_bps),liquidationFeesBps:co(t.liquidation_fees_bps),isCollateralizable:Boolean(t.is_collateralizable),isBorrowable:Boolean(t.is_borrowable),isFlashloanable:Boolean(t.is_flashloanable),flashloanFeeBps:co(t.flashloan_fee_bps),eModeCategories:(t.e_mode_categories??[]).map(co)}),To=(t,e)=>{const o="Borrow"===e;return{action:(r=t[0],vo[co(r)]??lo(r)),positionType:e,asset:yo(t[1]),scaledAmountRay:lo(t[2]),indexRay:lo(t[3]),amount:lo(t[4]),liquidationThresholdBps:o?void 0:co(t[5]),liquidationBonusBps:o?void 0:co(t[6]),loanToValueBps:o?void 0:co(t[7])};var r},wo=t=>{return{owner:yo(t[0]),eModeCategoryId:co(t[1]),mode:(e=t[2],mo[co(e)]??"None")};var e},Ao=(t,e)=>{const o=xo[co(t[`${e}_read_mode`])]??"Spot",r=t[`${e}_asset`],n=t[`${e}_symbol`],u=null!=r?{kind:"Stellar",value:yo(r)}:null!=n?{kind:"Symbol",value:yo(n)}:void 0;return{provider:_o[co(t[`${e}_provider`])]??"ReflectorSep40",contractAddress:yo(t[`${e}_contract`]),asset:u,feedId:fo(t[`${e}_feed_id`]),readMode:o,twapRecords:"Twap"===o?co(t[`${e}_twap_records`]):void 0,decimals:co(t[`${e}_decimals`]),resolutionSeconds:co(t[`${e}_resolution_seconds`]),maxStaleSeconds:co(t[`${e}_max_stale_seconds`])}},ko=t=>{const e=null!==t.anchor_provider&&void 0!==t.anchor_provider;return{baseTokenId:yo(t.base_token_id),quoteTokenId:yo(t.quote_token_id),tolerance:{upperRatio:co(t.upper_ratio_bps??t.tolerance?.upper_ratio_bps),lowerRatio:co(t.lower_ratio_bps??t.tolerance?.lower_ratio_bps)},assetDecimals:co(t.asset_decimals),maxPriceStaleSeconds:co(t.max_price_stale_seconds),strategy:ho[co(t.strategy)]??"Single",primary:Ao(t,"primary"),anchor:e?Ao(t,"anchor"):void 0,primaryQuoteToken:fo(t.primary_quote_token),anchorQuoteToken:fo(t.anchor_quote_token),minSanityPriceWad:bo(t.min_sanity_price_wad),maxSanityPriceWad:bo(t.max_sanity_price_wad)}},Eo={"market:create":t=>({topic:"market:create",data:{baseAsset:yo(t.base_asset),maxBorrowRate:lo(t.max_borrow_rate),baseBorrowRate:lo(t.base_borrow_rate),slope1:lo(t.slope1),slope2:lo(t.slope2),slope3:lo(t.slope3),midUtilization:lo(t.mid_utilization),optimalUtilization:lo(t.optimal_utilization),maxUtilization:bo(t.max_utilization),reserveFactor:co(t.reserve_factor),marketAddress:yo(t.market_address),config:qo(t.config)}}),"market:params_update":t=>({topic:"market:params_update",data:{asset:yo(t.asset),maxBorrowRateRay:lo(t.max_borrow_rate_ray),baseBorrowRateRay:lo(t.base_borrow_rate_ray),slope1Ray:lo(t.slope1_ray),slope2Ray:lo(t.slope2_ray),slope3Ray:lo(t.slope3_ray),midUtilizationRay:lo(t.mid_utilization_ray),optimalUtilizationRay:lo(t.optimal_utilization_ray),maxUtilizationRay:bo(t.max_utilization_ray),reserveFactorBps:co(t.reserve_factor_bps)}}),"market:batch_state_update":t=>({topic:"market:batch_state_update",data:{updates:So(t).map((t=>{return e=So(t),{asset:yo(e[0]),timestamp:co(e[1]),supplyIndexRay:lo(e[2]),borrowIndexRay:lo(e[3]),reservesRay:lo(e[4]),suppliedRay:lo(e[5]),borrowedRay:lo(e[6]),revenueRay:lo(e[7]),assetPriceWad:bo(e[8])};var e}))}}),"market:batch_params_update":t=>({topic:"market:batch_params_update",data:{updates:So(t).map((t=>{const e=t;return{asset:yo(e.asset),params:(o=e.params,{maxBorrowRateRay:lo(o.max_borrow_rate_ray),baseBorrowRateRay:lo(o.base_borrow_rate_ray),slope1Ray:lo(o.slope1_ray),slope2Ray:lo(o.slope2_ray),slope3Ray:lo(o.slope3_ray),midUtilizationRay:lo(o.mid_utilization_ray),optimalUtilizationRay:lo(o.optimal_utilization_ray),maxUtilizationRay:bo(o.max_utilization_ray),reserveFactorBps:co(o.reserve_factor_bps),supplyCap:lo(o.supply_cap),borrowCap:lo(o.borrow_cap),assetId:fo(o.asset_id),assetDecimals:void 0===o.asset_decimals?void 0:co(o.asset_decimals)})};var o}))}}),"position:batch_update":t=>{const e=So(t);return{topic:"position:batch_update",data:{accountId:lo(e[0]),accountAttributes:wo(So(e[1])),updates:[...So(e[2]).map((t=>To(So(t),"Deposit"))),...So(e[3]).map((t=>To(So(t),"Borrow")))]}}},"position:flash_loan":t=>({topic:"position:flash_loan",data:{asset:yo(t.asset),receiver:yo(t.receiver),caller:yo(t.caller),amount:lo(t.amount),fee:lo(t.fee)}}),"config:asset":t=>({topic:"config:asset",data:{asset:yo(t.asset),config:qo(t.config)}}),"config:oracle":t=>({topic:"config:oracle",data:{asset:yo(t.asset),oracle:ko(t.oracle)}}),"config:emode_category":t=>({topic:"config:emode_category",data:{category:{categoryId:co(t.category.category_id),isDeprecated:Boolean(t.category.is_deprecated)}}}),"config:emode_asset":t=>({topic:"config:emode_asset",data:{asset:yo(t.asset),config:{isCollateralizable:Boolean(t.config.is_collateralizable),isBorrowable:Boolean(t.config.is_borrowable),loanToValueBps:co(t.config.loan_to_value_bps),liquidationThresholdBps:co(t.config.liquidation_threshold_bps),liquidationBonusBps:co(t.config.liquidation_bonus_bps),supplyCap:lo(t.config.supply_cap),borrowCap:lo(t.config.borrow_cap)},categoryId:co(t.category_id)}}),"config:remove_emode_asset":t=>({topic:"config:remove_emode_asset",data:{asset:yo(t.asset),categoryId:co(t.category_id)}}),"debt:bad_debt":t=>({topic:"debt:bad_debt",data:{accountId:lo(t.account_id),totalBorrowUsdWad:lo(t.total_borrow_usd_wad),totalCollateralUsdWad:lo(t.total_collateral_usd_wad)}}),"strategy:initial_payment":t=>({topic:"strategy:initial_payment",data:{token:yo(t.token),amount:lo(t.amount),usdValueWad:lo(t.usd_value_wad),accountId:lo(t.account_id)}}),"strategy:fee":t=>({topic:"strategy:fee",data:{asset:yo(t.asset),amount:lo(t.amount),fee:lo(t.fee),amountSent:lo(t.amount_sent)}}),"config:approve_token":t=>({topic:"config:approve_token",data:{wasmHash:go(t.wasm_hash),approved:Boolean(t.approved)}}),"config:aggregator":t=>({topic:"config:aggregator",data:{aggregator:yo(t.aggregator)}}),"config:accumulator":t=>({topic:"config:accumulator",data:{accumulator:yo(t.accumulator)}}),"config:pool_template":t=>({topic:"config:pool_template",data:{wasmHash:go(t.wasm_hash)}}),"config:position_limits":t=>({topic:"config:position_limits",data:{maxSupplyPositions:co(t.max_supply_positions),maxBorrowPositions:co(t.max_borrow_positions)}}),"config:oracle_disabled":t=>({topic:"config:oracle_disabled",data:{asset:yo(t.asset)}})},Po=Object.freeze(Object.keys(Eo));function Mo(t,e){const o=po(t),r=Eo[o];return r?r(i(ao(e))):null}const Ro="XLENDXLM-a7c9f3",Oo=1e4;function Io(t){const e=BigInt(t).toString(16),o=e.length%2==0?e:`0${e}`;return`${Ro}-${o}`}function Co(t){const e=t.split("-");return e.length>=2&&parseInt(e[1],10)||0}function Uo(t,e=0){return t*Oo+e}function Lo(t){switch(t){case"liq_repay":return"lendingLiquidateRepayDebt";case"liq_seize":return"lendingLiquidateSeizeCollateral";case"param_upd":return"lendingUpdateAccountParameters";default:return"lendingUpdateAccountPosition"}}const $o=(t,e,o)=>{const r=new URL(e,t.endsWith("/")?t:`${t}/`);if(o)for(const[t,e]of Object.entries(o))void 0!==e&&r.searchParams.set(t,String(e));return r.toString()},Bo=t=>t.baseUrl??f[t.network];async function No(t,e){if(null==t.amountIn==(null==t.amountOut))throw new Error("getStellarAggregatorQuote: exactly one of `amountIn` or `amountOut` must be provided");const o=$o(Bo(e),"api/v1/quote",{from:t.from,to:t.to,amountIn:t.amountIn,amountOut:t.amountOut,maxHops:t.maxHops,maxSplits:t.maxSplits,slippage:t.slippage,includePaths:t.includePaths,sender:t.sender,router:t.router,platform:t.platform,fresh:t.fresh}),r=await fetch(o,e.fetchOptions);if(!r.ok){const t=await r.text().catch((()=>""));throw new Error(`Stellar quote server responded ${r.status} ${r.statusText} for ${o} — ${t}`)}return await r.json()}async function Do(t){const e=$o(Bo(t),"api/v1/tokens"),o=await fetch(e,t.fetchOptions);if(!o.ok){const t=await o.text().catch((()=>""));throw new Error(`Stellar quote server responded ${o.status} ${o.statusText} for ${e} — ${t}`)}return await o.json()}const Go=t=>L(t).toXDR("base64");function zo(e,n){const i=e.routerAddress??h(e.network),s=new r(i),a=new t(e.caller,e.sourceSequence),p=N(((t,e)=>(t=>Boolean(t&&"object"==typeof t&&!(t instanceof Uint8Array)&&"paths"in t))(t)&&void 0===t.referralId?{...t,referralId:e??0}:t)(n,e.referralId));return{xdr:new u(a,{fee:e.fee??o,networkPassphrase:g[e.network]}).addOperation(s.call("execute_strategy",v(e.caller),S(e.totalIn),p)).setTimeout(e.timeoutSeconds??300).build().toXDR()}}function Vo(t,e){return zo(t,e)}function Wo(t,e={}){if("string"!=typeof t.amountOutMin)throw new Error("mapQuoteResponseToStrategyPayload: quote response is missing `amountOutMin`. Pass `slippage` when fetching the quote.");return{paths:t.paths?t.paths.map((t=>({hops:t.swaps.map(Xo),splitPpm:t.splitPpm}))):[{hops:t.hops.map(Xo),splitPpm:1e6}],referralId:e.referralId??0,tokenIn:t.from,tokenOut:t.to,totalMinOut:t.amountOutMin}}function jo(t,e={}){const o=t;return"string"==typeof o.routeXdr&&o.routeXdr.length>0?{routeXdr:o.routeXdr}:Wo(t,e)}const Ho=Wo,Xo=t=>({amountOut:t.amountOut,pool:t.address,tokenIn:t.from,tokenOut:t.to,venue:t.dex});function Fo(t,e){const o=e instanceof Error?e.message:String(e);return new Error(`[xoxno-invoked:${t}] ${o}`)}async function Qo(t,e,o){const r=u.fromXDR(e,"base64");try{return(await t.prepareTransaction(r)).toXDR()}catch(t){if(o?.invokedContractId)throw Fo(o.invokedContractId,t);throw t}}async function Ko(t,e,o){return Qo(t,e.xdr,o)}function Zo(t){if(t<=0||t>4)throw new Error(`Invalid PositionMode ${t} for Stellar — expected 1 (Normal) through 4 (Short). "None" (0) has no Stellar equivalent.`);return t-1}function Jo(t,e){return{paths:[{hops:[{amountOut:"0",pool:t,tokenIn:t,tokenOut:t,venue:"Soroswap"}],splitPpm:1e6}],referralId:0,tokenIn:t,tokenOut:t,totalMinOut:e}}const Yo=t=>{const e=t.startsWith("0x")?t.slice(2):t;if(e.length%2!=0)throw new Error("buildStellarCctpForwardTx: hex input must have even length");return Buffer.from(e,"hex")};function tr(e){const o=new t(e.caller,e.sourceSequence),n=new r(e.forwarderAddress).call("mint_and_forward",s.ScVal.scvBytes(Yo(e.message)),s.ScVal.scvBytes(Yo(e.attestation)));return{xdr:new u(o,{fee:e.fee??"10000000",networkPassphrase:g[e.network]}).addOperation(n).setTimeout(e.timeoutSeconds??120).build().toXDR()}}}},p={};function l(t){var e=p[t];if(void 0!==e)return e.exports;var o=p[t]={exports:{}};return a[t](o,o.exports,l),o.exports}l.d=(t,e)=>{for(var o in e)l.o(e,o)&&!l.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},l.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const c="https://api.xoxno.com",d="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",y="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",b="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var f;!function(t){t.MAINNET="1",t.DEVNET="D"}(f||(f={}));class g{apiUrl;chain;init;config;constructor({chain:t=f.MAINNET,apiUrl:e=c,...o}={}){this.apiUrl=e??{[f.MAINNET]:c,[f.DEVNET]:"https://devnet-api.xoxno.com"}[t],this.chain=t,this.init=o,this.config=t==f.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:d,DR_SC:y,KG_SC:b,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:d,DR_SC:y,KG_SC:b,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}fetchWithTimeout=async(t,{params:e,...o}={})=>{const{next:r,cache:n,debug:u,...i}=this.init,{next:s,cache:a,debug:p,headers:l,method:c="GET",...d}=o,y=l?.Authorization,b="Bearer undefined"===y?void 0:y,f={...l,Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."PUT"===c?{}:{"Content-Type":"application/json"},...b?{Authorization:b}:{}},g=Object.entries(e??{}).flatMap((([t,e])=>Array.isArray(e)?e.map((e=>`${t}=${encodeURIComponent(e)}`)):`${t}=${encodeURIComponent(e)}`)).join("&"),m=`${this.apiUrl}${t}${g.length?`?${g}`:""}`,{revalidate:h,..._}=r??{},{revalidate:x,...v}=s??{},S="GET"!==c||b?void 0:x??h,q="GET"!==c||b||S?void 0:a??n,T={...i,...d,method:c,...Object.keys(f).length?{headers:f}:{},cache:q,next:{..._,...v,revalidate:S}};(p??u)&&console.debug("SDK fetch: ",m,T);const w=await fetch(m,T).catch((t=>{if(t instanceof Error&&!t.message.match(/^http(s?):\/\//))throw Object.assign(new Error(`${m}: ${t.message}`),{cause:t});throw t})),A=await w.text();if(!w.ok){let t;try{t=JSON.parse(A)}catch{t={message:A}}const e=[m,w.status,w.statusText,t.message].filter(Boolean).join(";;");throw new Error(e)}try{return JSON.parse(A)}catch{return A}}}const m=t=>{const e=/^0x[a-fA-F0-9]{1,64}-[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(t)),o=/^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(t);return e||o},h=t=>{const e=/^0x[a-fA-F0-9]{1,64}$/.test(t),o=/^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,7}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(t);return e||o};class _ extends Error{constructor(t){super(`Invalid collection ticker: ${t}`)}}class x extends Error{constructor(t){super(`Invalid address: ${t}`)}}Error,Error;const v=t=>!!t&&(t.startsWith("erd1")&&62===t.length||/^0x[a-fA-F0-9]{40,64}$/.test(t)||/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(t)||/^G[A-Z2-7]{55}$/.test(t)),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:{}}}},q=["PATCH","POST","DELETE","PUT"];var T=l(388);const w=t=>t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase()));function A(t,e,o,r){const{input:n,output:u,...i}=e,s=async(e={})=>{const n={...o,...e},u=t.replace(/:([a-zA-Z_]+)/g,((t,e)=>`${n[e]}`)),i=[...t.matchAll(/:([a-zA-Z_]+)/g)].map((t=>t[1])),s=Object.fromEntries(Object.entries(n).filter((([t])=>!i.includes(t)))),a=/:address[^A-Z]/.test(t)||"address"in s,p=/:collection[^A-Z]/.test(t)||"collection"in s;if(a){const t=n.address;if(!v(t))throw new x(t)}if(p){const t=n.collection;if(Array.isArray(t)?t.some((t=>!m(t))):!m(t))throw new _(t)}const l=Object.fromEntries(Object.entries(s).map((([t,e])=>[t,e instanceof FormData?e:"filter"===t||"body"===t?JSON.stringify(e):Array.isArray(e)?e.join(","):e]))),{body:c,auth:d,method:y,headers:b,cache:f,next:g,debug:h,continuationToken:S,...q}=l,T=d?`Bearer ${d}`:void 0,w={...b,...T?{Authorization:T}:{},...S?{"X-Continuation-Token":String(S)}:{}},A={...g,tags:[...g?.tags??[],u]};return r.fetchWithTimeout(u,{method:y,params:q,body:c,headers:w,cache:f,debug:h,...A?{next:A}:{}})},a=(t={})=>s(t);for(const t of Object.keys(i))q.includes(t)&&(a[t]=e=>s({...e,method:e.method??t.toUpperCase()}));return a}function k(t){const e=function(){const t={static:{},params:{},leaves:[]};for(const[e,o]of Object.entries(S)){const r=e.split("/").filter(Boolean);let n=t;for(const t of r)if(t.startsWith(":")){const e=w(t.slice(1));n=n.params[e]||={static:{},params:{},leaves:[]}}else{const e=w(t);n=n.static[e]||={static:{},params:{},leaves:[]}}n.leaves.push({rawPath:e,def:o})}return t}(),o=(e,r)=>{const n=e.leaves.length,u=Object.keys(e.static).length,i=Object.keys(e.params).length;let s;if(1===n&&u+i>0){const{rawPath:o,def:n}=e.leaves[0];s=A(o,n,r,t)}else{s={};for(const{rawPath:o,def:n}of e.leaves)s[w(o.split("/").pop().replace(/^:/,""))]=A(o,n,r,t)}for(const[t,n]of Object.entries(e.static)){const e=o(n,r);let u=e;if(e&&"object"==typeof e&&t in e&&"function"==typeof e[t]){const o=e[t],r=Object.fromEntries(Object.entries(e).filter((([e])=>e!==t)));1===o.length||(Object.assign(o,r),u=o)}void 0===s[t]?s[t]=u:"function"==typeof s[t]?Object.assign(s[t],u):"function"==typeof u?(Object.assign(u,s[t]),s[t]=u):Object.assign(s[t],u)}for(const[t,n]of Object.entries(e.params)){const e=e=>{const u=o(n,{...r,[t]:e});if(u&&"object"==typeof u&&1===Object.keys(u).length&&t in u&&"function"==typeof u[t]){const e=u[t],o=(...t)=>e(...t);return Object.assign(o,e)}return u};if(s[t]){const o=s[t];s[t]=t=>({...o(t),...e(t)})}else s[t]=e}return s};return o(e,{})}export{f as Chain,g as XOXNOClient,k as buildSdk,m as isValidCollectionTicker,h as isValidNftIdentifier};export const STELLAR_AGGREGATOR_ROUTER=T.ME;export const STELLAR_GOVERNANCE=T.nO;export const STELLAR_GOVERNANCE_ZERO_PREDECESSOR=T.G_;export const STELLAR_LENDING_CONTROLLER=T.DU;export const STELLAR_LENDING_TOPICS=T.fA;export const STELLAR_NETWORK_PASSPHRASE=T.A$;export const STELLAR_QUOTE_URL=T.J9;export const STELLAR_SOROBAN_RPC_URL=T.hS;export const SYNTHETIC_EVENT_ORDER_STRIDE=T.gR;export const XOXNO_LENDING_STELLAR_TICKER=T.Cg;export const buildSameTokenRepaySwapSteps=T.VZ;export const buildStellarAcceptOwnershipTx=T.N0;export const buildStellarAddAssetToEModeCategoryTx=T.Wc;export const buildStellarAddEModeCategoryTx=T.hu;export const buildStellarAddRewardsTx=T.B_;export const buildStellarApproveTokenTx=T.eX;export const buildStellarBatchSwapTx=T.z;export const buildStellarBorrowBatchTx=T.xD;export const buildStellarBorrowTx=T.jR;export const buildStellarCctpForwardTx=T.P2;export const buildStellarClaimRevenueTx=T.W6;export const buildStellarConfigureMarketOracleTx=T.KH;export const buildStellarCreateLiquidityPoolTx=T.se;export const buildStellarDisableTokenOracleTx=T.ln;export const buildStellarEditAssetConfigTx=T.g;export const buildStellarEditAssetInEModeCategoryTx=T.jP;export const buildStellarEditOracleToleranceTx=T.FM;export const buildStellarExecuteStrategyTx=T.yr;export const buildStellarFlashLoanTx=T.sp;export const buildStellarGovernanceExecuteGovernanceUpgradeTx=T.$9;export const buildStellarGovernanceExecuteGrantGovernanceRoleTx=T.zw;export const buildStellarGovernanceExecuteRevokeGovernanceRoleTx=T.h_;export const buildStellarGovernanceExecuteTransferGovOwnTx=T.e_;export const buildStellarGovernanceExecuteTx=T.Tk;export const buildStellarGovernanceExecuteUpdateDelayTx=T.BA;export const buildStellarGrantRoleTx=T.SX;export const buildStellarLendingIdentifier=T.UF;export const buildStellarLiquidateTx=T.Y5;export const buildStellarMigrateFromBlendTx=T.mE;export const buildStellarMigrateTx=T.xG;export const buildStellarMultiplyTx=T.s9;export const buildStellarPauseTx=T.OL;export const buildStellarProposeAddAssetToEModeTx=T.Mq;export const buildStellarProposeAddEModeCategoryTx=T.fc;export const buildStellarProposeApproveBlendPoolTx=T.kD;export const buildStellarProposeApproveTokenTx=T.Yf;export const buildStellarProposeConfigureMarketOracleTx=T.c5;export const buildStellarProposeCreateLiquidityPoolTx=T.qU;export const buildStellarProposeDeployPoolTx=T.RZ;export const buildStellarProposeDisableTokenOracleTx=T.PD;export const buildStellarProposeEditAssetConfigTx=T.cJ;export const buildStellarProposeEditAssetInEModeTx=T.vM;export const buildStellarProposeEditOracleToleranceTx=T.hF;export const buildStellarProposeGovernanceUpgradeTx=T.Qk;export const buildStellarProposeGrantGovernanceRoleTx=T.Gw;export const buildStellarProposeMigrateControllerTx=T.$K;export const buildStellarProposeRemoveAssetFromEModeTx=T.cO;export const buildStellarProposeRemoveEModeCategoryTx=T.Qy;export const buildStellarProposeRevokeBlendPoolTx=T.X7;export const buildStellarProposeRevokeGovernanceRoleTx=T.Ub;export const buildStellarProposeRevokeTokenTx=T.Dx;export const buildStellarProposeSetAccumulatorTx=T.OA;export const buildStellarProposeSetAggregatorTx=T.$U;export const buildStellarProposeSetMinBorrowCollatTx=T.ob;export const buildStellarProposeSetPoolTemplateTx=T.cY;export const buildStellarProposeSetPositionLimitsTx=T.$l;export const buildStellarProposeTransferCtrlOwnershipTx=T.VS;export const buildStellarProposeTransferGovOwnTx=T.HP;export const buildStellarProposeUpdateDelayTx=T.YQ;export const buildStellarProposeUpdatePoolCapsTx=T.mK;export const buildStellarProposeUpgradeControllerTx=T.QY;export const buildStellarProposeUpgradePoolParamsTx=T.os;export const buildStellarProposeUpgradePoolTx=T.Ko;export const buildStellarRemoveAssetFromEModeTx=T.kz;export const buildStellarRemoveEModeCategoryTx=T.Oy;export const buildStellarRenewAccountTx=T.IJ;export const buildStellarRepayBatchTx=T.nw;export const buildStellarRepayDebtWithCollateralTx=T.Pr;export const buildStellarRepayTx=T.ZE;export const buildStellarRevokeRoleTx=T.ev;export const buildStellarRevokeTokenTx=T.P8;export const buildStellarSetAccumulatorTx=T.aV;export const buildStellarSetAggregatorTx=T.p2;export const buildStellarSetLiquidityPoolTemplateTx=T.Ww;export const buildStellarSetPositionLimitsTx=T.Dy;export const buildStellarSupplyBatchTx=T.Ni;export const buildStellarSupplyTx=T.v_;export const buildStellarSwapCollateralTx=T.qD;export const buildStellarSwapDebtTx=T.qR;export const buildStellarTransferOwnershipTx=T.QJ;export const buildStellarUnpauseTx=T.bm;export const buildStellarUpdateAccountThresholdTx=T.n_;export const buildStellarUpdateIndexesTx=T.v8;export const buildStellarUpdatePoolCapsTx=T.Y_;export const buildStellarUpgradeControllerTx=T.qM;export const buildStellarUpgradeLiquidityPoolParamsTx=T.gH;export const buildStellarUpgradeLiquidityPoolTx=T.un;export const buildStellarWithdrawBatchTx=T.O3;export const buildStellarWithdrawTx=T.Gz;export const buildTx=T.pr;export const decodeStellarLendingEvent=T.Fm;export const encodeAssetConfigRaw=T.ns;export const encodeInterestRateModel=T.MB;export const encodeMarketOracleConfigInput=T.Dn;export const encodeMarketParamsRaw=T.pq;export const encodeOracleSourceConfigInput=T.ml;export const encodePositionLimits=T.Q3;export const encodeStrategyPayloadToRouteXdr=T.wf;export const extractEventOrder=T.Um;export const getStellarAccountPositions=T.xO;export const getStellarAggregatorQuote=T.Lw;export const getStellarAggregatorRouter=T.KM;export const getStellarAsset=T.mM;export const getStellarAssetGraph=T.iE;export const getStellarAssetMarkets=T.zp;export const getStellarAssetPage=T.N3;export const getStellarAssets=T.bN;export const getStellarGovernance=T.QV;export const getStellarGovernanceProposals=T.T_;export const getStellarHub=T.XI;export const getStellarHubGraph=T.Lt;export const getStellarHubs=T.KK;export const getStellarLendingContext=T.yl;export const getStellarLendingController=T.vc;export const getStellarQuoteTokens=T.CH;export const getStellarReserve=T.FI;export const getStellarReserveGraph=T.KG;export const getStellarReserveHolders=T.nW;export const getStellarReserves=T.jF;export const getStellarSpoke=T.S2;export const getStellarSpokeGraph=T.uS;export const getStellarSpokes=T.u_;export const getStellarUserActivity=T.O5;export const getStellarUserPositions=T.Av;export const mapQuoteResponseToAggregatorSwap=T.LA;export const mapQuoteResponseToStrategyPayload=T.E6;export const mapQuoteResponseToStrategySwap=T.Ds;export const mapStellarPositionActivityType=T.CU;export const prepareStellarBuiltTx=T.Vx;export const prepareStellarTxXdr=T.DL;export const stellarLendingDispatchKey=T.ON;export const stellarLendingRead=T.Hh;export const syntheticEventOrder=T.oV;export const tagStellarInvokedContractError=T.g5;export const toBase64Xdr=T.L;export const toStellarPositionMode=T.Vu;
|
package/dist/sdk/swagger.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PublicOnly, RateType, LoginAccessDto, LoginRequestDto, UserNetworkInfoDto, UserTokenInventoryResponseDto, UserProfileDoc, UserProfileEditDto, UserProfileDto, UserSettingsDoc, NotificationPreferencesPostDto, SetEmailDto, SetPhoneDto, UserBillingDetails, VerifyEmailDto, TradesilvaniaSignature, SuccessDto, CreatorProfileDto, CreatorProfileDoc, CreatorProfileEditDto, CollectionStatsFilter, CollectionStatsPaginated, CheckLikeStatusResponseDto, UserFavoriteResponseDto, TokenDataDocHydrated, XoxnoInfo, XoxnoLiquidStatsDto, AnalyticsMarketplaceUniqueUsers, ProtocolAprType, ProviderDto, DelegationDataOutput, LendingMarketProfile, LendingMarketProfileFilter, LendingMarketProfileQuery, LendingGovernanceProposalFilter, LendingGovernanceProposalQuery, LendingGovernanceProposalDoc, LendingAccountProfile, LendingIndexesDto, LendingAccountPnl, LendingAccountSummary, LendingEModeCategoryProfile, LendingMarketAnalyticsGraph, LendingStatsHistory, LendingMarketAverageGraph, LendingPositionStatus, LendingOverallStats, NftDocFilter, NftPaginated, LikeNftDto, InventorySummaryDtoHydrated, NftOfferPaginated, NftOfferDocFilter, NftOfferDocHydrated, ValueFp, TraitInfo, CollectionRanksDTO, ListingsResponseDto, NftDocHydrated, SignDataDto, SignWithdrawDto, SignAcceptGlobalOfferDto, SignMintDto, NftDocFull, CollectionProfileDoc, CollectionProfileEditDto, FloorPriceDto, PinnedCollectionDto, CollectionMintProfileDocHydrated, CollectionPinnedStatusDto, FollowCollectionDto, CollectionProfileFilter, CollectionProfilePaginated, CollectionMintProfileFilter, CollectionMintProfilePaginated, CollectionMintProfileDocWithStages, CollectionHoldersDto, CollectionHoldersExportDto, CollectionOwnerDto, CollectionStatsDocHydrated, CollectionOffersFilter, GlobalOfferPaginated, CreatorDetailsDto, ShareholderDto, StakingSummary, StakingPoolDoc, StakingEditDto, OwnedCollectionsDto, UserStakingSummaryDto, StakingCreatorDoc, StakingUserPoolNfts, StakingExploreDtoHydrated, OwnedServicesDto, FilterQueryDto, GlobalSearchResourcesPaginated, LendingNftAttributes, LendingTokenPriceDto, StellarAssetListItemDto, StellarHubListItemDto, StellarSpokeListItemDto, StellarReserveListItemDto, ReserveDto, TopHoldersDto, AssetDto, AssetPageDto, AssetMarketDto, HubDto, SpokeDto, AccountPositionsDto, StellarUserActivityItemDto, GovernanceProposalsPageDto, MarketGraphDto, SpokeGraphDto, StellarStatsHistoryDto, StellarPositionsPnlDto, StellarPositionsRankDto, UserHistoryDto, PnlByScopeDto, RevenueSeriesDto, FeeRevenueSeriesDto, ParticipantCountsDto, LiquidationsSeriesDto, LiquidationsLeaderboardDto, VolumeSeriesDto, ActiveUsersSeriesDto, HolderDistributionDto, RateSpreadSeriesDto, DefiLlamaDimensionsDto, NotificationPaginated, PushNotificationCountResponse, NotificationDoc, MobileDeviceDoc, MobileDeviceRegistrationDto, PushNotificationResponse, PushNotificationDoc, NotificationSuccessResponseDto, EventNotificationDto, CreatorMarketingNotificationDto, StellarChallengeResponseDto, Web2UserDoc, SuccessWithMessageDto, NativeWalletDto, SwitchWalletDto, Web2WalletDto, Web2UserShardsDto, NftActivityFilter, NftActivityPaginated, NftActivityDocHydrated, VolumeGraph, AnalyticsVolumeDto, UserAnalyticsDto, GlobalAnalyticsOverviewResponseDto, UserStatsDto, AirdropDtoHydrated, TransactionDetailed, TransactionProcessStatus, TransactionCostData, TransactionCreate, TransactionSendResult, ChatMessageDocHydrated, SendChatMessageDto, UserConversationPaginated, ChatMessagePaginated, GlobalConversationSummaryDto, UserBlockPaginated, WebSocketTokenDto, UserInfo, EventProfile, EventProfileCreateDto, EventProfileEditDto, EventProfileFilter, EventProfileQuery, EventRegistrationResponseDto, EventGuestRegistrationDto, EventTicketProfileDoc, EventTicketProfileCreateDto, EventTicketProfileEditDto, EventStageProfileDoc, EventStageProfileCreateDto, EventStageProfileEditDto, TicketPricesResponse, TicketCalculationRequestDto, DiscountCodeValidationResponse, EventInvitationDoc, EventInvitationCreateDto, EventInvitationFilter, EventInvitationQuery, EventInvitation, EventAcceptInvitation, EventClaimInvitationDto, EventVoucherFilter, EventVoucherQuery, EventQuestionDoc, EventQuestionCreateDto, EventQuestionEditDto, EventGuestFilter, EventGuestProfileQuery, EventGuestProfile, EventGuestExport, EventUserRole, EventUserRoleCreateDto, EventUserRoleEditDto, EventUserRoleDoc, BageQRData, TicketValidationResult, EventCheckInQR, EventVoucherDoc, EventVoucherCreateDto, EventVoucherEditDto, ManualCheckInDto, AnsweredQuestionWithDetails, EventGuestApproveDto, EventCountGroupedByCountry, EventReferralConfigDoc, EventReferralConfigCreateDto, EventReferralConfigEditDto, EventReferralConfigFilter, EventReferralConfigPaginated, EventReferralDoc, EventReferralCreateDto, EventReferralEditDto, EventReferralFilter, EventReferralPaginated, BlendUserPosition, SoroswapQuoteResponseDto, PerpOrderResponse, BarDto, SymbolInfoDto, PerpCoinExtended, PerpSpotCoinExtended, PerpCoinExtendedSlim, PerpLegalCheck, PerpSpotCoinExtendedSlim, L2BookPerpResponseSingle, TradesPerpResponseSingle, ActiveSpotAssetCtx, ActivePerpAssetCtx, PerpEvent } from '@xoxno/types';
|
|
1
|
+
import type { PublicOnly, RateType, LoginAccessDto, LoginRequestDto, UserNetworkInfoDto, UserTokenInventoryResponseDto, UserProfileDoc, UserProfileEditDto, UserProfileDto, UserSettingsDoc, NotificationPreferencesPostDto, SetEmailDto, SetPhoneDto, UserBillingDetails, VerifyEmailDto, TradesilvaniaSignature, SuccessDto, CreatorProfileDto, CreatorProfileDoc, CreatorProfileEditDto, CollectionStatsFilter, CollectionStatsPaginated, CheckLikeStatusResponseDto, UserFavoriteResponseDto, TokenDataDocHydrated, XoxnoInfo, XoxnoLiquidStatsDto, AnalyticsMarketplaceUniqueUsers, ProtocolAprType, ProviderDto, DelegationDataOutput, LendingMarketProfile, LendingMarketProfileFilter, LendingMarketProfileQuery, LendingGovernanceProposalFilter, LendingGovernanceProposalQuery, LendingGovernanceProposalDoc, LendingAccountProfile, LendingIndexesDto, LendingAccountPnl, LendingAccountSummary, LendingEModeCategoryProfile, LendingMarketAnalyticsGraph, LendingStatsHistory, LendingMarketAverageGraph, LendingPositionStatus, LendingOverallStats, NftDocFilter, NftPaginated, LikeNftDto, InventorySummaryDtoHydrated, NftOfferPaginated, NftOfferDocFilter, NftOfferDocHydrated, ValueFp, TraitInfo, CollectionRanksDTO, ListingsResponseDto, NftDocHydrated, SignDataDto, SignWithdrawDto, SignAcceptGlobalOfferDto, SignMintDto, NftDocFull, CollectionProfileDoc, CollectionProfileEditDto, FloorPriceDto, PinnedCollectionDto, CollectionMintProfileDocHydrated, CollectionPinnedStatusDto, FollowCollectionDto, CollectionProfileFilter, CollectionProfilePaginated, CollectionMintProfileFilter, CollectionMintProfilePaginated, CollectionMintProfileDocWithStages, CollectionHoldersDto, CollectionHoldersExportDto, CollectionOwnerDto, CollectionStatsDocHydrated, CollectionOffersFilter, GlobalOfferPaginated, CreatorDetailsDto, ShareholderDto, StakingSummary, StakingPoolDoc, StakingEditDto, OwnedCollectionsDto, UserStakingSummaryDto, StakingCreatorDoc, StakingUserPoolNfts, StakingExploreDtoHydrated, OwnedServicesDto, FilterQueryDto, GlobalSearchResourcesPaginated, LendingNftAttributes, LendingTokenPriceDto, StellarAssetListItemDto, StellarLendingContextDto, StellarHubListItemDto, StellarSpokeListItemDto, StellarReserveListItemDto, ReserveDto, TopHoldersDto, AssetDto, AssetPageDto, AssetMarketDto, HubDto, SpokeDto, AccountPositionsDto, StellarUserActivityItemDto, GovernanceProposalsPageDto, MarketGraphDto, SpokeGraphDto, StellarStatsHistoryDto, StellarPositionsPnlDto, StellarPositionsRankDto, UserHistoryDto, PnlByScopeDto, RevenueSeriesDto, FeeRevenueSeriesDto, ParticipantCountsDto, LiquidationsSeriesDto, LiquidationsLeaderboardDto, VolumeSeriesDto, ActiveUsersSeriesDto, HolderDistributionDto, RateSpreadSeriesDto, DefiLlamaDimensionsDto, NotificationPaginated, PushNotificationCountResponse, NotificationDoc, MobileDeviceDoc, MobileDeviceRegistrationDto, PushNotificationResponse, PushNotificationDoc, NotificationSuccessResponseDto, EventNotificationDto, CreatorMarketingNotificationDto, StellarChallengeResponseDto, Web2UserDoc, SuccessWithMessageDto, NativeWalletDto, SwitchWalletDto, Web2WalletDto, Web2UserShardsDto, NftActivityFilter, NftActivityPaginated, NftActivityDocHydrated, VolumeGraph, AnalyticsVolumeDto, UserAnalyticsDto, GlobalAnalyticsOverviewResponseDto, UserStatsDto, AirdropDtoHydrated, TransactionDetailed, TransactionProcessStatus, TransactionCostData, TransactionCreate, TransactionSendResult, ChatMessageDocHydrated, SendChatMessageDto, UserConversationPaginated, ChatMessagePaginated, GlobalConversationSummaryDto, UserBlockPaginated, WebSocketTokenDto, UserInfo, EventProfile, EventProfileCreateDto, EventProfileEditDto, EventProfileFilter, EventProfileQuery, EventRegistrationResponseDto, EventGuestRegistrationDto, EventTicketProfileDoc, EventTicketProfileCreateDto, EventTicketProfileEditDto, EventStageProfileDoc, EventStageProfileCreateDto, EventStageProfileEditDto, TicketPricesResponse, TicketCalculationRequestDto, DiscountCodeValidationResponse, EventInvitationDoc, EventInvitationCreateDto, EventInvitationFilter, EventInvitationQuery, EventInvitation, EventAcceptInvitation, EventClaimInvitationDto, EventVoucherFilter, EventVoucherQuery, EventQuestionDoc, EventQuestionCreateDto, EventQuestionEditDto, EventGuestFilter, EventGuestProfileQuery, EventGuestProfile, EventGuestExport, EventUserRole, EventUserRoleCreateDto, EventUserRoleEditDto, EventUserRoleDoc, BageQRData, TicketValidationResult, EventCheckInQR, EventVoucherDoc, EventVoucherCreateDto, EventVoucherEditDto, ManualCheckInDto, AnsweredQuestionWithDetails, EventGuestApproveDto, EventCountGroupedByCountry, EventReferralConfigDoc, EventReferralConfigCreateDto, EventReferralConfigEditDto, EventReferralConfigFilter, EventReferralConfigPaginated, EventReferralDoc, EventReferralCreateDto, EventReferralEditDto, EventReferralFilter, EventReferralPaginated, BlendUserPosition, SoroswapQuoteResponseDto, PerpOrderResponse, BarDto, SymbolInfoDto, PerpCoinExtended, PerpSpotCoinExtended, PerpCoinExtendedSlim, PerpLegalCheck, PerpSpotCoinExtendedSlim, L2BookPerpResponseSingle, TradesPerpResponseSingle, ActiveSpotAssetCtx, ActivePerpAssetCtx, PerpEvent } from '@xoxno/types';
|
|
2
2
|
import type { ActivityChain, TokenCategory, LendingPositionOrderByColumn, KustoOrderDirection, OfferType, StakingStatus, UserStatsOrderByColumn } from '@xoxno/types/enums';
|
|
3
3
|
export declare const endpoints: {
|
|
4
4
|
readonly "/liquid/xoxno/rate": {
|
|
@@ -908,6 +908,10 @@ export declare const endpoints: {
|
|
|
908
908
|
readonly input: {};
|
|
909
909
|
readonly output: StellarAssetListItemDto[];
|
|
910
910
|
};
|
|
911
|
+
readonly "/stellar-lending/context": {
|
|
912
|
+
readonly input: {};
|
|
913
|
+
readonly output: StellarLendingContextDto;
|
|
914
|
+
};
|
|
911
915
|
readonly "/stellar-lending/hubs": {
|
|
912
916
|
readonly input: {};
|
|
913
917
|
readonly output: StellarHubListItemDto[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xoxno/sdk-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.176",
|
|
4
4
|
"description": "The SDK to interact with the XOXNO Protocol!",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"dependencies": {
|
|
115
115
|
"@multiversx/sdk-core": "^15.3.2",
|
|
116
116
|
"@multiversx/sdk-network-providers": "^2.9.3",
|
|
117
|
-
"@xoxno/types": "1.0.
|
|
117
|
+
"@xoxno/types": "1.0.452"
|
|
118
118
|
},
|
|
119
119
|
"peerDependencies": {
|
|
120
120
|
"@stellar/stellar-sdk": ">=15.0.0 <17.0.0"
|