@nktkas/hyperliquid 0.24.2 → 0.25.0-beta.1
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 +197 -117
- package/esm/mod.d.ts +11 -11
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -1
- package/esm/src/clients/exchange.d.ts +29 -18
- package/esm/src/clients/exchange.d.ts.map +1 -1
- package/esm/src/clients/exchange.js +50 -48
- package/esm/src/clients/info.d.ts +79 -75
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +294 -163
- package/esm/src/clients/multiSign.d.ts +11 -7
- package/esm/src/clients/multiSign.d.ts.map +1 -1
- package/esm/src/clients/subscription.d.ts +105 -32
- package/esm/src/clients/subscription.d.ts.map +1 -1
- package/esm/src/clients/subscription.js +114 -33
- package/esm/src/{base.d.ts → errors.d.ts} +1 -1
- package/esm/src/errors.d.ts.map +1 -0
- package/esm/src/schemas/_base.d.ts +10 -0
- package/esm/src/schemas/_base.d.ts.map +1 -0
- package/esm/src/schemas/_base.js +12 -0
- package/esm/src/schemas/exchange/requests.d.ts +8953 -0
- package/esm/src/schemas/exchange/requests.d.ts.map +1 -0
- package/esm/src/schemas/exchange/requests.js +1413 -0
- package/esm/src/schemas/exchange/responses.d.ts +567 -0
- package/esm/src/schemas/exchange/responses.d.ts.map +1 -0
- package/esm/src/schemas/exchange/responses.js +243 -0
- package/esm/src/schemas/explorer/requests.d.ts +44 -0
- package/esm/src/schemas/explorer/requests.d.ts.map +1 -0
- package/esm/src/schemas/explorer/requests.js +32 -0
- package/esm/src/schemas/explorer/responses.d.ts +360 -0
- package/esm/src/schemas/explorer/responses.d.ts.map +1 -0
- package/esm/src/schemas/explorer/responses.js +56 -0
- package/esm/src/schemas/info/accounts.d.ts +2159 -0
- package/esm/src/schemas/info/accounts.d.ts.map +1 -0
- package/esm/src/schemas/info/accounts.js +622 -0
- package/esm/src/schemas/info/assets.d.ts +945 -0
- package/esm/src/schemas/info/assets.d.ts.map +1 -0
- package/esm/src/schemas/info/assets.js +265 -0
- package/esm/src/schemas/info/markets.d.ts +138 -0
- package/esm/src/schemas/info/markets.d.ts.map +1 -0
- package/esm/src/schemas/info/markets.js +58 -0
- package/esm/src/schemas/info/orders.d.ts +957 -0
- package/esm/src/schemas/info/orders.d.ts.map +1 -0
- package/esm/src/schemas/info/orders.js +297 -0
- package/esm/src/schemas/info/requests.d.ts +882 -0
- package/esm/src/schemas/info/requests.d.ts.map +1 -0
- package/esm/src/schemas/info/requests.js +655 -0
- package/esm/src/schemas/info/validators.d.ts +305 -0
- package/esm/src/schemas/info/validators.d.ts.map +1 -0
- package/esm/src/schemas/info/validators.js +112 -0
- package/esm/src/schemas/info/vaults.d.ts +447 -0
- package/esm/src/schemas/info/vaults.d.ts.map +1 -0
- package/esm/src/schemas/info/vaults.js +110 -0
- package/esm/src/schemas/mod.d.ts +100 -0
- package/esm/src/schemas/mod.d.ts.map +1 -0
- package/esm/src/schemas/mod.js +113 -0
- package/esm/src/schemas/subscriptions/requests.d.ts +332 -0
- package/esm/src/schemas/subscriptions/requests.d.ts.map +1 -0
- package/esm/src/schemas/subscriptions/requests.js +258 -0
- package/esm/src/schemas/subscriptions/responses.d.ts +3643 -0
- package/esm/src/schemas/subscriptions/responses.d.ts.map +1 -0
- package/esm/src/schemas/subscriptions/responses.js +233 -0
- package/esm/src/signing/mod.d.ts +109 -29
- package/esm/src/signing/mod.d.ts.map +1 -1
- package/esm/src/signing/mod.js +135 -29
- package/esm/src/transports/base.d.ts +2 -2
- package/esm/src/transports/base.d.ts.map +1 -1
- package/esm/src/transports/base.js +2 -2
- package/esm/src/transports/http/http_transport.d.ts +2 -1
- package/esm/src/transports/http/http_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
- package/esm/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.d.ts +2 -1
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/package.json +6 -5
- package/script/mod.d.ts +11 -11
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +1 -1
- package/script/src/clients/exchange.d.ts +29 -18
- package/script/src/clients/exchange.d.ts.map +1 -1
- package/script/src/clients/exchange.js +56 -54
- package/script/src/clients/info.d.ts +79 -75
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +294 -163
- package/script/src/clients/multiSign.d.ts +11 -7
- package/script/src/clients/multiSign.d.ts.map +1 -1
- package/script/src/clients/subscription.d.ts +105 -32
- package/script/src/clients/subscription.d.ts.map +1 -1
- package/script/src/clients/subscription.js +114 -33
- package/script/src/{base.d.ts → errors.d.ts} +1 -1
- package/script/src/errors.d.ts.map +1 -0
- package/script/src/schemas/_base.d.ts +10 -0
- package/script/src/schemas/_base.d.ts.map +1 -0
- package/script/src/schemas/_base.js +48 -0
- package/script/src/schemas/exchange/requests.d.ts +8953 -0
- package/script/src/schemas/exchange/requests.d.ts.map +1 -0
- package/script/src/schemas/exchange/requests.js +1449 -0
- package/script/src/schemas/exchange/responses.d.ts +567 -0
- package/script/src/schemas/exchange/responses.d.ts.map +1 -0
- package/script/src/schemas/exchange/responses.js +279 -0
- package/script/src/schemas/explorer/requests.d.ts +44 -0
- package/script/src/schemas/explorer/requests.d.ts.map +1 -0
- package/script/src/schemas/explorer/requests.js +68 -0
- package/script/src/schemas/explorer/responses.d.ts +360 -0
- package/script/src/schemas/explorer/responses.d.ts.map +1 -0
- package/script/src/schemas/explorer/responses.js +92 -0
- package/script/src/schemas/info/accounts.d.ts +2159 -0
- package/script/src/schemas/info/accounts.d.ts.map +1 -0
- package/script/src/schemas/info/accounts.js +658 -0
- package/script/src/schemas/info/assets.d.ts +945 -0
- package/script/src/schemas/info/assets.d.ts.map +1 -0
- package/script/src/schemas/info/assets.js +301 -0
- package/script/src/schemas/info/markets.d.ts +138 -0
- package/script/src/schemas/info/markets.d.ts.map +1 -0
- package/script/src/schemas/info/markets.js +94 -0
- package/script/src/schemas/info/orders.d.ts +957 -0
- package/script/src/schemas/info/orders.d.ts.map +1 -0
- package/script/src/schemas/info/orders.js +333 -0
- package/script/src/schemas/info/requests.d.ts +882 -0
- package/script/src/schemas/info/requests.d.ts.map +1 -0
- package/script/src/schemas/info/requests.js +692 -0
- package/script/src/schemas/info/validators.d.ts +305 -0
- package/script/src/schemas/info/validators.d.ts.map +1 -0
- package/script/src/schemas/info/validators.js +148 -0
- package/script/src/schemas/info/vaults.d.ts +447 -0
- package/script/src/schemas/info/vaults.d.ts.map +1 -0
- package/script/src/schemas/info/vaults.js +146 -0
- package/script/src/schemas/mod.d.ts +100 -0
- package/script/src/schemas/mod.d.ts.map +1 -0
- package/script/src/schemas/mod.js +154 -0
- package/script/src/schemas/subscriptions/requests.d.ts +332 -0
- package/script/src/schemas/subscriptions/requests.d.ts.map +1 -0
- package/script/src/schemas/subscriptions/requests.js +294 -0
- package/script/src/schemas/subscriptions/responses.d.ts +3643 -0
- package/script/src/schemas/subscriptions/responses.d.ts.map +1 -0
- package/script/src/schemas/subscriptions/responses.js +269 -0
- package/script/src/signing/mod.d.ts +109 -29
- package/script/src/signing/mod.d.ts.map +1 -1
- package/script/src/signing/mod.js +137 -33
- package/script/src/transports/base.d.ts +2 -2
- package/script/src/transports/base.d.ts.map +1 -1
- package/script/src/transports/base.js +3 -3
- package/script/src/transports/http/http_transport.d.ts +2 -1
- package/script/src/transports/http/http_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts +1 -1
- package/script/src/transports/websocket/_hyperliquid_event_target.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.d.ts +2 -1
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/base.d.ts.map +0 -1
- package/esm/src/signing/_sorter.d.ts +0 -127
- package/esm/src/signing/_sorter.d.ts.map +0 -1
- package/esm/src/signing/_sorter.js +0 -693
- package/esm/src/types/exchange/requests.d.ts +0 -1345
- package/esm/src/types/exchange/requests.d.ts.map +0 -1
- package/esm/src/types/exchange/requests.js +0 -1
- package/esm/src/types/exchange/responses.d.ts +0 -233
- package/esm/src/types/exchange/responses.d.ts.map +0 -1
- package/esm/src/types/exchange/responses.js +0 -1
- package/esm/src/types/explorer/requests.d.ts +0 -32
- package/esm/src/types/explorer/requests.d.ts.map +0 -1
- package/esm/src/types/explorer/requests.js +0 -1
- package/esm/src/types/explorer/responses.d.ts +0 -58
- package/esm/src/types/explorer/responses.d.ts.map +0 -1
- package/esm/src/types/explorer/responses.js +0 -1
- package/esm/src/types/info/accounts.d.ts +0 -864
- package/esm/src/types/info/accounts.d.ts.map +0 -1
- package/esm/src/types/info/accounts.js +0 -1
- package/esm/src/types/info/assets.d.ts +0 -354
- package/esm/src/types/info/assets.d.ts.map +0 -1
- package/esm/src/types/info/assets.js +0 -1
- package/esm/src/types/info/markets.d.ts +0 -79
- package/esm/src/types/info/markets.d.ts.map +0 -1
- package/esm/src/types/info/markets.js +0 -1
- package/esm/src/types/info/orders.d.ts +0 -266
- package/esm/src/types/info/orders.d.ts.map +0 -1
- package/esm/src/types/info/orders.js +0 -1
- package/esm/src/types/info/requests.d.ts +0 -634
- package/esm/src/types/info/requests.d.ts.map +0 -1
- package/esm/src/types/info/requests.js +0 -1
- package/esm/src/types/info/validators.d.ts +0 -147
- package/esm/src/types/info/validators.d.ts.map +0 -1
- package/esm/src/types/info/validators.js +0 -1
- package/esm/src/types/info/vaults.d.ts +0 -119
- package/esm/src/types/info/vaults.d.ts.map +0 -1
- package/esm/src/types/info/vaults.js +0 -1
- package/esm/src/types/mod.d.ts +0 -38
- package/esm/src/types/mod.d.ts.map +0 -1
- package/esm/src/types/mod.js +0 -24
- package/esm/src/types/subscriptions/requests.d.ts +0 -143
- package/esm/src/types/subscriptions/requests.d.ts.map +0 -1
- package/esm/src/types/subscriptions/requests.js +0 -1
- package/esm/src/types/subscriptions/responses.d.ts +0 -213
- package/esm/src/types/subscriptions/responses.d.ts.map +0 -1
- package/esm/src/types/subscriptions/responses.js +0 -1
- package/script/src/base.d.ts.map +0 -1
- package/script/src/signing/_sorter.d.ts +0 -127
- package/script/src/signing/_sorter.d.ts.map +0 -1
- package/script/src/signing/_sorter.js +0 -696
- package/script/src/types/exchange/requests.d.ts +0 -1345
- package/script/src/types/exchange/requests.d.ts.map +0 -1
- package/script/src/types/exchange/requests.js +0 -2
- package/script/src/types/exchange/responses.d.ts +0 -233
- package/script/src/types/exchange/responses.d.ts.map +0 -1
- package/script/src/types/exchange/responses.js +0 -2
- package/script/src/types/explorer/requests.d.ts +0 -32
- package/script/src/types/explorer/requests.d.ts.map +0 -1
- package/script/src/types/explorer/requests.js +0 -2
- package/script/src/types/explorer/responses.d.ts +0 -58
- package/script/src/types/explorer/responses.d.ts.map +0 -1
- package/script/src/types/explorer/responses.js +0 -2
- package/script/src/types/info/accounts.d.ts +0 -864
- package/script/src/types/info/accounts.d.ts.map +0 -1
- package/script/src/types/info/accounts.js +0 -2
- package/script/src/types/info/assets.d.ts +0 -354
- package/script/src/types/info/assets.d.ts.map +0 -1
- package/script/src/types/info/assets.js +0 -2
- package/script/src/types/info/markets.d.ts +0 -79
- package/script/src/types/info/markets.d.ts.map +0 -1
- package/script/src/types/info/markets.js +0 -2
- package/script/src/types/info/orders.d.ts +0 -266
- package/script/src/types/info/orders.d.ts.map +0 -1
- package/script/src/types/info/orders.js +0 -2
- package/script/src/types/info/requests.d.ts +0 -634
- package/script/src/types/info/requests.d.ts.map +0 -1
- package/script/src/types/info/requests.js +0 -2
- package/script/src/types/info/validators.d.ts +0 -147
- package/script/src/types/info/validators.d.ts.map +0 -1
- package/script/src/types/info/validators.js +0 -2
- package/script/src/types/info/vaults.d.ts +0 -119
- package/script/src/types/info/vaults.d.ts.map +0 -1
- package/script/src/types/info/vaults.js +0 -2
- package/script/src/types/mod.d.ts +0 -38
- package/script/src/types/mod.d.ts.map +0 -1
- package/script/src/types/mod.js +0 -25
- package/script/src/types/subscriptions/requests.d.ts +0 -143
- package/script/src/types/subscriptions/requests.d.ts.map +0 -1
- package/script/src/types/subscriptions/requests.js +0 -2
- package/script/src/types/subscriptions/responses.d.ts +0 -213
- package/script/src/types/subscriptions/responses.d.ts.map +0 -1
- package/script/src/types/subscriptions/responses.js +0 -2
- /package/esm/src/{base.js → errors.js} +0 -0
- /package/script/src/{base.js → errors.js} +0 -0
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.UserNonFundingLedgerUpdate = exports.WithdrawUpdate = exports.VaultWithdrawUpdate = exports.VaultDistributionUpdate = exports.VaultDepositUpdate = exports.VaultCreateUpdate = exports.SubAccountTransferUpdate = exports.SpotTransferUpdate = exports.RewardsClaimUpdate = exports.LiquidationUpdate = exports.InternalTransferUpdate = exports.DepositUpdate = exports.AccountClassTransferUpdate = exports.UserRole = exports.UserRateLimit = exports.UserFundingUpdate = exports.FundingUpdate = exports.UserFees = exports.SubAccount = exports.SpotClearinghouseState = exports.SpotBalance = exports.Referral = exports.PreTransferCheck = exports.PortfolioPeriods = exports.Portfolio = exports.PerpsClearinghouseState = exports.MultiSigSigners = exports.LegalCheck = exports.ExtraAgent = exports.EvmEscrowsBalance = exports.AssetPosition = exports.ActiveAssetData = void 0;
|
|
37
|
+
const v = __importStar(require("valibot"));
|
|
38
|
+
const _base_js_1 = require("../_base.js");
|
|
39
|
+
/** User active asset data. */
|
|
40
|
+
exports.ActiveAssetData = v.pipe(v.strictObject({
|
|
41
|
+
/** User address. */
|
|
42
|
+
user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("User address.")),
|
|
43
|
+
/** Asset symbol (e.g., BTC). */
|
|
44
|
+
coin: v.pipe(v.string(), v.description("Asset symbol (e.g., BTC).")),
|
|
45
|
+
/** Leverage configuration. */
|
|
46
|
+
leverage: v.pipe(v.union([
|
|
47
|
+
v.strictObject({
|
|
48
|
+
/** Leverage type. */
|
|
49
|
+
type: v.pipe(v.literal("isolated"), v.description("Leverage type.")),
|
|
50
|
+
/** Leverage value used. */
|
|
51
|
+
value: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Leverage value used.")),
|
|
52
|
+
/** Amount of USD used (1 = 1$). */
|
|
53
|
+
rawUsd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of USD used (1 = 1$).")),
|
|
54
|
+
}),
|
|
55
|
+
v.strictObject({
|
|
56
|
+
/** Leverage type. */
|
|
57
|
+
type: v.pipe(v.literal("cross"), v.description("Leverage type.")),
|
|
58
|
+
/** Leverage value used. */
|
|
59
|
+
value: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Leverage value used.")),
|
|
60
|
+
}),
|
|
61
|
+
]), v.description("Leverage configuration.")),
|
|
62
|
+
/** Maximum trade size range [min, max]. */
|
|
63
|
+
maxTradeSzs: v.pipe(v.strictTuple([_base_js_1.UnsignedDecimal, _base_js_1.UnsignedDecimal]), v.description("Maximum trade size range [min, max].")),
|
|
64
|
+
/** Available to trade range [min, max]. */
|
|
65
|
+
availableToTrade: v.pipe(v.strictTuple([_base_js_1.UnsignedDecimal, _base_js_1.UnsignedDecimal]), v.description("Available to trade range [min, max].")),
|
|
66
|
+
/** Mark price. */
|
|
67
|
+
markPx: v.pipe(_base_js_1.UnsignedDecimal, v.description("Mark price.")),
|
|
68
|
+
}), v.description("User active asset data."));
|
|
69
|
+
/** Position for a specific asset. */
|
|
70
|
+
exports.AssetPosition = v.pipe(v.strictObject({
|
|
71
|
+
/** Position type. */
|
|
72
|
+
type: v.pipe(v.literal("oneWay"), v.description("Position type.")),
|
|
73
|
+
/** Position details. */
|
|
74
|
+
position: v.pipe(v.strictObject({
|
|
75
|
+
/** Asset symbol. */
|
|
76
|
+
coin: v.pipe(v.string(), v.description("Asset symbol.")),
|
|
77
|
+
/** Signed position size. */
|
|
78
|
+
szi: v.pipe(_base_js_1.SignedDecimal, v.description("Signed position size.")),
|
|
79
|
+
/** Leverage details. */
|
|
80
|
+
leverage: v.pipe(v.union([
|
|
81
|
+
v.strictObject({
|
|
82
|
+
/** Leverage type. */
|
|
83
|
+
type: v.pipe(v.literal("isolated"), v.description("Leverage type.")),
|
|
84
|
+
/** Leverage value used. */
|
|
85
|
+
value: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Leverage value used.")),
|
|
86
|
+
/** Amount of USD used (1 = 1$). */
|
|
87
|
+
rawUsd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of USD used (1 = 1$).")),
|
|
88
|
+
}),
|
|
89
|
+
v.strictObject({
|
|
90
|
+
/** Leverage type. */
|
|
91
|
+
type: v.pipe(v.literal("cross"), v.description("Leverage type.")),
|
|
92
|
+
/** Leverage value used. */
|
|
93
|
+
value: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Leverage value used.")),
|
|
94
|
+
}),
|
|
95
|
+
]), v.description("Leverage details.")),
|
|
96
|
+
/** Average entry price. */
|
|
97
|
+
entryPx: v.pipe(_base_js_1.UnsignedDecimal, v.description("Average entry price.")),
|
|
98
|
+
/** Position value. */
|
|
99
|
+
positionValue: v.pipe(_base_js_1.UnsignedDecimal, v.description("Position value.")),
|
|
100
|
+
/** Unrealized profit and loss. */
|
|
101
|
+
unrealizedPnl: v.pipe(_base_js_1.SignedDecimal, v.description("Unrealized profit and loss.")),
|
|
102
|
+
/** Return on equity. */
|
|
103
|
+
returnOnEquity: v.pipe(_base_js_1.SignedDecimal, v.description("Return on equity.")),
|
|
104
|
+
/** Liquidation price. */
|
|
105
|
+
liquidationPx: v.pipe(v.union([_base_js_1.UnsignedDecimal, v.null()]), v.description("Liquidation price.")),
|
|
106
|
+
/** Margin used. */
|
|
107
|
+
marginUsed: v.pipe(_base_js_1.UnsignedDecimal, v.description("Margin used.")),
|
|
108
|
+
/** Maximum allowed leverage. */
|
|
109
|
+
maxLeverage: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Maximum allowed leverage.")),
|
|
110
|
+
/** Cumulative funding details. */
|
|
111
|
+
cumFunding: v.pipe(v.strictObject({
|
|
112
|
+
/** Total funding paid or received since account opening. */
|
|
113
|
+
allTime: v.pipe(_base_js_1.SignedDecimal, v.description("Total funding paid or received since account opening.")),
|
|
114
|
+
/** Funding accumulated since the position was opened. */
|
|
115
|
+
sinceOpen: v.pipe(_base_js_1.SignedDecimal, v.description("Funding accumulated since the position was opened.")),
|
|
116
|
+
/** Funding accumulated since the last change in position size. */
|
|
117
|
+
sinceChange: v.pipe(_base_js_1.SignedDecimal, v.description("Funding accumulated since the last change in position size.")),
|
|
118
|
+
}), v.description("Cumulative funding details.")),
|
|
119
|
+
}), v.description("Position details.")),
|
|
120
|
+
}), v.description("Position for a specific asset."));
|
|
121
|
+
/** Escrowed balance for a specific asset. */
|
|
122
|
+
exports.EvmEscrowsBalance = v.pipe(v.strictObject({
|
|
123
|
+
/** Asset symbol. */
|
|
124
|
+
coin: v.pipe(v.string(), v.description("Asset symbol.")),
|
|
125
|
+
/** Unique identifier for the token. */
|
|
126
|
+
token: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Unique identifier for the token.")),
|
|
127
|
+
/** Total balance. */
|
|
128
|
+
total: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total balance.")),
|
|
129
|
+
}), v.description("Escrowed balance for a specific asset."));
|
|
130
|
+
/** Extra agent details for a user. */
|
|
131
|
+
exports.ExtraAgent = v.pipe(v.strictObject({
|
|
132
|
+
/** Extra agent address. */
|
|
133
|
+
address: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Extra agent address.")),
|
|
134
|
+
/** Extra agent name. */
|
|
135
|
+
name: v.pipe(v.string(), v.minLength(1), v.description("Extra agent name.")),
|
|
136
|
+
/** Validity period as a timestamp (in ms since epoch). */
|
|
137
|
+
validUntil: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Validity period as a timestamp (in ms since epoch).")),
|
|
138
|
+
}), v.description("Extra agent details for a user."));
|
|
139
|
+
/** Legal verification status for a user. */
|
|
140
|
+
exports.LegalCheck = v.pipe(v.strictObject({
|
|
141
|
+
/** Whether the user IP address is allowed. */
|
|
142
|
+
ipAllowed: v.pipe(v.boolean(), v.description("Whether the user IP address is allowed.")),
|
|
143
|
+
/** Whether the user has accepted the terms of service. */
|
|
144
|
+
acceptedTerms: v.pipe(v.boolean(), v.description("Whether the user has accepted the terms of service.")),
|
|
145
|
+
/** Whether the user is allowed to use the platform. */
|
|
146
|
+
userAllowed: v.pipe(v.boolean(), v.description("Whether the user is allowed to use the platform.")),
|
|
147
|
+
}), v.description("Legal verification status for a user."));
|
|
148
|
+
/** Multi-sig signers for a user. */
|
|
149
|
+
exports.MultiSigSigners = v.pipe(v.strictObject({
|
|
150
|
+
/** Authorized users addresses. */
|
|
151
|
+
authorizedUsers: v.pipe(v.array(v.pipe(_base_js_1.Hex, v.length(42))), v.minLength(1), v.description("Authorized users addresses.")),
|
|
152
|
+
/** Threshold number of signatures required. */
|
|
153
|
+
threshold: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.minValue(1), v.description("Threshold number of signatures required.")),
|
|
154
|
+
}), v.description("Multi-sig signers for a user."));
|
|
155
|
+
/** Account summary for perpetual trading. */
|
|
156
|
+
exports.PerpsClearinghouseState = v.pipe(v.strictObject({
|
|
157
|
+
/** Margin summary details. */
|
|
158
|
+
marginSummary: v.pipe(v.strictObject({
|
|
159
|
+
/** Total account value. */
|
|
160
|
+
accountValue: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total account value.")),
|
|
161
|
+
/** Total notional position value. */
|
|
162
|
+
totalNtlPos: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total notional position value.")),
|
|
163
|
+
/** Total raw USD value. */
|
|
164
|
+
totalRawUsd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total raw USD value.")),
|
|
165
|
+
/** Total margin used. */
|
|
166
|
+
totalMarginUsed: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total margin used.")),
|
|
167
|
+
}), v.description("Margin summary details.")),
|
|
168
|
+
/** Cross-margin summary details. */
|
|
169
|
+
crossMarginSummary: v.pipe(v.strictObject({
|
|
170
|
+
/** Total account value. */
|
|
171
|
+
accountValue: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total account value.")),
|
|
172
|
+
/** Total notional position value. */
|
|
173
|
+
totalNtlPos: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total notional position value.")),
|
|
174
|
+
/** Total raw USD value. */
|
|
175
|
+
totalRawUsd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total raw USD value.")),
|
|
176
|
+
/** Total margin used. */
|
|
177
|
+
totalMarginUsed: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total margin used.")),
|
|
178
|
+
}), v.description("Cross-margin summary details.")),
|
|
179
|
+
/** Maintenance margin used for cross-margin positions. */
|
|
180
|
+
crossMaintenanceMarginUsed: v.pipe(_base_js_1.UnsignedDecimal, v.description("Maintenance margin used for cross-margin positions.")),
|
|
181
|
+
/** Amount available for withdrawal. */
|
|
182
|
+
withdrawable: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount available for withdrawal.")),
|
|
183
|
+
/** List of asset positions. */
|
|
184
|
+
assetPositions: v.pipe(v.array(exports.AssetPosition), v.description("List of asset positions.")),
|
|
185
|
+
/** Timestamp when data was retrieved (in ms since epoch). */
|
|
186
|
+
time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when data was retrieved (in ms since epoch).")),
|
|
187
|
+
}), v.description("Account summary for perpetual trading."));
|
|
188
|
+
/** Portfolio metrics snapshot. */
|
|
189
|
+
exports.Portfolio = v.pipe(v.strictObject({
|
|
190
|
+
/** History entries for account value as [timestamp, value]. */
|
|
191
|
+
accountValueHistory: v.pipe(v.array(v.strictTuple([v.pipe(v.number(), v.safeInteger(), v.minValue(0)), _base_js_1.UnsignedDecimal])), v.description("History entries for account value as [timestamp, value].")),
|
|
192
|
+
/** History entries for profit and loss as [timestamp, value]. */
|
|
193
|
+
pnlHistory: v.pipe(v.array(v.strictTuple([v.pipe(v.number(), v.safeInteger(), v.minValue(0)), _base_js_1.SignedDecimal])), v.description("History entries for profit and loss as [timestamp, value].")),
|
|
194
|
+
/** Volume metric for the portfolio. */
|
|
195
|
+
vlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Volume metric for the portfolio.")),
|
|
196
|
+
}), v.description("Portfolio metrics snapshot."));
|
|
197
|
+
/** Portfolio metrics grouped by time periods. */
|
|
198
|
+
exports.PortfolioPeriods = v.pipe(v.strictTuple([
|
|
199
|
+
v.strictTuple([v.literal("day"), exports.Portfolio]),
|
|
200
|
+
v.strictTuple([v.literal("week"), exports.Portfolio]),
|
|
201
|
+
v.strictTuple([v.literal("month"), exports.Portfolio]),
|
|
202
|
+
v.strictTuple([v.literal("allTime"), exports.Portfolio]),
|
|
203
|
+
v.strictTuple([v.literal("perpDay"), exports.Portfolio]),
|
|
204
|
+
v.strictTuple([v.literal("perpWeek"), exports.Portfolio]),
|
|
205
|
+
v.strictTuple([v.literal("perpMonth"), exports.Portfolio]),
|
|
206
|
+
v.strictTuple([v.literal("perpAllTime"), exports.Portfolio]),
|
|
207
|
+
]), v.description("Portfolio metrics grouped by time periods."));
|
|
208
|
+
/** Pre-transfer user existence check result. */
|
|
209
|
+
exports.PreTransferCheck = v.pipe(v.strictObject({
|
|
210
|
+
/** Activation fee. */
|
|
211
|
+
fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Activation fee.")),
|
|
212
|
+
/** Whether the user is sanctioned. */
|
|
213
|
+
isSanctioned: v.pipe(v.boolean(), v.description("Whether the user is sanctioned.")),
|
|
214
|
+
/** Whether the user exists. */
|
|
215
|
+
userExists: v.pipe(v.boolean(), v.description("Whether the user exists.")),
|
|
216
|
+
/** Whether the user has sent a transaction. */
|
|
217
|
+
userHasSentTx: v.pipe(v.boolean(), v.description("Whether the user has sent a transaction.")),
|
|
218
|
+
}), v.description("Pre-transfer user existence check result."));
|
|
219
|
+
/** Referral details for a user. */
|
|
220
|
+
exports.Referral = v.pipe(v.strictObject({
|
|
221
|
+
/** Referrer details. */
|
|
222
|
+
referredBy: v.pipe(v.union([
|
|
223
|
+
v.strictObject({
|
|
224
|
+
/** Referrer address. */
|
|
225
|
+
referrer: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Referrer address.")),
|
|
226
|
+
/** Referral code used. */
|
|
227
|
+
code: v.pipe(v.string(), v.minLength(1), v.description("Referral code used.")),
|
|
228
|
+
}),
|
|
229
|
+
v.null(),
|
|
230
|
+
]), v.description("Referrer details.")),
|
|
231
|
+
/** Cumulative traded volume. */
|
|
232
|
+
cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative traded volume.")),
|
|
233
|
+
/** Rewards earned but not yet claimed. */
|
|
234
|
+
unclaimedRewards: v.pipe(_base_js_1.UnsignedDecimal, v.description("Rewards earned but not yet claimed.")),
|
|
235
|
+
/** Rewards that have been claimed. */
|
|
236
|
+
claimedRewards: v.pipe(_base_js_1.UnsignedDecimal, v.description("Rewards that have been claimed.")),
|
|
237
|
+
/** Builder reward amount. */
|
|
238
|
+
builderRewards: v.pipe(_base_js_1.UnsignedDecimal, v.description("Builder reward amount.")),
|
|
239
|
+
/** Current state of the referrer. */
|
|
240
|
+
referrerState: v.pipe(v.union([
|
|
241
|
+
v.strictObject({
|
|
242
|
+
/** Referrer is ready to receive rewards. */
|
|
243
|
+
stage: v.pipe(v.literal("ready"), v.description("Referrer is ready to receive rewards.")),
|
|
244
|
+
/** Referral program details. */
|
|
245
|
+
data: v.pipe(v.strictObject({
|
|
246
|
+
/** Assigned referral code. */
|
|
247
|
+
code: v.pipe(v.string(), v.minLength(1), v.description("Assigned referral code.")),
|
|
248
|
+
/** Total number of referrals. */
|
|
249
|
+
nReferrals: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Total number of referrals.")),
|
|
250
|
+
/** Summary of each referral state. */
|
|
251
|
+
referralStates: v.pipe(v.array(v.strictObject({
|
|
252
|
+
/** Cumulative traded volume. */
|
|
253
|
+
cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative traded volume.")),
|
|
254
|
+
/** Total fees rewarded to the referred user since referral. */
|
|
255
|
+
cumRewardedFeesSinceReferred: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total fees rewarded to the referred user since referral.")),
|
|
256
|
+
/** Total fees rewarded to the referrer from referred trades. */
|
|
257
|
+
cumFeesRewardedToReferrer: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total fees rewarded to the referrer from referred trades.")),
|
|
258
|
+
/** Timestamp when the referred user joined (in ms since epoch). */
|
|
259
|
+
timeJoined: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when the referred user joined (in ms since epoch).")),
|
|
260
|
+
/** Address of the referred user. */
|
|
261
|
+
user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the referred user.")),
|
|
262
|
+
/** Mapping of token IDs to referral reward states. */
|
|
263
|
+
tokenToState: v.pipe(v.array(v.strictTuple([
|
|
264
|
+
v.pipe(v.number(), v.safeInteger(), v.minValue(0)),
|
|
265
|
+
v.strictObject({
|
|
266
|
+
/** Cumulative traded volume. */
|
|
267
|
+
cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative traded volume.")),
|
|
268
|
+
/** Total fees rewarded to the referred user since referral. */
|
|
269
|
+
cumRewardedFeesSinceReferred: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total fees rewarded to the referred user since referral.")),
|
|
270
|
+
/** Total fees rewarded to the referrer from referred trades. */
|
|
271
|
+
cumFeesRewardedToReferrer: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total fees rewarded to the referrer from referred trades.")),
|
|
272
|
+
}),
|
|
273
|
+
])), v.description("Mapping of token IDs to referral reward states.")),
|
|
274
|
+
})), v.description("Summary of each referral state.")),
|
|
275
|
+
}), v.description("Referral program details.")),
|
|
276
|
+
}),
|
|
277
|
+
v.strictObject({
|
|
278
|
+
/** Referrer needs to create a referral code. */
|
|
279
|
+
stage: v.pipe(v.literal("needToCreateCode"), v.description("Referrer needs to create a referral code.")),
|
|
280
|
+
}),
|
|
281
|
+
v.strictObject({
|
|
282
|
+
/** Referrer must complete a trade before earning rewards. */
|
|
283
|
+
stage: v.pipe(v.literal("needToTrade"), v.description("Referrer must complete a trade before earning rewards.")),
|
|
284
|
+
/** Required trading volume details for activation. */
|
|
285
|
+
data: v.pipe(v.strictObject({
|
|
286
|
+
/** Required trading volume. */
|
|
287
|
+
required: v.pipe(_base_js_1.UnsignedDecimal, v.description("Required trading volume.")),
|
|
288
|
+
}), v.description("Required trading volume details for activation.")),
|
|
289
|
+
}),
|
|
290
|
+
]), v.description("Current state of the referrer.")),
|
|
291
|
+
/** History of referral rewards. */
|
|
292
|
+
rewardHistory: v.pipe(v.array(v.strictObject({
|
|
293
|
+
/** Amount of earned rewards. */
|
|
294
|
+
earned: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of earned rewards.")),
|
|
295
|
+
/** Traded volume at the time of reward. */
|
|
296
|
+
vlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Traded volume at the time of reward.")),
|
|
297
|
+
/** Traded volume via referrals. */
|
|
298
|
+
referralVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Traded volume via referrals.")),
|
|
299
|
+
/** Timestamp when the reward was earned (in ms since epoch). */
|
|
300
|
+
time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp when the reward was earned (in ms since epoch).")),
|
|
301
|
+
})), v.description("History of referral rewards.")),
|
|
302
|
+
/** Mapping of token IDs to referral reward states. */
|
|
303
|
+
tokenToState: v.pipe(v.array(v.strictTuple([
|
|
304
|
+
v.pipe(v.number(), v.safeInteger(), v.minValue(0)),
|
|
305
|
+
v.strictObject({
|
|
306
|
+
/** Cumulative traded volume. */
|
|
307
|
+
cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative traded volume.")),
|
|
308
|
+
/** Rewards earned but not yet claimed. */
|
|
309
|
+
unclaimedRewards: v.pipe(_base_js_1.UnsignedDecimal, v.description("Rewards earned but not yet claimed.")),
|
|
310
|
+
/** Rewards that have been claimed. */
|
|
311
|
+
claimedRewards: v.pipe(_base_js_1.UnsignedDecimal, v.description("Rewards that have been claimed.")),
|
|
312
|
+
/** Builder reward amount. */
|
|
313
|
+
builderRewards: v.pipe(_base_js_1.UnsignedDecimal, v.description("Builder reward amount.")),
|
|
314
|
+
}),
|
|
315
|
+
])), v.description("Mapping of token IDs to referral reward states.")),
|
|
316
|
+
}), v.description("Referral details for a user."));
|
|
317
|
+
/** Balance for a specific spot token. */
|
|
318
|
+
exports.SpotBalance = v.pipe(v.strictObject({
|
|
319
|
+
/** Asset symbol. */
|
|
320
|
+
coin: v.pipe(v.string(), v.description("Asset symbol.")),
|
|
321
|
+
/** Unique identifier for the token. */
|
|
322
|
+
token: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Unique identifier for the token.")),
|
|
323
|
+
/** Total balance. */
|
|
324
|
+
total: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total balance.")),
|
|
325
|
+
/** Amount on hold. */
|
|
326
|
+
hold: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount on hold.")),
|
|
327
|
+
/** Entry notional value. */
|
|
328
|
+
entryNtl: v.pipe(_base_js_1.UnsignedDecimal, v.description("Entry notional value.")),
|
|
329
|
+
}), v.description("Balance for a specific spot token."));
|
|
330
|
+
/** Account summary for spot trading. */
|
|
331
|
+
exports.SpotClearinghouseState = v.pipe(v.strictObject({
|
|
332
|
+
/** Balance for each token. */
|
|
333
|
+
balances: v.pipe(v.array(exports.SpotBalance), v.description("Balance for each token.")),
|
|
334
|
+
/** Escrowed balances. */
|
|
335
|
+
evmEscrows: v.pipe(v.optional(v.array(exports.EvmEscrowsBalance)), v.description("Escrowed balances.")),
|
|
336
|
+
}), v.description("Account summary for spot trading."));
|
|
337
|
+
/** Sub-account details for a user. */
|
|
338
|
+
exports.SubAccount = v.pipe(v.strictObject({
|
|
339
|
+
/** Sub-account name. */
|
|
340
|
+
name: v.pipe(v.string(), v.minLength(1), v.description("Sub-account name.")),
|
|
341
|
+
/** Sub-account address. */
|
|
342
|
+
subAccountUser: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Sub-account address.")),
|
|
343
|
+
/** Master account address. */
|
|
344
|
+
master: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Master account address.")),
|
|
345
|
+
/** Perpetual trading clearinghouse state summary. */
|
|
346
|
+
clearinghouseState: v.pipe(exports.PerpsClearinghouseState, v.description("Perpetual trading clearinghouse state summary.")),
|
|
347
|
+
/** Spot tokens clearinghouse state. */
|
|
348
|
+
spotState: v.pipe(exports.SpotClearinghouseState, v.description("Spot tokens clearinghouse state.")),
|
|
349
|
+
}), v.description("Sub-account details for a user."));
|
|
350
|
+
/** User fees. */
|
|
351
|
+
exports.UserFees = v.pipe(v.strictObject({
|
|
352
|
+
/** Daily user volume metrics. */
|
|
353
|
+
dailyUserVlm: v.pipe(v.array(v.strictObject({
|
|
354
|
+
/** Date in YYYY-M-D format. */
|
|
355
|
+
date: v.pipe(v.string(), v.isoDate(), v.description("Date in YYYY-M-D format.")),
|
|
356
|
+
/** User cross-trade volume. */
|
|
357
|
+
userCross: v.pipe(_base_js_1.UnsignedDecimal, v.description("User cross-trade volume.")),
|
|
358
|
+
/** User add-liquidity volume. */
|
|
359
|
+
userAdd: v.pipe(_base_js_1.UnsignedDecimal, v.description("User add-liquidity volume.")),
|
|
360
|
+
/** Exchange total volume. */
|
|
361
|
+
exchange: v.pipe(_base_js_1.UnsignedDecimal, v.description("Exchange total volume.")),
|
|
362
|
+
})), v.description("Daily user volume metrics.")),
|
|
363
|
+
/** Fee schedule information. */
|
|
364
|
+
feeSchedule: v.pipe(v.strictObject({
|
|
365
|
+
/** Cross-trade fee rate. */
|
|
366
|
+
cross: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cross-trade fee rate.")),
|
|
367
|
+
/** Add-liquidity fee rate. */
|
|
368
|
+
add: v.pipe(_base_js_1.UnsignedDecimal, v.description("Add-liquidity fee rate.")),
|
|
369
|
+
/** Spot cross-trade fee rate. */
|
|
370
|
+
spotCross: v.pipe(_base_js_1.UnsignedDecimal, v.description("Spot cross-trade fee rate.")),
|
|
371
|
+
/** Spot add-liquidity fee rate. */
|
|
372
|
+
spotAdd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Spot add-liquidity fee rate.")),
|
|
373
|
+
/** Fee tiers details. */
|
|
374
|
+
tiers: v.pipe(v.strictObject({
|
|
375
|
+
/** VIP fee tier information. */
|
|
376
|
+
vip: v.pipe(v.array(v.strictObject({
|
|
377
|
+
/** Notional volume cutoff. */
|
|
378
|
+
ntlCutoff: v.pipe(_base_js_1.UnsignedDecimal, v.description("Notional volume cutoff.")),
|
|
379
|
+
/** Cross-trade fee rate. */
|
|
380
|
+
cross: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cross-trade fee rate.")),
|
|
381
|
+
/** Add-liquidity fee rate. */
|
|
382
|
+
add: v.pipe(_base_js_1.UnsignedDecimal, v.description("Add-liquidity fee rate.")),
|
|
383
|
+
/** Spot cross-trade fee rate. */
|
|
384
|
+
spotCross: v.pipe(_base_js_1.UnsignedDecimal, v.description("Spot cross-trade fee rate.")),
|
|
385
|
+
/** Spot add-liquidity fee rate. */
|
|
386
|
+
spotAdd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Spot add-liquidity fee rate.")),
|
|
387
|
+
})), v.description("VIP fee tier information.")),
|
|
388
|
+
/** Market maker fee tier information. */
|
|
389
|
+
mm: v.pipe(v.array(v.strictObject({
|
|
390
|
+
/** Maker fraction cutoff. */
|
|
391
|
+
makerFractionCutoff: v.pipe(_base_js_1.UnsignedDecimal, v.description("Maker fraction cutoff.")),
|
|
392
|
+
/** Add-liquidity fee rate. */
|
|
393
|
+
add: v.pipe(_base_js_1.SignedDecimal, v.description("Add-liquidity fee rate.")),
|
|
394
|
+
})), v.description("Market maker fee tier information.")),
|
|
395
|
+
}), v.description("Fee tiers details.")),
|
|
396
|
+
/** Referral discount rate. */
|
|
397
|
+
referralDiscount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Referral discount rate.")),
|
|
398
|
+
/** Staking discount tiers details. */
|
|
399
|
+
stakingDiscountTiers: v.pipe(v.array(v.strictObject({
|
|
400
|
+
/** Basis points of maximum supply. */
|
|
401
|
+
bpsOfMaxSupply: v.pipe(_base_js_1.UnsignedDecimal, v.description("Basis points of maximum supply.")),
|
|
402
|
+
/** Discount rate applied. */
|
|
403
|
+
discount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Discount rate applied.")),
|
|
404
|
+
})), v.description("Staking discount tiers details.")),
|
|
405
|
+
}), v.description("Fee schedule information.")),
|
|
406
|
+
/** User cross-trade rate. */
|
|
407
|
+
userCrossRate: v.pipe(_base_js_1.UnsignedDecimal, v.description("User cross-trade rate.")),
|
|
408
|
+
/** User add-liquidity rate. */
|
|
409
|
+
userAddRate: v.pipe(_base_js_1.UnsignedDecimal, v.description("User add-liquidity rate.")),
|
|
410
|
+
/** User spot cross-trade rate. */
|
|
411
|
+
userSpotCrossRate: v.pipe(_base_js_1.UnsignedDecimal, v.description("User spot cross-trade rate.")),
|
|
412
|
+
/** User spot add-liquidity rate. */
|
|
413
|
+
userSpotAddRate: v.pipe(_base_js_1.UnsignedDecimal, v.description("User spot add-liquidity rate.")),
|
|
414
|
+
/** Active referral discount rate. */
|
|
415
|
+
activeReferralDiscount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Active referral discount rate.")),
|
|
416
|
+
/** Trial details. */
|
|
417
|
+
trial: v.pipe(v.union([v.unknown(), v.null()]), v.description("Trial details.")),
|
|
418
|
+
/** Fee trial reward amount. */
|
|
419
|
+
feeTrialReward: v.pipe(_base_js_1.UnsignedDecimal, v.description("Fee trial reward amount.")),
|
|
420
|
+
/** Timestamp when next trial becomes available. */
|
|
421
|
+
nextTrialAvailableTimestamp: v.pipe(v.union([v.unknown(), v.null()]), v.description("Timestamp when next trial becomes available.")),
|
|
422
|
+
stakingLink: v.union([v.unknown(), v.null()]),
|
|
423
|
+
/** Active staking discount details. */
|
|
424
|
+
activeStakingDiscount: v.pipe(v.strictObject({
|
|
425
|
+
/** Basis points of maximum supply. */
|
|
426
|
+
bpsOfMaxSupply: v.pipe(_base_js_1.UnsignedDecimal, v.description("Basis points of maximum supply.")),
|
|
427
|
+
/** Discount rate applied. */
|
|
428
|
+
discount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Discount rate applied.")),
|
|
429
|
+
}), v.description("Active staking discount details.")),
|
|
430
|
+
}), v.description("User fees."));
|
|
431
|
+
/** Funding update details. */
|
|
432
|
+
exports.FundingUpdate = v.pipe(v.strictObject({
|
|
433
|
+
/** Update type. */
|
|
434
|
+
type: v.pipe(v.literal("funding"), v.description("Update type.")),
|
|
435
|
+
/** Asset symbol. */
|
|
436
|
+
coin: v.pipe(v.string(), v.description("Asset symbol.")),
|
|
437
|
+
/** Amount transferred in USDC. */
|
|
438
|
+
usdc: v.pipe(_base_js_1.SignedDecimal, v.description("Amount transferred in USDC.")),
|
|
439
|
+
/** Signed position size. */
|
|
440
|
+
szi: v.pipe(_base_js_1.SignedDecimal, v.description("Signed position size.")),
|
|
441
|
+
/** Applied funding rate. */
|
|
442
|
+
fundingRate: v.pipe(_base_js_1.SignedDecimal, v.description("Applied funding rate.")),
|
|
443
|
+
/** Number of samples. */
|
|
444
|
+
nSamples: v.pipe(v.union([v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.null()]), v.description("Number of samples.")),
|
|
445
|
+
}), v.description("Funding update details."));
|
|
446
|
+
/** Funding ledger update for a user. */
|
|
447
|
+
exports.UserFundingUpdate = v.pipe(v.strictObject({
|
|
448
|
+
/** Timestamp of the update (in ms since epoch). */
|
|
449
|
+
time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp of the update (in ms since epoch).")),
|
|
450
|
+
/** L1 transaction hash. */
|
|
451
|
+
hash: v.pipe(v.pipe(_base_js_1.Hex, v.length(66)), v.description("L1 transaction hash.")),
|
|
452
|
+
/** Update details. */
|
|
453
|
+
delta: v.pipe(exports.FundingUpdate, v.description("Update details.")),
|
|
454
|
+
}), v.description("Funding ledger update for a user."));
|
|
455
|
+
/** User rate limits. */
|
|
456
|
+
exports.UserRateLimit = v.pipe(v.strictObject({
|
|
457
|
+
/** Cumulative trading volume. */
|
|
458
|
+
cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative trading volume.")),
|
|
459
|
+
/** Number of API requests used. */
|
|
460
|
+
nRequestsUsed: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Number of API requests used.")),
|
|
461
|
+
/** Maximum allowed API requests. */
|
|
462
|
+
nRequestsCap: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Maximum allowed API requests.")),
|
|
463
|
+
}), v.description("User rate limits."));
|
|
464
|
+
/** User role. */
|
|
465
|
+
exports.UserRole = v.pipe(v.union([
|
|
466
|
+
v.strictObject({
|
|
467
|
+
/** Role identifier. */
|
|
468
|
+
role: v.pipe(v.union([v.literal("missing"), v.literal("user"), v.literal("vault")]), v.description("Role identifier.")),
|
|
469
|
+
}),
|
|
470
|
+
v.strictObject({
|
|
471
|
+
/** Role identifier. */
|
|
472
|
+
role: v.pipe(v.literal("agent"), v.description("Role identifier.")),
|
|
473
|
+
/** Details for agent role. */
|
|
474
|
+
data: v.pipe(v.strictObject({
|
|
475
|
+
/** Master account address associated with the agent. */
|
|
476
|
+
user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Master account address associated with the agent.")),
|
|
477
|
+
}), v.description("Details for agent role.")),
|
|
478
|
+
}),
|
|
479
|
+
v.strictObject({
|
|
480
|
+
/** Role identifier. */
|
|
481
|
+
role: v.pipe(v.literal("subAccount"), v.description("Role identifier.")),
|
|
482
|
+
/** Details for sub-account role. */
|
|
483
|
+
data: v.pipe(v.strictObject({
|
|
484
|
+
/** Master account address associated with the sub-account. */
|
|
485
|
+
master: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Master account address associated with the sub-account.")),
|
|
486
|
+
}), v.description("Details for sub-account role.")),
|
|
487
|
+
}),
|
|
488
|
+
]), v.description("User role."));
|
|
489
|
+
/** Transfer between spot and perpetual accounts. */
|
|
490
|
+
exports.AccountClassTransferUpdate = v.pipe(v.strictObject({
|
|
491
|
+
/** Update type. */
|
|
492
|
+
type: v.pipe(v.literal("accountClassTransfer"), v.description("Update type.")),
|
|
493
|
+
/** Amount transferred in USDC. */
|
|
494
|
+
usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount transferred in USDC.")),
|
|
495
|
+
/** Indicates if the transfer is to the perpetual account. */
|
|
496
|
+
toPerp: v.pipe(v.boolean(), v.description("Indicates if the transfer is to the perpetual account.")),
|
|
497
|
+
}), v.description("Transfer between spot and perpetual accounts."));
|
|
498
|
+
/** Deposit update to an account. */
|
|
499
|
+
exports.DepositUpdate = v.pipe(v.strictObject({
|
|
500
|
+
/** Update type. */
|
|
501
|
+
type: v.pipe(v.literal("deposit"), v.description("Update type.")),
|
|
502
|
+
/** Amount deposited in USDC. */
|
|
503
|
+
usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount deposited in USDC.")),
|
|
504
|
+
}), v.description("Deposit update to an account."));
|
|
505
|
+
/** Internal transfer between accounts. */
|
|
506
|
+
exports.InternalTransferUpdate = v.pipe(v.strictObject({
|
|
507
|
+
/** Update type. */
|
|
508
|
+
type: v.pipe(v.literal("internalTransfer"), v.description("Update type.")),
|
|
509
|
+
/** Amount transferred in USDC. */
|
|
510
|
+
usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount transferred in USDC.")),
|
|
511
|
+
/** Initiator address. */
|
|
512
|
+
user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Initiator address.")),
|
|
513
|
+
/** Destination address. */
|
|
514
|
+
destination: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Destination address.")),
|
|
515
|
+
/** Transfer fee. */
|
|
516
|
+
fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Transfer fee.")),
|
|
517
|
+
}), v.description("Internal transfer between accounts."));
|
|
518
|
+
/** Liquidation event update. */
|
|
519
|
+
exports.LiquidationUpdate = v.pipe(v.strictObject({
|
|
520
|
+
/** Update type. */
|
|
521
|
+
type: v.pipe(v.literal("liquidation"), v.description("Update type.")),
|
|
522
|
+
/** Total notional value of liquidated positions. */
|
|
523
|
+
liquidatedNtlPos: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total notional value of liquidated positions.")),
|
|
524
|
+
/** Account value at liquidation time. */
|
|
525
|
+
accountValue: v.pipe(_base_js_1.UnsignedDecimal, v.description("Account value at liquidation time.")),
|
|
526
|
+
/** Leverage type for liquidated positions. */
|
|
527
|
+
leverageType: v.pipe(v.union([v.literal("Cross"), v.literal("Isolated")]), v.description("Leverage type for liquidated positions.")),
|
|
528
|
+
/** Details of each liquidated position. */
|
|
529
|
+
liquidatedPositions: v.pipe(v.array(v.strictObject({
|
|
530
|
+
/** Asset symbol of the liquidated position. */
|
|
531
|
+
coin: v.pipe(v.string(), v.description("Asset symbol of the liquidated position.")),
|
|
532
|
+
/** Signed position size liquidated. */
|
|
533
|
+
szi: v.pipe(_base_js_1.SignedDecimal, v.description("Signed position size liquidated.")),
|
|
534
|
+
})), v.description("Details of each liquidated position.")),
|
|
535
|
+
}), v.description("Liquidation event update."));
|
|
536
|
+
/** Rewards claim event update. */
|
|
537
|
+
exports.RewardsClaimUpdate = v.pipe(v.strictObject({
|
|
538
|
+
/** Update type. */
|
|
539
|
+
type: v.pipe(v.literal("rewardsClaim"), v.description("Update type.")),
|
|
540
|
+
/** Amount of rewards claimed. */
|
|
541
|
+
amount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of rewards claimed.")),
|
|
542
|
+
/** Token symbol. */
|
|
543
|
+
token: v.pipe(v.string(), v.description("Token symbol.")),
|
|
544
|
+
}), v.description("Rewards claim event update."));
|
|
545
|
+
/** Spot transfer update between accounts. */
|
|
546
|
+
exports.SpotTransferUpdate = v.pipe(v.strictObject({
|
|
547
|
+
/** Update type. */
|
|
548
|
+
type: v.pipe(v.literal("spotTransfer"), v.description("Update type.")),
|
|
549
|
+
/** Token symbol. */
|
|
550
|
+
token: v.pipe(v.string(), v.description("Token symbol.")),
|
|
551
|
+
/** Amount transferred. */
|
|
552
|
+
amount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount transferred.")),
|
|
553
|
+
/** Equivalent USDC value. */
|
|
554
|
+
usdcValue: v.pipe(_base_js_1.UnsignedDecimal, v.description("Equivalent USDC value.")),
|
|
555
|
+
/** Initiator address. */
|
|
556
|
+
user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Initiator address.")),
|
|
557
|
+
/** Destination address. */
|
|
558
|
+
destination: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Destination address.")),
|
|
559
|
+
/** Transfer fee. */
|
|
560
|
+
fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Transfer fee.")),
|
|
561
|
+
/** Fee in native token. */
|
|
562
|
+
nativeTokenFee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Fee in native token.")),
|
|
563
|
+
nonce: v.null(),
|
|
564
|
+
/** Token in which the fee is denominated (e.g., "USDC"). */
|
|
565
|
+
feeToken: v.pipe(v.string(), v.description('Token in which the fee is denominated (e.g., "USDC").')),
|
|
566
|
+
}), v.description("Spot transfer update between accounts."));
|
|
567
|
+
/** Transfer update between sub-accounts. */
|
|
568
|
+
exports.SubAccountTransferUpdate = v.pipe(v.strictObject({
|
|
569
|
+
/** Update type. */
|
|
570
|
+
type: v.pipe(v.literal("subAccountTransfer"), v.description("Update type.")),
|
|
571
|
+
/** Amount transferred in USDC. */
|
|
572
|
+
usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount transferred in USDC.")),
|
|
573
|
+
/** Initiator address. */
|
|
574
|
+
user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Initiator address.")),
|
|
575
|
+
/** Destination address. */
|
|
576
|
+
destination: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Destination address.")),
|
|
577
|
+
}), v.description("Transfer update between sub-accounts."));
|
|
578
|
+
/** Vault creation update. */
|
|
579
|
+
exports.VaultCreateUpdate = v.pipe(v.strictObject({
|
|
580
|
+
/** Update type. */
|
|
581
|
+
type: v.pipe(v.literal("vaultCreate"), v.description("Update type.")),
|
|
582
|
+
/** Address of the created vault. */
|
|
583
|
+
vault: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the created vault.")),
|
|
584
|
+
/** Initial allocated amount in USDC. */
|
|
585
|
+
usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Initial allocated amount in USDC.")),
|
|
586
|
+
/** Vault creation fee. */
|
|
587
|
+
fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Vault creation fee.")),
|
|
588
|
+
}), v.description("Vault creation update."));
|
|
589
|
+
/** Vault deposit update. */
|
|
590
|
+
exports.VaultDepositUpdate = v.pipe(v.strictObject({
|
|
591
|
+
/** Update type. */
|
|
592
|
+
type: v.pipe(v.literal("vaultDeposit"), v.description("Update type.")),
|
|
593
|
+
/** Address of the target vault. */
|
|
594
|
+
vault: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the target vault.")),
|
|
595
|
+
/** Amount deposited in USDC. */
|
|
596
|
+
usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount deposited in USDC.")),
|
|
597
|
+
}), v.description("Vault deposit update."));
|
|
598
|
+
/** Vault distribution update. */
|
|
599
|
+
exports.VaultDistributionUpdate = v.pipe(v.strictObject({
|
|
600
|
+
/** Update type. */
|
|
601
|
+
type: v.pipe(v.literal("vaultDistribution"), v.description("Update type.")),
|
|
602
|
+
/** Address of the vault distributing funds. */
|
|
603
|
+
vault: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the vault distributing funds.")),
|
|
604
|
+
/** Amount distributed in USDC. */
|
|
605
|
+
usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount distributed in USDC.")),
|
|
606
|
+
}), v.description("Vault distribution update."));
|
|
607
|
+
/** Vault withdrawal event update. */
|
|
608
|
+
exports.VaultWithdrawUpdate = v.pipe(v.strictObject({
|
|
609
|
+
/** Update type. */
|
|
610
|
+
type: v.pipe(v.literal("vaultWithdraw"), v.description("Update type.")),
|
|
611
|
+
/** Vault address. */
|
|
612
|
+
vault: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Vault address.")),
|
|
613
|
+
/** Address of the user withdrawing funds. */
|
|
614
|
+
user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the user withdrawing funds.")),
|
|
615
|
+
/** Withdrawal request amount in USD. */
|
|
616
|
+
requestedUsd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Withdrawal request amount in USD.")),
|
|
617
|
+
/** Withdrawal commission fee. */
|
|
618
|
+
commission: v.pipe(_base_js_1.UnsignedDecimal, v.description("Withdrawal commission fee.")),
|
|
619
|
+
/** Closing cost associated with positions. */
|
|
620
|
+
closingCost: v.pipe(_base_js_1.UnsignedDecimal, v.description("Closing cost associated with positions.")),
|
|
621
|
+
/** Basis value for withdrawal calculation. */
|
|
622
|
+
basis: v.pipe(_base_js_1.UnsignedDecimal, v.description("Basis value for withdrawal calculation.")),
|
|
623
|
+
/** Net withdrawn amount in USD after fees and costs. */
|
|
624
|
+
netWithdrawnUsd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Net withdrawn amount in USD after fees and costs.")),
|
|
625
|
+
}), v.description("Vault withdrawal event update."));
|
|
626
|
+
/** Withdrawal update from an account. */
|
|
627
|
+
exports.WithdrawUpdate = v.pipe(v.strictObject({
|
|
628
|
+
/** Update type. */
|
|
629
|
+
type: v.pipe(v.literal("withdraw"), v.description("Update type.")),
|
|
630
|
+
/** Amount withdrawn in USDC. */
|
|
631
|
+
usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount withdrawn in USDC.")),
|
|
632
|
+
/** Unique nonce for the withdrawal request. */
|
|
633
|
+
nonce: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Unique nonce for the withdrawal request.")),
|
|
634
|
+
/** Withdrawal fee. */
|
|
635
|
+
fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Withdrawal fee.")),
|
|
636
|
+
}), v.description("Withdrawal update from an account."));
|
|
637
|
+
/** Non-funding ledger update for a user. */
|
|
638
|
+
exports.UserNonFundingLedgerUpdate = v.pipe(v.strictObject({
|
|
639
|
+
/** Timestamp of the update (in ms since epoch). */
|
|
640
|
+
time: v.pipe(v.pipe(v.number(), v.safeInteger(), v.minValue(0)), v.description("Timestamp of the update (in ms since epoch).")),
|
|
641
|
+
/** L1 transaction hash. */
|
|
642
|
+
hash: v.pipe(v.pipe(_base_js_1.Hex, v.length(66)), v.description("L1 transaction hash.")),
|
|
643
|
+
/** Update details. */
|
|
644
|
+
delta: v.pipe(v.union([
|
|
645
|
+
exports.AccountClassTransferUpdate,
|
|
646
|
+
exports.DepositUpdate,
|
|
647
|
+
exports.InternalTransferUpdate,
|
|
648
|
+
exports.LiquidationUpdate,
|
|
649
|
+
exports.RewardsClaimUpdate,
|
|
650
|
+
exports.SpotTransferUpdate,
|
|
651
|
+
exports.SubAccountTransferUpdate,
|
|
652
|
+
exports.VaultCreateUpdate,
|
|
653
|
+
exports.VaultDepositUpdate,
|
|
654
|
+
exports.VaultDistributionUpdate,
|
|
655
|
+
exports.VaultWithdrawUpdate,
|
|
656
|
+
exports.WithdrawUpdate,
|
|
657
|
+
]), v.description("Update details.")),
|
|
658
|
+
}), v.description("Non-funding ledger update for a user."));
|