ault-sdk-ts 0.8.0 → 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 +25837 -10411
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +25760 -10598
- 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 +2045 -27
- package/dist/rest/dex.d.ts +18 -1
- package/dist/rest/dex.generated.d.ts +5097 -1276
- 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,46 @@
|
|
|
1
|
+
import { type RestContext } from "./context";
|
|
2
|
+
import { MarketId } from "../utils/opaque-id";
|
|
3
|
+
import { QueryAccountResponse, QueryAccountRiskResponse, QueryCollateralDenomResponse, QueryFundingResponse, QueryImpactPricesResponse, QueryParamsResponse, QueryPositionResponse, QueryPricesResponse } from "../proto/gen/ault/perpetual/v1/query";
|
|
4
|
+
/** A perpetual market id as raw bytes, a `MarketId`, or a base64 string (grpc-gateway form). */
|
|
5
|
+
export type PerpetualMarketIdInput = Uint8Array | MarketId | string;
|
|
6
|
+
/**
|
|
7
|
+
* Chain-side `x/perpetual` queries.
|
|
8
|
+
*/
|
|
9
|
+
export interface PerpetualApi {
|
|
10
|
+
getParams: () => Promise<QueryParamsResponse>;
|
|
11
|
+
/** The single collateral denom shared by every perpetual market. */
|
|
12
|
+
getCollateralDenom: () => Promise<QueryCollateralDenomResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* The owner's derived perpetual account and its collateral share. Without
|
|
15
|
+
* `marketId` this is the cross account; with one, the isolated account for
|
|
16
|
+
* that market. Collateral is a LegacyDec string and can be negative.
|
|
17
|
+
*/
|
|
18
|
+
getAccount: (owner: string, marketId?: PerpetualMarketIdInput) => Promise<QueryAccountResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* The owner's position in a market. `cross` selects which account the
|
|
21
|
+
* position is looked up in, independently of the owner's current margin mode.
|
|
22
|
+
*/
|
|
23
|
+
getPosition: (owner: string, marketId: PerpetualMarketIdInput, cross: boolean) => Promise<QueryPositionResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Equity, initial/maintenance margin, order margin, notional, available
|
|
26
|
+
* margin and the liquidatable flag for the cross account (no `marketId`) or
|
|
27
|
+
* an isolated account. This is the health snapshot the chain gates on.
|
|
28
|
+
*/
|
|
29
|
+
getAccountRisk: (owner: string, marketId?: PerpetualMarketIdInput) => Promise<QueryAccountRiskResponse>;
|
|
30
|
+
/** A market's cumulative funding index and current sampling window. */
|
|
31
|
+
getFunding: (marketId: PerpetualMarketIdInput) => Promise<QueryFundingResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* A market's index, internal and mark prices. Each one is absent until the
|
|
34
|
+
* chain has a value for it: `indexPrice` while no valid oracle price is
|
|
35
|
+
* available, `internalPrice` while the source session is open, `markPrice`
|
|
36
|
+
* before the first mark update.
|
|
37
|
+
*/
|
|
38
|
+
getPrices: (marketId: PerpetualMarketIdInput) => Promise<QueryPricesResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* The prices last recorded for executing the market's impact notional
|
|
41
|
+
* against each side of its book. A side the book could not fill is zero, as
|
|
42
|
+
* is a market whose impact prices were never recorded.
|
|
43
|
+
*/
|
|
44
|
+
getImpactPrices: (marketId: PerpetualMarketIdInput) => Promise<QueryImpactPricesResponse>;
|
|
45
|
+
}
|
|
46
|
+
export declare function createPerpetualApi(context: RestContext): PerpetualApi;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { type RestContext } from "./context";
|
|
2
2
|
import type { PaginationParams } from "./types";
|
|
3
3
|
import { QueryParamsResponse, QueryTokenPairResponse, QueryTokenPairsResponse, QueryTransferLimitResponse } from "../proto/gen/ault/tokenregistry/v1/query";
|
|
4
|
+
/**
|
|
5
|
+
* Page size sent when the caller does not set `pagination.limit`. The chain
|
|
6
|
+
* returns 10 pairs per page otherwise, which silently drops the rest of the
|
|
7
|
+
* registry once it grows past that.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_TOKEN_PAIRS_LIMIT = 1000;
|
|
4
10
|
export interface TokenRegistryApi {
|
|
5
11
|
getParams: () => Promise<QueryParamsResponse>;
|
|
6
12
|
getTokenPair: (token: string) => Promise<QueryTokenPairResponse>;
|
|
13
|
+
/** Asks for up to `DEFAULT_TOKEN_PAIRS_LIMIT` pairs unless `pagination.limit` is set. */
|
|
7
14
|
getTokenPairs: (params?: {
|
|
8
15
|
pagination?: PaginationParams;
|
|
9
16
|
}) => Promise<QueryTokenPairsResponse>;
|