@lit-protocol/vincent-ability-hyperliquid 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/CONTRIBUTING.md +5 -0
- package/README.md +922 -0
- package/dist/CHANGELOG.md +21 -0
- package/dist/CONTRIBUTING.md +5 -0
- package/dist/README.md +922 -0
- package/dist/package.json +35 -0
- package/dist/src/generated/lit-action.js +9 -0
- package/dist/src/generated/vincent-ability-metadata.json +3 -0
- package/dist/src/generated/vincent-bundled-ability.d.ts +483 -0
- package/dist/src/generated/vincent-bundled-ability.d.ts.map +1 -0
- package/dist/src/generated/vincent-bundled-ability.js +15 -0
- package/dist/src/generated/vincent-bundled-ability.js.map +1 -0
- package/dist/src/generated/vincent-bundled-ability.ts +13 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +14 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib/ability-checks/cancel.d.ts +41 -0
- package/dist/src/lib/ability-checks/cancel.d.ts.map +1 -0
- package/dist/src/lib/ability-checks/cancel.js +58 -0
- package/dist/src/lib/ability-checks/cancel.js.map +1 -0
- package/dist/src/lib/ability-checks/deposit-usdc.d.ts +18 -0
- package/dist/src/lib/ability-checks/deposit-usdc.d.ts.map +1 -0
- package/dist/src/lib/ability-checks/deposit-usdc.js +40 -0
- package/dist/src/lib/ability-checks/deposit-usdc.js.map +1 -0
- package/dist/src/lib/ability-checks/hyperliquid-account-exists.d.ts +6 -0
- package/dist/src/lib/ability-checks/hyperliquid-account-exists.d.ts.map +1 -0
- package/dist/src/lib/ability-checks/hyperliquid-account-exists.js +22 -0
- package/dist/src/lib/ability-checks/hyperliquid-account-exists.js.map +1 -0
- package/dist/src/lib/ability-checks/index.d.ts +11 -0
- package/dist/src/lib/ability-checks/index.d.ts.map +1 -0
- package/dist/src/lib/ability-checks/index.js +25 -0
- package/dist/src/lib/ability-checks/index.js.map +1 -0
- package/dist/src/lib/ability-checks/is-builder-code-approved.d.ts +14 -0
- package/dist/src/lib/ability-checks/is-builder-code-approved.d.ts.map +1 -0
- package/dist/src/lib/ability-checks/is-builder-code-approved.js +29 -0
- package/dist/src/lib/ability-checks/is-builder-code-approved.js.map +1 -0
- package/dist/src/lib/ability-checks/perp.d.ts +23 -0
- package/dist/src/lib/ability-checks/perp.d.ts.map +1 -0
- package/dist/src/lib/ability-checks/perp.js +47 -0
- package/dist/src/lib/ability-checks/perp.js.map +1 -0
- package/dist/src/lib/ability-checks/send-perp-usdc.d.ts +26 -0
- package/dist/src/lib/ability-checks/send-perp-usdc.d.ts.map +1 -0
- package/dist/src/lib/ability-checks/send-perp-usdc.js +38 -0
- package/dist/src/lib/ability-checks/send-perp-usdc.js.map +1 -0
- package/dist/src/lib/ability-checks/send-spot-asset.d.ts +27 -0
- package/dist/src/lib/ability-checks/send-spot-asset.d.ts.map +1 -0
- package/dist/src/lib/ability-checks/send-spot-asset.js +59 -0
- package/dist/src/lib/ability-checks/send-spot-asset.js.map +1 -0
- package/dist/src/lib/ability-checks/spot.d.ts +24 -0
- package/dist/src/lib/ability-checks/spot.d.ts.map +1 -0
- package/dist/src/lib/ability-checks/spot.js +98 -0
- package/dist/src/lib/ability-checks/spot.js.map +1 -0
- package/dist/src/lib/ability-checks/transfer-usdc.d.ts +26 -0
- package/dist/src/lib/ability-checks/transfer-usdc.d.ts.map +1 -0
- package/dist/src/lib/ability-checks/transfer-usdc.js +64 -0
- package/dist/src/lib/ability-checks/transfer-usdc.js.map +1 -0
- package/dist/src/lib/ability-checks/withdraw-usdc.d.ts +25 -0
- package/dist/src/lib/ability-checks/withdraw-usdc.d.ts.map +1 -0
- package/dist/src/lib/ability-checks/withdraw-usdc.js +39 -0
- package/dist/src/lib/ability-checks/withdraw-usdc.js.map +1 -0
- package/dist/src/lib/ability-helpers/approve-builder-code.d.ts +22 -0
- package/dist/src/lib/ability-helpers/approve-builder-code.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/approve-builder-code.js +53 -0
- package/dist/src/lib/ability-helpers/approve-builder-code.js.map +1 -0
- package/dist/src/lib/ability-helpers/cancel-order/cancel-all-orders.d.ts +21 -0
- package/dist/src/lib/ability-helpers/cancel-order/cancel-all-orders.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/cancel-order/cancel-all-orders.js +69 -0
- package/dist/src/lib/ability-helpers/cancel-order/cancel-all-orders.js.map +1 -0
- package/dist/src/lib/ability-helpers/cancel-order/cancel-order.d.ts +25 -0
- package/dist/src/lib/ability-helpers/cancel-order/cancel-order.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/cancel-order/cancel-order.js +63 -0
- package/dist/src/lib/ability-helpers/cancel-order/cancel-order.js.map +1 -0
- package/dist/src/lib/ability-helpers/execute-perp-order.d.ts +65 -0
- package/dist/src/lib/ability-helpers/execute-perp-order.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/execute-perp-order.js +110 -0
- package/dist/src/lib/ability-helpers/execute-perp-order.js.map +1 -0
- package/dist/src/lib/ability-helpers/execute-spot-order.d.ts +50 -0
- package/dist/src/lib/ability-helpers/execute-spot-order.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/execute-spot-order.js +84 -0
- package/dist/src/lib/ability-helpers/execute-spot-order.js.map +1 -0
- package/dist/src/lib/ability-helpers/get-hyperliquid-chain-id.d.ts +3 -0
- package/dist/src/lib/ability-helpers/get-hyperliquid-chain-id.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/get-hyperliquid-chain-id.js +15 -0
- package/dist/src/lib/ability-helpers/get-hyperliquid-chain-id.js.map +1 -0
- package/dist/src/lib/ability-helpers/get-hyperliquid-nonce.d.ts +2 -0
- package/dist/src/lib/ability-helpers/get-hyperliquid-nonce.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/get-hyperliquid-nonce.js +10 -0
- package/dist/src/lib/ability-helpers/get-hyperliquid-nonce.js.map +1 -0
- package/dist/src/lib/ability-helpers/index.d.ts +12 -0
- package/dist/src/lib/ability-helpers/index.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/index.js +26 -0
- package/dist/src/lib/ability-helpers/index.js.map +1 -0
- package/dist/src/lib/ability-helpers/lit-action-pkp-ethers-wallet.d.ts +74 -0
- package/dist/src/lib/ability-helpers/lit-action-pkp-ethers-wallet.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/lit-action-pkp-ethers-wallet.js +192 -0
- package/dist/src/lib/ability-helpers/lit-action-pkp-ethers-wallet.js.map +1 -0
- package/dist/src/lib/ability-helpers/send-deposit-tx.d.ts +15 -0
- package/dist/src/lib/ability-helpers/send-deposit-tx.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/send-deposit-tx.js +82 -0
- package/dist/src/lib/ability-helpers/send-deposit-tx.js.map +1 -0
- package/dist/src/lib/ability-helpers/send-perp-usdc.d.ts +16 -0
- package/dist/src/lib/ability-helpers/send-perp-usdc.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/send-perp-usdc.js +49 -0
- package/dist/src/lib/ability-helpers/send-perp-usdc.js.map +1 -0
- package/dist/src/lib/ability-helpers/send-spot-asset.d.ts +17 -0
- package/dist/src/lib/ability-helpers/send-spot-asset.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/send-spot-asset.js +61 -0
- package/dist/src/lib/ability-helpers/send-spot-asset.js.map +1 -0
- package/dist/src/lib/ability-helpers/sign-tx.d.ts +3 -0
- package/dist/src/lib/ability-helpers/sign-tx.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/sign-tx.js +28 -0
- package/dist/src/lib/ability-helpers/sign-tx.js.map +1 -0
- package/dist/src/lib/ability-helpers/transfer-usdc-to.d.ts +16 -0
- package/dist/src/lib/ability-helpers/transfer-usdc-to.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/transfer-usdc-to.js +50 -0
- package/dist/src/lib/ability-helpers/transfer-usdc-to.js.map +1 -0
- package/dist/src/lib/ability-helpers/withdraw-usdc.d.ts +16 -0
- package/dist/src/lib/ability-helpers/withdraw-usdc.d.ts.map +1 -0
- package/dist/src/lib/ability-helpers/withdraw-usdc.js +49 -0
- package/dist/src/lib/ability-helpers/withdraw-usdc.js.map +1 -0
- package/dist/src/lib/constants.d.ts +3 -0
- package/dist/src/lib/constants.d.ts.map +1 -0
- package/dist/src/lib/constants.js +6 -0
- package/dist/src/lib/constants.js.map +1 -0
- package/dist/src/lib/lit-action.d.ts +2 -0
- package/dist/src/lib/lit-action.d.ts.map +1 -0
- package/dist/src/lib/lit-action.js +16 -0
- package/dist/src/lib/lit-action.js.map +1 -0
- package/dist/src/lib/schemas.d.ts +687 -0
- package/dist/src/lib/schemas.d.ts.map +1 -0
- package/dist/src/lib/schemas.js +233 -0
- package/dist/src/lib/schemas.js.map +1 -0
- package/dist/src/lib/types.d.ts +39 -0
- package/dist/src/lib/types.d.ts.map +1 -0
- package/dist/src/lib/types.js +45 -0
- package/dist/src/lib/types.js.map +1 -0
- package/dist/src/lib/vincent-ability.d.ts +480 -0
- package/dist/src/lib/vincent-ability.d.ts.map +1 -0
- package/dist/src/lib/vincent-ability.js +595 -0
- package/dist/src/lib/vincent-ability.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DO NOT EDIT THIS FILE. IT IS GENERATED ON BUILD.
|
|
3
|
+
*/
|
|
4
|
+
export declare const bundledVincentAbility: import("@lit-protocol/vincent-ability-sdk").BundledVincentAbility<import("@lit-protocol/vincent-ability-sdk").VincentAbility<import("zod").ZodEffects<import("zod").ZodObject<{
|
|
5
|
+
action: import("zod").ZodEnum<["deposit", "withdraw", "sendSpotAsset", "sendPerpUsdc", "transferToSpot", "transferToPerp", "spotBuy", "spotSell", "perpLong", "perpShort", "cancelOrder", "cancelAllOrdersForSymbol", "approveBuilderCode"]>;
|
|
6
|
+
useTestnet: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
7
|
+
deposit: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
8
|
+
amount: import("zod").ZodString;
|
|
9
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
10
|
+
amount: string;
|
|
11
|
+
}, {
|
|
12
|
+
amount: string;
|
|
13
|
+
}>>;
|
|
14
|
+
withdraw: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
15
|
+
amount: import("zod").ZodString;
|
|
16
|
+
destination: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
18
|
+
amount: string;
|
|
19
|
+
destination?: string | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
amount: string;
|
|
22
|
+
destination?: string | undefined;
|
|
23
|
+
}>>;
|
|
24
|
+
sendSpotAsset: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
25
|
+
destination: import("zod").ZodString;
|
|
26
|
+
token: import("zod").ZodString;
|
|
27
|
+
amount: import("zod").ZodString;
|
|
28
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
29
|
+
amount: string;
|
|
30
|
+
destination: string;
|
|
31
|
+
token: string;
|
|
32
|
+
}, {
|
|
33
|
+
amount: string;
|
|
34
|
+
destination: string;
|
|
35
|
+
token: string;
|
|
36
|
+
}>>;
|
|
37
|
+
sendPerpUsdc: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
38
|
+
destination: import("zod").ZodString;
|
|
39
|
+
amount: import("zod").ZodString;
|
|
40
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
41
|
+
amount: string;
|
|
42
|
+
destination: string;
|
|
43
|
+
}, {
|
|
44
|
+
amount: string;
|
|
45
|
+
destination: string;
|
|
46
|
+
}>>;
|
|
47
|
+
transfer: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
48
|
+
amount: import("zod").ZodString;
|
|
49
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
50
|
+
amount: string;
|
|
51
|
+
}, {
|
|
52
|
+
amount: string;
|
|
53
|
+
}>>;
|
|
54
|
+
spot: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodObject<{
|
|
55
|
+
symbol: import("zod").ZodString;
|
|
56
|
+
price: import("zod").ZodString;
|
|
57
|
+
size: import("zod").ZodString;
|
|
58
|
+
orderType: import("zod").ZodOptional<import("zod").ZodDiscriminatedUnion<"type", [import("zod").ZodObject<{
|
|
59
|
+
type: import("zod").ZodLiteral<"limit">;
|
|
60
|
+
tif: import("zod").ZodEnum<["Gtc", "Ioc", "Alo"]>;
|
|
61
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
62
|
+
type: "limit";
|
|
63
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
64
|
+
}, {
|
|
65
|
+
type: "limit";
|
|
66
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
67
|
+
}>, import("zod").ZodObject<{
|
|
68
|
+
type: import("zod").ZodLiteral<"market">;
|
|
69
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
70
|
+
type: "market";
|
|
71
|
+
}, {
|
|
72
|
+
type: "market";
|
|
73
|
+
}>]>>;
|
|
74
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
75
|
+
symbol: string;
|
|
76
|
+
price: string;
|
|
77
|
+
size: string;
|
|
78
|
+
orderType?: {
|
|
79
|
+
type: "limit";
|
|
80
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
81
|
+
} | {
|
|
82
|
+
type: "market";
|
|
83
|
+
} | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
symbol: string;
|
|
86
|
+
price: string;
|
|
87
|
+
size: string;
|
|
88
|
+
orderType?: {
|
|
89
|
+
type: "limit";
|
|
90
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
91
|
+
} | {
|
|
92
|
+
type: "market";
|
|
93
|
+
} | undefined;
|
|
94
|
+
}>, {
|
|
95
|
+
symbol: string;
|
|
96
|
+
price: string;
|
|
97
|
+
size: string;
|
|
98
|
+
orderType?: {
|
|
99
|
+
type: "limit";
|
|
100
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
101
|
+
} | {
|
|
102
|
+
type: "market";
|
|
103
|
+
} | undefined;
|
|
104
|
+
}, {
|
|
105
|
+
symbol: string;
|
|
106
|
+
price: string;
|
|
107
|
+
size: string;
|
|
108
|
+
orderType?: {
|
|
109
|
+
type: "limit";
|
|
110
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
111
|
+
} | {
|
|
112
|
+
type: "market";
|
|
113
|
+
} | undefined;
|
|
114
|
+
}>>;
|
|
115
|
+
perp: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
116
|
+
symbol: import("zod").ZodString;
|
|
117
|
+
price: import("zod").ZodString;
|
|
118
|
+
size: import("zod").ZodString;
|
|
119
|
+
leverage: import("zod").ZodNumber;
|
|
120
|
+
isCross: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
121
|
+
reduceOnly: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
122
|
+
orderType: import("zod").ZodOptional<import("zod").ZodDiscriminatedUnion<"type", [import("zod").ZodObject<{
|
|
123
|
+
type: import("zod").ZodLiteral<"limit">;
|
|
124
|
+
tif: import("zod").ZodEnum<["Gtc", "Ioc", "Alo"]>;
|
|
125
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
126
|
+
type: "limit";
|
|
127
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
128
|
+
}, {
|
|
129
|
+
type: "limit";
|
|
130
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
131
|
+
}>, import("zod").ZodObject<{
|
|
132
|
+
type: import("zod").ZodLiteral<"market">;
|
|
133
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
134
|
+
type: "market";
|
|
135
|
+
}, {
|
|
136
|
+
type: "market";
|
|
137
|
+
}>]>>;
|
|
138
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
139
|
+
symbol: string;
|
|
140
|
+
price: string;
|
|
141
|
+
size: string;
|
|
142
|
+
leverage: number;
|
|
143
|
+
orderType?: {
|
|
144
|
+
type: "limit";
|
|
145
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
146
|
+
} | {
|
|
147
|
+
type: "market";
|
|
148
|
+
} | undefined;
|
|
149
|
+
isCross?: boolean | undefined;
|
|
150
|
+
reduceOnly?: boolean | undefined;
|
|
151
|
+
}, {
|
|
152
|
+
symbol: string;
|
|
153
|
+
price: string;
|
|
154
|
+
size: string;
|
|
155
|
+
leverage: number;
|
|
156
|
+
orderType?: {
|
|
157
|
+
type: "limit";
|
|
158
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
159
|
+
} | {
|
|
160
|
+
type: "market";
|
|
161
|
+
} | undefined;
|
|
162
|
+
isCross?: boolean | undefined;
|
|
163
|
+
reduceOnly?: boolean | undefined;
|
|
164
|
+
}>>;
|
|
165
|
+
cancelOrder: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodObject<{
|
|
166
|
+
symbol: import("zod").ZodString;
|
|
167
|
+
orderId: import("zod").ZodNumber;
|
|
168
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
169
|
+
symbol: string;
|
|
170
|
+
orderId: number;
|
|
171
|
+
}, {
|
|
172
|
+
symbol: string;
|
|
173
|
+
orderId: number;
|
|
174
|
+
}>, {
|
|
175
|
+
symbol: string;
|
|
176
|
+
orderId: number;
|
|
177
|
+
}, {
|
|
178
|
+
symbol: string;
|
|
179
|
+
orderId: number;
|
|
180
|
+
}>>;
|
|
181
|
+
cancelAllOrdersForSymbol: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodObject<{
|
|
182
|
+
symbol: import("zod").ZodString;
|
|
183
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
184
|
+
symbol: string;
|
|
185
|
+
}, {
|
|
186
|
+
symbol: string;
|
|
187
|
+
}>, {
|
|
188
|
+
symbol: string;
|
|
189
|
+
}, {
|
|
190
|
+
symbol: string;
|
|
191
|
+
}>>;
|
|
192
|
+
arbitrumRpcUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
193
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
194
|
+
action: "deposit" | "withdraw" | "sendSpotAsset" | "sendPerpUsdc" | "transferToSpot" | "transferToPerp" | "spotBuy" | "spotSell" | "perpLong" | "perpShort" | "cancelOrder" | "cancelAllOrdersForSymbol" | "approveBuilderCode";
|
|
195
|
+
deposit?: {
|
|
196
|
+
amount: string;
|
|
197
|
+
} | undefined;
|
|
198
|
+
withdraw?: {
|
|
199
|
+
amount: string;
|
|
200
|
+
destination?: string | undefined;
|
|
201
|
+
} | undefined;
|
|
202
|
+
sendSpotAsset?: {
|
|
203
|
+
amount: string;
|
|
204
|
+
destination: string;
|
|
205
|
+
token: string;
|
|
206
|
+
} | undefined;
|
|
207
|
+
sendPerpUsdc?: {
|
|
208
|
+
amount: string;
|
|
209
|
+
destination: string;
|
|
210
|
+
} | undefined;
|
|
211
|
+
cancelOrder?: {
|
|
212
|
+
symbol: string;
|
|
213
|
+
orderId: number;
|
|
214
|
+
} | undefined;
|
|
215
|
+
cancelAllOrdersForSymbol?: {
|
|
216
|
+
symbol: string;
|
|
217
|
+
} | undefined;
|
|
218
|
+
useTestnet?: boolean | undefined;
|
|
219
|
+
transfer?: {
|
|
220
|
+
amount: string;
|
|
221
|
+
} | undefined;
|
|
222
|
+
spot?: {
|
|
223
|
+
symbol: string;
|
|
224
|
+
price: string;
|
|
225
|
+
size: string;
|
|
226
|
+
orderType?: {
|
|
227
|
+
type: "limit";
|
|
228
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
229
|
+
} | {
|
|
230
|
+
type: "market";
|
|
231
|
+
} | undefined;
|
|
232
|
+
} | undefined;
|
|
233
|
+
perp?: {
|
|
234
|
+
symbol: string;
|
|
235
|
+
price: string;
|
|
236
|
+
size: string;
|
|
237
|
+
leverage: number;
|
|
238
|
+
orderType?: {
|
|
239
|
+
type: "limit";
|
|
240
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
241
|
+
} | {
|
|
242
|
+
type: "market";
|
|
243
|
+
} | undefined;
|
|
244
|
+
isCross?: boolean | undefined;
|
|
245
|
+
reduceOnly?: boolean | undefined;
|
|
246
|
+
} | undefined;
|
|
247
|
+
arbitrumRpcUrl?: string | undefined;
|
|
248
|
+
}, {
|
|
249
|
+
action: "deposit" | "withdraw" | "sendSpotAsset" | "sendPerpUsdc" | "transferToSpot" | "transferToPerp" | "spotBuy" | "spotSell" | "perpLong" | "perpShort" | "cancelOrder" | "cancelAllOrdersForSymbol" | "approveBuilderCode";
|
|
250
|
+
deposit?: {
|
|
251
|
+
amount: string;
|
|
252
|
+
} | undefined;
|
|
253
|
+
withdraw?: {
|
|
254
|
+
amount: string;
|
|
255
|
+
destination?: string | undefined;
|
|
256
|
+
} | undefined;
|
|
257
|
+
sendSpotAsset?: {
|
|
258
|
+
amount: string;
|
|
259
|
+
destination: string;
|
|
260
|
+
token: string;
|
|
261
|
+
} | undefined;
|
|
262
|
+
sendPerpUsdc?: {
|
|
263
|
+
amount: string;
|
|
264
|
+
destination: string;
|
|
265
|
+
} | undefined;
|
|
266
|
+
cancelOrder?: {
|
|
267
|
+
symbol: string;
|
|
268
|
+
orderId: number;
|
|
269
|
+
} | undefined;
|
|
270
|
+
cancelAllOrdersForSymbol?: {
|
|
271
|
+
symbol: string;
|
|
272
|
+
} | undefined;
|
|
273
|
+
useTestnet?: boolean | undefined;
|
|
274
|
+
transfer?: {
|
|
275
|
+
amount: string;
|
|
276
|
+
} | undefined;
|
|
277
|
+
spot?: {
|
|
278
|
+
symbol: string;
|
|
279
|
+
price: string;
|
|
280
|
+
size: string;
|
|
281
|
+
orderType?: {
|
|
282
|
+
type: "limit";
|
|
283
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
284
|
+
} | {
|
|
285
|
+
type: "market";
|
|
286
|
+
} | undefined;
|
|
287
|
+
} | undefined;
|
|
288
|
+
perp?: {
|
|
289
|
+
symbol: string;
|
|
290
|
+
price: string;
|
|
291
|
+
size: string;
|
|
292
|
+
leverage: number;
|
|
293
|
+
orderType?: {
|
|
294
|
+
type: "limit";
|
|
295
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
296
|
+
} | {
|
|
297
|
+
type: "market";
|
|
298
|
+
} | undefined;
|
|
299
|
+
isCross?: boolean | undefined;
|
|
300
|
+
reduceOnly?: boolean | undefined;
|
|
301
|
+
} | undefined;
|
|
302
|
+
arbitrumRpcUrl?: string | undefined;
|
|
303
|
+
}>, {
|
|
304
|
+
action: "deposit" | "withdraw" | "sendSpotAsset" | "sendPerpUsdc" | "transferToSpot" | "transferToPerp" | "spotBuy" | "spotSell" | "perpLong" | "perpShort" | "cancelOrder" | "cancelAllOrdersForSymbol" | "approveBuilderCode";
|
|
305
|
+
deposit?: {
|
|
306
|
+
amount: string;
|
|
307
|
+
} | undefined;
|
|
308
|
+
withdraw?: {
|
|
309
|
+
amount: string;
|
|
310
|
+
destination?: string | undefined;
|
|
311
|
+
} | undefined;
|
|
312
|
+
sendSpotAsset?: {
|
|
313
|
+
amount: string;
|
|
314
|
+
destination: string;
|
|
315
|
+
token: string;
|
|
316
|
+
} | undefined;
|
|
317
|
+
sendPerpUsdc?: {
|
|
318
|
+
amount: string;
|
|
319
|
+
destination: string;
|
|
320
|
+
} | undefined;
|
|
321
|
+
cancelOrder?: {
|
|
322
|
+
symbol: string;
|
|
323
|
+
orderId: number;
|
|
324
|
+
} | undefined;
|
|
325
|
+
cancelAllOrdersForSymbol?: {
|
|
326
|
+
symbol: string;
|
|
327
|
+
} | undefined;
|
|
328
|
+
useTestnet?: boolean | undefined;
|
|
329
|
+
transfer?: {
|
|
330
|
+
amount: string;
|
|
331
|
+
} | undefined;
|
|
332
|
+
spot?: {
|
|
333
|
+
symbol: string;
|
|
334
|
+
price: string;
|
|
335
|
+
size: string;
|
|
336
|
+
orderType?: {
|
|
337
|
+
type: "limit";
|
|
338
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
339
|
+
} | {
|
|
340
|
+
type: "market";
|
|
341
|
+
} | undefined;
|
|
342
|
+
} | undefined;
|
|
343
|
+
perp?: {
|
|
344
|
+
symbol: string;
|
|
345
|
+
price: string;
|
|
346
|
+
size: string;
|
|
347
|
+
leverage: number;
|
|
348
|
+
orderType?: {
|
|
349
|
+
type: "limit";
|
|
350
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
351
|
+
} | {
|
|
352
|
+
type: "market";
|
|
353
|
+
} | undefined;
|
|
354
|
+
isCross?: boolean | undefined;
|
|
355
|
+
reduceOnly?: boolean | undefined;
|
|
356
|
+
} | undefined;
|
|
357
|
+
arbitrumRpcUrl?: string | undefined;
|
|
358
|
+
}, {
|
|
359
|
+
action: "deposit" | "withdraw" | "sendSpotAsset" | "sendPerpUsdc" | "transferToSpot" | "transferToPerp" | "spotBuy" | "spotSell" | "perpLong" | "perpShort" | "cancelOrder" | "cancelAllOrdersForSymbol" | "approveBuilderCode";
|
|
360
|
+
deposit?: {
|
|
361
|
+
amount: string;
|
|
362
|
+
} | undefined;
|
|
363
|
+
withdraw?: {
|
|
364
|
+
amount: string;
|
|
365
|
+
destination?: string | undefined;
|
|
366
|
+
} | undefined;
|
|
367
|
+
sendSpotAsset?: {
|
|
368
|
+
amount: string;
|
|
369
|
+
destination: string;
|
|
370
|
+
token: string;
|
|
371
|
+
} | undefined;
|
|
372
|
+
sendPerpUsdc?: {
|
|
373
|
+
amount: string;
|
|
374
|
+
destination: string;
|
|
375
|
+
} | undefined;
|
|
376
|
+
cancelOrder?: {
|
|
377
|
+
symbol: string;
|
|
378
|
+
orderId: number;
|
|
379
|
+
} | undefined;
|
|
380
|
+
cancelAllOrdersForSymbol?: {
|
|
381
|
+
symbol: string;
|
|
382
|
+
} | undefined;
|
|
383
|
+
useTestnet?: boolean | undefined;
|
|
384
|
+
transfer?: {
|
|
385
|
+
amount: string;
|
|
386
|
+
} | undefined;
|
|
387
|
+
spot?: {
|
|
388
|
+
symbol: string;
|
|
389
|
+
price: string;
|
|
390
|
+
size: string;
|
|
391
|
+
orderType?: {
|
|
392
|
+
type: "limit";
|
|
393
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
394
|
+
} | {
|
|
395
|
+
type: "market";
|
|
396
|
+
} | undefined;
|
|
397
|
+
} | undefined;
|
|
398
|
+
perp?: {
|
|
399
|
+
symbol: string;
|
|
400
|
+
price: string;
|
|
401
|
+
size: string;
|
|
402
|
+
leverage: number;
|
|
403
|
+
orderType?: {
|
|
404
|
+
type: "limit";
|
|
405
|
+
tif: "Gtc" | "Ioc" | "Alo";
|
|
406
|
+
} | {
|
|
407
|
+
type: "market";
|
|
408
|
+
} | undefined;
|
|
409
|
+
isCross?: boolean | undefined;
|
|
410
|
+
reduceOnly?: boolean | undefined;
|
|
411
|
+
} | undefined;
|
|
412
|
+
arbitrumRpcUrl?: string | undefined;
|
|
413
|
+
}>, string, import("node_modules/@lit-protocol/vincent-ability-sdk/dist/src/lib/abilityCore/helpers").AbilityPolicyMap<readonly [], never>, {}, import("zod").ZodObject<{
|
|
414
|
+
action: import("zod").ZodString;
|
|
415
|
+
txHash: import("zod").ZodOptional<import("zod").ZodString>;
|
|
416
|
+
withdrawResult: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
417
|
+
sendResult: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
418
|
+
transferResult: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
419
|
+
orderResult: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
420
|
+
cancelResult: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
421
|
+
approveResult: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
422
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
423
|
+
action: string;
|
|
424
|
+
txHash?: string | undefined;
|
|
425
|
+
withdrawResult?: any;
|
|
426
|
+
sendResult?: any;
|
|
427
|
+
transferResult?: any;
|
|
428
|
+
orderResult?: any;
|
|
429
|
+
cancelResult?: any;
|
|
430
|
+
approveResult?: any;
|
|
431
|
+
}, {
|
|
432
|
+
action: string;
|
|
433
|
+
txHash?: string | undefined;
|
|
434
|
+
withdrawResult?: any;
|
|
435
|
+
sendResult?: any;
|
|
436
|
+
transferResult?: any;
|
|
437
|
+
orderResult?: any;
|
|
438
|
+
cancelResult?: any;
|
|
439
|
+
approveResult?: any;
|
|
440
|
+
}>, import("zod").ZodObject<{
|
|
441
|
+
action: import("zod").ZodString;
|
|
442
|
+
reason: import("zod").ZodString;
|
|
443
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
444
|
+
action: string;
|
|
445
|
+
reason: string;
|
|
446
|
+
}, {
|
|
447
|
+
action: string;
|
|
448
|
+
reason: string;
|
|
449
|
+
}>, import("zod").ZodObject<{
|
|
450
|
+
action: import("zod").ZodString;
|
|
451
|
+
availableBalance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
452
|
+
isBuilderApproved: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
453
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
454
|
+
action: string;
|
|
455
|
+
availableBalance?: string | undefined;
|
|
456
|
+
isBuilderApproved?: boolean | undefined;
|
|
457
|
+
}, {
|
|
458
|
+
action: string;
|
|
459
|
+
availableBalance?: string | undefined;
|
|
460
|
+
isBuilderApproved?: boolean | undefined;
|
|
461
|
+
}>, import("zod").ZodObject<{
|
|
462
|
+
action: import("zod").ZodString;
|
|
463
|
+
reason: import("zod").ZodString;
|
|
464
|
+
availableBalance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
465
|
+
requiredBalance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
466
|
+
balanceAsset: import("zod").ZodOptional<import("zod").ZodString>;
|
|
467
|
+
isBuilderApproved: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
468
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
469
|
+
action: string;
|
|
470
|
+
reason: string;
|
|
471
|
+
availableBalance?: string | undefined;
|
|
472
|
+
isBuilderApproved?: boolean | undefined;
|
|
473
|
+
requiredBalance?: string | undefined;
|
|
474
|
+
balanceAsset?: string | undefined;
|
|
475
|
+
}, {
|
|
476
|
+
action: string;
|
|
477
|
+
reason: string;
|
|
478
|
+
availableBalance?: string | undefined;
|
|
479
|
+
isBuilderApproved?: boolean | undefined;
|
|
480
|
+
requiredBalance?: string | undefined;
|
|
481
|
+
balanceAsset?: string | undefined;
|
|
482
|
+
}>>, string>;
|
|
483
|
+
//# sourceMappingURL=vincent-bundled-ability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vincent-bundled-ability.d.ts","sourceRoot":"","sources":["../../../src/generated/vincent-bundled-ability.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAA4D,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DO NOT EDIT THIS FILE. IT IS GENERATED ON BUILD.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.bundledVincentAbility = void 0;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
const vincent_ability_sdk_1 = require("@lit-protocol/vincent-ability-sdk");
|
|
9
|
+
const vincent_ability_1 = require("../lib/vincent-ability");
|
|
10
|
+
const vincent_ability_metadata_json_1 = tslib_1.__importDefault(require("./vincent-ability-metadata.json"));
|
|
11
|
+
if (!vincent_ability_metadata_json_1.default.ipfsCid) {
|
|
12
|
+
throw new Error('ipfsCid is not defined in metadata JSON file');
|
|
13
|
+
}
|
|
14
|
+
exports.bundledVincentAbility = (0, vincent_ability_sdk_1.asBundledVincentAbility)(vincent_ability_1.vincentAbility, vincent_ability_metadata_json_1.default.ipfsCid);
|
|
15
|
+
//# sourceMappingURL=vincent-bundled-ability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vincent-bundled-ability.js","sourceRoot":"","sources":["../../../src/generated/vincent-bundled-ability.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,2EAA4E;AAC5E,4DAAwD;AACxD,4GAAuD;AAEvD,IAAG,CAAC,uCAAQ,CAAC,OAAO,EAAE,CAAC;IACrB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;AAClE,CAAC;AAEY,QAAA,qBAAqB,GAAG,IAAA,6CAAuB,EAAC,gCAAc,EAAE,uCAAQ,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DO NOT EDIT THIS FILE. IT IS GENERATED ON BUILD.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { asBundledVincentAbility } from '@lit-protocol/vincent-ability-sdk';
|
|
6
|
+
import { vincentAbility } from '../lib/vincent-ability';
|
|
7
|
+
import metadata from './vincent-ability-metadata.json';
|
|
8
|
+
|
|
9
|
+
if(!metadata.ipfsCid) {
|
|
10
|
+
throw new Error('ipfsCid is not defined in metadata JSON file');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const bundledVincentAbility = asBundledVincentAbility(vincentAbility, metadata.ipfsCid);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { bundledVincentAbility } from './generated/vincent-bundled-ability';
|
|
2
|
+
export { HyperliquidAction, TimeInForce, OrderType } from './lib/types';
|
|
3
|
+
export type { TransferUsdcResult } from './lib/ability-helpers/transfer-usdc-to';
|
|
4
|
+
export type { CancelOrderResult } from './lib/ability-helpers/cancel-order/cancel-order';
|
|
5
|
+
export type { CancelAllOrdersResult } from './lib/ability-helpers/cancel-order/cancel-all-orders';
|
|
6
|
+
export type { SpotOrderResult } from './lib/ability-helpers/execute-spot-order';
|
|
7
|
+
export type { PerpOrderResult } from './lib/ability-helpers/execute-perp-order';
|
|
8
|
+
export type { ApproveBuilderCodeResult } from './lib/ability-helpers/approve-builder-code';
|
|
9
|
+
export type { WithdrawUsdcResult } from './lib/ability-helpers/withdraw-usdc';
|
|
10
|
+
export type { SendPerpUsdcResult } from './lib/ability-helpers/send-perp-usdc';
|
|
11
|
+
export type { SendSpotAssetResult } from './lib/ability-helpers/send-spot-asset';
|
|
12
|
+
export { HYPERLIQUID_BUILDER_ADDRESS, HYPERLIQUID_BUILDER_FEE_RATE } from './lib/constants';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAG5E,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExE,YAAY,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACjF,YAAY,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACzF,YAAY,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAClG,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,YAAY,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAC3F,YAAY,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,YAAY,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,YAAY,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAEjF,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HYPERLIQUID_BUILDER_FEE_RATE = exports.HYPERLIQUID_BUILDER_ADDRESS = exports.OrderType = exports.TimeInForce = exports.HyperliquidAction = exports.bundledVincentAbility = void 0;
|
|
4
|
+
var vincent_bundled_ability_1 = require("./generated/vincent-bundled-ability");
|
|
5
|
+
Object.defineProperty(exports, "bundledVincentAbility", { enumerable: true, get: function () { return vincent_bundled_ability_1.bundledVincentAbility; } });
|
|
6
|
+
// Export enums and types for users
|
|
7
|
+
var types_1 = require("./lib/types");
|
|
8
|
+
Object.defineProperty(exports, "HyperliquidAction", { enumerable: true, get: function () { return types_1.HyperliquidAction; } });
|
|
9
|
+
Object.defineProperty(exports, "TimeInForce", { enumerable: true, get: function () { return types_1.TimeInForce; } });
|
|
10
|
+
Object.defineProperty(exports, "OrderType", { enumerable: true, get: function () { return types_1.OrderType; } });
|
|
11
|
+
var constants_1 = require("./lib/constants");
|
|
12
|
+
Object.defineProperty(exports, "HYPERLIQUID_BUILDER_ADDRESS", { enumerable: true, get: function () { return constants_1.HYPERLIQUID_BUILDER_ADDRESS; } });
|
|
13
|
+
Object.defineProperty(exports, "HYPERLIQUID_BUILDER_FEE_RATE", { enumerable: true, get: function () { return constants_1.HYPERLIQUID_BUILDER_FEE_RATE; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+EAA4E;AAAnE,gIAAA,qBAAqB,OAAA;AAE9B,mCAAmC;AACnC,qCAAwE;AAA/D,0GAAA,iBAAiB,OAAA;AAAE,oGAAA,WAAW,OAAA;AAAE,kGAAA,SAAS,OAAA;AAYlD,6CAA4F;AAAnF,wHAAA,2BAA2B,OAAA;AAAE,yHAAA,4BAA4B,OAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as hyperliquid from '@nktkas/hyperliquid';
|
|
2
|
+
export type CancelOrderPrechecksResult = CancelOrderPrechecksResultSuccess | CancelOrderPrechecksResultFailure;
|
|
3
|
+
export interface CancelOrderPrechecksResultSuccess {
|
|
4
|
+
success: true;
|
|
5
|
+
}
|
|
6
|
+
export interface CancelOrderPrechecksResultFailure {
|
|
7
|
+
success: false;
|
|
8
|
+
reason: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CancelOrderParams {
|
|
11
|
+
orderId: number;
|
|
12
|
+
}
|
|
13
|
+
export type CancelAllOrdersForSymbolPrechecksResult = CancelAllOrdersForSymbolPrechecksResultSuccess | CancelAllOrdersForSymbolPrechecksResultFailure;
|
|
14
|
+
export interface CancelAllOrdersForSymbolPrechecksResultSuccess {
|
|
15
|
+
success: true;
|
|
16
|
+
orderCount: number;
|
|
17
|
+
}
|
|
18
|
+
export interface CancelAllOrdersForSymbolPrechecksResultFailure {
|
|
19
|
+
success: false;
|
|
20
|
+
reason: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CancelAllOrdersForSymbolParams {
|
|
23
|
+
symbol: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if a specific order can be cancelled
|
|
27
|
+
*/
|
|
28
|
+
export declare function cancelOrderPrechecks({ infoClient, ethAddress, params, }: {
|
|
29
|
+
infoClient: hyperliquid.InfoClient;
|
|
30
|
+
ethAddress: string;
|
|
31
|
+
params: CancelOrderParams;
|
|
32
|
+
}): Promise<CancelOrderPrechecksResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Check if there are open orders for a symbol that can be cancelled
|
|
35
|
+
*/
|
|
36
|
+
export declare function cancelAllOrdersForSymbolPrechecks({ infoClient, ethAddress, params, }: {
|
|
37
|
+
infoClient: hyperliquid.InfoClient;
|
|
38
|
+
ethAddress: string;
|
|
39
|
+
params: CancelAllOrdersForSymbolParams;
|
|
40
|
+
}): Promise<CancelAllOrdersForSymbolPrechecksResult>;
|
|
41
|
+
//# sourceMappingURL=cancel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../../../src/lib/ability-checks/cancel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AAEnD,MAAM,MAAM,0BAA0B,GAClC,iCAAiC,GACjC,iCAAiC,CAAC;AAEtC,MAAM,WAAW,iCAAiC;IAChD,OAAO,EAAE,IAAI,CAAC;CACf;AAED,MAAM,WAAW,iCAAiC;IAChD,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,uCAAuC,GAC/C,8CAA8C,GAC9C,8CAA8C,CAAC;AAEnD,MAAM,WAAW,8CAA8C;IAC7D,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,8CAA8C;IAC7D,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,UAAU,EACV,UAAU,EACV,MAAM,GACP,EAAE;IACD,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAwBtC;AAED;;GAEG;AACH,wBAAsB,iCAAiC,CAAC,EACtD,UAAU,EACV,UAAU,EACV,MAAM,GACP,EAAE;IACD,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,8BAA8B,CAAC;CACxC,GAAG,OAAO,CAAC,uCAAuC,CAAC,CAyBnD"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cancelOrderPrechecks = cancelOrderPrechecks;
|
|
4
|
+
exports.cancelAllOrdersForSymbolPrechecks = cancelAllOrdersForSymbolPrechecks;
|
|
5
|
+
/**
|
|
6
|
+
* Check if a specific order can be cancelled
|
|
7
|
+
*/
|
|
8
|
+
async function cancelOrderPrechecks({ infoClient, ethAddress, params, }) {
|
|
9
|
+
try {
|
|
10
|
+
const openOrders = await infoClient.openOrders({
|
|
11
|
+
user: ethAddress,
|
|
12
|
+
});
|
|
13
|
+
const orderExists = openOrders.some((order) => order.oid === params.orderId);
|
|
14
|
+
if (!orderExists) {
|
|
15
|
+
return {
|
|
16
|
+
success: false,
|
|
17
|
+
reason: `Order ${params.orderId} not found or already filled/cancelled`,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
success: true,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
return {
|
|
26
|
+
success: false,
|
|
27
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if there are open orders for a symbol that can be cancelled
|
|
33
|
+
*/
|
|
34
|
+
async function cancelAllOrdersForSymbolPrechecks({ infoClient, ethAddress, params, }) {
|
|
35
|
+
try {
|
|
36
|
+
const openOrders = await infoClient.openOrders({
|
|
37
|
+
user: ethAddress,
|
|
38
|
+
});
|
|
39
|
+
const ordersForSymbol = openOrders.filter((order) => order.coin === params.symbol);
|
|
40
|
+
if (ordersForSymbol.length === 0) {
|
|
41
|
+
return {
|
|
42
|
+
success: false,
|
|
43
|
+
reason: `No open orders found for ${params.symbol}`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
success: true,
|
|
48
|
+
orderCount: ordersForSymbol.length,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
return {
|
|
53
|
+
success: false,
|
|
54
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=cancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../../../src/lib/ability-checks/cancel.ts"],"names":[],"mappings":";;AAwCA,oDAgCC;AAKD,8EAiCC;AAzED;;GAEG;AACI,KAAK,UAAU,oBAAoB,CAAC,EACzC,UAAU,EACV,UAAU,EACV,MAAM,GAKP;IACC,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,UAAU,CAAC;YAC7C,IAAI,EAAE,UAA2B;SAClC,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,MAAM,CAAC,OAAO,CAAC,CAAC;QAE7E,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,SAAS,MAAM,CAAC,OAAO,wCAAwC;aACxE,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC/D,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,iCAAiC,CAAC,EACtD,UAAU,EACV,UAAU,EACV,MAAM,GAKP;IACC,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,UAAU,CAAC;YAC7C,IAAI,EAAE,UAA2B;SAClC,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC;QAEnF,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,4BAA4B,MAAM,CAAC,MAAM,EAAE;aACpD,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,eAAe,CAAC,MAAM;SACnC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC/D,CAAC;IACJ,CAAC;AACH,CAAC"}
|