@xoxno/sdk-js 1.0.119 → 1.0.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.bundled.d.cts +88 -38
- package/dist/index.bundled.d.ts +88 -38
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/sdk/stellar/__tests__/swap.test.d.ts +1 -0
- package/dist/sdk/stellar/contracts.d.ts +3 -2
- package/dist/sdk/stellar/lending.d.ts +16 -13
- package/dist/sdk/stellar/scval-encode.d.ts +49 -13
- package/dist/sdk/stellar/swap.d.ts +47 -32
- package/package.json +1 -1
package/dist/index.bundled.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
3
|
import { xdr } from '@stellar/stellar-sdk';
|
|
4
|
-
import { ActivePerpAssetCtx, ActiveSpotAssetCtx,
|
|
4
|
+
import { ActivePerpAssetCtx, ActiveSpotAssetCtx, AirdropDtoHydrated, AnalyticsMarketplaceUniqueUsers, AnalyticsVolumeDto, AnsweredQuestionWithDetails, AssetConfigRawDto, BageQRData, BarDto, BorrowArgs, ChatMessageDocHydrated, ChatMessagePaginated, CheckLikeStatusResponseDto, CollectionHoldersDto, CollectionHoldersExportDto, CollectionMintProfileDocHydrated, CollectionMintProfileDocWithStages, CollectionMintProfileFilter, CollectionMintProfilePaginated, CollectionOffersFilter, CollectionOwnerDto, CollectionPinnedStatusDto, CollectionProfileDoc, CollectionProfileEditDto, CollectionProfileFilter, CollectionProfilePaginated, CollectionRanksDTO, CollectionStatsDocHydrated, CollectionStatsFilter, CollectionStatsPaginated, CreatorDetailsDto, CreatorMarketingNotificationDto, CreatorProfileDoc, CreatorProfileDto, CreatorProfileEditDto, DelegationDataOutput, DiscountCodeValidationResponse, EventAcceptInvitation, EventCheckInQR, EventClaimInvitationDto, EventCountGroupedByCountry, EventGuestApproveDto, EventGuestExport, EventGuestFilter, EventGuestProfile, EventGuestProfileQuery, EventGuestRegistrationDto, EventInvitation, EventInvitationCreateDto, EventInvitationDoc, EventInvitationFilter, EventInvitationQuery, EventNotificationDto, EventProfile, EventProfileCreateDto, EventProfileEditDto, EventProfileFilter, EventProfileQuery, EventQuestionCreateDto, EventQuestionDoc, EventQuestionEditDto, EventReferralConfigCreateDto, EventReferralConfigDoc, EventReferralConfigEditDto, EventReferralConfigFilter, EventReferralConfigPaginated, EventReferralCreateDto, EventReferralDoc, EventReferralEditDto, EventReferralFilter, EventReferralPaginated, EventRegistrationResponseDto, EventStageProfileCreateDto, EventStageProfileDoc, EventStageProfileEditDto, EventTicketProfileCreateDto, EventTicketProfileDoc, EventTicketProfileEditDto, EventUserRole, EventUserRoleCreateDto, EventUserRoleDoc, EventUserRoleEditDto, EventVoucherCreateDto, EventVoucherDoc, EventVoucherEditDto, EventVoucherFilter, EventVoucherQuery, FilterQueryDto, FlashLoanArgs, FloorPriceDto, FollowCollectionDto, GlobalAnalyticsOverviewResponseDto, GlobalConversationSummaryDto, GlobalOfferPaginated, GlobalSearchResourcesPaginated, InterestRateModelDto, InventorySummaryDtoHydrated, L2BookPerpResponseSingle, LendingAccountPnl, LendingAccountProfile, LendingAccountSummary, LendingEModeCategoryProfile, LendingIndexesDto, LendingMarketAnalyticsGraph, LendingMarketAverageGraph, LendingMarketProfile, LendingMarketProfileFilter, LendingMarketProfileQuery, LendingNftAttributes, LendingOverallStats, LendingPositionStatus, LendingTokenPriceDto, LikeNftDto, LiquidateArgs, ListingsResponseDto, LoginAccessDto, LoginRequestDto, ManualCheckInDto, MarketOracleConfigInputDto, MarketParamsRawDto, MobileDeviceDoc, MobileDeviceRegistrationDto, MultiplyArgs, NativeWalletDto, NftActivityDocHydrated, NftActivityFilter, NftActivityPaginated, NftDocFilter, NftDocFull, NftDocHydrated, NftOfferDocFilter, NftOfferDocHydrated, NftOfferPaginated, NftPaginated, NotificationDoc, NotificationPaginated, NotificationPreferencesPostDto, NotificationSuccessResponseDto, OracleSourceConfigInputDto, OwnedCollectionsDto, OwnedServicesDto, PerpCoinExtended, PerpCoinExtendedSlim, PerpEvent, PerpLegalCheck, PerpOrderResponse, PerpSpotCoinExtended, PerpSpotCoinExtendedSlim, PinnedCollectionDto, PositionLimitsDto, ProtocolAprType, ProviderDto, PublicOnly, PushNotificationCountResponse, PushNotificationDoc, PushNotificationResponse, RateType, RepayArgs, RepayDebtWithCollateralArgs, SendChatMessageDto, SetEmailDto, SetPhoneDto, ShareholderDto, SignAcceptGlobalOfferDto, SignDataDto, SignMintDto, SignWithdrawDto, SoroswapQuoteResponseDto, StakingCreatorDoc, StakingEditDto, StakingExploreDtoHydrated, StakingPoolDoc, StakingSummary, StakingUserPoolNfts, StellarAggregatorQuoteRequestDto, StellarAggregatorQuoteResponseDto, StellarChallengeResponseDto, StellarLendingDecodedEvent, StellarTokenKind, SuccessDto, SuccessWithMessageDto, SupplyArgs, SwapCollateralArgs, SwapDebtArgs, SwitchWalletDto, SymbolInfoDto, TicketCalculationRequestDto, TicketPricesResponse, TicketValidationResult, TokenDataDocHydrated, TradesPerpResponseSingle, TradesilvaniaSignature, TraitInfo, TransactionCostData, TransactionCreate, TransactionDetailed, TransactionProcessStatus, TransactionSendResult, UserAnalyticsDto, UserBillingDetails, UserBlockPaginated, UserConversationPaginated, UserFavoriteResponseDto, UserInfo, UserNetworkInfoDto, UserProfileDoc, UserProfileDto, UserProfileEditDto, UserSettingsDoc, UserStakingSummaryDto, UserStatsDto, UserTokenInventoryResponseDto, ValueFp, VerifyEmailDto, VolumeGraph, Web2UserDoc, Web2UserShardsDto, Web2WalletDto, WebSocketTokenDto, WithdrawArgs, XoxnoInfo, XoxnoLiquidStatsDto } from '@xoxno/types';
|
|
5
5
|
import { ActivityChain, KustoOrderDirection, LendingPositionOrderByColumn, OfferType, StakingStatus, TokenCategory, UserStatsOrderByColumn } from '@xoxno/types/enums';
|
|
6
6
|
|
|
7
7
|
export type SafeHeaders = Record<string, string> & {
|
|
@@ -2093,7 +2093,8 @@ export type StellarNetwork = "mainnet" | "testnet";
|
|
|
2093
2093
|
export declare const STELLAR_LENDING_CONTROLLER: Record<StellarNetwork, string>;
|
|
2094
2094
|
/**
|
|
2095
2095
|
* Stellar aggregator router contract addresses per network.
|
|
2096
|
-
* Targets `
|
|
2096
|
+
* Targets `execute_strategy(sender, total_in, swap_xdr)` for direct
|
|
2097
|
+
* (non-lending) swaps.
|
|
2097
2098
|
* Env vars:
|
|
2098
2099
|
* - STELLAR_AGGREGATOR_ROUTER_MAINNET
|
|
2099
2100
|
* - STELLAR_AGGREGATOR_ROUTER_TESTNET
|
|
@@ -2126,9 +2127,42 @@ export declare const STELLAR_NETWORK_PASSPHRASE: Record<StellarNetwork, string>;
|
|
|
2126
2127
|
export declare function getStellarLendingController(network: StellarNetwork): string;
|
|
2127
2128
|
/**
|
|
2128
2129
|
* Assert an aggregator router address is configured for the target network.
|
|
2129
|
-
* Used by `
|
|
2130
|
+
* Used by `buildStellarExecuteStrategyTx` for direct user -> router swaps.
|
|
2130
2131
|
*/
|
|
2131
2132
|
export declare function getStellarAggregatorRouter(network: StellarNetwork): string;
|
|
2133
|
+
declare const STELLAR_SWAP_VENUES: readonly [
|
|
2134
|
+
"Soroswap",
|
|
2135
|
+
"Aquarius",
|
|
2136
|
+
"Phoenix",
|
|
2137
|
+
"Sushi",
|
|
2138
|
+
"CometDex"
|
|
2139
|
+
];
|
|
2140
|
+
export type StellarSwapVenue = (typeof STELLAR_SWAP_VENUES)[number];
|
|
2141
|
+
export interface StellarStrategySwapHopInput {
|
|
2142
|
+
amountOut: string;
|
|
2143
|
+
pool: string;
|
|
2144
|
+
tokenIn: string;
|
|
2145
|
+
tokenOut: string;
|
|
2146
|
+
venue: StellarSwapVenue;
|
|
2147
|
+
}
|
|
2148
|
+
export interface StellarStrategySwapPathInput {
|
|
2149
|
+
hops: StellarStrategySwapHopInput[];
|
|
2150
|
+
splitPpm: number;
|
|
2151
|
+
}
|
|
2152
|
+
export interface StellarStrategyPayloadInput {
|
|
2153
|
+
paths: StellarStrategySwapPathInput[];
|
|
2154
|
+
referralId?: number | string;
|
|
2155
|
+
tokenIn: string;
|
|
2156
|
+
tokenOut: string;
|
|
2157
|
+
totalMinOut: string;
|
|
2158
|
+
}
|
|
2159
|
+
export type StellarStrategySwapInput = string | Uint8Array | {
|
|
2160
|
+
routeXdr: string;
|
|
2161
|
+
} | {
|
|
2162
|
+
swapXdr: string;
|
|
2163
|
+
} | {
|
|
2164
|
+
bytes: string | Uint8Array;
|
|
2165
|
+
} | StellarStrategyPayloadInput;
|
|
2132
2166
|
/**
|
|
2133
2167
|
* Stellar `G...` public key of the caller (tx source account).
|
|
2134
2168
|
*/
|
|
@@ -2163,14 +2197,15 @@ export interface BuiltStellarTx {
|
|
|
2163
2197
|
* `MultiplyArgs.steps`, `SwapDebtArgs.steps`, `SwapCollateralArgs.steps`, and
|
|
2164
2198
|
* `RepayDebtWithCollateralArgs.steps`.
|
|
2165
2199
|
*
|
|
2166
|
-
* `@xoxno/types` declares `steps: unknown` on these DTOs so every chain owns
|
|
2167
|
-
* own encoding. On Stellar, callers
|
|
2168
|
-
*
|
|
2200
|
+
* `@xoxno/types` declares `steps: unknown` on these DTOs so every chain owns
|
|
2201
|
+
* its own encoding. On Stellar, callers pass opaque aggregator strategy bytes,
|
|
2202
|
+
* normally the quote response `routeXdr` (base64 ScVal XDR) or `{ routeXdr }`.
|
|
2203
|
+
* The lending controller forwards those bytes to the aggregator and does not
|
|
2204
|
+
* decode the aggregator route.
|
|
2169
2205
|
*/
|
|
2170
|
-
export type StellarSwapStepsInput =
|
|
2171
|
-
export type StellarSwapHopInput =
|
|
2172
|
-
export type StellarSwapPathInput =
|
|
2173
|
-
export type StellarSwapVenue = SwapVenue;
|
|
2206
|
+
export type StellarSwapStepsInput = StellarStrategySwapInput;
|
|
2207
|
+
export type StellarSwapHopInput = StellarStrategySwapHopInput;
|
|
2208
|
+
export type StellarSwapPathInput = StellarStrategySwapPathInput;
|
|
2174
2209
|
/**
|
|
2175
2210
|
* Assemble an unsigned XDR that invokes a single Soroban contract method.
|
|
2176
2211
|
*
|
|
@@ -2209,8 +2244,8 @@ export declare function buildStellarFlashLoanTx(opts: StellarBuilderOptions, arg
|
|
|
2209
2244
|
/**
|
|
2210
2245
|
* multiply(caller, account_id, e_mode_category, collateral_token,
|
|
2211
2246
|
* debt_to_flash_loan: i128, debt_token, mode: PositionMode,
|
|
2212
|
-
* swap:
|
|
2213
|
-
* convert_swap: Option<
|
|
2247
|
+
* swap: Bytes, initial_payment: Option<(Address, i128)>,
|
|
2248
|
+
* convert_swap: Option<Bytes>) -> u64
|
|
2214
2249
|
*
|
|
2215
2250
|
* `mode` is a repr(u32) `PositionMode` → encoded as `scvU32`. The two trailing
|
|
2216
2251
|
* `Option`s seed an optional initial collateral payment and a secondary swap
|
|
@@ -2219,18 +2254,18 @@ export declare function buildStellarFlashLoanTx(opts: StellarBuilderOptions, arg
|
|
|
2219
2254
|
export declare function buildStellarMultiplyTx(opts: StellarBuilderOptions, args: MultiplyArgs): BuiltStellarTx;
|
|
2220
2255
|
/**
|
|
2221
2256
|
* swap_debt(caller, account_id, existing_debt_token, new_debt_amount: i128,
|
|
2222
|
-
* new_debt_token, steps:
|
|
2257
|
+
* new_debt_token, steps: Bytes)
|
|
2223
2258
|
*/
|
|
2224
2259
|
export declare function buildStellarSwapDebtTx(opts: StellarBuilderOptions, args: SwapDebtArgs): BuiltStellarTx;
|
|
2225
2260
|
/**
|
|
2226
2261
|
* swap_collateral(caller, account_id, current_collateral, from_amount: i128,
|
|
2227
|
-
* new_collateral, steps:
|
|
2262
|
+
* new_collateral, steps: Bytes)
|
|
2228
2263
|
*/
|
|
2229
2264
|
export declare function buildStellarSwapCollateralTx(opts: StellarBuilderOptions, args: SwapCollateralArgs): BuiltStellarTx;
|
|
2230
2265
|
/**
|
|
2231
2266
|
* repay_debt_with_collateral(caller, account_id, collateral_token,
|
|
2232
2267
|
* collateral_amount: i128, debt_token,
|
|
2233
|
-
* steps:
|
|
2268
|
+
* steps: Bytes, close_position: bool)
|
|
2234
2269
|
*/
|
|
2235
2270
|
export declare function buildStellarRepayDebtWithCollateralTx(opts: StellarBuilderOptions, args: RepayDebtWithCollateralArgs): BuiltStellarTx;
|
|
2236
2271
|
/** `InterestRateModel` — 8 RAY rates + reserve factor bps. */
|
|
@@ -2500,46 +2535,61 @@ export declare function getStellarAggregatorQuote(request: StellarAggregatorQuot
|
|
|
2500
2535
|
* pickers or validate that a user-supplied token has on-chain liquidity.
|
|
2501
2536
|
*/
|
|
2502
2537
|
export declare function getStellarQuoteTokens(opts: StellarQuoteFetchOptions): Promise<StellarQuoteToken[]>;
|
|
2503
|
-
export
|
|
2538
|
+
export type StellarStrategyPayload = StellarStrategyPayloadInput;
|
|
2539
|
+
export type StellarStrategySwap = StellarStrategySwapInput;
|
|
2540
|
+
export type StellarStrategySwapHop = StellarStrategySwapHopInput;
|
|
2541
|
+
export type StellarStrategySwapPath = StellarStrategySwapPathInput;
|
|
2542
|
+
export interface StellarExecuteStrategyBuilderOptions extends StellarBuilderOptions {
|
|
2504
2543
|
/**
|
|
2505
2544
|
* Override the resolved aggregator router contract address. Normally
|
|
2506
2545
|
* resolved from `STELLAR_AGGREGATOR_ROUTER[network]`.
|
|
2507
2546
|
*/
|
|
2508
2547
|
routerAddress?: string;
|
|
2509
2548
|
/**
|
|
2510
|
-
* Total input amount
|
|
2511
|
-
*
|
|
2512
|
-
* allocations are derived inside the router from each path's
|
|
2513
|
-
* `splitPpm`. For a quote-derived swap, pass `quote.amountIn`.
|
|
2549
|
+
* Total input amount passed to `execute_strategy` (i128 decimal string).
|
|
2550
|
+
* For a quote-derived swap, pass `quote.amountIn`.
|
|
2514
2551
|
*/
|
|
2515
2552
|
totalIn: string;
|
|
2516
2553
|
/**
|
|
2517
|
-
* Referral identifier
|
|
2518
|
-
*
|
|
2519
|
-
*
|
|
2520
|
-
* router reverts at execution.
|
|
2554
|
+
* Referral identifier used only when the `swap` input is a decoded
|
|
2555
|
+
* `StrategyPayload` object and does not already include `referralId`.
|
|
2556
|
+
* Quote `routeXdr` already contains the referral chosen by the quote server.
|
|
2521
2557
|
*/
|
|
2522
2558
|
referralId?: number | string;
|
|
2523
2559
|
}
|
|
2560
|
+
/** @deprecated Use `StellarExecuteStrategyBuilderOptions`. */
|
|
2561
|
+
export interface StellarBatchSwapBuilderOptions extends StellarExecuteStrategyBuilderOptions {
|
|
2562
|
+
}
|
|
2563
|
+
export declare const encodeStrategyPayloadToRouteXdr: (payload: StellarStrategyPayloadInput) => string;
|
|
2524
2564
|
/**
|
|
2525
|
-
* Build an unsigned XDR for a direct user
|
|
2565
|
+
* Build an unsigned XDR for a direct user -> aggregator router swap.
|
|
2526
2566
|
*
|
|
2527
|
-
*
|
|
2528
|
-
*
|
|
2529
|
-
*
|
|
2530
|
-
* calling this. `opts.totalIn` is the authoritative input amount.
|
|
2567
|
+
* Pass the quote response `routeXdr` string or `{ routeXdr }` directly when
|
|
2568
|
+
* available. Decoded `StrategyPayload` objects are accepted for local tests and
|
|
2569
|
+
* custom route builders.
|
|
2531
2570
|
*/
|
|
2532
|
-
export declare function
|
|
2571
|
+
export declare function buildStellarExecuteStrategyTx(opts: StellarExecuteStrategyBuilderOptions, swap: StellarStrategySwapInput): BuiltStellarTx;
|
|
2533
2572
|
/**
|
|
2534
|
-
*
|
|
2535
|
-
*
|
|
2536
|
-
* server; the single-path fallback (when `paths` is omitted) gets the
|
|
2537
|
-
* full 1_000_000 weight.
|
|
2538
|
-
*
|
|
2539
|
-
* Throws if `amountOutMin` is missing — the controller refuses
|
|
2540
|
-
* unbounded swaps so the SDK rejects them at the boundary.
|
|
2573
|
+
* @deprecated The router no longer exposes `batch_execute`; this wrapper now
|
|
2574
|
+
* builds `execute_strategy(sender, total_in, swap_xdr)`.
|
|
2541
2575
|
*/
|
|
2542
|
-
export declare function
|
|
2576
|
+
export declare function buildStellarBatchSwapTx(opts: StellarBatchSwapBuilderOptions, swap: StellarStrategySwapInput): BuiltStellarTx;
|
|
2577
|
+
/**
|
|
2578
|
+
* Translate a quote-server response into the decoded `StrategyPayload` shape.
|
|
2579
|
+
* Prefer `mapQuoteResponseToStrategySwap` when the quote includes `routeXdr`.
|
|
2580
|
+
*/
|
|
2581
|
+
export declare function mapQuoteResponseToStrategyPayload(quote: StellarAggregatorQuoteResponseDto, opts?: {
|
|
2582
|
+
referralId?: number | string;
|
|
2583
|
+
}): StellarStrategyPayloadInput;
|
|
2584
|
+
/**
|
|
2585
|
+
* Return the executable quote route when the API provided it; otherwise build
|
|
2586
|
+
* the decoded fallback payload from hop/path fields.
|
|
2587
|
+
*/
|
|
2588
|
+
export declare function mapQuoteResponseToStrategySwap(quote: StellarAggregatorQuoteResponseDto, opts?: {
|
|
2589
|
+
referralId?: number | string;
|
|
2590
|
+
}): StellarStrategySwapInput;
|
|
2591
|
+
/** @deprecated Use `mapQuoteResponseToStrategyPayload`. */
|
|
2592
|
+
export declare const mapQuoteResponseToAggregatorSwap: typeof mapQuoteResponseToStrategyPayload;
|
|
2543
2593
|
export declare function buildSdk(client: XOXNOClient): SDK;
|
|
2544
2594
|
|
|
2545
2595
|
export {};
|
package/dist/index.bundled.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
3
|
import { xdr } from '@stellar/stellar-sdk';
|
|
4
|
-
import { ActivePerpAssetCtx, ActiveSpotAssetCtx,
|
|
4
|
+
import { ActivePerpAssetCtx, ActiveSpotAssetCtx, AirdropDtoHydrated, AnalyticsMarketplaceUniqueUsers, AnalyticsVolumeDto, AnsweredQuestionWithDetails, AssetConfigRawDto, BageQRData, BarDto, BorrowArgs, ChatMessageDocHydrated, ChatMessagePaginated, CheckLikeStatusResponseDto, CollectionHoldersDto, CollectionHoldersExportDto, CollectionMintProfileDocHydrated, CollectionMintProfileDocWithStages, CollectionMintProfileFilter, CollectionMintProfilePaginated, CollectionOffersFilter, CollectionOwnerDto, CollectionPinnedStatusDto, CollectionProfileDoc, CollectionProfileEditDto, CollectionProfileFilter, CollectionProfilePaginated, CollectionRanksDTO, CollectionStatsDocHydrated, CollectionStatsFilter, CollectionStatsPaginated, CreatorDetailsDto, CreatorMarketingNotificationDto, CreatorProfileDoc, CreatorProfileDto, CreatorProfileEditDto, DelegationDataOutput, DiscountCodeValidationResponse, EventAcceptInvitation, EventCheckInQR, EventClaimInvitationDto, EventCountGroupedByCountry, EventGuestApproveDto, EventGuestExport, EventGuestFilter, EventGuestProfile, EventGuestProfileQuery, EventGuestRegistrationDto, EventInvitation, EventInvitationCreateDto, EventInvitationDoc, EventInvitationFilter, EventInvitationQuery, EventNotificationDto, EventProfile, EventProfileCreateDto, EventProfileEditDto, EventProfileFilter, EventProfileQuery, EventQuestionCreateDto, EventQuestionDoc, EventQuestionEditDto, EventReferralConfigCreateDto, EventReferralConfigDoc, EventReferralConfigEditDto, EventReferralConfigFilter, EventReferralConfigPaginated, EventReferralCreateDto, EventReferralDoc, EventReferralEditDto, EventReferralFilter, EventReferralPaginated, EventRegistrationResponseDto, EventStageProfileCreateDto, EventStageProfileDoc, EventStageProfileEditDto, EventTicketProfileCreateDto, EventTicketProfileDoc, EventTicketProfileEditDto, EventUserRole, EventUserRoleCreateDto, EventUserRoleDoc, EventUserRoleEditDto, EventVoucherCreateDto, EventVoucherDoc, EventVoucherEditDto, EventVoucherFilter, EventVoucherQuery, FilterQueryDto, FlashLoanArgs, FloorPriceDto, FollowCollectionDto, GlobalAnalyticsOverviewResponseDto, GlobalConversationSummaryDto, GlobalOfferPaginated, GlobalSearchResourcesPaginated, InterestRateModelDto, InventorySummaryDtoHydrated, L2BookPerpResponseSingle, LendingAccountPnl, LendingAccountProfile, LendingAccountSummary, LendingEModeCategoryProfile, LendingIndexesDto, LendingMarketAnalyticsGraph, LendingMarketAverageGraph, LendingMarketProfile, LendingMarketProfileFilter, LendingMarketProfileQuery, LendingNftAttributes, LendingOverallStats, LendingPositionStatus, LendingTokenPriceDto, LikeNftDto, LiquidateArgs, ListingsResponseDto, LoginAccessDto, LoginRequestDto, ManualCheckInDto, MarketOracleConfigInputDto, MarketParamsRawDto, MobileDeviceDoc, MobileDeviceRegistrationDto, MultiplyArgs, NativeWalletDto, NftActivityDocHydrated, NftActivityFilter, NftActivityPaginated, NftDocFilter, NftDocFull, NftDocHydrated, NftOfferDocFilter, NftOfferDocHydrated, NftOfferPaginated, NftPaginated, NotificationDoc, NotificationPaginated, NotificationPreferencesPostDto, NotificationSuccessResponseDto, OracleSourceConfigInputDto, OwnedCollectionsDto, OwnedServicesDto, PerpCoinExtended, PerpCoinExtendedSlim, PerpEvent, PerpLegalCheck, PerpOrderResponse, PerpSpotCoinExtended, PerpSpotCoinExtendedSlim, PinnedCollectionDto, PositionLimitsDto, ProtocolAprType, ProviderDto, PublicOnly, PushNotificationCountResponse, PushNotificationDoc, PushNotificationResponse, RateType, RepayArgs, RepayDebtWithCollateralArgs, SendChatMessageDto, SetEmailDto, SetPhoneDto, ShareholderDto, SignAcceptGlobalOfferDto, SignDataDto, SignMintDto, SignWithdrawDto, SoroswapQuoteResponseDto, StakingCreatorDoc, StakingEditDto, StakingExploreDtoHydrated, StakingPoolDoc, StakingSummary, StakingUserPoolNfts, StellarAggregatorQuoteRequestDto, StellarAggregatorQuoteResponseDto, StellarChallengeResponseDto, StellarLendingDecodedEvent, StellarTokenKind, SuccessDto, SuccessWithMessageDto, SupplyArgs, SwapCollateralArgs, SwapDebtArgs, SwitchWalletDto, SymbolInfoDto, TicketCalculationRequestDto, TicketPricesResponse, TicketValidationResult, TokenDataDocHydrated, TradesPerpResponseSingle, TradesilvaniaSignature, TraitInfo, TransactionCostData, TransactionCreate, TransactionDetailed, TransactionProcessStatus, TransactionSendResult, UserAnalyticsDto, UserBillingDetails, UserBlockPaginated, UserConversationPaginated, UserFavoriteResponseDto, UserInfo, UserNetworkInfoDto, UserProfileDoc, UserProfileDto, UserProfileEditDto, UserSettingsDoc, UserStakingSummaryDto, UserStatsDto, UserTokenInventoryResponseDto, ValueFp, VerifyEmailDto, VolumeGraph, Web2UserDoc, Web2UserShardsDto, Web2WalletDto, WebSocketTokenDto, WithdrawArgs, XoxnoInfo, XoxnoLiquidStatsDto } from '@xoxno/types';
|
|
5
5
|
import { ActivityChain, KustoOrderDirection, LendingPositionOrderByColumn, OfferType, StakingStatus, TokenCategory, UserStatsOrderByColumn } from '@xoxno/types/enums';
|
|
6
6
|
|
|
7
7
|
export type SafeHeaders = Record<string, string> & {
|
|
@@ -2093,7 +2093,8 @@ export type StellarNetwork = "mainnet" | "testnet";
|
|
|
2093
2093
|
export declare const STELLAR_LENDING_CONTROLLER: Record<StellarNetwork, string>;
|
|
2094
2094
|
/**
|
|
2095
2095
|
* Stellar aggregator router contract addresses per network.
|
|
2096
|
-
* Targets `
|
|
2096
|
+
* Targets `execute_strategy(sender, total_in, swap_xdr)` for direct
|
|
2097
|
+
* (non-lending) swaps.
|
|
2097
2098
|
* Env vars:
|
|
2098
2099
|
* - STELLAR_AGGREGATOR_ROUTER_MAINNET
|
|
2099
2100
|
* - STELLAR_AGGREGATOR_ROUTER_TESTNET
|
|
@@ -2126,9 +2127,42 @@ export declare const STELLAR_NETWORK_PASSPHRASE: Record<StellarNetwork, string>;
|
|
|
2126
2127
|
export declare function getStellarLendingController(network: StellarNetwork): string;
|
|
2127
2128
|
/**
|
|
2128
2129
|
* Assert an aggregator router address is configured for the target network.
|
|
2129
|
-
* Used by `
|
|
2130
|
+
* Used by `buildStellarExecuteStrategyTx` for direct user -> router swaps.
|
|
2130
2131
|
*/
|
|
2131
2132
|
export declare function getStellarAggregatorRouter(network: StellarNetwork): string;
|
|
2133
|
+
declare const STELLAR_SWAP_VENUES: readonly [
|
|
2134
|
+
"Soroswap",
|
|
2135
|
+
"Aquarius",
|
|
2136
|
+
"Phoenix",
|
|
2137
|
+
"Sushi",
|
|
2138
|
+
"CometDex"
|
|
2139
|
+
];
|
|
2140
|
+
export type StellarSwapVenue = (typeof STELLAR_SWAP_VENUES)[number];
|
|
2141
|
+
export interface StellarStrategySwapHopInput {
|
|
2142
|
+
amountOut: string;
|
|
2143
|
+
pool: string;
|
|
2144
|
+
tokenIn: string;
|
|
2145
|
+
tokenOut: string;
|
|
2146
|
+
venue: StellarSwapVenue;
|
|
2147
|
+
}
|
|
2148
|
+
export interface StellarStrategySwapPathInput {
|
|
2149
|
+
hops: StellarStrategySwapHopInput[];
|
|
2150
|
+
splitPpm: number;
|
|
2151
|
+
}
|
|
2152
|
+
export interface StellarStrategyPayloadInput {
|
|
2153
|
+
paths: StellarStrategySwapPathInput[];
|
|
2154
|
+
referralId?: number | string;
|
|
2155
|
+
tokenIn: string;
|
|
2156
|
+
tokenOut: string;
|
|
2157
|
+
totalMinOut: string;
|
|
2158
|
+
}
|
|
2159
|
+
export type StellarStrategySwapInput = string | Uint8Array | {
|
|
2160
|
+
routeXdr: string;
|
|
2161
|
+
} | {
|
|
2162
|
+
swapXdr: string;
|
|
2163
|
+
} | {
|
|
2164
|
+
bytes: string | Uint8Array;
|
|
2165
|
+
} | StellarStrategyPayloadInput;
|
|
2132
2166
|
/**
|
|
2133
2167
|
* Stellar `G...` public key of the caller (tx source account).
|
|
2134
2168
|
*/
|
|
@@ -2163,14 +2197,15 @@ export interface BuiltStellarTx {
|
|
|
2163
2197
|
* `MultiplyArgs.steps`, `SwapDebtArgs.steps`, `SwapCollateralArgs.steps`, and
|
|
2164
2198
|
* `RepayDebtWithCollateralArgs.steps`.
|
|
2165
2199
|
*
|
|
2166
|
-
* `@xoxno/types` declares `steps: unknown` on these DTOs so every chain owns
|
|
2167
|
-
* own encoding. On Stellar, callers
|
|
2168
|
-
*
|
|
2200
|
+
* `@xoxno/types` declares `steps: unknown` on these DTOs so every chain owns
|
|
2201
|
+
* its own encoding. On Stellar, callers pass opaque aggregator strategy bytes,
|
|
2202
|
+
* normally the quote response `routeXdr` (base64 ScVal XDR) or `{ routeXdr }`.
|
|
2203
|
+
* The lending controller forwards those bytes to the aggregator and does not
|
|
2204
|
+
* decode the aggregator route.
|
|
2169
2205
|
*/
|
|
2170
|
-
export type StellarSwapStepsInput =
|
|
2171
|
-
export type StellarSwapHopInput =
|
|
2172
|
-
export type StellarSwapPathInput =
|
|
2173
|
-
export type StellarSwapVenue = SwapVenue;
|
|
2206
|
+
export type StellarSwapStepsInput = StellarStrategySwapInput;
|
|
2207
|
+
export type StellarSwapHopInput = StellarStrategySwapHopInput;
|
|
2208
|
+
export type StellarSwapPathInput = StellarStrategySwapPathInput;
|
|
2174
2209
|
/**
|
|
2175
2210
|
* Assemble an unsigned XDR that invokes a single Soroban contract method.
|
|
2176
2211
|
*
|
|
@@ -2209,8 +2244,8 @@ export declare function buildStellarFlashLoanTx(opts: StellarBuilderOptions, arg
|
|
|
2209
2244
|
/**
|
|
2210
2245
|
* multiply(caller, account_id, e_mode_category, collateral_token,
|
|
2211
2246
|
* debt_to_flash_loan: i128, debt_token, mode: PositionMode,
|
|
2212
|
-
* swap:
|
|
2213
|
-
* convert_swap: Option<
|
|
2247
|
+
* swap: Bytes, initial_payment: Option<(Address, i128)>,
|
|
2248
|
+
* convert_swap: Option<Bytes>) -> u64
|
|
2214
2249
|
*
|
|
2215
2250
|
* `mode` is a repr(u32) `PositionMode` → encoded as `scvU32`. The two trailing
|
|
2216
2251
|
* `Option`s seed an optional initial collateral payment and a secondary swap
|
|
@@ -2219,18 +2254,18 @@ export declare function buildStellarFlashLoanTx(opts: StellarBuilderOptions, arg
|
|
|
2219
2254
|
export declare function buildStellarMultiplyTx(opts: StellarBuilderOptions, args: MultiplyArgs): BuiltStellarTx;
|
|
2220
2255
|
/**
|
|
2221
2256
|
* swap_debt(caller, account_id, existing_debt_token, new_debt_amount: i128,
|
|
2222
|
-
* new_debt_token, steps:
|
|
2257
|
+
* new_debt_token, steps: Bytes)
|
|
2223
2258
|
*/
|
|
2224
2259
|
export declare function buildStellarSwapDebtTx(opts: StellarBuilderOptions, args: SwapDebtArgs): BuiltStellarTx;
|
|
2225
2260
|
/**
|
|
2226
2261
|
* swap_collateral(caller, account_id, current_collateral, from_amount: i128,
|
|
2227
|
-
* new_collateral, steps:
|
|
2262
|
+
* new_collateral, steps: Bytes)
|
|
2228
2263
|
*/
|
|
2229
2264
|
export declare function buildStellarSwapCollateralTx(opts: StellarBuilderOptions, args: SwapCollateralArgs): BuiltStellarTx;
|
|
2230
2265
|
/**
|
|
2231
2266
|
* repay_debt_with_collateral(caller, account_id, collateral_token,
|
|
2232
2267
|
* collateral_amount: i128, debt_token,
|
|
2233
|
-
* steps:
|
|
2268
|
+
* steps: Bytes, close_position: bool)
|
|
2234
2269
|
*/
|
|
2235
2270
|
export declare function buildStellarRepayDebtWithCollateralTx(opts: StellarBuilderOptions, args: RepayDebtWithCollateralArgs): BuiltStellarTx;
|
|
2236
2271
|
/** `InterestRateModel` — 8 RAY rates + reserve factor bps. */
|
|
@@ -2500,46 +2535,61 @@ export declare function getStellarAggregatorQuote(request: StellarAggregatorQuot
|
|
|
2500
2535
|
* pickers or validate that a user-supplied token has on-chain liquidity.
|
|
2501
2536
|
*/
|
|
2502
2537
|
export declare function getStellarQuoteTokens(opts: StellarQuoteFetchOptions): Promise<StellarQuoteToken[]>;
|
|
2503
|
-
export
|
|
2538
|
+
export type StellarStrategyPayload = StellarStrategyPayloadInput;
|
|
2539
|
+
export type StellarStrategySwap = StellarStrategySwapInput;
|
|
2540
|
+
export type StellarStrategySwapHop = StellarStrategySwapHopInput;
|
|
2541
|
+
export type StellarStrategySwapPath = StellarStrategySwapPathInput;
|
|
2542
|
+
export interface StellarExecuteStrategyBuilderOptions extends StellarBuilderOptions {
|
|
2504
2543
|
/**
|
|
2505
2544
|
* Override the resolved aggregator router contract address. Normally
|
|
2506
2545
|
* resolved from `STELLAR_AGGREGATOR_ROUTER[network]`.
|
|
2507
2546
|
*/
|
|
2508
2547
|
routerAddress?: string;
|
|
2509
2548
|
/**
|
|
2510
|
-
* Total input amount
|
|
2511
|
-
*
|
|
2512
|
-
* allocations are derived inside the router from each path's
|
|
2513
|
-
* `splitPpm`. For a quote-derived swap, pass `quote.amountIn`.
|
|
2549
|
+
* Total input amount passed to `execute_strategy` (i128 decimal string).
|
|
2550
|
+
* For a quote-derived swap, pass `quote.amountIn`.
|
|
2514
2551
|
*/
|
|
2515
2552
|
totalIn: string;
|
|
2516
2553
|
/**
|
|
2517
|
-
* Referral identifier
|
|
2518
|
-
*
|
|
2519
|
-
*
|
|
2520
|
-
* router reverts at execution.
|
|
2554
|
+
* Referral identifier used only when the `swap` input is a decoded
|
|
2555
|
+
* `StrategyPayload` object and does not already include `referralId`.
|
|
2556
|
+
* Quote `routeXdr` already contains the referral chosen by the quote server.
|
|
2521
2557
|
*/
|
|
2522
2558
|
referralId?: number | string;
|
|
2523
2559
|
}
|
|
2560
|
+
/** @deprecated Use `StellarExecuteStrategyBuilderOptions`. */
|
|
2561
|
+
export interface StellarBatchSwapBuilderOptions extends StellarExecuteStrategyBuilderOptions {
|
|
2562
|
+
}
|
|
2563
|
+
export declare const encodeStrategyPayloadToRouteXdr: (payload: StellarStrategyPayloadInput) => string;
|
|
2524
2564
|
/**
|
|
2525
|
-
* Build an unsigned XDR for a direct user
|
|
2565
|
+
* Build an unsigned XDR for a direct user -> aggregator router swap.
|
|
2526
2566
|
*
|
|
2527
|
-
*
|
|
2528
|
-
*
|
|
2529
|
-
*
|
|
2530
|
-
* calling this. `opts.totalIn` is the authoritative input amount.
|
|
2567
|
+
* Pass the quote response `routeXdr` string or `{ routeXdr }` directly when
|
|
2568
|
+
* available. Decoded `StrategyPayload` objects are accepted for local tests and
|
|
2569
|
+
* custom route builders.
|
|
2531
2570
|
*/
|
|
2532
|
-
export declare function
|
|
2571
|
+
export declare function buildStellarExecuteStrategyTx(opts: StellarExecuteStrategyBuilderOptions, swap: StellarStrategySwapInput): BuiltStellarTx;
|
|
2533
2572
|
/**
|
|
2534
|
-
*
|
|
2535
|
-
*
|
|
2536
|
-
* server; the single-path fallback (when `paths` is omitted) gets the
|
|
2537
|
-
* full 1_000_000 weight.
|
|
2538
|
-
*
|
|
2539
|
-
* Throws if `amountOutMin` is missing — the controller refuses
|
|
2540
|
-
* unbounded swaps so the SDK rejects them at the boundary.
|
|
2573
|
+
* @deprecated The router no longer exposes `batch_execute`; this wrapper now
|
|
2574
|
+
* builds `execute_strategy(sender, total_in, swap_xdr)`.
|
|
2541
2575
|
*/
|
|
2542
|
-
export declare function
|
|
2576
|
+
export declare function buildStellarBatchSwapTx(opts: StellarBatchSwapBuilderOptions, swap: StellarStrategySwapInput): BuiltStellarTx;
|
|
2577
|
+
/**
|
|
2578
|
+
* Translate a quote-server response into the decoded `StrategyPayload` shape.
|
|
2579
|
+
* Prefer `mapQuoteResponseToStrategySwap` when the quote includes `routeXdr`.
|
|
2580
|
+
*/
|
|
2581
|
+
export declare function mapQuoteResponseToStrategyPayload(quote: StellarAggregatorQuoteResponseDto, opts?: {
|
|
2582
|
+
referralId?: number | string;
|
|
2583
|
+
}): StellarStrategyPayloadInput;
|
|
2584
|
+
/**
|
|
2585
|
+
* Return the executable quote route when the API provided it; otherwise build
|
|
2586
|
+
* the decoded fallback payload from hop/path fields.
|
|
2587
|
+
*/
|
|
2588
|
+
export declare function mapQuoteResponseToStrategySwap(quote: StellarAggregatorQuoteResponseDto, opts?: {
|
|
2589
|
+
referralId?: number | string;
|
|
2590
|
+
}): StellarStrategySwapInput;
|
|
2591
|
+
/** @deprecated Use `mapQuoteResponseToStrategyPayload`. */
|
|
2592
|
+
export declare const mapQuoteResponseToAggregatorSwap: typeof mapQuoteResponseToStrategyPayload;
|
|
2543
2593
|
export declare function buildSdk(client: XOXNOClient): SDK;
|
|
2544
2594
|
|
|
2545
2595
|
export {};
|