ault-sdk-ts 0.11.0 → 0.12.0
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 +104 -23
- package/dist/client.d.ts +2 -0
- package/dist/core/address.d.ts +1 -1
- package/dist/core/clob-gas.d.ts +4 -0
- package/dist/core/clob-msgs.d.ts +14 -6
- package/dist/core/clob-responses.d.ts +4 -1
- package/dist/core/conditional-msgs.d.ts +98 -0
- package/dist/core/manifest-types.d.ts +22 -2
- package/dist/core/margin-account.d.ts +8 -0
- package/dist/core/network.d.ts +21 -11
- package/dist/core/perpetual-msgs.d.ts +8 -0
- package/dist/core/vault-gas.d.ts +3 -1
- package/dist/core/vault-msgs.d.ts +46 -28
- package/dist/eip712/msg.generated.d.ts +19 -8
- package/dist/eip712/types.d.ts +5 -0
- package/dist/high-level/types.d.ts +172 -32
- package/dist/high-level-client.d.ts +1 -1
- package/dist/index.cjs +22007 -18578
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21855 -18453
- package/dist/index.js.map +1 -1
- package/dist/proto/gen/ault/authority/v1/tx.d.ts +12 -0
- package/dist/proto/gen/ault/clob/v1/conditional.d.ts +60 -0
- package/dist/proto/gen/ault/clob/v1/genesis.d.ts +13 -0
- package/dist/proto/gen/ault/clob/v1/group.d.ts +71 -0
- package/dist/proto/gen/ault/clob/v1/params.d.ts +5 -0
- package/dist/proto/gen/ault/clob/v1/query.d.ts +16 -0
- package/dist/proto/gen/ault/clob/v1/twap.d.ts +8 -4
- package/dist/proto/gen/ault/clob/v1/tx.d.ts +90 -1
- package/dist/proto/gen/ault/lending/v1/params.d.ts +2 -0
- package/dist/proto/gen/ault/lending/v1/tx.d.ts +1 -0
- package/dist/proto/gen/ault/margin/v1/genesis.d.ts +10 -48
- package/dist/proto/gen/ault/margin/v1/margin.d.ts +14 -64
- package/dist/proto/gen/ault/margin/v1/query.d.ts +4 -46
- package/dist/proto/gen/ault/margin/v1/tx.d.ts +11 -29
- package/dist/proto/gen/ault/miner/v1/miner.d.ts +4 -2
- package/dist/proto/gen/ault/oracle/v1/oracle.d.ts +5 -7
- package/dist/proto/gen/ault/oracle/v1/tx.d.ts +1 -1
- package/dist/proto/gen/ault/perpetual/v1/params.d.ts +6 -0
- package/dist/proto/gen/ault/perpetual/v1/perpetual.d.ts +10 -7
- package/dist/proto/gen/ault/spot/v1/genesis.d.ts +2 -0
- package/dist/proto/gen/ault/spot/v1/params.d.ts +25 -0
- package/dist/proto/gen/ault/spot/v1/query.d.ts +29 -0
- package/dist/proto/gen/ault/spot/v1/tx.d.ts +30 -0
- package/dist/proto/gen/ault/vault/v1/genesis.d.ts +22 -12
- package/dist/proto/gen/ault/vault/v1/query.d.ts +4 -18
- package/dist/proto/gen/ault/vault/v1/tx.d.ts +25 -5
- package/dist/proto/gen/ault/vault/v1/vault.d.ts +29 -57
- package/dist/rest/clob.d.ts +35 -3
- package/dist/rest/dex-types.generated.d.ts +548 -81
- package/dist/rest/dex.d.ts +3 -1
- package/dist/rest/dex.generated.d.ts +670 -123
- package/dist/rest/margin.d.ts +1 -5
- package/dist/rest/spot.d.ts +11 -0
- package/package.json +1 -1
|
@@ -40,20 +40,6 @@ export declare enum VaultStatus {
|
|
|
40
40
|
}
|
|
41
41
|
export declare function vaultStatusFromJSON(object: any): VaultStatus;
|
|
42
42
|
export declare function vaultStatusToJSON(object: VaultStatus): string;
|
|
43
|
-
/** fee type identifies the vault fee policy. */
|
|
44
|
-
export declare enum FeeType {
|
|
45
|
-
/** FEE_TYPE_UNSPECIFIED - unspecified is the invalid default fee type. */
|
|
46
|
-
FEE_TYPE_UNSPECIFIED = 0,
|
|
47
|
-
/** FEE_TYPE_NONE - none applies no vault fee. */
|
|
48
|
-
FEE_TYPE_NONE = 1,
|
|
49
|
-
/** FEE_TYPE_MANAGEMENT_DILUTION - management dilution mints manager shares over time. */
|
|
50
|
-
FEE_TYPE_MANAGEMENT_DILUTION = 2,
|
|
51
|
-
/** FEE_TYPE_PERFORMANCE_EXIT - performance exit charges realized redemption profit. */
|
|
52
|
-
FEE_TYPE_PERFORMANCE_EXIT = 3,
|
|
53
|
-
UNRECOGNIZED = -1
|
|
54
|
-
}
|
|
55
|
-
export declare function feeTypeFromJSON(object: any): FeeType;
|
|
56
|
-
export declare function feeTypeToJSON(object: FeeType): string;
|
|
57
43
|
/** trading action identifies a manager operation category. */
|
|
58
44
|
export declare enum TradingAction {
|
|
59
45
|
/** TRADING_ACTION_UNSPECIFIED - unspecified is the invalid default trading action. */
|
|
@@ -62,38 +48,38 @@ export declare enum TradingAction {
|
|
|
62
48
|
TRADING_ACTION_SPOT = 1,
|
|
63
49
|
/** TRADING_ACTION_LENDING_LIQUIDATION - lending liquidation allows lending liquidation. */
|
|
64
50
|
TRADING_ACTION_LENDING_LIQUIDATION = 2,
|
|
51
|
+
/** TRADING_ACTION_PERPETUAL - perpetual allows perpetual account operations. */
|
|
52
|
+
TRADING_ACTION_PERPETUAL = 3,
|
|
53
|
+
/** TRADING_ACTION_BACKSTOP - backstop designates a protocol child for perpetual takeovers. */
|
|
54
|
+
TRADING_ACTION_BACKSTOP = 4,
|
|
65
55
|
UNRECOGNIZED = -1
|
|
66
56
|
}
|
|
67
57
|
export declare function tradingActionFromJSON(object: any): TradingAction;
|
|
68
58
|
export declare function tradingActionToJSON(object: TradingAction): string;
|
|
69
|
-
/** Vault defines
|
|
59
|
+
/** Vault defines immutable vault terms. */
|
|
70
60
|
export interface Vault {
|
|
71
|
-
vaultAddress: Uint8Array;
|
|
72
|
-
vaultType: VaultType;
|
|
73
|
-
relationship: VaultRelationship;
|
|
74
61
|
owner: Uint8Array;
|
|
75
|
-
/**
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
62
|
+
/** fund_window is nil when deposits and redemptions are unrestricted. */
|
|
63
|
+
fundWindow: FundWindow | undefined;
|
|
64
|
+
lending?: LendingVaultTerms | undefined;
|
|
65
|
+
trading?: TradingVaultTerms | undefined;
|
|
66
|
+
}
|
|
67
|
+
/** LendingVaultTerms defines immutable lending denomination and fees. */
|
|
68
|
+
export interface LendingVaultTerms {
|
|
81
69
|
vaultDenom: string;
|
|
82
|
-
|
|
83
|
-
fee: FeePolicy | undefined;
|
|
84
|
-
status: VaultStatus;
|
|
85
|
-
exitFeeBps: number;
|
|
70
|
+
managementFeeBps: number;
|
|
86
71
|
}
|
|
87
|
-
/**
|
|
88
|
-
export interface
|
|
89
|
-
|
|
90
|
-
|
|
72
|
+
/** TradingVaultTerms defines immutable trading fees. */
|
|
73
|
+
export interface TradingVaultTerms {
|
|
74
|
+
performanceFeeBps: number;
|
|
75
|
+
exitFeeBps: number;
|
|
91
76
|
}
|
|
92
|
-
/**
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
77
|
+
/** VaultState defines mutable vault state. */
|
|
78
|
+
export interface VaultState {
|
|
79
|
+
/** manager is empty for child vaults, which use their parent's manager. */
|
|
80
|
+
manager: Uint8Array;
|
|
81
|
+
status: VaultStatus;
|
|
82
|
+
config: VaultConfig | undefined;
|
|
97
83
|
}
|
|
98
84
|
/** FundWindow defines a fixed deposit period and redemption-open time. */
|
|
99
85
|
export interface FundWindow {
|
|
@@ -101,11 +87,6 @@ export interface FundWindow {
|
|
|
101
87
|
depositCloseTime: Date | undefined;
|
|
102
88
|
redemptionOpenTime: Date | undefined;
|
|
103
89
|
}
|
|
104
|
-
/** FeePolicy defines a vault's fee policy. */
|
|
105
|
-
export interface FeePolicy {
|
|
106
|
-
feeType: FeeType;
|
|
107
|
-
rateBps: number;
|
|
108
|
-
}
|
|
109
90
|
/** Position defines a depositor's available shares and deposit value. */
|
|
110
91
|
export interface Position {
|
|
111
92
|
shares: string;
|
|
@@ -131,19 +112,10 @@ export interface RedemptionRequest {
|
|
|
131
112
|
*/
|
|
132
113
|
depositValue: string;
|
|
133
114
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* does not track forced close.
|
|
137
|
-
*/
|
|
138
|
-
closeOnRedemption: boolean;
|
|
139
|
-
/**
|
|
140
|
-
* counts rounds that placed at least one forced-close order, regardless of
|
|
141
|
-
* fills.
|
|
115
|
+
* awaiting_liquidity means the previous liquidity action should be checked
|
|
116
|
+
* once before retrying.
|
|
142
117
|
*/
|
|
143
|
-
|
|
144
|
-
noProgressRounds: number;
|
|
145
|
-
/** last_available_amount is denominated in the vault's VaultDenom. */
|
|
146
|
-
lastAvailableAmount: string;
|
|
118
|
+
awaitingLiquidity: boolean;
|
|
147
119
|
}
|
|
148
120
|
/** VaultConfig wraps type-specific vault configuration. */
|
|
149
121
|
export interface VaultConfig {
|
|
@@ -192,10 +164,10 @@ export interface OracleFeed {
|
|
|
192
164
|
feedId: string;
|
|
193
165
|
}
|
|
194
166
|
export declare const Vault: MessageFns<Vault>;
|
|
195
|
-
export declare const
|
|
196
|
-
export declare const
|
|
167
|
+
export declare const LendingVaultTerms: MessageFns<LendingVaultTerms>;
|
|
168
|
+
export declare const TradingVaultTerms: MessageFns<TradingVaultTerms>;
|
|
169
|
+
export declare const VaultState: MessageFns<VaultState>;
|
|
197
170
|
export declare const FundWindow: MessageFns<FundWindow>;
|
|
198
|
-
export declare const FeePolicy: MessageFns<FeePolicy>;
|
|
199
171
|
export declare const Position: MessageFns<Position>;
|
|
200
172
|
export declare const RedemptionQueue: MessageFns<RedemptionQueue>;
|
|
201
173
|
export declare const RedemptionRequest: MessageFns<RedemptionRequest>;
|
package/dist/rest/clob.d.ts
CHANGED
|
@@ -1,21 +1,53 @@
|
|
|
1
1
|
import { type RestContext } from "./context";
|
|
2
2
|
import type { PaginationParams } from "./types";
|
|
3
3
|
import { QueryOrderResponse, QueryOrdersResponse, QueryParamsResponse, QueryTwapOrdersResponse } from "../proto/gen/ault/clob/v1/query";
|
|
4
|
+
import { ConditionalOrder as ConditionalOrderProto } from "../proto/gen/ault/clob/v1/conditional";
|
|
5
|
+
import { MsgPlaceLimitOrder, MsgPlaceMarketOrder } from "../proto/gen/ault/clob/v1/tx";
|
|
6
|
+
import type { PageResponse } from "../proto/gen/cosmos/base/query/v1beta1/pagination";
|
|
7
|
+
/**
|
|
8
|
+
* A conditional order waiting for its trigger. The chain stores the order it
|
|
9
|
+
* will place as an Any; the gateway renders it as JSON with an `@type`, which
|
|
10
|
+
* is decoded here into `limit` or `market`.
|
|
11
|
+
*/
|
|
12
|
+
export type ConditionalOrder = Omit<ConditionalOrderProto, "order"> & {
|
|
13
|
+
limit?: MsgPlaceLimitOrder;
|
|
14
|
+
market?: MsgPlaceMarketOrder;
|
|
15
|
+
};
|
|
16
|
+
export interface ConditionalOrdersResponse {
|
|
17
|
+
orders: ConditionalOrder[];
|
|
18
|
+
pagination: PageResponse | undefined;
|
|
19
|
+
}
|
|
20
|
+
/** QueryOrderResponse with the rc.3 `conditional` branch decoded. */
|
|
21
|
+
export type OrderResponse = Omit<QueryOrderResponse, "conditional"> & {
|
|
22
|
+
conditional?: ConditionalOrder;
|
|
23
|
+
};
|
|
4
24
|
export interface ClobApi {
|
|
5
25
|
getParams: () => Promise<QueryParamsResponse>;
|
|
6
|
-
|
|
26
|
+
/** A live order: `resting`, `twap`, or (rc.3) a `conditional` order waiting for its trigger. */
|
|
27
|
+
getOrder: (orderId: Uint8Array | string) => Promise<OrderResponse>;
|
|
7
28
|
/**
|
|
8
29
|
* Resolves a live order by its `(orderer, cloid)` pair against the node's CLOB
|
|
9
30
|
* state. The cloid index is dropped once the order closes, so a miss returns
|
|
10
31
|
* a response with neither oneof branch set rather than throwing (non-404
|
|
11
32
|
* failures still throw), letting a caller fall back to the indexed dex-api.
|
|
12
|
-
* `cloid` is raw 8 bytes. A hit sets `resting` (limit order)
|
|
33
|
+
* `cloid` is raw 8 bytes. A hit sets `resting` (limit order), `twap` or
|
|
34
|
+
* `conditional`. Once a conditional order triggers, its cloid moves to the
|
|
35
|
+
* order it placed.
|
|
13
36
|
*/
|
|
14
|
-
getOrderByCloid: (orderer: string, cloid: Uint8Array) => Promise<
|
|
37
|
+
getOrderByCloid: (orderer: string, cloid: Uint8Array) => Promise<OrderResponse>;
|
|
15
38
|
getOrders: (params?: {
|
|
16
39
|
marketId?: Uint8Array | string;
|
|
17
40
|
pagination?: PaginationParams;
|
|
18
41
|
}) => Promise<QueryOrdersResponse>;
|
|
42
|
+
/**
|
|
43
|
+
* Conditional orders waiting for their trigger, held by `orderer`: the
|
|
44
|
+
* wallet for spot, the derived margin or perpetual account otherwise.
|
|
45
|
+
* The chain caps a page at 100 (default 10).
|
|
46
|
+
*/
|
|
47
|
+
getConditionalOrders: (params: {
|
|
48
|
+
orderer: string;
|
|
49
|
+
pagination?: PaginationParams;
|
|
50
|
+
}) => Promise<ConditionalOrdersResponse>;
|
|
19
51
|
/** Live TWAP orders (parent + slice schedule), optionally filtered by orderer. */
|
|
20
52
|
getTwapOrders: (params?: {
|
|
21
53
|
orderer?: string;
|