@xoxno/sdk-js 1.0.177 → 1.0.179

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,15 +9,13 @@
9
9
  * `opts.caller` as the leading `Address` arg; that account must hold the
10
10
  * role and sign the tx.
11
11
  */
12
- import type { AssetConfigRawDto, InterestRateModelDto, MarketOracleConfigInputDto, MarketParamsRawDto, OracleSourceConfigInputDto, PositionLimitsDto } from '@xoxno/types';
12
+ import type { InterestRateModelDto, MarketOracleConfigInputDto, MarketParamsRawDto, OracleSourceConfigInputDto, PositionLimitsDto } from '@xoxno/types';
13
13
  import { type BuiltStellarTx, type StellarBuilderOptions } from './lending';
14
14
  import { xdr } from '@stellar/stellar-sdk';
15
15
  /** `InterestRateModel` — 8 RAY rates + reserve factor bps. */
16
16
  export declare const encodeInterestRateModel: (m: InterestRateModelDto) => xdr.ScVal;
17
17
  /** `MarketParamsRaw` — `InterestRateModel` plus the pool asset identity. */
18
18
  export declare const encodeMarketParamsRaw: (p: MarketParamsRawDto) => xdr.ScVal;
19
- /** `AssetConfigRaw` — risk flags and e-mode membership (hub caps live on pool params). */
20
- export declare const encodeAssetConfigRaw: (c: AssetConfigRawDto) => xdr.ScVal;
21
19
  /** `PositionLimits` — per-account supply/borrow position caps. */
22
20
  export declare const encodePositionLimits: (l: PositionLimitsDto) => xdr.ScVal;
23
21
  /** `OracleSourceConfigInput` data-enum — `Reflector(...)` | `RedStone(...)`. */
@@ -32,57 +30,32 @@ export interface TransferOwnershipArgs {
32
30
  newOwner: string;
33
31
  liveUntilLedger: number;
34
32
  }
35
- export interface EditAssetConfigArgs {
36
- asset: string;
37
- config: AssetConfigRawDto;
38
- }
39
- export interface EModeAssetArgs {
40
- asset: string;
41
- categoryId: number;
42
- canCollateral: boolean;
43
- canBorrow: boolean;
44
- ltv: number;
45
- threshold: number;
46
- bonus: number;
47
- supplyCap: string;
48
- borrowCap: string;
49
- }
50
- export interface UpdatePoolCapsArgs {
51
- asset: string;
52
- supplyCap: string;
53
- borrowCap: string;
54
- }
55
- export interface RemoveEModeAssetArgs {
56
- asset: string;
57
- categoryId: number;
58
- }
59
33
  export interface ConfigureMarketOracleArgs {
34
+ hubId: number;
60
35
  asset: string;
61
36
  config: MarketOracleConfigInputDto;
62
37
  }
63
38
  export interface EditOracleToleranceArgs {
64
39
  asset: string;
65
- tolerance: number;
40
+ upperRatioBps: number;
41
+ lowerRatioBps: number;
66
42
  }
67
43
  export interface CreateLiquidityPoolArgs {
44
+ hubId: number;
68
45
  asset: string;
69
46
  params: MarketParamsRawDto;
70
- config: AssetConfigRawDto;
71
47
  }
72
48
  export interface UpgradeLiquidityPoolParamsArgs {
49
+ hubId: number;
73
50
  asset: string;
74
51
  params: InterestRateModelDto;
75
52
  }
76
- export interface UpgradeLiquidityPoolArgs {
77
- asset: string;
78
- wasmHash: string;
79
- }
80
53
  export interface RewardEntry {
81
- token: string;
54
+ hubId: number;
55
+ asset: string;
82
56
  amount: string;
83
57
  }
84
58
  export interface UpdateAccountThresholdArgs {
85
- asset: string;
86
59
  hasRisks: boolean;
87
60
  accountNonces: number[];
88
61
  }
@@ -118,24 +91,8 @@ export declare function buildStellarSetAccumulatorTx(opts: StellarBuilderOptions
118
91
  export declare function buildStellarSetLiquidityPoolTemplateTx(opts: StellarBuilderOptions, args: {
119
92
  wasmHash: string;
120
93
  }): BuiltStellarTx;
121
- /** edit_asset_config(asset: Address, cfg: AssetConfigRaw) — #[only_owner] */
122
- export declare function buildStellarEditAssetConfigTx(opts: StellarBuilderOptions, args: EditAssetConfigArgs): BuiltStellarTx;
123
94
  /** set_position_limits(limits: PositionLimits) — #[only_owner] */
124
95
  export declare function buildStellarSetPositionLimitsTx(opts: StellarBuilderOptions, args: PositionLimitsDto): BuiltStellarTx;
125
- /** add_e_mode_category() -> u32 — #[only_owner]. Risk params are per-asset. */
126
- export declare function buildStellarAddEModeCategoryTx(opts: StellarBuilderOptions): BuiltStellarTx;
127
- /** remove_e_mode_category(id: u32) — #[only_owner] */
128
- export declare function buildStellarRemoveEModeCategoryTx(opts: StellarBuilderOptions, args: {
129
- id: number;
130
- }): BuiltStellarTx;
131
- /** add_asset_to_e_mode_category(EModeAssetArgs) — #[only_owner] */
132
- export declare function buildStellarAddAssetToEModeCategoryTx(opts: StellarBuilderOptions, args: EModeAssetArgs): BuiltStellarTx;
133
- /** edit_asset_in_e_mode_category(EModeAssetArgs) — #[only_owner] */
134
- export declare function buildStellarEditAssetInEModeCategoryTx(opts: StellarBuilderOptions, args: EModeAssetArgs): BuiltStellarTx;
135
- /** update_pool_caps(asset, supply_cap, borrow_cap) — #[only_owner] */
136
- export declare function buildStellarUpdatePoolCapsTx(opts: StellarBuilderOptions, args: UpdatePoolCapsArgs): BuiltStellarTx;
137
- /** remove_asset_from_e_mode(asset: Address, category_id: u32) — #[only_owner] */
138
- export declare function buildStellarRemoveAssetFromEModeTx(opts: StellarBuilderOptions, args: RemoveEModeAssetArgs): BuiltStellarTx;
139
96
  /** approve_token(token: Address) — #[only_owner] */
140
97
  export declare function buildStellarApproveTokenTx(opts: StellarBuilderOptions, args: {
141
98
  token: string;
@@ -145,32 +102,36 @@ export declare function buildStellarRevokeTokenTx(opts: StellarBuilderOptions, a
145
102
  token: string;
146
103
  }): BuiltStellarTx;
147
104
  /** configure_market_oracle(caller, asset, cfg) — #[only_role(caller, "ORACLE")] */
148
- export declare function buildStellarConfigureMarketOracleTx(opts: StellarBuilderOptions, args: ConfigureMarketOracleArgs): BuiltStellarTx;
149
- /** edit_oracle_tolerance(caller, asset, tolerance) — #[only_role(caller, "ORACLE")] */
150
- export declare function buildStellarEditOracleToleranceTx(opts: StellarBuilderOptions, args: EditOracleToleranceArgs): BuiltStellarTx;
151
- /** disable_token_oracle(caller, asset) — #[only_role(caller, "ORACLE")] */
105
+ export declare function buildStellarSetMarketOracleConfigTx(opts: StellarBuilderOptions, args: ConfigureMarketOracleArgs): BuiltStellarTx;
106
+ /** set_oracle_tolerance(asset, tolerance: OraclePriceFluctuation) — #[only_owner] */
107
+ export declare function buildStellarSetOracleToleranceTx(opts: StellarBuilderOptions, args: EditOracleToleranceArgs): BuiltStellarTx;
108
+ /** disable_token_oracle(asset) — #[only_owner] */
152
109
  export declare function buildStellarDisableTokenOracleTx(opts: StellarBuilderOptions, args: {
153
110
  asset: string;
154
111
  }): BuiltStellarTx;
155
- /** update_indexes(caller, assets: Vec<Address>) — #[only_role(caller, "KEEPER")] */
112
+ /** update_indexes(caller, assets: Vec<HubAssetKey>) */
156
113
  export declare function buildStellarUpdateIndexesTx(opts: StellarBuilderOptions, args: {
157
- assets: string[];
114
+ assets: Array<{
115
+ hubId: number;
116
+ asset: string;
117
+ }>;
158
118
  }): BuiltStellarTx;
159
119
  /** renew_account(caller, account_id: u64) */
160
120
  export declare function buildStellarRenewAccountTx(opts: StellarBuilderOptions, args: {
161
121
  accountNonce: number;
162
122
  }): BuiltStellarTx;
163
- /** create_liquidity_pool(asset, params: MarketParamsRaw, config: AssetConfigRaw) -> Address — #[only_owner] */
123
+ /** create_liquidity_pool(hub_id, asset, params: MarketParamsRaw) -> Address — #[only_owner] */
164
124
  export declare function buildStellarCreateLiquidityPoolTx(opts: StellarBuilderOptions, args: CreateLiquidityPoolArgs): BuiltStellarTx;
165
- /** upgrade_liquidity_pool_params(asset, params: InterestRateModel) — #[only_owner] */
125
+ /** upgrade_liquidity_pool_params(hub_asset: HubAssetKey, params) — #[only_owner] */
166
126
  export declare function buildStellarUpgradeLiquidityPoolParamsTx(opts: StellarBuilderOptions, args: UpgradeLiquidityPoolParamsArgs): BuiltStellarTx;
167
- /** upgrade_liquidity_pool(asset, new_wasm_hash: BytesN<32>) #[only_owner] */
168
- export declare function buildStellarUpgradeLiquidityPoolTx(opts: StellarBuilderOptions, args: UpgradeLiquidityPoolArgs): BuiltStellarTx;
169
- /** claim_revenue(caller, assets: Vec<Address>) -> Vec<i128> — #[only_role(caller, "REVENUE")] */
127
+ /** claim_revenue(caller, assets: Vec<HubAssetKey>) -> Vec<i128> */
170
128
  export declare function buildStellarClaimRevenueTx(opts: StellarBuilderOptions, args: {
171
- assets: string[];
129
+ assets: Array<{
130
+ hubId: number;
131
+ asset: string;
132
+ }>;
172
133
  }): BuiltStellarTx;
173
- /** add_rewards(caller, rewards: Vec<(Address, i128)>) — #[only_role(caller, "REVENUE")] */
134
+ /** add_rewards(caller, rewards: Vec<(HubAssetKey, i128)>) */
174
135
  export declare function buildStellarAddRewardsTx(opts: StellarBuilderOptions, args: {
175
136
  rewards: RewardEntry[];
176
137
  }): BuiltStellarTx;
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Decoders for the Stellar lending controller `#[contractevent]`s.
3
3
  *
4
- * The controller defines 20+ contractevents; this SDK decodes 21 of them plus the
5
- * pool's `strategy:fee`. Controller omissions: `config:min_borrow_collateral`
6
- * (a single global `i128` floor with no indexing/UI consumer — the governance
7
- * `SetMinBorrowCollateral` proposal already surfaces the value) and
8
- * `config:spoke_asset` / `config:remove_spoke_asset` (indexed by the
9
- * az-functions pipeline's own decoders), so `decodeStellarLendingEvent`
10
- * returns `null` for them like any other unhandled topic.
4
+ * Decodes the core protocol topics plus the pool's `strategy:fee`. Intentional
5
+ * omissions (decodeStellarLendingEvent returns `null` for them, like any other
6
+ * unhandled topic): `config:min_borrow_collateral` (a single global `i128`
7
+ * floor with no indexing/UI consumer), `config:spoke_asset` /
8
+ * `config:remove_spoke_asset` / `config:hub` / `config:approve_blend_pool` /
9
+ * `strategy:blend_migration` (indexed by the az-functions pipeline's own
10
+ * decoders).
11
11
  *
12
12
  * The public API takes base64-XDR strings (`decodeStellarLendingEvent(topicsB64,
13
13
  * dataB64)`) and parses them with this SDK's bundled `@stellar/stellar-sdk`, so
@@ -39,9 +39,8 @@ export declare const toBase64Xdr: (scv: {
39
39
  }) => string;
40
40
  /** Build the `"<domain>:<action>"` dispatch key from the event topic ScVals. */
41
41
  export declare const stellarLendingDispatchKey: (topicsB64: readonly string[]) => string;
42
- /** Topic keys this SDK can decode (21 controller contractevents plus the pool's
43
- * `strategy:fee`; `config:min_borrow_collateral`, `config:spoke_asset`, and
44
- * `config:remove_spoke_asset` are intentionally not decoded). */
42
+ /** Topic keys this SDK can decode. See the module header for the intentional
43
+ * omissions. */
45
44
  export declare const STELLAR_LENDING_TOPICS: readonly string[];
46
45
  /**
47
46
  * Decode a Stellar lending controller event from its base64-XDR topics and
@@ -26,7 +26,7 @@
26
26
  * XDR still needs `rpc.Server.prepareTransaction` before signing.
27
27
  */
28
28
  import type { PositionLimitsDto } from '@xoxno/types';
29
- import { type ConfigureMarketOracleArgs, type CreateLiquidityPoolArgs, type EditAssetConfigArgs, type EditOracleToleranceArgs, type EModeAssetArgs, type RemoveEModeAssetArgs, type RoleGrantArgs, type TransferOwnershipArgs, type UpdatePoolCapsArgs, type UpgradeLiquidityPoolParamsArgs } from './admin';
29
+ import { type ConfigureMarketOracleArgs, type CreateLiquidityPoolArgs, type RoleGrantArgs, type TransferOwnershipArgs, type UpgradeLiquidityPoolParamsArgs } from './admin';
30
30
  import type { BuiltStellarTx, StellarBuilderOptions } from './lending';
31
31
  /**
32
32
  * A `salt: BytesN<32>` for a governance proposal/execution. Accepts a 32-byte
@@ -35,8 +35,10 @@ import type { BuiltStellarTx, StellarBuilderOptions } from './lending';
35
35
  export type StellarGovernanceSalt = string | Buffer | Uint8Array;
36
36
  /** The 32-zero-byte `BytesN<32>` predecessor used for every op in this system. */
37
37
  export declare const STELLAR_GOVERNANCE_ZERO_PREDECESSOR: string;
38
- export interface RemoveEModeCategoryArgs {
39
- id: number;
38
+ /** Governance derives the OraclePriceFluctuation on-chain from one bps value. */
39
+ export interface EditOracleToleranceProposalArgs {
40
+ asset: string;
41
+ tolerance: number;
40
42
  }
41
43
  export interface UpgradeArgs {
42
44
  wasmHash: string;
@@ -59,26 +61,12 @@ export declare function buildStellarProposeSetAccumulatorTx(opts: StellarBuilder
59
61
  export declare function buildStellarProposeSetPoolTemplateTx(opts: StellarBuilderOptions, args: {
60
62
  wasmHash: string;
61
63
  }, salt: StellarGovernanceSalt): BuiltStellarTx;
62
- /** propose(EditAssetConfig(asset, cfg)) */
63
- export declare function buildStellarProposeEditAssetConfigTx(opts: StellarBuilderOptions, args: EditAssetConfigArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
64
64
  /** propose(SetPositionLimits(limits)) */
65
65
  export declare function buildStellarProposeSetPositionLimitsTx(opts: StellarBuilderOptions, args: PositionLimitsDto, salt: StellarGovernanceSalt): BuiltStellarTx;
66
66
  /** propose(SetMinBorrowCollateralUsd(floor_wad)) */
67
67
  export declare function buildStellarProposeSetMinBorrowCollatTx(opts: StellarBuilderOptions, args: {
68
68
  floorWad: string;
69
69
  }, salt: StellarGovernanceSalt): BuiltStellarTx;
70
- /** propose(AddEModeCategory) — risk params are per-asset */
71
- export declare function buildStellarProposeAddEModeCategoryTx(opts: StellarBuilderOptions, salt: StellarGovernanceSalt): BuiltStellarTx;
72
- /** propose(RemoveEModeCategory(id)) */
73
- export declare function buildStellarProposeRemoveEModeCategoryTx(opts: StellarBuilderOptions, args: RemoveEModeCategoryArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
74
- /** propose(AddAssetToEModeCategory(EModeAssetArgs)) */
75
- export declare function buildStellarProposeAddAssetToEModeTx(opts: StellarBuilderOptions, args: EModeAssetArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
76
- /** propose(EditAssetInEModeCategory(EModeAssetArgs)) */
77
- export declare function buildStellarProposeEditAssetInEModeTx(opts: StellarBuilderOptions, args: EModeAssetArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
78
- /** propose(UpdatePoolCaps(PoolCapsArgs)) */
79
- export declare function buildStellarProposeUpdatePoolCapsTx(opts: StellarBuilderOptions, args: UpdatePoolCapsArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
80
- /** propose(RemoveAssetFromEMode(RemoveAssetFromEModeArgs)) */
81
- export declare function buildStellarProposeRemoveAssetFromEModeTx(opts: StellarBuilderOptions, args: RemoveEModeAssetArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
82
70
  /** propose(ApproveToken(token)) */
83
71
  export declare function buildStellarProposeApproveTokenTx(opts: StellarBuilderOptions, args: {
84
72
  token: string;
@@ -123,7 +111,7 @@ export declare function buildStellarProposeTransferCtrlOwnershipTx(opts: Stellar
123
111
  */
124
112
  export declare function buildStellarProposeConfigureMarketOracleTx(opts: StellarBuilderOptions, args: ConfigureMarketOracleArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
125
113
  /** propose(EditOracleTolerance(EditToleranceArgs)) */
126
- export declare function buildStellarProposeEditOracleToleranceTx(opts: StellarBuilderOptions, args: EditOracleToleranceArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
114
+ export declare function buildStellarProposeEditOracleToleranceTx(opts: StellarBuilderOptions, args: EditOracleToleranceProposalArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
127
115
  /** propose(UpgradeGov(hash)) */
128
116
  export declare function buildStellarProposeGovernanceUpgradeTx(opts: StellarBuilderOptions, args: UpgradeArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
129
117
  /** propose(UpdateGovDelay(new_delay)) */
@@ -130,12 +130,12 @@ export interface StellarReserve {
130
130
  suppliedShort: number;
131
131
  borrowedShort: number;
132
132
  availableLiquidityShort: number;
133
+ isFlashloanable: boolean;
134
+ flashloanFeeBps: number;
133
135
  supplyCapShort: number;
134
136
  borrowCapShort: number;
135
137
  depositCapFilledPct: number;
136
138
  borrowCapFilledPct: number;
137
- isFlashloanable: boolean;
138
- flashloanFeeBps: number;
139
139
  collateralFactorBps: number;
140
140
  liquidationThresholdBps: number;
141
141
  liquidationPenaltyBps: number;