@nktkas/hyperliquid 0.25.0-beta.1 → 0.25.0-beta.2
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 +46 -14
- package/esm/mod.js +1 -0
- package/esm/mod.js.map +1 -0
- package/esm/src/clients/exchange.d.ts +0 -7
- package/esm/src/clients/exchange.d.ts.map +1 -1
- package/esm/src/clients/exchange.js +4 -5
- package/esm/src/clients/exchange.js.map +1 -0
- package/esm/src/clients/info.d.ts +64 -2
- package/esm/src/clients/info.d.ts.map +1 -1
- package/esm/src/clients/info.js +77 -1
- package/esm/src/clients/info.js.map +1 -0
- package/esm/src/clients/multiSign.js +2 -1
- package/esm/src/clients/multiSign.js.map +1 -0
- package/esm/src/clients/subscription.js +1 -0
- package/esm/src/clients/subscription.js.map +1 -0
- package/esm/src/errors.js +1 -0
- package/esm/src/errors.js.map +1 -0
- package/esm/src/schemas/_base.d.ts +6 -2
- package/esm/src/schemas/_base.d.ts.map +1 -1
- package/esm/src/schemas/_base.js +4 -1
- package/esm/src/schemas/_base.js.map +1 -0
- package/esm/src/schemas/exchange/requests.d.ts +284 -284
- package/esm/src/schemas/exchange/requests.js +260 -259
- package/esm/src/schemas/exchange/requests.js.map +1 -0
- package/esm/src/schemas/exchange/responses.d.ts +47 -47
- package/esm/src/schemas/exchange/responses.js +55 -54
- package/esm/src/schemas/exchange/responses.js.map +1 -0
- package/esm/src/schemas/explorer/requests.d.ts +3 -3
- package/esm/src/schemas/explorer/requests.js +6 -5
- package/esm/src/schemas/explorer/requests.js.map +1 -0
- package/esm/src/schemas/explorer/responses.d.ts +10 -10
- package/esm/src/schemas/explorer/responses.js +12 -11
- package/esm/src/schemas/explorer/responses.js.map +1 -0
- package/esm/src/schemas/info/accounts.d.ts +121 -121
- package/esm/src/schemas/info/accounts.js +110 -109
- package/esm/src/schemas/info/accounts.js.map +1 -0
- package/esm/src/schemas/info/assets.d.ts +68 -39
- package/esm/src/schemas/info/assets.d.ts.map +1 -1
- package/esm/src/schemas/info/assets.js +69 -49
- package/esm/src/schemas/info/assets.js.map +1 -0
- package/esm/src/schemas/info/markets.d.ts +25 -8
- package/esm/src/schemas/info/markets.d.ts.map +1 -1
- package/esm/src/schemas/info/markets.js +27 -15
- package/esm/src/schemas/info/markets.js.map +1 -0
- package/esm/src/schemas/info/orders.d.ts +56 -56
- package/esm/src/schemas/info/orders.js +37 -36
- package/esm/src/schemas/info/orders.js.map +1 -0
- package/esm/src/schemas/info/requests.d.ts +98 -56
- package/esm/src/schemas/info/requests.d.ts.map +1 -1
- package/esm/src/schemas/info/requests.js +103 -71
- package/esm/src/schemas/info/requests.js.map +1 -0
- package/esm/src/schemas/info/validators.d.ts +44 -23
- package/esm/src/schemas/info/validators.d.ts.map +1 -1
- package/esm/src/schemas/info/validators.js +40 -26
- package/esm/src/schemas/info/validators.js.map +1 -0
- package/esm/src/schemas/info/vaults.d.ts +40 -40
- package/esm/src/schemas/info/vaults.js +20 -19
- package/esm/src/schemas/info/vaults.js.map +1 -0
- package/esm/src/schemas/mod.d.ts +1 -0
- package/esm/src/schemas/mod.d.ts.map +1 -1
- package/esm/src/schemas/mod.js +2 -0
- package/esm/src/schemas/mod.js.map +1 -0
- package/esm/src/schemas/subscriptions/requests.d.ts +21 -21
- package/esm/src/schemas/subscriptions/requests.js +22 -21
- package/esm/src/schemas/subscriptions/requests.js.map +1 -0
- package/esm/src/schemas/subscriptions/responses.d.ts +192 -192
- package/esm/src/schemas/subscriptions/responses.js +41 -40
- package/esm/src/schemas/subscriptions/responses.js.map +1 -0
- package/esm/src/signing/_signTypedData/ethers.js +1 -0
- package/esm/src/signing/_signTypedData/ethers.js.map +1 -0
- package/esm/src/signing/_signTypedData/mod.js +1 -0
- package/esm/src/signing/_signTypedData/mod.js.map +1 -0
- package/esm/src/signing/_signTypedData/private_key.js +1 -0
- package/esm/src/signing/_signTypedData/private_key.js.map +1 -0
- package/esm/src/signing/_signTypedData/viem.js +1 -0
- package/esm/src/signing/_signTypedData/viem.js.map +1 -0
- package/esm/src/signing/mod.js +1 -0
- package/esm/src/signing/mod.js.map +1 -0
- 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 +1 -0
- package/esm/src/transports/base.js.map +1 -0
- package/esm/src/transports/http/http_transport.d.ts +1 -1
- package/esm/src/transports/http/http_transport.js +1 -0
- package/esm/src/transports/http/http_transport.js.map +1 -0
- package/esm/src/transports/websocket/_hyperliquid_event_target.js +1 -0
- package/esm/src/transports/websocket/_hyperliquid_event_target.js.map +1 -0
- package/esm/src/transports/websocket/_reconnecting_websocket.js +1 -0
- package/esm/src/transports/websocket/_reconnecting_websocket.js.map +1 -0
- package/esm/src/transports/websocket/_websocket_async_request.js +1 -0
- package/esm/src/transports/websocket/_websocket_async_request.js.map +1 -0
- package/esm/src/transports/websocket/websocket_transport.d.ts +7 -0
- package/esm/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/esm/src/transports/websocket/websocket_transport.js +4 -0
- package/esm/src/transports/websocket/websocket_transport.js.map +1 -0
- package/package.json +1 -1
- package/script/mod.js +1 -0
- package/script/mod.js.map +1 -0
- package/script/src/clients/exchange.d.ts +0 -7
- package/script/src/clients/exchange.d.ts.map +1 -1
- package/script/src/clients/exchange.js +4 -5
- package/script/src/clients/exchange.js.map +1 -0
- package/script/src/clients/info.d.ts +64 -2
- package/script/src/clients/info.d.ts.map +1 -1
- package/script/src/clients/info.js +76 -0
- package/script/src/clients/info.js.map +1 -0
- package/script/src/clients/multiSign.js +2 -1
- package/script/src/clients/multiSign.js.map +1 -0
- package/script/src/clients/subscription.js +1 -0
- package/script/src/clients/subscription.js.map +1 -0
- package/script/src/errors.js +1 -0
- package/script/src/errors.js.map +1 -0
- package/script/src/schemas/_base.d.ts +6 -2
- package/script/src/schemas/_base.d.ts.map +1 -1
- package/script/src/schemas/_base.js +5 -2
- package/script/src/schemas/_base.js.map +1 -0
- package/script/src/schemas/exchange/requests.d.ts +284 -284
- package/script/src/schemas/exchange/requests.js +259 -258
- package/script/src/schemas/exchange/requests.js.map +1 -0
- package/script/src/schemas/exchange/responses.d.ts +47 -47
- package/script/src/schemas/exchange/responses.js +54 -53
- package/script/src/schemas/exchange/responses.js.map +1 -0
- package/script/src/schemas/explorer/requests.d.ts +3 -3
- package/script/src/schemas/explorer/requests.js +5 -4
- package/script/src/schemas/explorer/requests.js.map +1 -0
- package/script/src/schemas/explorer/responses.d.ts +10 -10
- package/script/src/schemas/explorer/responses.js +11 -10
- package/script/src/schemas/explorer/responses.js.map +1 -0
- package/script/src/schemas/info/accounts.d.ts +121 -121
- package/script/src/schemas/info/accounts.js +109 -108
- package/script/src/schemas/info/accounts.js.map +1 -0
- package/script/src/schemas/info/assets.d.ts +68 -39
- package/script/src/schemas/info/assets.d.ts.map +1 -1
- package/script/src/schemas/info/assets.js +69 -49
- package/script/src/schemas/info/assets.js.map +1 -0
- package/script/src/schemas/info/markets.d.ts +25 -8
- package/script/src/schemas/info/markets.d.ts.map +1 -1
- package/script/src/schemas/info/markets.js +27 -15
- package/script/src/schemas/info/markets.js.map +1 -0
- package/script/src/schemas/info/orders.d.ts +56 -56
- package/script/src/schemas/info/orders.js +36 -35
- package/script/src/schemas/info/orders.js.map +1 -0
- package/script/src/schemas/info/requests.d.ts +98 -56
- package/script/src/schemas/info/requests.d.ts.map +1 -1
- package/script/src/schemas/info/requests.js +103 -71
- package/script/src/schemas/info/requests.js.map +1 -0
- package/script/src/schemas/info/validators.d.ts +44 -23
- package/script/src/schemas/info/validators.d.ts.map +1 -1
- package/script/src/schemas/info/validators.js +40 -26
- package/script/src/schemas/info/validators.js.map +1 -0
- package/script/src/schemas/info/vaults.d.ts +40 -40
- package/script/src/schemas/info/vaults.js +19 -18
- package/script/src/schemas/info/vaults.js.map +1 -0
- package/script/src/schemas/mod.d.ts +1 -0
- package/script/src/schemas/mod.d.ts.map +1 -1
- package/script/src/schemas/mod.js +4 -1
- package/script/src/schemas/mod.js.map +1 -0
- package/script/src/schemas/subscriptions/requests.d.ts +21 -21
- package/script/src/schemas/subscriptions/requests.js +22 -21
- package/script/src/schemas/subscriptions/requests.js.map +1 -0
- package/script/src/schemas/subscriptions/responses.d.ts +192 -192
- package/script/src/schemas/subscriptions/responses.js +40 -39
- package/script/src/schemas/subscriptions/responses.js.map +1 -0
- package/script/src/signing/_signTypedData/ethers.js +1 -0
- package/script/src/signing/_signTypedData/ethers.js.map +1 -0
- package/script/src/signing/_signTypedData/mod.js +1 -0
- package/script/src/signing/_signTypedData/mod.js.map +1 -0
- package/script/src/signing/_signTypedData/private_key.js +1 -0
- package/script/src/signing/_signTypedData/private_key.js.map +1 -0
- package/script/src/signing/_signTypedData/viem.js +1 -0
- package/script/src/signing/_signTypedData/viem.js.map +1 -0
- package/script/src/signing/mod.js +1 -0
- package/script/src/signing/mod.js.map +1 -0
- 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 +1 -0
- package/script/src/transports/base.js.map +1 -0
- package/script/src/transports/http/http_transport.d.ts +1 -1
- package/script/src/transports/http/http_transport.js +1 -0
- package/script/src/transports/http/http_transport.js.map +1 -0
- package/script/src/transports/websocket/_hyperliquid_event_target.js +1 -0
- package/script/src/transports/websocket/_hyperliquid_event_target.js.map +1 -0
- package/script/src/transports/websocket/_reconnecting_websocket.js +1 -0
- package/script/src/transports/websocket/_reconnecting_websocket.js.map +1 -0
- package/script/src/transports/websocket/_websocket_async_request.js +1 -0
- package/script/src/transports/websocket/_websocket_async_request.js.map +1 -0
- package/script/src/transports/websocket/websocket_transport.d.ts +7 -0
- package/script/src/transports/websocket/websocket_transport.d.ts.map +1 -1
- package/script/src/transports/websocket/websocket_transport.js +4 -0
- package/script/src/transports/websocket/websocket_transport.js.map +1 -0
- package/src/mod.ts +28 -0
- package/src/src/clients/exchange.ts +2246 -0
- package/src/src/clients/info.ts +2076 -0
- package/src/src/clients/multiSign.ts +183 -0
- package/src/src/clients/subscription.ts +841 -0
- package/src/src/errors.ts +7 -0
- package/src/src/schemas/_base.ts +43 -0
- package/src/src/schemas/exchange/requests.ts +3057 -0
- package/src/src/schemas/exchange/responses.ts +540 -0
- package/src/src/schemas/explorer/requests.ts +65 -0
- package/src/src/schemas/explorer/responses.ts +138 -0
- package/src/src/schemas/info/accounts.ts +1490 -0
- package/src/src/schemas/info/assets.ts +693 -0
- package/src/src/schemas/info/markets.ts +171 -0
- package/src/src/schemas/info/orders.ts +597 -0
- package/src/src/schemas/info/requests.ts +1369 -0
- package/src/src/schemas/info/validators.ts +299 -0
- package/src/src/schemas/info/vaults.ts +262 -0
- package/src/src/schemas/mod.ts +121 -0
- package/src/src/schemas/subscriptions/requests.ts +504 -0
- package/src/src/schemas/subscriptions/responses.ts +576 -0
- package/src/src/signing/_signTypedData/ethers.ts +59 -0
- package/src/src/signing/_signTypedData/mod.ts +121 -0
- package/src/src/signing/_signTypedData/private_key.ts +229 -0
- package/src/src/signing/_signTypedData/viem.ts +55 -0
- package/src/src/signing/mod.ts +572 -0
- package/src/src/transports/base.ts +54 -0
- package/src/src/transports/http/http_transport.ts +208 -0
- package/src/src/transports/websocket/_hyperliquid_event_target.ts +118 -0
- package/src/src/transports/websocket/_reconnecting_websocket.ts +404 -0
- package/src/src/transports/websocket/_websocket_async_request.ts +229 -0
- package/src/src/transports/websocket/websocket_transport.ts +394 -0
|
@@ -37,60 +37,60 @@ exports.UserNonFundingLedgerUpdate = exports.WithdrawUpdate = exports.VaultWithd
|
|
|
37
37
|
const v = __importStar(require("valibot"));
|
|
38
38
|
const _base_js_1 = require("../_base.js");
|
|
39
39
|
/** User active asset data. */
|
|
40
|
-
exports.ActiveAssetData = v.pipe(v.
|
|
40
|
+
exports.ActiveAssetData = v.pipe(v.object({
|
|
41
41
|
/** User address. */
|
|
42
42
|
user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("User address.")),
|
|
43
43
|
/** Asset symbol (e.g., BTC). */
|
|
44
44
|
coin: v.pipe(v.string(), v.description("Asset symbol (e.g., BTC).")),
|
|
45
45
|
/** Leverage configuration. */
|
|
46
46
|
leverage: v.pipe(v.union([
|
|
47
|
-
v.
|
|
47
|
+
v.object({
|
|
48
48
|
/** Leverage type. */
|
|
49
49
|
type: v.pipe(v.literal("isolated"), v.description("Leverage type.")),
|
|
50
50
|
/** Leverage value used. */
|
|
51
|
-
value: v.pipe(
|
|
51
|
+
value: v.pipe(_base_js_1.UnsignedInteger, v.minValue(1), v.description("Leverage value used.")),
|
|
52
52
|
/** Amount of USD used (1 = 1$). */
|
|
53
53
|
rawUsd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of USD used (1 = 1$).")),
|
|
54
54
|
}),
|
|
55
|
-
v.
|
|
55
|
+
v.object({
|
|
56
56
|
/** Leverage type. */
|
|
57
57
|
type: v.pipe(v.literal("cross"), v.description("Leverage type.")),
|
|
58
58
|
/** Leverage value used. */
|
|
59
|
-
value: v.pipe(
|
|
59
|
+
value: v.pipe(_base_js_1.UnsignedInteger, v.minValue(1), v.description("Leverage value used.")),
|
|
60
60
|
}),
|
|
61
61
|
]), v.description("Leverage configuration.")),
|
|
62
62
|
/** Maximum trade size range [min, max]. */
|
|
63
|
-
maxTradeSzs: v.pipe(v.
|
|
63
|
+
maxTradeSzs: v.pipe(v.tuple([_base_js_1.UnsignedDecimal, _base_js_1.UnsignedDecimal]), v.description("Maximum trade size range [min, max].")),
|
|
64
64
|
/** Available to trade range [min, max]. */
|
|
65
|
-
availableToTrade: v.pipe(v.
|
|
65
|
+
availableToTrade: v.pipe(v.tuple([_base_js_1.UnsignedDecimal, _base_js_1.UnsignedDecimal]), v.description("Available to trade range [min, max].")),
|
|
66
66
|
/** Mark price. */
|
|
67
67
|
markPx: v.pipe(_base_js_1.UnsignedDecimal, v.description("Mark price.")),
|
|
68
68
|
}), v.description("User active asset data."));
|
|
69
69
|
/** Position for a specific asset. */
|
|
70
|
-
exports.AssetPosition = v.pipe(v.
|
|
70
|
+
exports.AssetPosition = v.pipe(v.object({
|
|
71
71
|
/** Position type. */
|
|
72
72
|
type: v.pipe(v.literal("oneWay"), v.description("Position type.")),
|
|
73
73
|
/** Position details. */
|
|
74
|
-
position: v.pipe(v.
|
|
74
|
+
position: v.pipe(v.object({
|
|
75
75
|
/** Asset symbol. */
|
|
76
76
|
coin: v.pipe(v.string(), v.description("Asset symbol.")),
|
|
77
77
|
/** Signed position size. */
|
|
78
|
-
szi: v.pipe(_base_js_1.
|
|
78
|
+
szi: v.pipe(_base_js_1.Decimal, v.description("Signed position size.")),
|
|
79
79
|
/** Leverage details. */
|
|
80
80
|
leverage: v.pipe(v.union([
|
|
81
|
-
v.
|
|
81
|
+
v.object({
|
|
82
82
|
/** Leverage type. */
|
|
83
83
|
type: v.pipe(v.literal("isolated"), v.description("Leverage type.")),
|
|
84
84
|
/** Leverage value used. */
|
|
85
|
-
value: v.pipe(
|
|
85
|
+
value: v.pipe(_base_js_1.UnsignedInteger, v.minValue(1), v.description("Leverage value used.")),
|
|
86
86
|
/** Amount of USD used (1 = 1$). */
|
|
87
87
|
rawUsd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of USD used (1 = 1$).")),
|
|
88
88
|
}),
|
|
89
|
-
v.
|
|
89
|
+
v.object({
|
|
90
90
|
/** Leverage type. */
|
|
91
91
|
type: v.pipe(v.literal("cross"), v.description("Leverage type.")),
|
|
92
92
|
/** Leverage value used. */
|
|
93
|
-
value: v.pipe(
|
|
93
|
+
value: v.pipe(_base_js_1.UnsignedInteger, v.minValue(1), v.description("Leverage value used.")),
|
|
94
94
|
}),
|
|
95
95
|
]), v.description("Leverage details.")),
|
|
96
96
|
/** Average entry price. */
|
|
@@ -98,46 +98,46 @@ exports.AssetPosition = v.pipe(v.strictObject({
|
|
|
98
98
|
/** Position value. */
|
|
99
99
|
positionValue: v.pipe(_base_js_1.UnsignedDecimal, v.description("Position value.")),
|
|
100
100
|
/** Unrealized profit and loss. */
|
|
101
|
-
unrealizedPnl: v.pipe(_base_js_1.
|
|
101
|
+
unrealizedPnl: v.pipe(_base_js_1.Decimal, v.description("Unrealized profit and loss.")),
|
|
102
102
|
/** Return on equity. */
|
|
103
|
-
returnOnEquity: v.pipe(_base_js_1.
|
|
103
|
+
returnOnEquity: v.pipe(_base_js_1.Decimal, v.description("Return on equity.")),
|
|
104
104
|
/** Liquidation price. */
|
|
105
105
|
liquidationPx: v.pipe(v.union([_base_js_1.UnsignedDecimal, v.null()]), v.description("Liquidation price.")),
|
|
106
106
|
/** Margin used. */
|
|
107
107
|
marginUsed: v.pipe(_base_js_1.UnsignedDecimal, v.description("Margin used.")),
|
|
108
108
|
/** Maximum allowed leverage. */
|
|
109
|
-
maxLeverage: v.pipe(
|
|
109
|
+
maxLeverage: v.pipe(_base_js_1.UnsignedInteger, v.minValue(1), v.description("Maximum allowed leverage.")),
|
|
110
110
|
/** Cumulative funding details. */
|
|
111
|
-
cumFunding: v.pipe(v.
|
|
111
|
+
cumFunding: v.pipe(v.object({
|
|
112
112
|
/** Total funding paid or received since account opening. */
|
|
113
|
-
allTime: v.pipe(_base_js_1.
|
|
113
|
+
allTime: v.pipe(_base_js_1.Decimal, v.description("Total funding paid or received since account opening.")),
|
|
114
114
|
/** Funding accumulated since the position was opened. */
|
|
115
|
-
sinceOpen: v.pipe(_base_js_1.
|
|
115
|
+
sinceOpen: v.pipe(_base_js_1.Decimal, v.description("Funding accumulated since the position was opened.")),
|
|
116
116
|
/** Funding accumulated since the last change in position size. */
|
|
117
|
-
sinceChange: v.pipe(_base_js_1.
|
|
117
|
+
sinceChange: v.pipe(_base_js_1.Decimal, v.description("Funding accumulated since the last change in position size.")),
|
|
118
118
|
}), v.description("Cumulative funding details.")),
|
|
119
119
|
}), v.description("Position details.")),
|
|
120
120
|
}), v.description("Position for a specific asset."));
|
|
121
121
|
/** Escrowed balance for a specific asset. */
|
|
122
|
-
exports.EvmEscrowsBalance = v.pipe(v.
|
|
122
|
+
exports.EvmEscrowsBalance = v.pipe(v.object({
|
|
123
123
|
/** Asset symbol. */
|
|
124
124
|
coin: v.pipe(v.string(), v.description("Asset symbol.")),
|
|
125
125
|
/** Unique identifier for the token. */
|
|
126
|
-
token: v.pipe(
|
|
126
|
+
token: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique identifier for the token.")),
|
|
127
127
|
/** Total balance. */
|
|
128
128
|
total: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total balance.")),
|
|
129
129
|
}), v.description("Escrowed balance for a specific asset."));
|
|
130
130
|
/** Extra agent details for a user. */
|
|
131
|
-
exports.ExtraAgent = v.pipe(v.
|
|
131
|
+
exports.ExtraAgent = v.pipe(v.object({
|
|
132
132
|
/** Extra agent address. */
|
|
133
133
|
address: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Extra agent address.")),
|
|
134
134
|
/** Extra agent name. */
|
|
135
135
|
name: v.pipe(v.string(), v.minLength(1), v.description("Extra agent name.")),
|
|
136
136
|
/** Validity period as a timestamp (in ms since epoch). */
|
|
137
|
-
validUntil: v.pipe(
|
|
137
|
+
validUntil: v.pipe(_base_js_1.UnsignedInteger, v.description("Validity period as a timestamp (in ms since epoch).")),
|
|
138
138
|
}), v.description("Extra agent details for a user."));
|
|
139
139
|
/** Legal verification status for a user. */
|
|
140
|
-
exports.LegalCheck = v.pipe(v.
|
|
140
|
+
exports.LegalCheck = v.pipe(v.object({
|
|
141
141
|
/** Whether the user IP address is allowed. */
|
|
142
142
|
ipAllowed: v.pipe(v.boolean(), v.description("Whether the user IP address is allowed.")),
|
|
143
143
|
/** Whether the user has accepted the terms of service. */
|
|
@@ -146,16 +146,16 @@ exports.LegalCheck = v.pipe(v.strictObject({
|
|
|
146
146
|
userAllowed: v.pipe(v.boolean(), v.description("Whether the user is allowed to use the platform.")),
|
|
147
147
|
}), v.description("Legal verification status for a user."));
|
|
148
148
|
/** Multi-sig signers for a user. */
|
|
149
|
-
exports.MultiSigSigners = v.pipe(v.
|
|
149
|
+
exports.MultiSigSigners = v.pipe(v.object({
|
|
150
150
|
/** Authorized users addresses. */
|
|
151
151
|
authorizedUsers: v.pipe(v.array(v.pipe(_base_js_1.Hex, v.length(42))), v.minLength(1), v.description("Authorized users addresses.")),
|
|
152
152
|
/** Threshold number of signatures required. */
|
|
153
|
-
threshold: v.pipe(
|
|
153
|
+
threshold: v.pipe(_base_js_1.UnsignedInteger, v.minValue(1), v.description("Threshold number of signatures required.")),
|
|
154
154
|
}), v.description("Multi-sig signers for a user."));
|
|
155
155
|
/** Account summary for perpetual trading. */
|
|
156
|
-
exports.PerpsClearinghouseState = v.pipe(v.
|
|
156
|
+
exports.PerpsClearinghouseState = v.pipe(v.object({
|
|
157
157
|
/** Margin summary details. */
|
|
158
|
-
marginSummary: v.pipe(v.
|
|
158
|
+
marginSummary: v.pipe(v.object({
|
|
159
159
|
/** Total account value. */
|
|
160
160
|
accountValue: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total account value.")),
|
|
161
161
|
/** Total notional position value. */
|
|
@@ -166,7 +166,7 @@ exports.PerpsClearinghouseState = v.pipe(v.strictObject({
|
|
|
166
166
|
totalMarginUsed: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total margin used.")),
|
|
167
167
|
}), v.description("Margin summary details.")),
|
|
168
168
|
/** Cross-margin summary details. */
|
|
169
|
-
crossMarginSummary: v.pipe(v.
|
|
169
|
+
crossMarginSummary: v.pipe(v.object({
|
|
170
170
|
/** Total account value. */
|
|
171
171
|
accountValue: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total account value.")),
|
|
172
172
|
/** Total notional position value. */
|
|
@@ -183,30 +183,30 @@ exports.PerpsClearinghouseState = v.pipe(v.strictObject({
|
|
|
183
183
|
/** List of asset positions. */
|
|
184
184
|
assetPositions: v.pipe(v.array(exports.AssetPosition), v.description("List of asset positions.")),
|
|
185
185
|
/** Timestamp when data was retrieved (in ms since epoch). */
|
|
186
|
-
time: v.pipe(
|
|
186
|
+
time: v.pipe(_base_js_1.UnsignedInteger, v.description("Timestamp when data was retrieved (in ms since epoch).")),
|
|
187
187
|
}), v.description("Account summary for perpetual trading."));
|
|
188
188
|
/** Portfolio metrics snapshot. */
|
|
189
|
-
exports.Portfolio = v.pipe(v.
|
|
189
|
+
exports.Portfolio = v.pipe(v.object({
|
|
190
190
|
/** History entries for account value as [timestamp, value]. */
|
|
191
|
-
accountValueHistory: v.pipe(v.array(v.
|
|
191
|
+
accountValueHistory: v.pipe(v.array(v.tuple([_base_js_1.UnsignedInteger, _base_js_1.UnsignedDecimal])), v.description("History entries for account value as [timestamp, value].")),
|
|
192
192
|
/** History entries for profit and loss as [timestamp, value]. */
|
|
193
|
-
pnlHistory: v.pipe(v.array(v.
|
|
193
|
+
pnlHistory: v.pipe(v.array(v.tuple([_base_js_1.UnsignedInteger, _base_js_1.Decimal])), v.description("History entries for profit and loss as [timestamp, value].")),
|
|
194
194
|
/** Volume metric for the portfolio. */
|
|
195
195
|
vlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Volume metric for the portfolio.")),
|
|
196
196
|
}), v.description("Portfolio metrics snapshot."));
|
|
197
197
|
/** Portfolio metrics grouped by time periods. */
|
|
198
|
-
exports.PortfolioPeriods = v.pipe(v.
|
|
199
|
-
v.
|
|
200
|
-
v.
|
|
201
|
-
v.
|
|
202
|
-
v.
|
|
203
|
-
v.
|
|
204
|
-
v.
|
|
205
|
-
v.
|
|
206
|
-
v.
|
|
198
|
+
exports.PortfolioPeriods = v.pipe(v.tuple([
|
|
199
|
+
v.tuple([v.literal("day"), exports.Portfolio]),
|
|
200
|
+
v.tuple([v.literal("week"), exports.Portfolio]),
|
|
201
|
+
v.tuple([v.literal("month"), exports.Portfolio]),
|
|
202
|
+
v.tuple([v.literal("allTime"), exports.Portfolio]),
|
|
203
|
+
v.tuple([v.literal("perpDay"), exports.Portfolio]),
|
|
204
|
+
v.tuple([v.literal("perpWeek"), exports.Portfolio]),
|
|
205
|
+
v.tuple([v.literal("perpMonth"), exports.Portfolio]),
|
|
206
|
+
v.tuple([v.literal("perpAllTime"), exports.Portfolio]),
|
|
207
207
|
]), v.description("Portfolio metrics grouped by time periods."));
|
|
208
208
|
/** Pre-transfer user existence check result. */
|
|
209
|
-
exports.PreTransferCheck = v.pipe(v.
|
|
209
|
+
exports.PreTransferCheck = v.pipe(v.object({
|
|
210
210
|
/** Activation fee. */
|
|
211
211
|
fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Activation fee.")),
|
|
212
212
|
/** Whether the user is sanctioned. */
|
|
@@ -217,10 +217,10 @@ exports.PreTransferCheck = v.pipe(v.strictObject({
|
|
|
217
217
|
userHasSentTx: v.pipe(v.boolean(), v.description("Whether the user has sent a transaction.")),
|
|
218
218
|
}), v.description("Pre-transfer user existence check result."));
|
|
219
219
|
/** Referral details for a user. */
|
|
220
|
-
exports.Referral = v.pipe(v.
|
|
220
|
+
exports.Referral = v.pipe(v.object({
|
|
221
221
|
/** Referrer details. */
|
|
222
222
|
referredBy: v.pipe(v.union([
|
|
223
|
-
v.
|
|
223
|
+
v.object({
|
|
224
224
|
/** Referrer address. */
|
|
225
225
|
referrer: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Referrer address.")),
|
|
226
226
|
/** Referral code used. */
|
|
@@ -238,17 +238,17 @@ exports.Referral = v.pipe(v.strictObject({
|
|
|
238
238
|
builderRewards: v.pipe(_base_js_1.UnsignedDecimal, v.description("Builder reward amount.")),
|
|
239
239
|
/** Current state of the referrer. */
|
|
240
240
|
referrerState: v.pipe(v.union([
|
|
241
|
-
v.
|
|
241
|
+
v.object({
|
|
242
242
|
/** Referrer is ready to receive rewards. */
|
|
243
243
|
stage: v.pipe(v.literal("ready"), v.description("Referrer is ready to receive rewards.")),
|
|
244
244
|
/** Referral program details. */
|
|
245
|
-
data: v.pipe(v.
|
|
245
|
+
data: v.pipe(v.object({
|
|
246
246
|
/** Assigned referral code. */
|
|
247
247
|
code: v.pipe(v.string(), v.minLength(1), v.description("Assigned referral code.")),
|
|
248
248
|
/** Total number of referrals. */
|
|
249
|
-
nReferrals: v.pipe(
|
|
249
|
+
nReferrals: v.pipe(_base_js_1.UnsignedInteger, v.description("Total number of referrals.")),
|
|
250
250
|
/** Summary of each referral state. */
|
|
251
|
-
referralStates: v.pipe(v.array(v.
|
|
251
|
+
referralStates: v.pipe(v.array(v.object({
|
|
252
252
|
/** Cumulative traded volume. */
|
|
253
253
|
cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative traded volume.")),
|
|
254
254
|
/** Total fees rewarded to the referred user since referral. */
|
|
@@ -256,13 +256,13 @@ exports.Referral = v.pipe(v.strictObject({
|
|
|
256
256
|
/** Total fees rewarded to the referrer from referred trades. */
|
|
257
257
|
cumFeesRewardedToReferrer: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total fees rewarded to the referrer from referred trades.")),
|
|
258
258
|
/** Timestamp when the referred user joined (in ms since epoch). */
|
|
259
|
-
timeJoined: v.pipe(
|
|
259
|
+
timeJoined: v.pipe(_base_js_1.UnsignedInteger, v.description("Timestamp when the referred user joined (in ms since epoch).")),
|
|
260
260
|
/** Address of the referred user. */
|
|
261
261
|
user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Address of the referred user.")),
|
|
262
262
|
/** Mapping of token IDs to referral reward states. */
|
|
263
|
-
tokenToState: v.pipe(v.array(v.
|
|
264
|
-
|
|
265
|
-
v.
|
|
263
|
+
tokenToState: v.pipe(v.array(v.tuple([
|
|
264
|
+
_base_js_1.UnsignedInteger,
|
|
265
|
+
v.object({
|
|
266
266
|
/** Cumulative traded volume. */
|
|
267
267
|
cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative traded volume.")),
|
|
268
268
|
/** Total fees rewarded to the referred user since referral. */
|
|
@@ -274,22 +274,22 @@ exports.Referral = v.pipe(v.strictObject({
|
|
|
274
274
|
})), v.description("Summary of each referral state.")),
|
|
275
275
|
}), v.description("Referral program details.")),
|
|
276
276
|
}),
|
|
277
|
-
v.
|
|
277
|
+
v.object({
|
|
278
278
|
/** Referrer needs to create a referral code. */
|
|
279
279
|
stage: v.pipe(v.literal("needToCreateCode"), v.description("Referrer needs to create a referral code.")),
|
|
280
280
|
}),
|
|
281
|
-
v.
|
|
281
|
+
v.object({
|
|
282
282
|
/** Referrer must complete a trade before earning rewards. */
|
|
283
283
|
stage: v.pipe(v.literal("needToTrade"), v.description("Referrer must complete a trade before earning rewards.")),
|
|
284
284
|
/** Required trading volume details for activation. */
|
|
285
|
-
data: v.pipe(v.
|
|
285
|
+
data: v.pipe(v.object({
|
|
286
286
|
/** Required trading volume. */
|
|
287
287
|
required: v.pipe(_base_js_1.UnsignedDecimal, v.description("Required trading volume.")),
|
|
288
288
|
}), v.description("Required trading volume details for activation.")),
|
|
289
289
|
}),
|
|
290
290
|
]), v.description("Current state of the referrer.")),
|
|
291
291
|
/** History of referral rewards. */
|
|
292
|
-
rewardHistory: v.pipe(v.array(v.
|
|
292
|
+
rewardHistory: v.pipe(v.array(v.object({
|
|
293
293
|
/** Amount of earned rewards. */
|
|
294
294
|
earned: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount of earned rewards.")),
|
|
295
295
|
/** Traded volume at the time of reward. */
|
|
@@ -297,12 +297,12 @@ exports.Referral = v.pipe(v.strictObject({
|
|
|
297
297
|
/** Traded volume via referrals. */
|
|
298
298
|
referralVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Traded volume via referrals.")),
|
|
299
299
|
/** Timestamp when the reward was earned (in ms since epoch). */
|
|
300
|
-
time: v.pipe(
|
|
300
|
+
time: v.pipe(_base_js_1.UnsignedInteger, v.description("Timestamp when the reward was earned (in ms since epoch).")),
|
|
301
301
|
})), v.description("History of referral rewards.")),
|
|
302
302
|
/** Mapping of token IDs to referral reward states. */
|
|
303
|
-
tokenToState: v.pipe(v.array(v.
|
|
304
|
-
|
|
305
|
-
v.
|
|
303
|
+
tokenToState: v.pipe(v.array(v.tuple([
|
|
304
|
+
_base_js_1.UnsignedInteger,
|
|
305
|
+
v.object({
|
|
306
306
|
/** Cumulative traded volume. */
|
|
307
307
|
cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative traded volume.")),
|
|
308
308
|
/** Rewards earned but not yet claimed. */
|
|
@@ -315,11 +315,11 @@ exports.Referral = v.pipe(v.strictObject({
|
|
|
315
315
|
])), v.description("Mapping of token IDs to referral reward states.")),
|
|
316
316
|
}), v.description("Referral details for a user."));
|
|
317
317
|
/** Balance for a specific spot token. */
|
|
318
|
-
exports.SpotBalance = v.pipe(v.
|
|
318
|
+
exports.SpotBalance = v.pipe(v.object({
|
|
319
319
|
/** Asset symbol. */
|
|
320
320
|
coin: v.pipe(v.string(), v.description("Asset symbol.")),
|
|
321
321
|
/** Unique identifier for the token. */
|
|
322
|
-
token: v.pipe(
|
|
322
|
+
token: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique identifier for the token.")),
|
|
323
323
|
/** Total balance. */
|
|
324
324
|
total: v.pipe(_base_js_1.UnsignedDecimal, v.description("Total balance.")),
|
|
325
325
|
/** Amount on hold. */
|
|
@@ -328,14 +328,14 @@ exports.SpotBalance = v.pipe(v.strictObject({
|
|
|
328
328
|
entryNtl: v.pipe(_base_js_1.UnsignedDecimal, v.description("Entry notional value.")),
|
|
329
329
|
}), v.description("Balance for a specific spot token."));
|
|
330
330
|
/** Account summary for spot trading. */
|
|
331
|
-
exports.SpotClearinghouseState = v.pipe(v.
|
|
331
|
+
exports.SpotClearinghouseState = v.pipe(v.object({
|
|
332
332
|
/** Balance for each token. */
|
|
333
333
|
balances: v.pipe(v.array(exports.SpotBalance), v.description("Balance for each token.")),
|
|
334
334
|
/** Escrowed balances. */
|
|
335
335
|
evmEscrows: v.pipe(v.optional(v.array(exports.EvmEscrowsBalance)), v.description("Escrowed balances.")),
|
|
336
336
|
}), v.description("Account summary for spot trading."));
|
|
337
337
|
/** Sub-account details for a user. */
|
|
338
|
-
exports.SubAccount = v.pipe(v.
|
|
338
|
+
exports.SubAccount = v.pipe(v.object({
|
|
339
339
|
/** Sub-account name. */
|
|
340
340
|
name: v.pipe(v.string(), v.minLength(1), v.description("Sub-account name.")),
|
|
341
341
|
/** Sub-account address. */
|
|
@@ -348,9 +348,9 @@ exports.SubAccount = v.pipe(v.strictObject({
|
|
|
348
348
|
spotState: v.pipe(exports.SpotClearinghouseState, v.description("Spot tokens clearinghouse state.")),
|
|
349
349
|
}), v.description("Sub-account details for a user."));
|
|
350
350
|
/** User fees. */
|
|
351
|
-
exports.UserFees = v.pipe(v.
|
|
351
|
+
exports.UserFees = v.pipe(v.object({
|
|
352
352
|
/** Daily user volume metrics. */
|
|
353
|
-
dailyUserVlm: v.pipe(v.array(v.
|
|
353
|
+
dailyUserVlm: v.pipe(v.array(v.object({
|
|
354
354
|
/** Date in YYYY-M-D format. */
|
|
355
355
|
date: v.pipe(v.string(), v.isoDate(), v.description("Date in YYYY-M-D format.")),
|
|
356
356
|
/** User cross-trade volume. */
|
|
@@ -361,7 +361,7 @@ exports.UserFees = v.pipe(v.strictObject({
|
|
|
361
361
|
exchange: v.pipe(_base_js_1.UnsignedDecimal, v.description("Exchange total volume.")),
|
|
362
362
|
})), v.description("Daily user volume metrics.")),
|
|
363
363
|
/** Fee schedule information. */
|
|
364
|
-
feeSchedule: v.pipe(v.
|
|
364
|
+
feeSchedule: v.pipe(v.object({
|
|
365
365
|
/** Cross-trade fee rate. */
|
|
366
366
|
cross: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cross-trade fee rate.")),
|
|
367
367
|
/** Add-liquidity fee rate. */
|
|
@@ -371,9 +371,9 @@ exports.UserFees = v.pipe(v.strictObject({
|
|
|
371
371
|
/** Spot add-liquidity fee rate. */
|
|
372
372
|
spotAdd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Spot add-liquidity fee rate.")),
|
|
373
373
|
/** Fee tiers details. */
|
|
374
|
-
tiers: v.pipe(v.
|
|
374
|
+
tiers: v.pipe(v.object({
|
|
375
375
|
/** VIP fee tier information. */
|
|
376
|
-
vip: v.pipe(v.array(v.
|
|
376
|
+
vip: v.pipe(v.array(v.object({
|
|
377
377
|
/** Notional volume cutoff. */
|
|
378
378
|
ntlCutoff: v.pipe(_base_js_1.UnsignedDecimal, v.description("Notional volume cutoff.")),
|
|
379
379
|
/** Cross-trade fee rate. */
|
|
@@ -386,17 +386,17 @@ exports.UserFees = v.pipe(v.strictObject({
|
|
|
386
386
|
spotAdd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Spot add-liquidity fee rate.")),
|
|
387
387
|
})), v.description("VIP fee tier information.")),
|
|
388
388
|
/** Market maker fee tier information. */
|
|
389
|
-
mm: v.pipe(v.array(v.
|
|
389
|
+
mm: v.pipe(v.array(v.object({
|
|
390
390
|
/** Maker fraction cutoff. */
|
|
391
391
|
makerFractionCutoff: v.pipe(_base_js_1.UnsignedDecimal, v.description("Maker fraction cutoff.")),
|
|
392
392
|
/** Add-liquidity fee rate. */
|
|
393
|
-
add: v.pipe(_base_js_1.
|
|
393
|
+
add: v.pipe(_base_js_1.Decimal, v.description("Add-liquidity fee rate.")),
|
|
394
394
|
})), v.description("Market maker fee tier information.")),
|
|
395
395
|
}), v.description("Fee tiers details.")),
|
|
396
396
|
/** Referral discount rate. */
|
|
397
397
|
referralDiscount: v.pipe(_base_js_1.UnsignedDecimal, v.description("Referral discount rate.")),
|
|
398
398
|
/** Staking discount tiers details. */
|
|
399
|
-
stakingDiscountTiers: v.pipe(v.array(v.
|
|
399
|
+
stakingDiscountTiers: v.pipe(v.array(v.object({
|
|
400
400
|
/** Basis points of maximum supply. */
|
|
401
401
|
bpsOfMaxSupply: v.pipe(_base_js_1.UnsignedDecimal, v.description("Basis points of maximum supply.")),
|
|
402
402
|
/** Discount rate applied. */
|
|
@@ -421,7 +421,7 @@ exports.UserFees = v.pipe(v.strictObject({
|
|
|
421
421
|
nextTrialAvailableTimestamp: v.pipe(v.union([v.unknown(), v.null()]), v.description("Timestamp when next trial becomes available.")),
|
|
422
422
|
stakingLink: v.union([v.unknown(), v.null()]),
|
|
423
423
|
/** Active staking discount details. */
|
|
424
|
-
activeStakingDiscount: v.pipe(v.
|
|
424
|
+
activeStakingDiscount: v.pipe(v.object({
|
|
425
425
|
/** Basis points of maximum supply. */
|
|
426
426
|
bpsOfMaxSupply: v.pipe(_base_js_1.UnsignedDecimal, v.description("Basis points of maximum supply.")),
|
|
427
427
|
/** Discount rate applied. */
|
|
@@ -429,65 +429,65 @@ exports.UserFees = v.pipe(v.strictObject({
|
|
|
429
429
|
}), v.description("Active staking discount details.")),
|
|
430
430
|
}), v.description("User fees."));
|
|
431
431
|
/** Funding update details. */
|
|
432
|
-
exports.FundingUpdate = v.pipe(v.
|
|
432
|
+
exports.FundingUpdate = v.pipe(v.object({
|
|
433
433
|
/** Update type. */
|
|
434
434
|
type: v.pipe(v.literal("funding"), v.description("Update type.")),
|
|
435
435
|
/** Asset symbol. */
|
|
436
436
|
coin: v.pipe(v.string(), v.description("Asset symbol.")),
|
|
437
437
|
/** Amount transferred in USDC. */
|
|
438
|
-
usdc: v.pipe(_base_js_1.
|
|
438
|
+
usdc: v.pipe(_base_js_1.Decimal, v.description("Amount transferred in USDC.")),
|
|
439
439
|
/** Signed position size. */
|
|
440
|
-
szi: v.pipe(_base_js_1.
|
|
440
|
+
szi: v.pipe(_base_js_1.Decimal, v.description("Signed position size.")),
|
|
441
441
|
/** Applied funding rate. */
|
|
442
|
-
fundingRate: v.pipe(_base_js_1.
|
|
442
|
+
fundingRate: v.pipe(_base_js_1.Decimal, v.description("Applied funding rate.")),
|
|
443
443
|
/** Number of samples. */
|
|
444
|
-
nSamples: v.pipe(v.union([
|
|
444
|
+
nSamples: v.pipe(v.union([_base_js_1.UnsignedInteger, v.null()]), v.description("Number of samples.")),
|
|
445
445
|
}), v.description("Funding update details."));
|
|
446
446
|
/** Funding ledger update for a user. */
|
|
447
|
-
exports.UserFundingUpdate = v.pipe(v.
|
|
447
|
+
exports.UserFundingUpdate = v.pipe(v.object({
|
|
448
448
|
/** Timestamp of the update (in ms since epoch). */
|
|
449
|
-
time: v.pipe(
|
|
449
|
+
time: v.pipe(_base_js_1.UnsignedInteger, v.description("Timestamp of the update (in ms since epoch).")),
|
|
450
450
|
/** L1 transaction hash. */
|
|
451
451
|
hash: v.pipe(v.pipe(_base_js_1.Hex, v.length(66)), v.description("L1 transaction hash.")),
|
|
452
452
|
/** Update details. */
|
|
453
453
|
delta: v.pipe(exports.FundingUpdate, v.description("Update details.")),
|
|
454
454
|
}), v.description("Funding ledger update for a user."));
|
|
455
455
|
/** User rate limits. */
|
|
456
|
-
exports.UserRateLimit = v.pipe(v.
|
|
456
|
+
exports.UserRateLimit = v.pipe(v.object({
|
|
457
457
|
/** Cumulative trading volume. */
|
|
458
458
|
cumVlm: v.pipe(_base_js_1.UnsignedDecimal, v.description("Cumulative trading volume.")),
|
|
459
459
|
/** Number of API requests used. */
|
|
460
|
-
nRequestsUsed: v.pipe(
|
|
460
|
+
nRequestsUsed: v.pipe(_base_js_1.UnsignedInteger, v.description("Number of API requests used.")),
|
|
461
461
|
/** Maximum allowed API requests. */
|
|
462
|
-
nRequestsCap: v.pipe(
|
|
462
|
+
nRequestsCap: v.pipe(_base_js_1.UnsignedInteger, v.description("Maximum allowed API requests.")),
|
|
463
463
|
}), v.description("User rate limits."));
|
|
464
464
|
/** User role. */
|
|
465
465
|
exports.UserRole = v.pipe(v.union([
|
|
466
|
-
v.
|
|
466
|
+
v.object({
|
|
467
467
|
/** Role identifier. */
|
|
468
468
|
role: v.pipe(v.union([v.literal("missing"), v.literal("user"), v.literal("vault")]), v.description("Role identifier.")),
|
|
469
469
|
}),
|
|
470
|
-
v.
|
|
470
|
+
v.object({
|
|
471
471
|
/** Role identifier. */
|
|
472
472
|
role: v.pipe(v.literal("agent"), v.description("Role identifier.")),
|
|
473
473
|
/** Details for agent role. */
|
|
474
|
-
data: v.pipe(v.
|
|
474
|
+
data: v.pipe(v.object({
|
|
475
475
|
/** Master account address associated with the agent. */
|
|
476
476
|
user: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Master account address associated with the agent.")),
|
|
477
477
|
}), v.description("Details for agent role.")),
|
|
478
478
|
}),
|
|
479
|
-
v.
|
|
479
|
+
v.object({
|
|
480
480
|
/** Role identifier. */
|
|
481
481
|
role: v.pipe(v.literal("subAccount"), v.description("Role identifier.")),
|
|
482
482
|
/** Details for sub-account role. */
|
|
483
|
-
data: v.pipe(v.
|
|
483
|
+
data: v.pipe(v.object({
|
|
484
484
|
/** Master account address associated with the sub-account. */
|
|
485
485
|
master: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Master account address associated with the sub-account.")),
|
|
486
486
|
}), v.description("Details for sub-account role.")),
|
|
487
487
|
}),
|
|
488
488
|
]), v.description("User role."));
|
|
489
489
|
/** Transfer between spot and perpetual accounts. */
|
|
490
|
-
exports.AccountClassTransferUpdate = v.pipe(v.
|
|
490
|
+
exports.AccountClassTransferUpdate = v.pipe(v.object({
|
|
491
491
|
/** Update type. */
|
|
492
492
|
type: v.pipe(v.literal("accountClassTransfer"), v.description("Update type.")),
|
|
493
493
|
/** Amount transferred in USDC. */
|
|
@@ -496,14 +496,14 @@ exports.AccountClassTransferUpdate = v.pipe(v.strictObject({
|
|
|
496
496
|
toPerp: v.pipe(v.boolean(), v.description("Indicates if the transfer is to the perpetual account.")),
|
|
497
497
|
}), v.description("Transfer between spot and perpetual accounts."));
|
|
498
498
|
/** Deposit update to an account. */
|
|
499
|
-
exports.DepositUpdate = v.pipe(v.
|
|
499
|
+
exports.DepositUpdate = v.pipe(v.object({
|
|
500
500
|
/** Update type. */
|
|
501
501
|
type: v.pipe(v.literal("deposit"), v.description("Update type.")),
|
|
502
502
|
/** Amount deposited in USDC. */
|
|
503
503
|
usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount deposited in USDC.")),
|
|
504
504
|
}), v.description("Deposit update to an account."));
|
|
505
505
|
/** Internal transfer between accounts. */
|
|
506
|
-
exports.InternalTransferUpdate = v.pipe(v.
|
|
506
|
+
exports.InternalTransferUpdate = v.pipe(v.object({
|
|
507
507
|
/** Update type. */
|
|
508
508
|
type: v.pipe(v.literal("internalTransfer"), v.description("Update type.")),
|
|
509
509
|
/** Amount transferred in USDC. */
|
|
@@ -516,7 +516,7 @@ exports.InternalTransferUpdate = v.pipe(v.strictObject({
|
|
|
516
516
|
fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Transfer fee.")),
|
|
517
517
|
}), v.description("Internal transfer between accounts."));
|
|
518
518
|
/** Liquidation event update. */
|
|
519
|
-
exports.LiquidationUpdate = v.pipe(v.
|
|
519
|
+
exports.LiquidationUpdate = v.pipe(v.object({
|
|
520
520
|
/** Update type. */
|
|
521
521
|
type: v.pipe(v.literal("liquidation"), v.description("Update type.")),
|
|
522
522
|
/** Total notional value of liquidated positions. */
|
|
@@ -526,15 +526,15 @@ exports.LiquidationUpdate = v.pipe(v.strictObject({
|
|
|
526
526
|
/** Leverage type for liquidated positions. */
|
|
527
527
|
leverageType: v.pipe(v.union([v.literal("Cross"), v.literal("Isolated")]), v.description("Leverage type for liquidated positions.")),
|
|
528
528
|
/** Details of each liquidated position. */
|
|
529
|
-
liquidatedPositions: v.pipe(v.array(v.
|
|
529
|
+
liquidatedPositions: v.pipe(v.array(v.object({
|
|
530
530
|
/** Asset symbol of the liquidated position. */
|
|
531
531
|
coin: v.pipe(v.string(), v.description("Asset symbol of the liquidated position.")),
|
|
532
532
|
/** Signed position size liquidated. */
|
|
533
|
-
szi: v.pipe(_base_js_1.
|
|
533
|
+
szi: v.pipe(_base_js_1.Decimal, v.description("Signed position size liquidated.")),
|
|
534
534
|
})), v.description("Details of each liquidated position.")),
|
|
535
535
|
}), v.description("Liquidation event update."));
|
|
536
536
|
/** Rewards claim event update. */
|
|
537
|
-
exports.RewardsClaimUpdate = v.pipe(v.
|
|
537
|
+
exports.RewardsClaimUpdate = v.pipe(v.object({
|
|
538
538
|
/** Update type. */
|
|
539
539
|
type: v.pipe(v.literal("rewardsClaim"), v.description("Update type.")),
|
|
540
540
|
/** Amount of rewards claimed. */
|
|
@@ -543,7 +543,7 @@ exports.RewardsClaimUpdate = v.pipe(v.strictObject({
|
|
|
543
543
|
token: v.pipe(v.string(), v.description("Token symbol.")),
|
|
544
544
|
}), v.description("Rewards claim event update."));
|
|
545
545
|
/** Spot transfer update between accounts. */
|
|
546
|
-
exports.SpotTransferUpdate = v.pipe(v.
|
|
546
|
+
exports.SpotTransferUpdate = v.pipe(v.object({
|
|
547
547
|
/** Update type. */
|
|
548
548
|
type: v.pipe(v.literal("spotTransfer"), v.description("Update type.")),
|
|
549
549
|
/** Token symbol. */
|
|
@@ -565,7 +565,7 @@ exports.SpotTransferUpdate = v.pipe(v.strictObject({
|
|
|
565
565
|
feeToken: v.pipe(v.string(), v.description('Token in which the fee is denominated (e.g., "USDC").')),
|
|
566
566
|
}), v.description("Spot transfer update between accounts."));
|
|
567
567
|
/** Transfer update between sub-accounts. */
|
|
568
|
-
exports.SubAccountTransferUpdate = v.pipe(v.
|
|
568
|
+
exports.SubAccountTransferUpdate = v.pipe(v.object({
|
|
569
569
|
/** Update type. */
|
|
570
570
|
type: v.pipe(v.literal("subAccountTransfer"), v.description("Update type.")),
|
|
571
571
|
/** Amount transferred in USDC. */
|
|
@@ -576,7 +576,7 @@ exports.SubAccountTransferUpdate = v.pipe(v.strictObject({
|
|
|
576
576
|
destination: v.pipe(v.pipe(_base_js_1.Hex, v.length(42)), v.description("Destination address.")),
|
|
577
577
|
}), v.description("Transfer update between sub-accounts."));
|
|
578
578
|
/** Vault creation update. */
|
|
579
|
-
exports.VaultCreateUpdate = v.pipe(v.
|
|
579
|
+
exports.VaultCreateUpdate = v.pipe(v.object({
|
|
580
580
|
/** Update type. */
|
|
581
581
|
type: v.pipe(v.literal("vaultCreate"), v.description("Update type.")),
|
|
582
582
|
/** Address of the created vault. */
|
|
@@ -587,7 +587,7 @@ exports.VaultCreateUpdate = v.pipe(v.strictObject({
|
|
|
587
587
|
fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Vault creation fee.")),
|
|
588
588
|
}), v.description("Vault creation update."));
|
|
589
589
|
/** Vault deposit update. */
|
|
590
|
-
exports.VaultDepositUpdate = v.pipe(v.
|
|
590
|
+
exports.VaultDepositUpdate = v.pipe(v.object({
|
|
591
591
|
/** Update type. */
|
|
592
592
|
type: v.pipe(v.literal("vaultDeposit"), v.description("Update type.")),
|
|
593
593
|
/** Address of the target vault. */
|
|
@@ -596,7 +596,7 @@ exports.VaultDepositUpdate = v.pipe(v.strictObject({
|
|
|
596
596
|
usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount deposited in USDC.")),
|
|
597
597
|
}), v.description("Vault deposit update."));
|
|
598
598
|
/** Vault distribution update. */
|
|
599
|
-
exports.VaultDistributionUpdate = v.pipe(v.
|
|
599
|
+
exports.VaultDistributionUpdate = v.pipe(v.object({
|
|
600
600
|
/** Update type. */
|
|
601
601
|
type: v.pipe(v.literal("vaultDistribution"), v.description("Update type.")),
|
|
602
602
|
/** Address of the vault distributing funds. */
|
|
@@ -605,7 +605,7 @@ exports.VaultDistributionUpdate = v.pipe(v.strictObject({
|
|
|
605
605
|
usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount distributed in USDC.")),
|
|
606
606
|
}), v.description("Vault distribution update."));
|
|
607
607
|
/** Vault withdrawal event update. */
|
|
608
|
-
exports.VaultWithdrawUpdate = v.pipe(v.
|
|
608
|
+
exports.VaultWithdrawUpdate = v.pipe(v.object({
|
|
609
609
|
/** Update type. */
|
|
610
610
|
type: v.pipe(v.literal("vaultWithdraw"), v.description("Update type.")),
|
|
611
611
|
/** Vault address. */
|
|
@@ -624,20 +624,20 @@ exports.VaultWithdrawUpdate = v.pipe(v.strictObject({
|
|
|
624
624
|
netWithdrawnUsd: v.pipe(_base_js_1.UnsignedDecimal, v.description("Net withdrawn amount in USD after fees and costs.")),
|
|
625
625
|
}), v.description("Vault withdrawal event update."));
|
|
626
626
|
/** Withdrawal update from an account. */
|
|
627
|
-
exports.WithdrawUpdate = v.pipe(v.
|
|
627
|
+
exports.WithdrawUpdate = v.pipe(v.object({
|
|
628
628
|
/** Update type. */
|
|
629
629
|
type: v.pipe(v.literal("withdraw"), v.description("Update type.")),
|
|
630
630
|
/** Amount withdrawn in USDC. */
|
|
631
631
|
usdc: v.pipe(_base_js_1.UnsignedDecimal, v.description("Amount withdrawn in USDC.")),
|
|
632
632
|
/** Unique nonce for the withdrawal request. */
|
|
633
|
-
nonce: v.pipe(
|
|
633
|
+
nonce: v.pipe(_base_js_1.UnsignedInteger, v.description("Unique nonce for the withdrawal request.")),
|
|
634
634
|
/** Withdrawal fee. */
|
|
635
635
|
fee: v.pipe(_base_js_1.UnsignedDecimal, v.description("Withdrawal fee.")),
|
|
636
636
|
}), v.description("Withdrawal update from an account."));
|
|
637
637
|
/** Non-funding ledger update for a user. */
|
|
638
|
-
exports.UserNonFundingLedgerUpdate = v.pipe(v.
|
|
638
|
+
exports.UserNonFundingLedgerUpdate = v.pipe(v.object({
|
|
639
639
|
/** Timestamp of the update (in ms since epoch). */
|
|
640
|
-
time: v.pipe(
|
|
640
|
+
time: v.pipe(_base_js_1.UnsignedInteger, v.description("Timestamp of the update (in ms since epoch).")),
|
|
641
641
|
/** L1 transaction hash. */
|
|
642
642
|
hash: v.pipe(v.pipe(_base_js_1.Hex, v.length(66)), v.description("L1 transaction hash.")),
|
|
643
643
|
/** Update details. */
|
|
@@ -656,3 +656,4 @@ exports.UserNonFundingLedgerUpdate = v.pipe(v.strictObject({
|
|
|
656
656
|
exports.WithdrawUpdate,
|
|
657
657
|
]), v.description("Update details.")),
|
|
658
658
|
}), v.description("Non-funding ledger update for a user."));
|
|
659
|
+
//# sourceMappingURL=accounts.js.map
|