@xoxno/sdk-js 1.0.176 → 1.0.178
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 +26 -57
- package/dist/cjs/sdk/stellar/events/decode.d.ts +9 -7
- package/dist/cjs/sdk/stellar/governance.d.ts +6 -16
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/sdk/stellar/admin.d.ts +26 -57
- package/dist/sdk/stellar/events/decode.d.ts +9 -7
- package/dist/sdk/stellar/governance.d.ts +6 -16
- package/dist/sdk/stellar/index.cjs +1 -1
- package/dist/sdk/stellar/index.esm.js +1 -1
- package/package.json +2 -2
|
@@ -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 {
|
|
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,38 @@ 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
33
|
export interface UpdatePoolCapsArgs {
|
|
34
|
+
hubId: number;
|
|
51
35
|
asset: string;
|
|
52
36
|
supplyCap: string;
|
|
53
37
|
borrowCap: string;
|
|
54
38
|
}
|
|
55
|
-
export interface RemoveEModeAssetArgs {
|
|
56
|
-
asset: string;
|
|
57
|
-
categoryId: number;
|
|
58
|
-
}
|
|
59
39
|
export interface ConfigureMarketOracleArgs {
|
|
40
|
+
hubId: number;
|
|
60
41
|
asset: string;
|
|
61
42
|
config: MarketOracleConfigInputDto;
|
|
62
43
|
}
|
|
63
44
|
export interface EditOracleToleranceArgs {
|
|
64
45
|
asset: string;
|
|
65
|
-
|
|
46
|
+
upperRatioBps: number;
|
|
47
|
+
lowerRatioBps: number;
|
|
66
48
|
}
|
|
67
49
|
export interface CreateLiquidityPoolArgs {
|
|
50
|
+
hubId: number;
|
|
68
51
|
asset: string;
|
|
69
52
|
params: MarketParamsRawDto;
|
|
70
|
-
config: AssetConfigRawDto;
|
|
71
53
|
}
|
|
72
54
|
export interface UpgradeLiquidityPoolParamsArgs {
|
|
55
|
+
hubId: number;
|
|
73
56
|
asset: string;
|
|
74
57
|
params: InterestRateModelDto;
|
|
75
58
|
}
|
|
76
|
-
export interface UpgradeLiquidityPoolArgs {
|
|
77
|
-
asset: string;
|
|
78
|
-
wasmHash: string;
|
|
79
|
-
}
|
|
80
59
|
export interface RewardEntry {
|
|
81
|
-
|
|
60
|
+
hubId: number;
|
|
61
|
+
asset: string;
|
|
82
62
|
amount: string;
|
|
83
63
|
}
|
|
84
64
|
export interface UpdateAccountThresholdArgs {
|
|
85
|
-
asset: string;
|
|
86
65
|
hasRisks: boolean;
|
|
87
66
|
accountNonces: number[];
|
|
88
67
|
}
|
|
@@ -118,24 +97,10 @@ export declare function buildStellarSetAccumulatorTx(opts: StellarBuilderOptions
|
|
|
118
97
|
export declare function buildStellarSetLiquidityPoolTemplateTx(opts: StellarBuilderOptions, args: {
|
|
119
98
|
wasmHash: string;
|
|
120
99
|
}): BuiltStellarTx;
|
|
121
|
-
/** edit_asset_config(asset: Address, cfg: AssetConfigRaw) — #[only_owner] */
|
|
122
|
-
export declare function buildStellarEditAssetConfigTx(opts: StellarBuilderOptions, args: EditAssetConfigArgs): BuiltStellarTx;
|
|
123
100
|
/** set_position_limits(limits: PositionLimits) — #[only_owner] */
|
|
124
101
|
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
102
|
/** update_pool_caps(asset, supply_cap, borrow_cap) — #[only_owner] */
|
|
136
103
|
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
104
|
/** approve_token(token: Address) — #[only_owner] */
|
|
140
105
|
export declare function buildStellarApproveTokenTx(opts: StellarBuilderOptions, args: {
|
|
141
106
|
token: string;
|
|
@@ -145,32 +110,36 @@ export declare function buildStellarRevokeTokenTx(opts: StellarBuilderOptions, a
|
|
|
145
110
|
token: string;
|
|
146
111
|
}): BuiltStellarTx;
|
|
147
112
|
/** configure_market_oracle(caller, asset, cfg) — #[only_role(caller, "ORACLE")] */
|
|
148
|
-
export declare function
|
|
149
|
-
/**
|
|
150
|
-
export declare function
|
|
151
|
-
/** disable_token_oracle(
|
|
113
|
+
export declare function buildStellarSetMarketOracleConfigTx(opts: StellarBuilderOptions, args: ConfigureMarketOracleArgs): BuiltStellarTx;
|
|
114
|
+
/** set_oracle_tolerance(asset, tolerance: OraclePriceFluctuation) — #[only_owner] */
|
|
115
|
+
export declare function buildStellarSetOracleToleranceTx(opts: StellarBuilderOptions, args: EditOracleToleranceArgs): BuiltStellarTx;
|
|
116
|
+
/** disable_token_oracle(asset) — #[only_owner] */
|
|
152
117
|
export declare function buildStellarDisableTokenOracleTx(opts: StellarBuilderOptions, args: {
|
|
153
118
|
asset: string;
|
|
154
119
|
}): BuiltStellarTx;
|
|
155
|
-
/** update_indexes(caller, assets: Vec<
|
|
120
|
+
/** update_indexes(caller, assets: Vec<HubAssetKey>) */
|
|
156
121
|
export declare function buildStellarUpdateIndexesTx(opts: StellarBuilderOptions, args: {
|
|
157
|
-
assets:
|
|
122
|
+
assets: Array<{
|
|
123
|
+
hubId: number;
|
|
124
|
+
asset: string;
|
|
125
|
+
}>;
|
|
158
126
|
}): BuiltStellarTx;
|
|
159
127
|
/** renew_account(caller, account_id: u64) */
|
|
160
128
|
export declare function buildStellarRenewAccountTx(opts: StellarBuilderOptions, args: {
|
|
161
129
|
accountNonce: number;
|
|
162
130
|
}): BuiltStellarTx;
|
|
163
|
-
/** create_liquidity_pool(asset, params: MarketParamsRaw
|
|
131
|
+
/** create_liquidity_pool(hub_id, asset, params: MarketParamsRaw) -> Address — #[only_owner] */
|
|
164
132
|
export declare function buildStellarCreateLiquidityPoolTx(opts: StellarBuilderOptions, args: CreateLiquidityPoolArgs): BuiltStellarTx;
|
|
165
|
-
/** upgrade_liquidity_pool_params(
|
|
133
|
+
/** upgrade_liquidity_pool_params(hub_asset: HubAssetKey, params) — #[only_owner] */
|
|
166
134
|
export declare function buildStellarUpgradeLiquidityPoolParamsTx(opts: StellarBuilderOptions, args: UpgradeLiquidityPoolParamsArgs): BuiltStellarTx;
|
|
167
|
-
/**
|
|
168
|
-
export declare function buildStellarUpgradeLiquidityPoolTx(opts: StellarBuilderOptions, args: UpgradeLiquidityPoolArgs): BuiltStellarTx;
|
|
169
|
-
/** claim_revenue(caller, assets: Vec<Address>) -> Vec<i128> — #[only_role(caller, "REVENUE")] */
|
|
135
|
+
/** claim_revenue(caller, assets: Vec<HubAssetKey>) -> Vec<i128> */
|
|
170
136
|
export declare function buildStellarClaimRevenueTx(opts: StellarBuilderOptions, args: {
|
|
171
|
-
assets:
|
|
137
|
+
assets: Array<{
|
|
138
|
+
hubId: number;
|
|
139
|
+
asset: string;
|
|
140
|
+
}>;
|
|
172
141
|
}): BuiltStellarTx;
|
|
173
|
-
/** add_rewards(caller, rewards: Vec<(
|
|
142
|
+
/** add_rewards(caller, rewards: Vec<(HubAssetKey, i128)>) */
|
|
174
143
|
export declare function buildStellarAddRewardsTx(opts: StellarBuilderOptions, args: {
|
|
175
144
|
rewards: RewardEntry[];
|
|
176
145
|
}): BuiltStellarTx;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Decoders for the Stellar lending controller `#[contractevent]`s.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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).
|
|
9
11
|
*
|
|
10
12
|
* The public API takes base64-XDR strings (`decodeStellarLendingEvent(topicsB64,
|
|
11
13
|
* dataB64)`) and parses them with this SDK's bundled `@stellar/stellar-sdk`, so
|
|
@@ -37,8 +39,8 @@ export declare const toBase64Xdr: (scv: {
|
|
|
37
39
|
}) => string;
|
|
38
40
|
/** Build the `"<domain>:<action>"` dispatch key from the event topic ScVals. */
|
|
39
41
|
export declare const stellarLendingDispatchKey: (topicsB64: readonly string[]) => string;
|
|
40
|
-
/** Topic keys this SDK can decode
|
|
41
|
-
*
|
|
42
|
+
/** Topic keys this SDK can decode. See the module header for the intentional
|
|
43
|
+
* omissions. */
|
|
42
44
|
export declare const STELLAR_LENDING_TOPICS: readonly string[];
|
|
43
45
|
/**
|
|
44
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
|
|
29
|
+
import { type ConfigureMarketOracleArgs, type CreateLiquidityPoolArgs, type RoleGrantArgs, type TransferOwnershipArgs, type UpdatePoolCapsArgs, 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
|
-
|
|
39
|
-
|
|
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,14 @@ 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
70
|
/** propose(UpdatePoolCaps(PoolCapsArgs)) */
|
|
79
71
|
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
72
|
/** propose(ApproveToken(token)) */
|
|
83
73
|
export declare function buildStellarProposeApproveTokenTx(opts: StellarBuilderOptions, args: {
|
|
84
74
|
token: string;
|
|
@@ -123,7 +113,7 @@ export declare function buildStellarProposeTransferCtrlOwnershipTx(opts: Stellar
|
|
|
123
113
|
*/
|
|
124
114
|
export declare function buildStellarProposeConfigureMarketOracleTx(opts: StellarBuilderOptions, args: ConfigureMarketOracleArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
|
|
125
115
|
/** propose(EditOracleTolerance(EditToleranceArgs)) */
|
|
126
|
-
export declare function buildStellarProposeEditOracleToleranceTx(opts: StellarBuilderOptions, args:
|
|
116
|
+
export declare function buildStellarProposeEditOracleToleranceTx(opts: StellarBuilderOptions, args: EditOracleToleranceProposalArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
|
|
127
117
|
/** propose(UpgradeGov(hash)) */
|
|
128
118
|
export declare function buildStellarProposeGovernanceUpgradeTx(opts: StellarBuilderOptions, args: UpgradeArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
|
|
129
119
|
/** propose(UpdateGovDelay(new_delay)) */
|