@xoxno/sdk-js 1.0.206 → 1.0.207
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/cjs/sdk/stellar/admin.d.ts +7 -3
- package/dist/cjs/sdk/stellar/events/id.d.ts +11 -1
- package/dist/cjs/sdk/stellar/governance.d.ts +23 -6
- package/dist/cjs/sdk/stellar/lending.d.ts +26 -3
- package/dist/cjs/sdk/stellar/scval-encode.d.ts +22 -0
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/sdk/stellar/admin.d.ts +7 -3
- package/dist/sdk/stellar/events/id.d.ts +11 -1
- package/dist/sdk/stellar/governance.d.ts +23 -6
- package/dist/sdk/stellar/index.cjs +1 -1
- package/dist/sdk/stellar/index.esm.js +1 -1
- package/dist/sdk/stellar/lending.d.ts +26 -3
- package/dist/sdk/stellar/scval-encode.d.ts +22 -0
- package/package.json +2 -2
|
@@ -124,9 +124,11 @@ export declare function buildStellarSetOracleToleranceTx(opts: StellarBuilderOpt
|
|
|
124
124
|
lowerRatioBps?: number;
|
|
125
125
|
}): BuiltStellarTx;
|
|
126
126
|
/**
|
|
127
|
-
* set_spoke_asset_flags(spoke_id, hub_asset, paused, frozen) —
|
|
128
|
-
* Flags-only listing edit; production callers route through the
|
|
129
|
-
* governance forwarder
|
|
127
|
+
* set_spoke_asset_flags(spoke_id, hub_asset, paused, frozen, no_seize) —
|
|
128
|
+
* #[only_owner]. Flags-only listing edit; production callers route through the
|
|
129
|
+
* GUARDIAN-gated governance forwarder
|
|
130
|
+
* (`buildStellarGovernanceSetSpokeAssetFlagsImmediateTx`). Every flag is a
|
|
131
|
+
* one-way ratchet here: clearing one requires the timelocked spoke-asset edit.
|
|
130
132
|
*/
|
|
131
133
|
export declare function buildStellarSetSpokeAssetFlagsTx(opts: StellarBuilderOptions, args: {
|
|
132
134
|
spokeId: number;
|
|
@@ -134,6 +136,8 @@ export declare function buildStellarSetSpokeAssetFlagsTx(opts: StellarBuilderOpt
|
|
|
134
136
|
asset: string;
|
|
135
137
|
paused: boolean;
|
|
136
138
|
frozen: boolean;
|
|
139
|
+
/** Halts only the liquidation seizure leg for this listing (error 318). */
|
|
140
|
+
noSeize: boolean;
|
|
137
141
|
}): BuiltStellarTx;
|
|
138
142
|
/**
|
|
139
143
|
* set_oracle_sanity_bounds(asset, min_wad, max_wad) — #[only_owner].
|
|
@@ -35,6 +35,16 @@ export declare function extractEventOrder(eventId: string): number;
|
|
|
35
35
|
export declare function syntheticEventOrder(baseEventOrder: number, childIndex?: number): number;
|
|
36
36
|
/**
|
|
37
37
|
* Map a position-delta `action` symbol to its `XoxnoLendingActivity` value.
|
|
38
|
-
* The tag list is authoritative in `rs-lending-xlm
|
|
38
|
+
* The tag list is authoritative in `rs-lending-xlm
|
|
39
|
+
* contracts/controller/src/events/mod.rs` (`PositionAction`).
|
|
40
|
+
*
|
|
41
|
+
* `liq_credit` is deliberately NOT `lendingLiquidateSeizeCollateral`. That
|
|
42
|
+
* activity renders as "Liquidated by / Liquidation", and a share-credit leg
|
|
43
|
+
* lands on the *liquidator's* receiving account, which was not liquidated —
|
|
44
|
+
* so it maps to the plain position update instead. It also keeps a
|
|
45
|
+
* protocol-wide sum over `lendingLiquidateSeizeCollateral` from
|
|
46
|
+
* double-counting the same seizure twice (gross on the liquidated account,
|
|
47
|
+
* net on the receiver). The raw `liq_credit` / `liq_seize` strings stay on
|
|
48
|
+
* the delta itself, so the two legs remain distinguishable downstream.
|
|
39
49
|
*/
|
|
40
50
|
export declare function mapStellarPositionActivityType(action?: string): StellarLendingActivityType;
|
|
@@ -49,10 +49,21 @@ export interface SpokeAssetArgs {
|
|
|
49
49
|
asset: string;
|
|
50
50
|
canCollateral: boolean;
|
|
51
51
|
canBorrow: boolean;
|
|
52
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* ADR 0008 per-listing incident flag: blocks every *user* verb on the
|
|
54
|
+
* listing, including the debt leg of a liquidation that names this asset.
|
|
55
|
+
*/
|
|
53
56
|
paused: boolean;
|
|
54
|
-
/** ADR
|
|
57
|
+
/** ADR 0008 per-listing incident flag: blocks new exposure, exits stay live. */
|
|
55
58
|
frozen: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* ADR 0008 per-listing incident flag: blocks only the liquidation *seizure*
|
|
61
|
+
* leg (`SpokeAssetSeizureHalted`, 318), and nothing else. Deliberately not
|
|
62
|
+
* folded into `paused`: seizure is pro-rata over an account's whole
|
|
63
|
+
* collateral, so gating it on a user-activity halt would turn one paused
|
|
64
|
+
* listing into a protocol-wide liquidation halt.
|
|
65
|
+
*/
|
|
66
|
+
noSeize: boolean;
|
|
56
67
|
ltv: number;
|
|
57
68
|
threshold: number;
|
|
58
69
|
bonus: number;
|
|
@@ -260,6 +271,8 @@ export interface SpokeAssetFlagsArgs {
|
|
|
260
271
|
asset: string;
|
|
261
272
|
paused: boolean;
|
|
262
273
|
frozen: boolean;
|
|
274
|
+
/** Halts only the liquidation seizure leg for this listing (error 318). */
|
|
275
|
+
noSeize: boolean;
|
|
263
276
|
}
|
|
264
277
|
export interface OracleSanityBoundsArgs {
|
|
265
278
|
asset: string;
|
|
@@ -269,10 +282,14 @@ export interface OracleSanityBoundsArgs {
|
|
|
269
282
|
maxPriceWad: string;
|
|
270
283
|
}
|
|
271
284
|
/**
|
|
272
|
-
* set_spoke_asset_flags(caller, spoke_id, hub_asset, paused, frozen)
|
|
273
|
-
* GUARDIAN-gated, immediate. Flags-only per-listing incident brake: no risk
|
|
274
|
-
* params
|
|
275
|
-
*
|
|
285
|
+
* set_spoke_asset_flags(caller, spoke_id, hub_asset, paused, frozen, no_seize)
|
|
286
|
+
* — GUARDIAN-gated, immediate. Flags-only per-listing incident brake: no risk
|
|
287
|
+
* params or caps travel with it. `caller = opts.caller` must hold GUARDIAN and
|
|
288
|
+
* sign.
|
|
289
|
+
*
|
|
290
|
+
* All three flags are one-way ratchets on this path — the guardian may only
|
|
291
|
+
* set them true. Clearing any of them requires the timelocked
|
|
292
|
+
* `EditAssetInSpoke` proposal.
|
|
276
293
|
*/
|
|
277
294
|
export declare function buildStellarGovernanceSetSpokeAssetFlagsImmediateTx(opts: StellarBuilderOptions, args: SpokeAssetFlagsArgs): BuiltStellarTx;
|
|
278
295
|
/**
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { xdr } from '@stellar/stellar-sdk';
|
|
19
19
|
import { type StellarNetwork } from './contracts';
|
|
20
|
-
import { type StellarStrategySwapHopInput, type StellarStrategySwapInput, type StellarStrategySwapPathInput } from './scval-encode';
|
|
20
|
+
import { type StellarSeizeModeInput, type StellarStrategySwapHopInput, type StellarStrategySwapInput, type StellarStrategySwapPathInput } from './scval-encode';
|
|
21
21
|
/**
|
|
22
22
|
* Stellar `G...` public key of the caller (tx source account).
|
|
23
23
|
*/
|
|
@@ -68,7 +68,7 @@ export interface BuiltStellarTx {
|
|
|
68
68
|
export type StellarSwapStepsInput = StellarStrategySwapInput;
|
|
69
69
|
export type StellarSwapHopInput = StellarStrategySwapHopInput;
|
|
70
70
|
export type StellarSwapPathInput = StellarStrategySwapPathInput;
|
|
71
|
-
export type { StellarSwapVenue } from './scval-encode';
|
|
71
|
+
export type { StellarSeizeModeInput, StellarSwapVenue } from './scval-encode';
|
|
72
72
|
/**
|
|
73
73
|
* Assemble an unsigned XDR that invokes a single Soroban contract method.
|
|
74
74
|
*
|
|
@@ -133,6 +133,13 @@ export interface StellarRepayBatchArgs {
|
|
|
133
133
|
export interface StellarLiquidateArgs {
|
|
134
134
|
accountNonce: number;
|
|
135
135
|
debtPayments: ReadonlyArray<StellarHubAssetAmount>;
|
|
136
|
+
/**
|
|
137
|
+
* How the liquidator takes delivery of the seized collateral. Defaults to
|
|
138
|
+
* `'Transfer'` — the pool pays out underlying tokens, which is the only
|
|
139
|
+
* behaviour the pre-`SeizeMode` ABI had. `{ Credit: 0 }` opens a fresh
|
|
140
|
+
* receiving account; `{ Credit: id }` credits an existing one.
|
|
141
|
+
*/
|
|
142
|
+
seizeMode?: StellarSeizeModeInput;
|
|
136
143
|
}
|
|
137
144
|
export interface StellarFlashLoanArgs extends StellarHubAsset {
|
|
138
145
|
amount: string;
|
|
@@ -219,9 +226,25 @@ export declare function buildStellarRepayBatchTx(opts: StellarBuilderOptions, ar
|
|
|
219
226
|
/** Single-asset `repay`. */
|
|
220
227
|
export declare function buildStellarRepayTx(opts: StellarBuilderOptions, args: StellarRepayArgs): BuiltStellarTx;
|
|
221
228
|
/**
|
|
222
|
-
* liquidate(liquidator, account_id: u64, debt_payments: Vec<(HubAssetKey, i128)
|
|
229
|
+
* liquidate(liquidator, account_id: u64, debt_payments: Vec<(HubAssetKey, i128)>,
|
|
230
|
+
* seize_mode: SeizeMode) -> u64
|
|
231
|
+
*
|
|
232
|
+
* The `u64` return is the account credited with the seized supply shares under
|
|
233
|
+
* `SeizeMode::Credit` (freshly opened when `Credit(0)` was passed), and `0`
|
|
234
|
+
* under `SeizeMode::Transfer`. Read it from the simulation / tx result with
|
|
235
|
+
* `decodeStellarLiquidateReturn`.
|
|
223
236
|
*/
|
|
224
237
|
export declare function buildStellarLiquidateTx(opts: StellarBuilderOptions, args: StellarLiquidateArgs): BuiltStellarTx;
|
|
238
|
+
/**
|
|
239
|
+
* Decode `liquidate`'s `u64` return value from its base64 XDR — the receiving
|
|
240
|
+
* account id, as a decimal string. `'0'` means `SeizeMode::Transfer` (the
|
|
241
|
+
* liquidator was paid in underlying tokens, no account was touched).
|
|
242
|
+
*
|
|
243
|
+
* Takes base64 XDR (as Soroban RPC delivers `returnValue` / `result.retval`)
|
|
244
|
+
* so no live `xdr.ScVal` crosses the consumer boundary — same contract as
|
|
245
|
+
* `decodeStellarLendingEvent`. Hold a parsed ScVal? Pass `toBase64Xdr(scv)`.
|
|
246
|
+
*/
|
|
247
|
+
export declare function decodeStellarLiquidateReturn(returnValueB64: string): string;
|
|
225
248
|
/**
|
|
226
249
|
* flash_loan(caller, asset: HubAssetKey, amount: i128, receiver, data: Bytes)
|
|
227
250
|
*/
|
|
@@ -118,6 +118,28 @@ export declare const tupleHubAssetAmountVec: (entries: Array<{
|
|
|
118
118
|
asset: string;
|
|
119
119
|
amount: string;
|
|
120
120
|
}>) => xdr.ScVal;
|
|
121
|
+
/**
|
|
122
|
+
* How a liquidator takes delivery of seized collateral — the Soroban
|
|
123
|
+
* `SeizeMode` enum.
|
|
124
|
+
*
|
|
125
|
+
* - `'Transfer'` — the pool withdraws the collateral and pays the liquidator
|
|
126
|
+
* in underlying tokens, withholding the protocol fee from the transfer.
|
|
127
|
+
* - `{ Credit: accountId }` — the seized *supply shares* are credited to a
|
|
128
|
+
* controller account instead. `0` opens a fresh account owned by the
|
|
129
|
+
* liquidator and bound to the liquidated account's spoke; any other id must
|
|
130
|
+
* already exist, be owned by (or delegated to) the liquidator, sit in the
|
|
131
|
+
* same spoke, and be in `PositionMode::Normal`.
|
|
132
|
+
*/
|
|
133
|
+
export type StellarSeizeModeInput = 'Transfer' | {
|
|
134
|
+
Credit: number | string;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Encode `SeizeMode`. Soroban serializes a `#[contracttype]` enum as
|
|
138
|
+
* `scvVec([scvSymbol(Variant), ...payload])` — the void variant carries only
|
|
139
|
+
* the symbol, `Credit` appends its `u64`. Same shape as `OracleReadMode`
|
|
140
|
+
* (`Spot` / `Twap(u32)`) in `admin.ts`.
|
|
141
|
+
*/
|
|
142
|
+
export declare const seizeMode: (mode: StellarSeizeModeInput) => xdr.ScVal;
|
|
121
143
|
/**
|
|
122
144
|
* Encode a Soroban `struct` — at the XDR level, structs are maps with
|
|
123
145
|
* `Symbol` keys in **lexicographic order** of field names.
|