ault-sdk-ts 0.14.0 → 0.16.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 +10 -2
- package/dist/index.cjs +92 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +88 -54
- package/dist/index.js.map +1 -1
- package/dist/perp/index.d.ts +1 -0
- package/dist/perp/orders.d.ts +6 -3
- package/dist/perp/tick.d.ts +11 -0
- package/package.json +2 -2
package/dist/perp/index.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export { type MarginTier, parseMarginTiers, validateMarginTiers, maintenanceMarg
|
|
|
3
3
|
export { SECONDS_PER_FUNDING_WINDOW, fundingRate, averagePremium } from "./funding";
|
|
4
4
|
export { notional, positionValue, unrealizedPnl, pendingFunding, equity, entryPrice, } from "./position";
|
|
5
5
|
export { type IocLimitPriceInput, type IocLimitPrice, iocLimitPrice } from "./orders";
|
|
6
|
+
export { tickSizeAt, isTickPrice, floorTickPrice, ceilTickPrice } from "./tick";
|
package/dist/perp/orders.d.ts
CHANGED
|
@@ -8,8 +8,11 @@ export interface IocLimitPriceInput {
|
|
|
8
8
|
fallbackPrice?: string | null;
|
|
9
9
|
/** Fractional slippage allowance, e.g. "0.005" for 0.5%. */
|
|
10
10
|
slippage: string;
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The market's `tick_precision`: significant digits past the first, not
|
|
13
|
+
* decimal places (see `tickSizeAt`).
|
|
14
|
+
*/
|
|
15
|
+
tickPrecision: number;
|
|
13
16
|
}
|
|
14
17
|
export interface IocLimitPrice {
|
|
15
18
|
/** The limit price to submit with `timeInForce: "ioc"`. */
|
|
@@ -21,7 +24,7 @@ export interface IocLimitPrice {
|
|
|
21
24
|
* Perpetual markets accept limit orders only, so a "market order" is an
|
|
22
25
|
* immediate-or-cancel limit priced through the book: best opposite price
|
|
23
26
|
* plus (buy) or minus (sell) the slippage allowance, rounded away from the
|
|
24
|
-
* reference to the market's price
|
|
27
|
+
* reference to the market's price grid so the order stays marketable. The
|
|
25
28
|
* chain projects margin at this limit price, which bounds the worst fill.
|
|
26
29
|
*/
|
|
27
30
|
export declare function iocLimitPrice(input: IocLimitPriceInput): IocLimitPrice;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The distance between `price` and the next price on the grid above it. */
|
|
2
|
+
export declare function tickSizeAt(price: string, tickPrecision: number): string;
|
|
3
|
+
/** Whether the chain accepts `price` as an order price (`TickAtPrice`). */
|
|
4
|
+
export declare function isTickPrice(price: string, tickPrecision: number): boolean;
|
|
5
|
+
/** The highest price on the grid at or below `price` (`FloorTickAtPrice`). */
|
|
6
|
+
export declare function floorTickPrice(price: string, tickPrecision: number): string;
|
|
7
|
+
/**
|
|
8
|
+
* The lowest price on the grid at or above `price` (`CeilTickAtPrice`). It may
|
|
9
|
+
* carry into the next power of ten: 99,999.995 at precision 6 becomes 100,000.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ceilTickPrice(price: string, tickPrecision: number): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ault-sdk-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "TypeScript SDK for the Ault blockchain with high-level transaction methods and REST query clients",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ault",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
|
-
"gen:openapi": "orval",
|
|
48
|
+
"gen:openapi": "orval && node scripts/encode-dex-path-params.mjs",
|
|
49
49
|
"gen:proto": "node scripts/generate-protos.mjs",
|
|
50
50
|
"gen:eip712": "node scripts/generate-eip712-registry.mjs",
|
|
51
51
|
"gen:all": "npm run gen:openapi && npm run gen:proto && npm run gen:eip712 && pnpm lint:fix && pnpm format",
|