ault-sdk-ts 0.7.2 → 0.9.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 -1
- package/dist/agent/sign-and-broadcast.d.ts +1 -1
- package/dist/agent/tx/perpetual.d.ts +10 -0
- package/dist/client.d.ts +2 -0
- package/dist/core/clob-msgs.d.ts +12 -3
- package/dist/core/manifest-types.d.ts +8 -0
- package/dist/core/network.d.ts +11 -7
- package/dist/core/perpetual-gas.d.ts +12 -0
- package/dist/core/perpetual-msgs.d.ts +60 -0
- package/dist/eip712/msg-encoders.generated.d.ts +8 -0
- package/dist/eip712/msg.generated.d.ts +76 -6
- package/dist/eip712/registry.d.ts +11 -0
- package/dist/eip712/types.d.ts +5 -0
- package/dist/high-level/tx/perpetual.d.ts +3 -0
- package/dist/high-level/types.d.ts +83 -4
- package/dist/index.cjs +24916 -9691
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +25243 -10290
- package/dist/index.js.map +1 -1
- package/dist/perp/decimal.d.ts +39 -0
- package/dist/perp/funding.d.ts +18 -0
- package/dist/perp/index.d.ts +5 -0
- package/dist/perp/margin.d.ts +33 -0
- package/dist/perp/orders.d.ts +27 -0
- package/dist/perp/position.d.ts +29 -0
- package/dist/proto/gen/ault/accountx/v1/query.d.ts +10 -1
- package/dist/proto/gen/ault/authority/v1/authority.d.ts +2 -0
- package/dist/proto/gen/ault/clob/v1/genesis.d.ts +7 -0
- package/dist/proto/gen/ault/clob/v1/twap.d.ts +11 -8
- package/dist/proto/gen/ault/clob/v1/tx.d.ts +11 -1
- package/dist/proto/gen/ault/common/v1/system.d.ts +31 -0
- package/dist/proto/gen/ault/lending/v1/genesis.d.ts +34 -0
- package/dist/proto/gen/ault/lending/v1/lending.d.ts +152 -0
- package/dist/proto/gen/ault/lending/v1/params.d.ts +42 -0
- package/dist/proto/gen/ault/lending/v1/query.d.ts +157 -0
- package/dist/proto/gen/ault/lending/v1/tx.d.ts +236 -0
- package/dist/proto/gen/ault/margin/v1/genesis.d.ts +102 -0
- package/dist/proto/gen/ault/margin/v1/margin.d.ts +130 -0
- package/dist/proto/gen/ault/margin/v1/params.d.ts +31 -0
- package/dist/proto/gen/ault/margin/v1/query.d.ts +127 -0
- package/dist/proto/gen/ault/margin/v1/tx.d.ts +181 -0
- package/dist/proto/gen/ault/market/v1/market.d.ts +9 -0
- package/dist/proto/gen/ault/market/v1/tx.d.ts +16 -0
- package/dist/proto/gen/ault/oracle/v1/genesis.d.ts +69 -0
- package/dist/proto/gen/ault/oracle/v1/oracle.d.ts +154 -0
- package/dist/proto/gen/ault/oracle/v1/query.d.ts +93 -0
- package/dist/proto/gen/ault/oracle/v1/tx.d.ts +151 -0
- package/dist/proto/gen/ault/perpetual/v1/genesis.d.ts +119 -0
- package/dist/proto/gen/ault/perpetual/v1/order.d.ts +46 -0
- package/dist/proto/gen/ault/perpetual/v1/params.d.ts +30 -0
- package/dist/proto/gen/ault/perpetual/v1/perpetual.d.ts +192 -0
- package/dist/proto/gen/ault/perpetual/v1/query.d.ts +150 -0
- package/dist/proto/gen/ault/perpetual/v1/tx.d.ts +97 -0
- package/dist/proto/gen/ault/systemtx/v1/genesis.d.ts +37 -0
- package/dist/proto/gen/ault/vault/v1/genesis.d.ts +90 -0
- package/dist/proto/gen/ault/vault/v1/params.d.ts +55 -0
- package/dist/proto/gen/ault/vault/v1/query.d.ts +152 -0
- package/dist/proto/gen/ault/vault/v1/tx.d.ts +194 -0
- package/dist/proto/gen/ault/vault/v1/vault.d.ts +227 -0
- package/dist/rest/dex-types.generated.d.ts +2104 -25
- package/dist/rest/dex.d.ts +18 -1
- package/dist/rest/dex.generated.d.ts +4336 -445
- package/dist/rest/perpetual.d.ts +46 -0
- package/dist/rest/tokenregistry.d.ts +7 -0
- package/dist/utils/cosmos-dec.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination";
|
|
3
|
+
import { Coin } from "../../../cosmos/base/v1beta1/coin";
|
|
4
|
+
import { Params } from "./params";
|
|
5
|
+
export declare const protobufPackage = "ault.margin.v1";
|
|
6
|
+
export interface QueryParamsRequest {
|
|
7
|
+
}
|
|
8
|
+
export interface QueryParamsResponse {
|
|
9
|
+
params: Params | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface QueryEnabledMarketsRequest {
|
|
12
|
+
pagination: PageRequest | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface QueryEnabledMarketsResponse {
|
|
15
|
+
/**
|
|
16
|
+
* market_ids are the markets margin orders may be placed on, raw bytes as
|
|
17
|
+
* every other market id on this surface is: QueryMarginAccountRequest takes
|
|
18
|
+
* one that way and MarginAccountResponse returns one that way.
|
|
19
|
+
*/
|
|
20
|
+
marketIds: Uint8Array[];
|
|
21
|
+
pagination: PageResponse | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface QueryMarginAccountRequest {
|
|
24
|
+
/** owner is the address that controls the margin account. */
|
|
25
|
+
owner: string;
|
|
26
|
+
/**
|
|
27
|
+
* market_id selects the isolated margin account of that market; empty selects
|
|
28
|
+
* the cross-margin account, matching how the store reads an empty market id.
|
|
29
|
+
*/
|
|
30
|
+
marketId: Uint8Array;
|
|
31
|
+
}
|
|
32
|
+
export interface QueryMarginAccountResponse {
|
|
33
|
+
account: MarginAccountResponse | undefined;
|
|
34
|
+
}
|
|
35
|
+
export interface QueryMarginOrdersRequest {
|
|
36
|
+
/** account is the derived margin account address, not its owner. */
|
|
37
|
+
account: string;
|
|
38
|
+
pagination: PageRequest | undefined;
|
|
39
|
+
}
|
|
40
|
+
export interface QueryMarginOrdersResponse {
|
|
41
|
+
/** order_ids are the x/clob order ids the account still has open. */
|
|
42
|
+
orderIds: Uint8Array[];
|
|
43
|
+
pagination: PageResponse | undefined;
|
|
44
|
+
}
|
|
45
|
+
export interface QueryPendingSettlementsRequest {
|
|
46
|
+
pagination: PageRequest | undefined;
|
|
47
|
+
}
|
|
48
|
+
export interface QueryPendingSettlementsResponse {
|
|
49
|
+
settlements: PendingSettlementResponse[];
|
|
50
|
+
pagination: PageResponse | undefined;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* MarginAccountResponse is one margin account with its reservation ledger
|
|
54
|
+
* folded in, so a frontend renders a position from one read.
|
|
55
|
+
*
|
|
56
|
+
* Every address here is bech32.
|
|
57
|
+
*/
|
|
58
|
+
export interface MarginAccountResponse {
|
|
59
|
+
/**
|
|
60
|
+
* address is the derived margin account address, which is the store key and
|
|
61
|
+
* the address x/lending holds the collateral under.
|
|
62
|
+
*/
|
|
63
|
+
address: string;
|
|
64
|
+
/** owner is the address that controls the account. */
|
|
65
|
+
owner: string;
|
|
66
|
+
/** market_id is the isolated market, or empty for the cross-margin account. */
|
|
67
|
+
marketId: Uint8Array;
|
|
68
|
+
/**
|
|
69
|
+
* collaterals_in_order is the collateral committed to resting orders and so
|
|
70
|
+
* unavailable for withdrawal, repayment, or new orders.
|
|
71
|
+
*/
|
|
72
|
+
collateralsInOrder: Coin[];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* PendingSettlementResponse is one queued settlement with the order id keying
|
|
76
|
+
* it, which the stored record does not carry. Its addresses are bech32 for the
|
|
77
|
+
* same reason MarginAccountResponse's are.
|
|
78
|
+
*/
|
|
79
|
+
export interface PendingSettlementResponse {
|
|
80
|
+
/** order_id is the x/clob order the proceeds came from. */
|
|
81
|
+
orderId: Uint8Array;
|
|
82
|
+
/** escrow_address is the market escrow the proceeds are drawn from. */
|
|
83
|
+
escrowAddress: string;
|
|
84
|
+
/**
|
|
85
|
+
* orderer is the margin account that receives the proceeds, bech32 like every
|
|
86
|
+
* other orderer on this chain, x/clob's order events included. The one
|
|
87
|
+
* exception is margin's own settlement_deferred event, which carries the same
|
|
88
|
+
* field hex under its own key, orderer_hex, for the reason at
|
|
89
|
+
* x/margin/types/events.go.
|
|
90
|
+
*/
|
|
91
|
+
orderer: string;
|
|
92
|
+
/** payout is the fill proceeds to credit as collateral. */
|
|
93
|
+
payout: Coin | undefined;
|
|
94
|
+
/** pool_id is the lending pool the fill was funded from. */
|
|
95
|
+
poolId: bigint;
|
|
96
|
+
}
|
|
97
|
+
export declare const QueryParamsRequest: MessageFns<QueryParamsRequest>;
|
|
98
|
+
export declare const QueryParamsResponse: MessageFns<QueryParamsResponse>;
|
|
99
|
+
export declare const QueryEnabledMarketsRequest: MessageFns<QueryEnabledMarketsRequest>;
|
|
100
|
+
export declare const QueryEnabledMarketsResponse: MessageFns<QueryEnabledMarketsResponse>;
|
|
101
|
+
export declare const QueryMarginAccountRequest: MessageFns<QueryMarginAccountRequest>;
|
|
102
|
+
export declare const QueryMarginAccountResponse: MessageFns<QueryMarginAccountResponse>;
|
|
103
|
+
export declare const QueryMarginOrdersRequest: MessageFns<QueryMarginOrdersRequest>;
|
|
104
|
+
export declare const QueryMarginOrdersResponse: MessageFns<QueryMarginOrdersResponse>;
|
|
105
|
+
export declare const QueryPendingSettlementsRequest: MessageFns<QueryPendingSettlementsRequest>;
|
|
106
|
+
export declare const QueryPendingSettlementsResponse: MessageFns<QueryPendingSettlementsResponse>;
|
|
107
|
+
export declare const MarginAccountResponse: MessageFns<MarginAccountResponse>;
|
|
108
|
+
export declare const PendingSettlementResponse: MessageFns<PendingSettlementResponse>;
|
|
109
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
110
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
111
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
112
|
+
} : Partial<T>;
|
|
113
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
114
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
115
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
116
|
+
} & {
|
|
117
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
118
|
+
};
|
|
119
|
+
export interface MessageFns<T> {
|
|
120
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
121
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
122
|
+
fromJSON(object: any): T;
|
|
123
|
+
toJSON(message: T): unknown;
|
|
124
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
125
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
126
|
+
}
|
|
127
|
+
export {};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { Coin } from "../../../cosmos/base/v1beta1/coin";
|
|
3
|
+
import { Params } from "./params";
|
|
4
|
+
export declare const protobufPackage = "ault.margin.v1";
|
|
5
|
+
/** MsgDepositMargin deposits collateral into the sender's margin account. */
|
|
6
|
+
export interface MsgDepositMargin {
|
|
7
|
+
/** sender is the signer address. */
|
|
8
|
+
sender: string;
|
|
9
|
+
/**
|
|
10
|
+
* market_id selects the margin account: nil for the cross-margin account, a
|
|
11
|
+
* non-empty value for the isolated-margin account scoped to that market.
|
|
12
|
+
*/
|
|
13
|
+
marketId: Uint8Array;
|
|
14
|
+
/** amount is the collateral to deposit. */
|
|
15
|
+
amount: Coin[];
|
|
16
|
+
}
|
|
17
|
+
/** MsgDepositMarginResponse is the response for MsgDepositMargin. */
|
|
18
|
+
export interface MsgDepositMarginResponse {
|
|
19
|
+
}
|
|
20
|
+
/** MsgWithdrawMargin withdraws collateral from the sender's margin account. */
|
|
21
|
+
export interface MsgWithdrawMargin {
|
|
22
|
+
/** sender is the signer address. */
|
|
23
|
+
sender: string;
|
|
24
|
+
/**
|
|
25
|
+
* market_id selects the margin account: nil for the cross-margin account, a
|
|
26
|
+
* non-empty value for the isolated-margin account scoped to that market.
|
|
27
|
+
*/
|
|
28
|
+
marketId: Uint8Array;
|
|
29
|
+
/** amount is the collateral to withdraw. */
|
|
30
|
+
amount: Coin[];
|
|
31
|
+
}
|
|
32
|
+
/** MsgWithdrawMarginResponse is the response for MsgWithdrawMargin. */
|
|
33
|
+
export interface MsgWithdrawMarginResponse {
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* MsgBorrowMargin borrows into the sender's margin account and books the
|
|
37
|
+
* borrowed coins straight back as its collateral, so that a later order can be
|
|
38
|
+
* funded without borrowing at placement. It is the deliberate counterpart to
|
|
39
|
+
* the per-order auto_repay flags: turning those off leaves the account without
|
|
40
|
+
* a repayment trigger, and borrowing is refused while the oracle is stale, so
|
|
41
|
+
* the buffer has to be raisable while it is not.
|
|
42
|
+
*
|
|
43
|
+
* The coins never leave the margin account. Withdrawing them is
|
|
44
|
+
* MsgWithdrawMargin, which x/lending health gates once the account carries
|
|
45
|
+
* debt.
|
|
46
|
+
*/
|
|
47
|
+
export interface MsgBorrowMargin {
|
|
48
|
+
/** sender is the signer address. */
|
|
49
|
+
sender: string;
|
|
50
|
+
/**
|
|
51
|
+
* market_id selects the margin account: nil for the cross-margin account, a
|
|
52
|
+
* non-empty value for the isolated-margin account scoped to that market.
|
|
53
|
+
*/
|
|
54
|
+
marketId: Uint8Array;
|
|
55
|
+
/**
|
|
56
|
+
* amount is the coin to borrow. It must be a collateral asset of the margin
|
|
57
|
+
* lending pool, since it is booked back as collateral in the same call.
|
|
58
|
+
*/
|
|
59
|
+
amount: Coin | undefined;
|
|
60
|
+
}
|
|
61
|
+
/** MsgBorrowMarginResponse is the response for MsgBorrowMargin. */
|
|
62
|
+
export interface MsgBorrowMarginResponse {
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* MsgRepayMargin repays the sender's margin account debt out of the collateral
|
|
66
|
+
* the account already holds. Gated on nothing, like MsgWithdrawMargin:
|
|
67
|
+
* unwinding must never be trapped by an operator's switch.
|
|
68
|
+
*/
|
|
69
|
+
export interface MsgRepayMargin {
|
|
70
|
+
/** sender is the signer address. */
|
|
71
|
+
sender: string;
|
|
72
|
+
/**
|
|
73
|
+
* market_id selects the margin account: nil for the cross-margin account, a
|
|
74
|
+
* non-empty value for the isolated-margin account scoped to that market.
|
|
75
|
+
*/
|
|
76
|
+
marketId: Uint8Array;
|
|
77
|
+
/**
|
|
78
|
+
* amount bounds the repayment. Less is repaid when the account owes less, or
|
|
79
|
+
* when x/lending caps what its collateral can cover.
|
|
80
|
+
*/
|
|
81
|
+
amount: Coin | undefined;
|
|
82
|
+
}
|
|
83
|
+
/** MsgRepayMarginResponse is the response for MsgRepayMargin. */
|
|
84
|
+
export interface MsgRepayMarginResponse {
|
|
85
|
+
/** repaid is what the repayment actually cleared, which is at most amount. */
|
|
86
|
+
repaid: Coin | undefined;
|
|
87
|
+
}
|
|
88
|
+
/** MsgEnableMarginMarket enables margin trading for a market. */
|
|
89
|
+
export interface MsgEnableMarginMarket {
|
|
90
|
+
/** sender must hold the MARKET_COORDINATOR role. */
|
|
91
|
+
sender: string;
|
|
92
|
+
/** market_id is the x/clob market to enable for margin trading. */
|
|
93
|
+
marketId: Uint8Array;
|
|
94
|
+
}
|
|
95
|
+
/** MsgEnableMarginMarketResponse is the response for MsgEnableMarginMarket. */
|
|
96
|
+
export interface MsgEnableMarginMarketResponse {
|
|
97
|
+
}
|
|
98
|
+
/** MsgDisableMarginMarket disables margin trading for a market. */
|
|
99
|
+
export interface MsgDisableMarginMarket {
|
|
100
|
+
/** sender must hold the RISK_MANAGER role. */
|
|
101
|
+
sender: string;
|
|
102
|
+
/** market_id is the x/clob market to disable for margin trading. */
|
|
103
|
+
marketId: Uint8Array;
|
|
104
|
+
}
|
|
105
|
+
/** MsgDisableMarginMarketResponse is the response for MsgDisableMarginMarket. */
|
|
106
|
+
export interface MsgDisableMarginMarketResponse {
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* MsgUpdateParams is the request type for updating module parameters.
|
|
110
|
+
* Can only be executed via governance proposal.
|
|
111
|
+
*/
|
|
112
|
+
export interface MsgUpdateParams {
|
|
113
|
+
/** authority is the address of the governance account. */
|
|
114
|
+
authority: string;
|
|
115
|
+
/** params defines the new parameter values to set. */
|
|
116
|
+
params: Params | undefined;
|
|
117
|
+
}
|
|
118
|
+
/** MsgUpdateParamsResponse is the response type for the Msg/UpdateParams RPC. */
|
|
119
|
+
export interface MsgUpdateParamsResponse {
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* MsgSetMarginLendingPool sets the x/lending pool that backs every margin
|
|
123
|
+
* account. It is its own message rather than a Params field because the move is
|
|
124
|
+
* only legal against state: the pool must exist and back every enabled market's
|
|
125
|
+
* denoms, and no account may still hold anything in the pool being left. None
|
|
126
|
+
* of that is expressible in the stateless Params.Validate, and folding it into
|
|
127
|
+
* MsgUpdateParams would let this one field block an unrelated parameter change
|
|
128
|
+
* after a voting period has already been spent.
|
|
129
|
+
* Can only be executed via governance proposal.
|
|
130
|
+
*/
|
|
131
|
+
export interface MsgSetMarginLendingPool {
|
|
132
|
+
/** authority is the address of the governance account. */
|
|
133
|
+
authority: string;
|
|
134
|
+
/**
|
|
135
|
+
* pool_id is the x/lending pool to back margin accounts with. Every value is
|
|
136
|
+
* syntactically legal, pool ids starting at 0, so existence is checked in the
|
|
137
|
+
* msg server against state rather than in ValidateBasic.
|
|
138
|
+
*/
|
|
139
|
+
poolId: bigint;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* MsgSetMarginLendingPoolResponse is the response type for the
|
|
143
|
+
* Msg/SetMarginLendingPool RPC.
|
|
144
|
+
*/
|
|
145
|
+
export interface MsgSetMarginLendingPoolResponse {
|
|
146
|
+
}
|
|
147
|
+
export declare const MsgDepositMargin: MessageFns<MsgDepositMargin>;
|
|
148
|
+
export declare const MsgDepositMarginResponse: MessageFns<MsgDepositMarginResponse>;
|
|
149
|
+
export declare const MsgWithdrawMargin: MessageFns<MsgWithdrawMargin>;
|
|
150
|
+
export declare const MsgWithdrawMarginResponse: MessageFns<MsgWithdrawMarginResponse>;
|
|
151
|
+
export declare const MsgBorrowMargin: MessageFns<MsgBorrowMargin>;
|
|
152
|
+
export declare const MsgBorrowMarginResponse: MessageFns<MsgBorrowMarginResponse>;
|
|
153
|
+
export declare const MsgRepayMargin: MessageFns<MsgRepayMargin>;
|
|
154
|
+
export declare const MsgRepayMarginResponse: MessageFns<MsgRepayMarginResponse>;
|
|
155
|
+
export declare const MsgEnableMarginMarket: MessageFns<MsgEnableMarginMarket>;
|
|
156
|
+
export declare const MsgEnableMarginMarketResponse: MessageFns<MsgEnableMarginMarketResponse>;
|
|
157
|
+
export declare const MsgDisableMarginMarket: MessageFns<MsgDisableMarginMarket>;
|
|
158
|
+
export declare const MsgDisableMarginMarketResponse: MessageFns<MsgDisableMarginMarketResponse>;
|
|
159
|
+
export declare const MsgUpdateParams: MessageFns<MsgUpdateParams>;
|
|
160
|
+
export declare const MsgUpdateParamsResponse: MessageFns<MsgUpdateParamsResponse>;
|
|
161
|
+
export declare const MsgSetMarginLendingPool: MessageFns<MsgSetMarginLendingPool>;
|
|
162
|
+
export declare const MsgSetMarginLendingPoolResponse: MessageFns<MsgSetMarginLendingPoolResponse>;
|
|
163
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
164
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
165
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
166
|
+
} : Partial<T>;
|
|
167
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
168
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
169
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
170
|
+
} & {
|
|
171
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
172
|
+
};
|
|
173
|
+
export interface MessageFns<T> {
|
|
174
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
175
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
176
|
+
fromJSON(object: any): T;
|
|
177
|
+
toJSON(message: T): unknown;
|
|
178
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
179
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
180
|
+
}
|
|
181
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { Any } from "../../../google/protobuf/any";
|
|
2
3
|
export declare const protobufPackage = "ault.market.v1";
|
|
3
4
|
/** MarketType defines the type of market. */
|
|
4
5
|
export declare enum MarketType {
|
|
@@ -6,6 +7,8 @@ export declare enum MarketType {
|
|
|
6
7
|
MARKET_TYPE_UNSPECIFIED = 0,
|
|
7
8
|
/** MARKET_TYPE_SPOT - MARKET_TYPE_SPOT is a spot market. */
|
|
8
9
|
MARKET_TYPE_SPOT = 1,
|
|
10
|
+
/** MARKET_TYPE_PERPETUAL - MARKET_TYPE_PERPETUAL is a perpetual futures market. */
|
|
11
|
+
MARKET_TYPE_PERPETUAL = 2,
|
|
9
12
|
UNRECOGNIZED = -1
|
|
10
13
|
}
|
|
11
14
|
export declare function marketTypeFromJSON(object: any): MarketType;
|
|
@@ -18,6 +21,11 @@ export interface Market {
|
|
|
18
21
|
takerFeeRate: string;
|
|
19
22
|
tickPrecision: number;
|
|
20
23
|
deployer: string;
|
|
24
|
+
/**
|
|
25
|
+
* config is the market-type-specific policy, validated by the module that
|
|
26
|
+
* owns the market type. Some market types require one; others take none.
|
|
27
|
+
*/
|
|
28
|
+
config: Any | undefined;
|
|
21
29
|
}
|
|
22
30
|
export interface MarketState {
|
|
23
31
|
lastPrice: string;
|
|
@@ -41,6 +49,7 @@ export interface MarketResponse {
|
|
|
41
49
|
lastMatchingHeight: bigint;
|
|
42
50
|
halted: boolean;
|
|
43
51
|
deployer: string;
|
|
52
|
+
config: Any | undefined;
|
|
44
53
|
}
|
|
45
54
|
export declare const Market: MessageFns<Market>;
|
|
46
55
|
export declare const MarketState: MessageFns<MarketState>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { Any } from "../../../google/protobuf/any";
|
|
2
3
|
import { MarketType } from "./market";
|
|
3
4
|
import { Params } from "./params";
|
|
4
5
|
export declare const protobufPackage = "ault.market.v1";
|
|
@@ -10,6 +11,11 @@ export interface MsgCreateMarket {
|
|
|
10
11
|
tickPrecision: number;
|
|
11
12
|
makerFeeRate: string;
|
|
12
13
|
takerFeeRate: string;
|
|
14
|
+
/**
|
|
15
|
+
* config is required for a market type whose owning module registers one,
|
|
16
|
+
* as a perpetual market does, and must be absent otherwise.
|
|
17
|
+
*/
|
|
18
|
+
config: Any | undefined;
|
|
13
19
|
}
|
|
14
20
|
export interface MsgCreateMarketResponse {
|
|
15
21
|
marketId: Uint8Array;
|
|
@@ -39,6 +45,14 @@ export interface MsgUpdateMarketDeployer {
|
|
|
39
45
|
}
|
|
40
46
|
export interface MsgUpdateMarketDeployerResponse {
|
|
41
47
|
}
|
|
48
|
+
export interface MsgSetMarketConfig {
|
|
49
|
+
/** sender must be the market's deployer. */
|
|
50
|
+
sender: string;
|
|
51
|
+
marketId: Uint8Array;
|
|
52
|
+
config: Any | undefined;
|
|
53
|
+
}
|
|
54
|
+
export interface MsgSetMarketConfigResponse {
|
|
55
|
+
}
|
|
42
56
|
export interface MsgUpdateParams {
|
|
43
57
|
authority: string;
|
|
44
58
|
params: Params | undefined;
|
|
@@ -74,6 +88,8 @@ export declare const MsgUpdateMarket: MessageFns<MsgUpdateMarket>;
|
|
|
74
88
|
export declare const MsgUpdateMarketResponse: MessageFns<MsgUpdateMarketResponse>;
|
|
75
89
|
export declare const MsgUpdateMarketDeployer: MessageFns<MsgUpdateMarketDeployer>;
|
|
76
90
|
export declare const MsgUpdateMarketDeployerResponse: MessageFns<MsgUpdateMarketDeployerResponse>;
|
|
91
|
+
export declare const MsgSetMarketConfig: MessageFns<MsgSetMarketConfig>;
|
|
92
|
+
export declare const MsgSetMarketConfigResponse: MessageFns<MsgSetMarketConfigResponse>;
|
|
77
93
|
export declare const MsgUpdateParams: MessageFns<MsgUpdateParams>;
|
|
78
94
|
export declare const MsgUpdateParamsResponse: MessageFns<MsgUpdateParamsResponse>;
|
|
79
95
|
export declare const MsgHaltMarkets: MessageFns<MsgHaltMarkets>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { Feed, MarketStatus, OracleData, OracleMetadata, Params } from "./oracle";
|
|
3
|
+
export declare const protobufPackage = "ault.oracle.v1";
|
|
4
|
+
/** GenesisState defines the oracle module genesis state. */
|
|
5
|
+
export interface GenesisState {
|
|
6
|
+
/** params are the module params. */
|
|
7
|
+
params: Params | undefined;
|
|
8
|
+
/** trusted_signers is the initial authorized provider signer set. */
|
|
9
|
+
trustedSigners: Uint8Array[];
|
|
10
|
+
/** feeds is the initial feed registry. */
|
|
11
|
+
feeds: Feed[];
|
|
12
|
+
/** feed_mappings is the governance-owned feed_id -> source_id bindings. */
|
|
13
|
+
feedMappings: FeedMapping[];
|
|
14
|
+
/** market_mappings is the governance-owned market_id -> source_id bindings. */
|
|
15
|
+
marketMappings: MarketMapping[];
|
|
16
|
+
/** market_statuses is the stored per-market trading-session status. */
|
|
17
|
+
marketStatuses: MarketStatus[];
|
|
18
|
+
/** oracle_data is the latest canonical value per feed (runtime price state). */
|
|
19
|
+
oracleData: FeedOracleData[];
|
|
20
|
+
/** oracle_metadata is the internal bridge/replay state per feed. */
|
|
21
|
+
oracleMetadata: FeedOracleMetadata[];
|
|
22
|
+
}
|
|
23
|
+
/** FeedOracleData pairs a feed id with its stored OracleData for genesis. */
|
|
24
|
+
export interface FeedOracleData {
|
|
25
|
+
feedId: string;
|
|
26
|
+
data: OracleData | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* FeedOracleMetadata pairs a feed id with its stored OracleMetadata for
|
|
30
|
+
* genesis.
|
|
31
|
+
*/
|
|
32
|
+
export interface FeedOracleMetadata {
|
|
33
|
+
feedId: string;
|
|
34
|
+
metadata: OracleMetadata | undefined;
|
|
35
|
+
}
|
|
36
|
+
/** FeedMapping is one feed_id -> vendor source_id binding. */
|
|
37
|
+
export interface FeedMapping {
|
|
38
|
+
feedId: string;
|
|
39
|
+
sourceId: string;
|
|
40
|
+
}
|
|
41
|
+
/** MarketMapping is one market_id -> vendor source_id binding. */
|
|
42
|
+
export interface MarketMapping {
|
|
43
|
+
marketId: string;
|
|
44
|
+
sourceId: string;
|
|
45
|
+
}
|
|
46
|
+
export declare const GenesisState: MessageFns<GenesisState>;
|
|
47
|
+
export declare const FeedOracleData: MessageFns<FeedOracleData>;
|
|
48
|
+
export declare const FeedOracleMetadata: MessageFns<FeedOracleMetadata>;
|
|
49
|
+
export declare const FeedMapping: MessageFns<FeedMapping>;
|
|
50
|
+
export declare const MarketMapping: MessageFns<MarketMapping>;
|
|
51
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
52
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
53
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
54
|
+
} : Partial<T>;
|
|
55
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
56
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
57
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
58
|
+
} & {
|
|
59
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
60
|
+
};
|
|
61
|
+
export interface MessageFns<T> {
|
|
62
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
63
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
64
|
+
fromJSON(object: any): T;
|
|
65
|
+
toJSON(message: T): unknown;
|
|
66
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
67
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "ault.oracle.v1";
|
|
3
|
+
/** Params defines the oracle module parameters. */
|
|
4
|
+
export interface Params {
|
|
5
|
+
/**
|
|
6
|
+
* max_linear_bridge_duration_us caps a linear-bridge duration derived from a
|
|
7
|
+
* chain or feed gap (microseconds). Must be positive; default 30 minutes.
|
|
8
|
+
*/
|
|
9
|
+
maxLinearBridgeDurationUs: bigint;
|
|
10
|
+
/**
|
|
11
|
+
* min_signers is the quorum: the minimum number of distinct trusted signers a
|
|
12
|
+
* feed's packages must carry to be accepted (the median is taken over them).
|
|
13
|
+
* Must be positive.
|
|
14
|
+
*/
|
|
15
|
+
minSigners: number;
|
|
16
|
+
/**
|
|
17
|
+
* price_shard_count shards proposer-side price injection across blocks: a
|
|
18
|
+
* price feed is injected only when crc32(source_id) % price_shard_count ==
|
|
19
|
+
* height % price_shard_count, bounding per-block payload and verification.
|
|
20
|
+
* Market-status feeds are exempt (injected every block). Must be positive;
|
|
21
|
+
* 1 injects every price feed every block.
|
|
22
|
+
*/
|
|
23
|
+
priceShardCount: number;
|
|
24
|
+
}
|
|
25
|
+
/** Feed is a registry entry for a single provider price feed. */
|
|
26
|
+
export interface Feed {
|
|
27
|
+
/** feed_id is the exact signed provider feed identifier (e.g. "BTC", "XAU"). */
|
|
28
|
+
feedId: string;
|
|
29
|
+
/** owner is the feed owner (v1: admin/system; future: deployer). */
|
|
30
|
+
owner: string;
|
|
31
|
+
/** enabled controls whether the feed accepts updates. */
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* market_id binds the feed to a market whose trading session gates it. Set
|
|
35
|
+
* once at registration and immutable; empty means a 24/7 feed (always open).
|
|
36
|
+
*/
|
|
37
|
+
marketId: string;
|
|
38
|
+
/**
|
|
39
|
+
* base_denom is the asset the price is for (e.g. "WETH", "SKYNIX"), aligned
|
|
40
|
+
* with x/market naming. Set once at registration and immutable. An empty
|
|
41
|
+
* base_denom marks a standalone feed (e.g. a perp mark price) that is read
|
|
42
|
+
* only by feed_id and not registered in the denom-pair conversion index.
|
|
43
|
+
*/
|
|
44
|
+
baseDenom: string;
|
|
45
|
+
/**
|
|
46
|
+
* quote_denom is the denom the price is expressed in (e.g. "USD", "KRW",
|
|
47
|
+
* "USDC.e"). "USD" is the normalization hub. Set once and immutable.
|
|
48
|
+
*/
|
|
49
|
+
quoteDenom: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* OracleData is the latest verified source data and bridge-adjusted canonical
|
|
53
|
+
* price stored per feed (the consumer-facing value).
|
|
54
|
+
*/
|
|
55
|
+
export interface OracleData {
|
|
56
|
+
/** price is the final canonical price after any active linear bridge. */
|
|
57
|
+
price: string;
|
|
58
|
+
/**
|
|
59
|
+
* feed_update_timestamp is the latest valid time of the source price data
|
|
60
|
+
* (μs).
|
|
61
|
+
*/
|
|
62
|
+
feedUpdateTimestamp: bigint;
|
|
63
|
+
/**
|
|
64
|
+
* timestamp is the block time when this feed was last processed (μs); set
|
|
65
|
+
* from ctx.BlockTime(), not from the payload.
|
|
66
|
+
*/
|
|
67
|
+
timestamp: bigint;
|
|
68
|
+
/**
|
|
69
|
+
* market_open is the price-confirmed trading flag: true once a price is
|
|
70
|
+
* applied while the market is open, reset when a price is dropped during a
|
|
71
|
+
* close. It is one input to tradeability; use the IsMarketOpen keeper method,
|
|
72
|
+
* which also checks the live session and MarketStatus.opened_at (rejecting
|
|
73
|
+
* replayed pre-open prices).
|
|
74
|
+
*/
|
|
75
|
+
marketOpen: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* MarketStatus is the trading-session state of a market, stored separately from
|
|
79
|
+
* price feeds and read by consumers (e.g. perp/lending) for halt decisions. The
|
|
80
|
+
* feed-driven status carries only the current session code.
|
|
81
|
+
*/
|
|
82
|
+
export interface MarketStatus {
|
|
83
|
+
/** market_id is the internal market identifier. */
|
|
84
|
+
marketId: string;
|
|
85
|
+
/**
|
|
86
|
+
* is_open is the market session state from the status feed, aggregated by
|
|
87
|
+
* majority of signers (open is the raw value 1). Price feeds of this market
|
|
88
|
+
* are dropped while it is closed.
|
|
89
|
+
*/
|
|
90
|
+
isOpen: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* opened_at is the status feed's round timestamp (μs) of the most recent
|
|
93
|
+
* transition to open. A feed is tradeable only when its price round is at
|
|
94
|
+
* least this, so a replayed pre-open price (whose signed timestamp predates
|
|
95
|
+
* the reopen) cannot make the market tradeable.
|
|
96
|
+
*/
|
|
97
|
+
openedAt: bigint;
|
|
98
|
+
/**
|
|
99
|
+
* updated_at is the source timestamp (μs) of the last accepted status update.
|
|
100
|
+
* An update whose timestamp predates this is a stale replay and is rejected,
|
|
101
|
+
* so a replayed older "open" cannot overwrite a newer "closed".
|
|
102
|
+
*/
|
|
103
|
+
updatedAt: bigint;
|
|
104
|
+
}
|
|
105
|
+
/** LinearBridgeState is the state of an active linear bridge. */
|
|
106
|
+
export interface LinearBridgeState {
|
|
107
|
+
/** anchor_price is the canonical price immediately before the bridge started. */
|
|
108
|
+
anchorPrice: string;
|
|
109
|
+
/** start_timestamp is the block time the bridge started (μs). */
|
|
110
|
+
startTimestamp: bigint;
|
|
111
|
+
/** duration_us is the smoothing period (μs). */
|
|
112
|
+
durationUs: bigint;
|
|
113
|
+
/**
|
|
114
|
+
* target_price is the price the bridge interpolates toward. When a new price
|
|
115
|
+
* changes the target mid-bridge, the bridge reanchors at the current smoothed
|
|
116
|
+
* value and heads to the new target over the remaining window (no jump).
|
|
117
|
+
*/
|
|
118
|
+
targetPrice: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* OracleMetadata is internal per-feed state for bridge continuation and exact
|
|
122
|
+
* carry-forward recognition. It is not returned by QueryOracle.
|
|
123
|
+
*/
|
|
124
|
+
export interface OracleMetadata {
|
|
125
|
+
/** bridge is the active linear bridge; absent when no bridge is active. */
|
|
126
|
+
bridge: LinearBridgeState | undefined;
|
|
127
|
+
/** last_payload_hash is the hash of the accepted signed bytes. */
|
|
128
|
+
lastPayloadHash: Uint8Array;
|
|
129
|
+
}
|
|
130
|
+
export declare const Params: MessageFns<Params>;
|
|
131
|
+
export declare const Feed: MessageFns<Feed>;
|
|
132
|
+
export declare const OracleData: MessageFns<OracleData>;
|
|
133
|
+
export declare const MarketStatus: MessageFns<MarketStatus>;
|
|
134
|
+
export declare const LinearBridgeState: MessageFns<LinearBridgeState>;
|
|
135
|
+
export declare const OracleMetadata: MessageFns<OracleMetadata>;
|
|
136
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
137
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
138
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
139
|
+
} : Partial<T>;
|
|
140
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
141
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
142
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
143
|
+
} & {
|
|
144
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
145
|
+
};
|
|
146
|
+
export interface MessageFns<T> {
|
|
147
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
148
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
149
|
+
fromJSON(object: any): T;
|
|
150
|
+
toJSON(message: T): unknown;
|
|
151
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
152
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
153
|
+
}
|
|
154
|
+
export {};
|