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.
Files changed (67) hide show
  1. package/README.md +104 -1
  2. package/dist/agent/sign-and-broadcast.d.ts +1 -1
  3. package/dist/agent/tx/perpetual.d.ts +10 -0
  4. package/dist/client.d.ts +2 -0
  5. package/dist/core/clob-msgs.d.ts +12 -3
  6. package/dist/core/manifest-types.d.ts +8 -0
  7. package/dist/core/network.d.ts +11 -7
  8. package/dist/core/perpetual-gas.d.ts +12 -0
  9. package/dist/core/perpetual-msgs.d.ts +60 -0
  10. package/dist/eip712/msg-encoders.generated.d.ts +8 -0
  11. package/dist/eip712/msg.generated.d.ts +76 -6
  12. package/dist/eip712/registry.d.ts +11 -0
  13. package/dist/eip712/types.d.ts +5 -0
  14. package/dist/high-level/tx/perpetual.d.ts +3 -0
  15. package/dist/high-level/types.d.ts +83 -4
  16. package/dist/index.cjs +24916 -9691
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.ts +3 -0
  19. package/dist/index.js +25243 -10290
  20. package/dist/index.js.map +1 -1
  21. package/dist/perp/decimal.d.ts +39 -0
  22. package/dist/perp/funding.d.ts +18 -0
  23. package/dist/perp/index.d.ts +5 -0
  24. package/dist/perp/margin.d.ts +33 -0
  25. package/dist/perp/orders.d.ts +27 -0
  26. package/dist/perp/position.d.ts +29 -0
  27. package/dist/proto/gen/ault/accountx/v1/query.d.ts +10 -1
  28. package/dist/proto/gen/ault/authority/v1/authority.d.ts +2 -0
  29. package/dist/proto/gen/ault/clob/v1/genesis.d.ts +7 -0
  30. package/dist/proto/gen/ault/clob/v1/twap.d.ts +11 -8
  31. package/dist/proto/gen/ault/clob/v1/tx.d.ts +11 -1
  32. package/dist/proto/gen/ault/common/v1/system.d.ts +31 -0
  33. package/dist/proto/gen/ault/lending/v1/genesis.d.ts +34 -0
  34. package/dist/proto/gen/ault/lending/v1/lending.d.ts +152 -0
  35. package/dist/proto/gen/ault/lending/v1/params.d.ts +42 -0
  36. package/dist/proto/gen/ault/lending/v1/query.d.ts +157 -0
  37. package/dist/proto/gen/ault/lending/v1/tx.d.ts +236 -0
  38. package/dist/proto/gen/ault/margin/v1/genesis.d.ts +102 -0
  39. package/dist/proto/gen/ault/margin/v1/margin.d.ts +130 -0
  40. package/dist/proto/gen/ault/margin/v1/params.d.ts +31 -0
  41. package/dist/proto/gen/ault/margin/v1/query.d.ts +127 -0
  42. package/dist/proto/gen/ault/margin/v1/tx.d.ts +181 -0
  43. package/dist/proto/gen/ault/market/v1/market.d.ts +9 -0
  44. package/dist/proto/gen/ault/market/v1/tx.d.ts +16 -0
  45. package/dist/proto/gen/ault/oracle/v1/genesis.d.ts +69 -0
  46. package/dist/proto/gen/ault/oracle/v1/oracle.d.ts +154 -0
  47. package/dist/proto/gen/ault/oracle/v1/query.d.ts +93 -0
  48. package/dist/proto/gen/ault/oracle/v1/tx.d.ts +151 -0
  49. package/dist/proto/gen/ault/perpetual/v1/genesis.d.ts +119 -0
  50. package/dist/proto/gen/ault/perpetual/v1/order.d.ts +46 -0
  51. package/dist/proto/gen/ault/perpetual/v1/params.d.ts +30 -0
  52. package/dist/proto/gen/ault/perpetual/v1/perpetual.d.ts +192 -0
  53. package/dist/proto/gen/ault/perpetual/v1/query.d.ts +150 -0
  54. package/dist/proto/gen/ault/perpetual/v1/tx.d.ts +97 -0
  55. package/dist/proto/gen/ault/systemtx/v1/genesis.d.ts +37 -0
  56. package/dist/proto/gen/ault/vault/v1/genesis.d.ts +90 -0
  57. package/dist/proto/gen/ault/vault/v1/params.d.ts +55 -0
  58. package/dist/proto/gen/ault/vault/v1/query.d.ts +152 -0
  59. package/dist/proto/gen/ault/vault/v1/tx.d.ts +194 -0
  60. package/dist/proto/gen/ault/vault/v1/vault.d.ts +227 -0
  61. package/dist/rest/dex-types.generated.d.ts +2104 -25
  62. package/dist/rest/dex.d.ts +18 -1
  63. package/dist/rest/dex.generated.d.ts +4336 -445
  64. package/dist/rest/perpetual.d.ts +46 -0
  65. package/dist/rest/tokenregistry.d.ts +7 -0
  66. package/dist/utils/cosmos-dec.d.ts +1 -0
  67. package/package.json +1 -1
@@ -0,0 +1,93 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination";
3
+ import { Feed, MarketStatus, OracleData, Params } from "./oracle";
4
+ export declare const protobufPackage = "ault.oracle.v1";
5
+ /** QueryParamsRequest is the request for Query/Params. */
6
+ export interface QueryParamsRequest {
7
+ }
8
+ /** QueryParamsResponse is the response for Query/Params. */
9
+ export interface QueryParamsResponse {
10
+ /** params are the current module params. */
11
+ params: Params | undefined;
12
+ }
13
+ /** QueryTrustedSignersRequest is the request for Query/TrustedSigners. */
14
+ export interface QueryTrustedSignersRequest {
15
+ }
16
+ /** QueryTrustedSignersResponse is the response for Query/TrustedSigners. */
17
+ export interface QueryTrustedSignersResponse {
18
+ /** signers is the list of authorized provider signer identities. */
19
+ signers: Uint8Array[];
20
+ }
21
+ /** QueryFeedRequest is the request for Query/Feed. */
22
+ export interface QueryFeedRequest {
23
+ /** feed_id is the exact signed provider identifier. */
24
+ feedId: string;
25
+ }
26
+ /** QueryFeedResponse is the response for Query/Feed. */
27
+ export interface QueryFeedResponse {
28
+ /** feed is the feed registry entry. */
29
+ feed: Feed | undefined;
30
+ }
31
+ /** QueryFeedsRequest is the request for Query/Feeds. */
32
+ export interface QueryFeedsRequest {
33
+ /** pagination defines the pagination in the request. */
34
+ pagination: PageRequest | undefined;
35
+ }
36
+ /** QueryFeedsResponse is the response for Query/Feeds. */
37
+ export interface QueryFeedsResponse {
38
+ /** feeds is the paginated list of feeds. */
39
+ feeds: Feed[];
40
+ /** pagination defines the pagination in the response. */
41
+ pagination: PageResponse | undefined;
42
+ }
43
+ /** QueryOracleRequest is the request for Query/Oracle. */
44
+ export interface QueryOracleRequest {
45
+ /** feed_id is the exact signed provider identifier. */
46
+ feedId: string;
47
+ }
48
+ /** QueryOracleResponse is the response for Query/Oracle. */
49
+ export interface QueryOracleResponse {
50
+ /** data is the latest canonical OracleData for the feed. */
51
+ data: OracleData | undefined;
52
+ }
53
+ /** QueryMarketStatusRequest is the request for Query/MarketStatus. */
54
+ export interface QueryMarketStatusRequest {
55
+ /** market_id is the internal market identifier. */
56
+ marketId: string;
57
+ }
58
+ /** QueryMarketStatusResponse is the response for Query/MarketStatus. */
59
+ export interface QueryMarketStatusResponse {
60
+ /** status is the market's trading-session status. */
61
+ status: MarketStatus | undefined;
62
+ }
63
+ export declare const QueryParamsRequest: MessageFns<QueryParamsRequest>;
64
+ export declare const QueryParamsResponse: MessageFns<QueryParamsResponse>;
65
+ export declare const QueryTrustedSignersRequest: MessageFns<QueryTrustedSignersRequest>;
66
+ export declare const QueryTrustedSignersResponse: MessageFns<QueryTrustedSignersResponse>;
67
+ export declare const QueryFeedRequest: MessageFns<QueryFeedRequest>;
68
+ export declare const QueryFeedResponse: MessageFns<QueryFeedResponse>;
69
+ export declare const QueryFeedsRequest: MessageFns<QueryFeedsRequest>;
70
+ export declare const QueryFeedsResponse: MessageFns<QueryFeedsResponse>;
71
+ export declare const QueryOracleRequest: MessageFns<QueryOracleRequest>;
72
+ export declare const QueryOracleResponse: MessageFns<QueryOracleResponse>;
73
+ export declare const QueryMarketStatusRequest: MessageFns<QueryMarketStatusRequest>;
74
+ export declare const QueryMarketStatusResponse: MessageFns<QueryMarketStatusResponse>;
75
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
76
+ 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 {} ? {
77
+ [K in keyof T]?: DeepPartial<T[K]>;
78
+ } : Partial<T>;
79
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
80
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
81
+ [K in keyof P]: Exact<P[K], I[K]>;
82
+ } & {
83
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
84
+ };
85
+ export interface MessageFns<T> {
86
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
87
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
88
+ fromJSON(object: any): T;
89
+ toJSON(message: T): unknown;
90
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
91
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
92
+ }
93
+ export {};
@@ -0,0 +1,151 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "ault.oracle.v1";
3
+ /**
4
+ * MsgInjectOraclePrices is the proposer-injected payload batch at the oracle
5
+ * system-tx slot (slot 2, after EVM at slot 0 and liquidation at slot 1). It is
6
+ * a system message: unsigned, created only by PrepareProposal.
7
+ */
8
+ export interface MsgInjectOraclePrices {
9
+ /** payloads each carry one self-contained signed provider payload per feed. */
10
+ payloads: Uint8Array[];
11
+ }
12
+ /** MsgInjectOraclePricesResponse is the response for MsgInjectOraclePrices. */
13
+ export interface MsgInjectOraclePricesResponse {
14
+ }
15
+ /**
16
+ * MsgSetTrustedSigner adds or removes a trusted provider signer identity. Both
17
+ * activation and revocation are governance-gated.
18
+ */
19
+ export interface MsgSetTrustedSigner {
20
+ /** sender is the signer address (the governance module account). */
21
+ sender: string;
22
+ /**
23
+ * signer is the provider signer identity, encoded by the v1 Oracle Provider
24
+ * Profile.
25
+ */
26
+ signer: Uint8Array;
27
+ /** active is true to add/authorize, false to remove/revoke. */
28
+ active: boolean;
29
+ }
30
+ /** MsgSetTrustedSignerResponse is the response for MsgSetTrustedSigner. */
31
+ export interface MsgSetTrustedSignerResponse {
32
+ }
33
+ /** MsgSetFeed registers a feed or sets its enabled state (upsert). */
34
+ export interface MsgSetFeed {
35
+ /** sender is the signer address (requires ROLE_MARKET_COORDINATOR). */
36
+ sender: string;
37
+ /** feed_id is the exact signed provider identifier. */
38
+ feedId: string;
39
+ /** enabled controls whether the feed accepts updates. */
40
+ enabled: boolean;
41
+ /**
42
+ * market_id binds the feed to a market (empty = 24/7). Honored only at
43
+ * creation; immutable afterwards. The market must already be mapped.
44
+ */
45
+ marketId: string;
46
+ /**
47
+ * base_denom / quote_denom identify the price pair (e.g. base "WETH", quote
48
+ * "USD"). Honored only at creation; immutable afterwards. An empty base_denom
49
+ * marks a standalone feed (e.g. a perp) that is not added to the denom-pair
50
+ * conversion index.
51
+ */
52
+ baseDenom: string;
53
+ quoteDenom: string;
54
+ }
55
+ /** MsgSetFeedResponse is the response for MsgSetFeed. */
56
+ export interface MsgSetFeedResponse {
57
+ }
58
+ /** MsgRemoveFeed removes a feed. */
59
+ export interface MsgRemoveFeed {
60
+ /** sender is the signer address (requires ROLE_MARKET_COORDINATOR). */
61
+ sender: string;
62
+ /** feed_id is the exact signed provider identifier. */
63
+ feedId: string;
64
+ }
65
+ /** MsgRemoveFeedResponse is the response for MsgRemoveFeed. */
66
+ export interface MsgRemoveFeedResponse {
67
+ }
68
+ /**
69
+ * MsgSetFeedMapping binds, rebinds, or unbinds a feed's vendor source id. The
70
+ * binding decouples the internal feed_id consumers reference from the vendor's
71
+ * native data id used on the ingest path (identity when unbound). An empty
72
+ * source_id unbinds. Governance-gated.
73
+ */
74
+ export interface MsgSetFeedMapping {
75
+ /** sender is the signer address (the governance module account). */
76
+ sender: string;
77
+ /** feed_id is the internal feed identifier consumers reference. */
78
+ feedId: string;
79
+ /** source_id is the vendor-native data id bound to feed_id; empty unbinds. */
80
+ sourceId: string;
81
+ }
82
+ /** MsgSetFeedMappingResponse is the response for MsgSetFeedMapping. */
83
+ export interface MsgSetFeedMappingResponse {
84
+ }
85
+ /**
86
+ * MsgSetMarketMapping binds, rebinds, or unbinds a market's vendor source id,
87
+ * decoupling the internal market_id consumers reference from the vendor's
88
+ * native status package id used on the ingest path (identity when unbound). An
89
+ * empty source_id unbinds. Governance-gated.
90
+ */
91
+ export interface MsgSetMarketMapping {
92
+ /** sender is the signer address (the governance module account). */
93
+ sender: string;
94
+ /** market_id is the internal market identifier consumers reference. */
95
+ marketId: string;
96
+ /** source_id is the vendor-native status id bound to market_id; empty unbinds. */
97
+ sourceId: string;
98
+ }
99
+ /** MsgSetMarketMappingResponse is the response for MsgSetMarketMapping. */
100
+ export interface MsgSetMarketMappingResponse {
101
+ }
102
+ /**
103
+ * MsgUpdateParams updates the governance-controlled module params. Both fields
104
+ * are applied as a full replacement; governance-gated.
105
+ */
106
+ export interface MsgUpdateParams {
107
+ /** sender is the signer address (the governance module account). */
108
+ sender: string;
109
+ /** max_linear_bridge_duration_us is the new cap (μs), must be positive. */
110
+ maxLinearBridgeDurationUs: bigint;
111
+ /** min_signers is the new quorum (distinct trusted signers), must be positive. */
112
+ minSigners: number;
113
+ /** price_shard_count shards proposer-side price injection; must be positive. */
114
+ priceShardCount: number;
115
+ }
116
+ /** MsgUpdateParamsResponse is the response for MsgUpdateParams. */
117
+ export interface MsgUpdateParamsResponse {
118
+ }
119
+ export declare const MsgInjectOraclePrices: MessageFns<MsgInjectOraclePrices>;
120
+ export declare const MsgInjectOraclePricesResponse: MessageFns<MsgInjectOraclePricesResponse>;
121
+ export declare const MsgSetTrustedSigner: MessageFns<MsgSetTrustedSigner>;
122
+ export declare const MsgSetTrustedSignerResponse: MessageFns<MsgSetTrustedSignerResponse>;
123
+ export declare const MsgSetFeed: MessageFns<MsgSetFeed>;
124
+ export declare const MsgSetFeedResponse: MessageFns<MsgSetFeedResponse>;
125
+ export declare const MsgRemoveFeed: MessageFns<MsgRemoveFeed>;
126
+ export declare const MsgRemoveFeedResponse: MessageFns<MsgRemoveFeedResponse>;
127
+ export declare const MsgSetFeedMapping: MessageFns<MsgSetFeedMapping>;
128
+ export declare const MsgSetFeedMappingResponse: MessageFns<MsgSetFeedMappingResponse>;
129
+ export declare const MsgSetMarketMapping: MessageFns<MsgSetMarketMapping>;
130
+ export declare const MsgSetMarketMappingResponse: MessageFns<MsgSetMarketMappingResponse>;
131
+ export declare const MsgUpdateParams: MessageFns<MsgUpdateParams>;
132
+ export declare const MsgUpdateParamsResponse: MessageFns<MsgUpdateParamsResponse>;
133
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
134
+ 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 {} ? {
135
+ [K in keyof T]?: DeepPartial<T[K]>;
136
+ } : Partial<T>;
137
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
138
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
139
+ [K in keyof P]: Exact<P[K], I[K]>;
140
+ } & {
141
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
142
+ };
143
+ export interface MessageFns<T> {
144
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
145
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
146
+ fromJSON(object: any): T;
147
+ toJSON(message: T): unknown;
148
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
149
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
150
+ }
151
+ export {};
@@ -0,0 +1,119 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import { PerpetualOrder, PerpetualOrderState } from "./order";
3
+ import { Params } from "./params";
4
+ import { FundingState, ImpactPriceState, InternalPriceState, MarginConfig, MarkPriceState, OrderExposure, Position } from "./perpetual";
5
+ export declare const protobufPackage = "ault.perpetual.v1";
6
+ /** GenesisState defines the perpetual module's genesis state. */
7
+ export interface GenesisState {
8
+ /** params defines the module parameters at genesis. */
9
+ params: Params | undefined;
10
+ /**
11
+ * collateral_denom is the common collateral token used by every perpetual
12
+ * market.
13
+ */
14
+ collateralDenom: string;
15
+ marginConfigs: MarginConfigRecord[];
16
+ collaterals: CollateralRecord[];
17
+ orders: OrderRecord[];
18
+ orderExposures: OrderExposureRecord[];
19
+ positions: PositionRecord[];
20
+ filledOpenInterests: FilledOpenInterestRecord[];
21
+ /**
22
+ * last_funding_sample_time is the Unix time in seconds of the last funding
23
+ * premium sampling.
24
+ */
25
+ lastFundingSampleTime: bigint;
26
+ fundingStates: FundingStateRecord[];
27
+ markPrices: MarkPriceRecord[];
28
+ impactPrices: ImpactPriceRecord[];
29
+ internalPrices: InternalPriceRecord[];
30
+ }
31
+ export interface MarginConfigRecord {
32
+ owner: string;
33
+ marketId: Uint8Array;
34
+ config: MarginConfig | undefined;
35
+ }
36
+ /**
37
+ * CollateralRecord is the share of the module pool one account owns. It goes
38
+ * negative for an account that has withdrawn against unrealized profit.
39
+ */
40
+ export interface CollateralRecord {
41
+ account: string;
42
+ collateral: string;
43
+ }
44
+ /** OrderRecord pairs a live order with its mutable state. */
45
+ export interface OrderRecord {
46
+ orderId: Uint8Array;
47
+ order: PerpetualOrder | undefined;
48
+ state: PerpetualOrderState | undefined;
49
+ }
50
+ /**
51
+ * OrderExposureRecord pairs an owner's resting order exposure with the market
52
+ * it rests in. It is keyed by the owner rather than the position account, so
53
+ * that the cross account can read what every margin mode has resting.
54
+ */
55
+ export interface OrderExposureRecord {
56
+ owner: string;
57
+ marketId: Uint8Array;
58
+ exposure: OrderExposure | undefined;
59
+ }
60
+ /** PositionRecord pairs a position with the account and market holding it. */
61
+ export interface PositionRecord {
62
+ account: string;
63
+ marketId: Uint8Array;
64
+ position: Position | undefined;
65
+ }
66
+ /**
67
+ * FilledOpenInterestRecord is a market's one-sided filled open interest, in
68
+ * base units.
69
+ */
70
+ export interface FilledOpenInterestRecord {
71
+ marketId: Uint8Array;
72
+ filledOpenInterest: string;
73
+ }
74
+ export interface FundingStateRecord {
75
+ marketId: Uint8Array;
76
+ state: FundingState | undefined;
77
+ }
78
+ export interface MarkPriceRecord {
79
+ marketId: Uint8Array;
80
+ state: MarkPriceState | undefined;
81
+ }
82
+ export interface ImpactPriceRecord {
83
+ marketId: Uint8Array;
84
+ state: ImpactPriceState | undefined;
85
+ }
86
+ export interface InternalPriceRecord {
87
+ marketId: Uint8Array;
88
+ state: InternalPriceState | undefined;
89
+ }
90
+ export declare const GenesisState: MessageFns<GenesisState>;
91
+ export declare const MarginConfigRecord: MessageFns<MarginConfigRecord>;
92
+ export declare const CollateralRecord: MessageFns<CollateralRecord>;
93
+ export declare const OrderRecord: MessageFns<OrderRecord>;
94
+ export declare const OrderExposureRecord: MessageFns<OrderExposureRecord>;
95
+ export declare const PositionRecord: MessageFns<PositionRecord>;
96
+ export declare const FilledOpenInterestRecord: MessageFns<FilledOpenInterestRecord>;
97
+ export declare const FundingStateRecord: MessageFns<FundingStateRecord>;
98
+ export declare const MarkPriceRecord: MessageFns<MarkPriceRecord>;
99
+ export declare const ImpactPriceRecord: MessageFns<ImpactPriceRecord>;
100
+ export declare const InternalPriceRecord: MessageFns<InternalPriceRecord>;
101
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
102
+ 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 {} ? {
103
+ [K in keyof T]?: DeepPartial<T[K]>;
104
+ } : Partial<T>;
105
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
106
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
107
+ [K in keyof P]: Exact<P[K], I[K]>;
108
+ } & {
109
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
110
+ };
111
+ export interface MessageFns<T> {
112
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
113
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
114
+ fromJSON(object: any): T;
115
+ toJSON(message: T): unknown;
116
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
117
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
118
+ }
119
+ export {};
@@ -0,0 +1,46 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import { FeeInfo } from "../../clob/v1/fee";
3
+ import { TimeInForce } from "../../clob/v1/tx";
4
+ export declare const protobufPackage = "ault.perpetual.v1";
5
+ export interface PerpetualOrderOptions {
6
+ reduceOnly: boolean;
7
+ }
8
+ export interface PerpetualOrder {
9
+ orderer: Uint8Array;
10
+ marketId: Uint8Array;
11
+ buy: boolean;
12
+ price: string;
13
+ deadline: Date | undefined;
14
+ tick: bigint;
15
+ postOnly: boolean;
16
+ feeInfo: FeeInfo | undefined;
17
+ timeInForce: TimeInForce;
18
+ options: PerpetualOrderOptions | undefined;
19
+ }
20
+ export interface PerpetualOrderState {
21
+ quantity: string;
22
+ openQuantity: string;
23
+ remainingDeposit: string;
24
+ }
25
+ export declare const PerpetualOrderOptions: MessageFns<PerpetualOrderOptions>;
26
+ export declare const PerpetualOrder: MessageFns<PerpetualOrder>;
27
+ export declare const PerpetualOrderState: MessageFns<PerpetualOrderState>;
28
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
29
+ 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 {} ? {
30
+ [K in keyof T]?: DeepPartial<T[K]>;
31
+ } : Partial<T>;
32
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
33
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
34
+ [K in keyof P]: Exact<P[K], I[K]>;
35
+ } & {
36
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
37
+ };
38
+ export interface MessageFns<T> {
39
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
40
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
41
+ fromJSON(object: any): T;
42
+ toJSON(message: T): unknown;
43
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
44
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
45
+ }
46
+ export {};
@@ -0,0 +1,30 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "ault.perpetual.v1";
3
+ /** Params defines the configurable parameters for the perpetual module. */
4
+ export interface Params {
5
+ /**
6
+ * transfer_notional_floor keeps at least this fraction of position notional
7
+ * in an account after a withdrawal or margin removal.
8
+ */
9
+ transferNotionalFloor: string;
10
+ }
11
+ export declare const Params: MessageFns<Params>;
12
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
13
+ 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 {} ? {
14
+ [K in keyof T]?: DeepPartial<T[K]>;
15
+ } : Partial<T>;
16
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
17
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
18
+ [K in keyof P]: Exact<P[K], I[K]>;
19
+ } & {
20
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
21
+ };
22
+ export interface MessageFns<T> {
23
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
24
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
25
+ fromJSON(object: any): T;
26
+ toJSON(message: T): unknown;
27
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
28
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
29
+ }
30
+ export {};
@@ -0,0 +1,192 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "ault.perpetual.v1";
3
+ export interface Position {
4
+ netBase: string;
5
+ netQuote: string;
6
+ /**
7
+ * last_funding_index is the market's cumulative funding index last settled
8
+ * into the account's collateral.
9
+ */
10
+ lastFundingIndex: string;
11
+ }
12
+ /**
13
+ * MarginTier selects a market's maximum leverage by position notional. The
14
+ * first tier defines the market-wide maximum, and a zero cap on the last tier
15
+ * leaves it unbounded.
16
+ */
17
+ export interface MarginTier {
18
+ notionalCap: string;
19
+ maxLeverage: number;
20
+ }
21
+ /** MarginConfig is an owner's margin mode and leverage for one market. */
22
+ export interface MarginConfig {
23
+ cross: boolean;
24
+ leverage: number;
25
+ }
26
+ /** PerpetualMarketConfig is one market's perpetual funding and price policy. */
27
+ export interface PerpetualMarketConfig {
28
+ /** isolated_only restricts the market to isolated margin. */
29
+ isolatedOnly: boolean;
30
+ /** funding_interest_rate is expressed per eight-hour interval. */
31
+ fundingInterestRate: string;
32
+ fundingInterestAdjustmentCap: string;
33
+ fundingHourlyCap: string;
34
+ oracleMaxAgeSeconds: number;
35
+ /**
36
+ * margin_tiers derive the maintenance margin requirement from position
37
+ * notional.
38
+ */
39
+ marginTiers: MarginTier[];
40
+ /**
41
+ * mark_price_max_change_rate bounds one mark price update relative to the
42
+ * previous mark.
43
+ */
44
+ markPriceMaxChangeRate: string;
45
+ /**
46
+ * max_open_interest_notional caps one-sided filled open interest at the mark
47
+ * price. Zero leaves it uncapped.
48
+ */
49
+ maxOpenInterestNotional: string;
50
+ /**
51
+ * max_position_notional caps one account's projected position in this
52
+ * market, including its risk-increasing resting orders. Zero leaves it
53
+ * uncapped.
54
+ */
55
+ maxPositionNotional: string;
56
+ /**
57
+ * impact_notional is the quote value each side of the CLOB must fully
58
+ * execute to produce an impact price.
59
+ */
60
+ impactNotional: string;
61
+ /** max_impact_levels bounds the price levels traversed on each side. */
62
+ maxImpactLevels: number;
63
+ /** index_feed_id is the x/oracle feed used as this market's Index. */
64
+ indexFeedId: string;
65
+ /**
66
+ * external_perpetual_feed_id is the x/oracle MARK feed used as the external
67
+ * perpetual candidate when constructing Mark.
68
+ */
69
+ externalPerpetualFeedId: string;
70
+ }
71
+ /**
72
+ * MarkPriceState is one market's canonical mark price and the recursive EMA
73
+ * state needed to advance it without retaining samples.
74
+ */
75
+ export interface MarkPriceState {
76
+ markPrice: string;
77
+ /**
78
+ * price_difference_ema is the 150-second EMA of (local median - index), in
79
+ * quote price units.
80
+ */
81
+ priceDifferenceEma: string;
82
+ /**
83
+ * price_difference_weight is the decayed time weight backing
84
+ * price_difference_ema.
85
+ */
86
+ priceDifferenceWeight: string;
87
+ /**
88
+ * local_median_ema is the 30-second EMA of the local median, the candidate
89
+ * used only when exactly two primary candidates exist.
90
+ */
91
+ localMedianEma: string;
92
+ localMedianWeight: string;
93
+ /**
94
+ * last_local_median_update_time is the Unix time in seconds of the last
95
+ * accepted local median EMA sample.
96
+ */
97
+ lastLocalMedianUpdateTime: bigint;
98
+ /**
99
+ * last_price_difference_update_time is the Unix time in seconds of the last
100
+ * accepted price difference EMA sample.
101
+ */
102
+ lastPriceDifferenceUpdateTime: bigint;
103
+ }
104
+ /**
105
+ * ImpactPriceState is one market's impact prices from the latest accepted vote
106
+ * extension. A zero side means the book had insufficient depth and contributes
107
+ * no funding premium.
108
+ */
109
+ export interface ImpactPriceState {
110
+ bid: string;
111
+ ask: string;
112
+ /**
113
+ * last_updated_time is the block time in Unix seconds when the prices were
114
+ * accepted. Funding reads prices older than its last sample as missing
115
+ * depth.
116
+ */
117
+ lastUpdatedTime: bigint;
118
+ }
119
+ /**
120
+ * InternalPriceState is the effective Index owned by x/perpetual while the
121
+ * source market is closed.
122
+ */
123
+ export interface InternalPriceState {
124
+ indexPrice: string;
125
+ /**
126
+ * anchor_price is initialized from the last available external Oracle Index
127
+ * and remains fixed for the whole closed session.
128
+ */
129
+ anchorPrice: string;
130
+ /**
131
+ * last_update_timestamp is the consensus block time of the last internal
132
+ * price update, in Unix seconds.
133
+ */
134
+ lastUpdateTimestamp: bigint;
135
+ /** max_leverage fixes the anchor's deviation bound for this closed session. */
136
+ maxLeverage: number;
137
+ }
138
+ /**
139
+ * FundingState is one market's global funding accumulator. Positions settle
140
+ * against cumulative_funding_index lazily when touched.
141
+ */
142
+ export interface FundingState {
143
+ /**
144
+ * cumulative_funding_index is quote currency per one base unit. Positive
145
+ * index movement means longs pay shorts.
146
+ */
147
+ cumulativeFundingIndex: string;
148
+ premiumSum: string;
149
+ premiumCount: number;
150
+ /**
151
+ * window_start_time is the UTC hour boundary, in Unix seconds, of the
152
+ * funding window being sampled; zero means no active window.
153
+ */
154
+ windowStartTime: bigint;
155
+ }
156
+ /**
157
+ * OrderExposure is an account's resting non-reduce-only order quantity in one
158
+ * market. A margin check projects it onto the account's position, assuming
159
+ * either side fills in full.
160
+ */
161
+ export interface OrderExposure {
162
+ openBids: string;
163
+ openAsks: string;
164
+ }
165
+ export declare const Position: MessageFns<Position>;
166
+ export declare const MarginTier: MessageFns<MarginTier>;
167
+ export declare const MarginConfig: MessageFns<MarginConfig>;
168
+ export declare const PerpetualMarketConfig: MessageFns<PerpetualMarketConfig>;
169
+ export declare const MarkPriceState: MessageFns<MarkPriceState>;
170
+ export declare const ImpactPriceState: MessageFns<ImpactPriceState>;
171
+ export declare const InternalPriceState: MessageFns<InternalPriceState>;
172
+ export declare const FundingState: MessageFns<FundingState>;
173
+ export declare const OrderExposure: MessageFns<OrderExposure>;
174
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
175
+ 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 {} ? {
176
+ [K in keyof T]?: DeepPartial<T[K]>;
177
+ } : Partial<T>;
178
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
179
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
180
+ [K in keyof P]: Exact<P[K], I[K]>;
181
+ } & {
182
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
183
+ };
184
+ export interface MessageFns<T> {
185
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
186
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
187
+ fromJSON(object: any): T;
188
+ toJSON(message: T): unknown;
189
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
190
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
191
+ }
192
+ export {};