@pear-protocol/types 1.19.0 → 1.20.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/dist/auth/payloads.d.ts
CHANGED
|
@@ -13,11 +13,13 @@ export declare const LinkEmailRequest: z.ZodObject<{
|
|
|
13
13
|
export declare const LinkWalletRequest: z.ZodObject<{
|
|
14
14
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
15
15
|
signature: z.ZodString;
|
|
16
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
16
17
|
}, z.core.$strip>;
|
|
17
18
|
export declare const WalletLoginRequest: z.ZodObject<{
|
|
18
19
|
method: z.ZodLiteral<"wallet">;
|
|
19
20
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
20
21
|
signature: z.ZodString;
|
|
22
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
21
23
|
accessCode: z.ZodOptional<z.ZodString>;
|
|
22
24
|
}, z.core.$strip>;
|
|
23
25
|
export declare const EmailLoginRequest: z.ZodObject<{
|
|
@@ -44,6 +46,7 @@ export declare const LoginRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
44
46
|
method: z.ZodLiteral<"wallet">;
|
|
45
47
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
46
48
|
signature: z.ZodString;
|
|
49
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
47
50
|
accessCode: z.ZodOptional<z.ZodString>;
|
|
48
51
|
}, z.core.$strip>, z.ZodObject<{
|
|
49
52
|
method: z.ZodLiteral<"email">;
|
package/dist/auth/payloads.js
CHANGED
|
@@ -4,6 +4,7 @@ const EthereumAddress = z.string().regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereu
|
|
|
4
4
|
const Email = z.email("Invalid email address").transform((val) => val.toLowerCase()).describe("Email address (lowercase)");
|
|
5
5
|
const Password = z.string().min(8, "Password must be at least 8 characters").max(128, "Password must be at most 128 characters").describe("Password for authentication");
|
|
6
6
|
const AccessCode = z.string().trim().max(64).optional().describe("Optional beta access code");
|
|
7
|
+
const SignedNonce = z.string().min(1).max(128).optional().describe("Nonce of the signed challenge, as returned by the nonce endpoint");
|
|
7
8
|
const RequestNonceRequest = z.object({
|
|
8
9
|
address: EthereumAddress
|
|
9
10
|
}).describe("Request a nonce for wallet authentication");
|
|
@@ -17,12 +18,14 @@ const LinkEmailRequest = z.object({
|
|
|
17
18
|
}).describe("Link email credentials to the authenticated account");
|
|
18
19
|
const LinkWalletRequest = z.object({
|
|
19
20
|
address: EthereumAddress,
|
|
20
|
-
signature: z.string().min(1, "Signature is required").describe("Signature of the nonce message")
|
|
21
|
+
signature: z.string().min(1, "Signature is required").describe("Signature of the nonce message"),
|
|
22
|
+
nonce: SignedNonce
|
|
21
23
|
}).describe("Link wallet credentials to the authenticated account");
|
|
22
24
|
const WalletLoginRequest = z.object({
|
|
23
25
|
method: z.literal("wallet").describe('Must be "wallet" for wallet authentication'),
|
|
24
26
|
address: EthereumAddress,
|
|
25
27
|
signature: z.string().min(1, "Signature is required").describe("Signature of the nonce message"),
|
|
28
|
+
nonce: SignedNonce,
|
|
26
29
|
accessCode: AccessCode
|
|
27
30
|
}).describe("Wallet-based authentication using nonce signature");
|
|
28
31
|
const EmailLoginRequest = z.object({
|
package/dist/sync/payloads.d.ts
CHANGED
|
@@ -348,6 +348,7 @@ export type SyncMeta = z.output<typeof SyncMeta>;
|
|
|
348
348
|
export declare const CreateApplicablesMeta: z.ZodObject<{
|
|
349
349
|
externalMaxTs: z.ZodNullable<z.ZodNumber>;
|
|
350
350
|
firstSyncStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
351
|
+
newestFillTs: z.ZodOptional<z.ZodNumber>;
|
|
351
352
|
}, z.core.$strip>;
|
|
352
353
|
export type CreateApplicablesMeta = z.output<typeof CreateApplicablesMeta>;
|
|
353
354
|
/**
|
|
@@ -429,6 +430,7 @@ export declare const CreateApplicablesRequest: z.ZodObject<{
|
|
|
429
430
|
meta: z.ZodObject<{
|
|
430
431
|
externalMaxTs: z.ZodNullable<z.ZodNumber>;
|
|
431
432
|
firstSyncStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
433
|
+
newestFillTs: z.ZodOptional<z.ZodNumber>;
|
|
432
434
|
}, z.core.$strip>;
|
|
433
435
|
}, z.core.$strip>;
|
|
434
436
|
export type CreateApplicablesRequest = z.output<typeof CreateApplicablesRequest>;
|
package/dist/sync/payloads.js
CHANGED
|
@@ -111,7 +111,11 @@ const SyncMeta = z.object({
|
|
|
111
111
|
).nullable().describe("watermark advance source")
|
|
112
112
|
});
|
|
113
113
|
const CreateApplicablesMeta = SyncMeta.extend({
|
|
114
|
-
firstSyncStartedAt: z.number().int().nonnegative().optional().describe("backend-issued timestamp returned before the first fill-history fetch")
|
|
114
|
+
firstSyncStartedAt: z.number().int().nonnegative().optional().describe("backend-issued timestamp returned before the first fill-history fetch"),
|
|
115
|
+
newestFillTs: z.number().int().nonnegative().refine(
|
|
116
|
+
(timestamp) => timestamp <= Date.now() + WATERMARK_FUTURE_SKEW_MS,
|
|
117
|
+
"newestFillTs must not be ahead of server time"
|
|
118
|
+
).optional().describe("raw newest fetched fill \u2014 settle-gate source, never trim-advanced")
|
|
115
119
|
});
|
|
116
120
|
const CreateApplicablesRequest = z.object({
|
|
117
121
|
applicables: z.array(ApplicablePosition),
|
|
@@ -1095,277 +1095,5 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
|
|
|
1095
1095
|
}, z.core.$strip>], "intent">], "orderType">;
|
|
1096
1096
|
}, z.core.$strip>;
|
|
1097
1097
|
export type CreateTradeReverseResponse = z.output<typeof CreateTradeReverseResponse>;
|
|
1098
|
-
export declare const CreateTradeCloseAllResponse: z.ZodObject<{
|
|
1099
|
-
executions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1100
|
-
id: z.ZodUUID;
|
|
1101
|
-
connector: z.ZodEnum<{
|
|
1102
|
-
hyperliquid: "hyperliquid";
|
|
1103
|
-
binance: "binance";
|
|
1104
|
-
bybit: "bybit";
|
|
1105
|
-
okx: "okx";
|
|
1106
|
-
lighter: "lighter";
|
|
1107
|
-
}>;
|
|
1108
|
-
status: z.ZodEnum<{
|
|
1109
|
-
CANCELLED: "CANCELLED";
|
|
1110
|
-
IDLE: "IDLE";
|
|
1111
|
-
ACTIVE: "ACTIVE";
|
|
1112
|
-
COMPLETED: "COMPLETED";
|
|
1113
|
-
FAILED: "FAILED";
|
|
1114
|
-
}>;
|
|
1115
|
-
error: z.ZodOptional<z.ZodString>;
|
|
1116
|
-
createdAt: z.ZodString;
|
|
1117
|
-
updatedAt: z.ZodString;
|
|
1118
|
-
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1119
|
-
id: z.ZodUUID;
|
|
1120
|
-
connector: z.ZodEnum<{
|
|
1121
|
-
hyperliquid: "hyperliquid";
|
|
1122
|
-
binance: "binance";
|
|
1123
|
-
bybit: "bybit";
|
|
1124
|
-
okx: "okx";
|
|
1125
|
-
lighter: "lighter";
|
|
1126
|
-
}>;
|
|
1127
|
-
status: z.ZodEnum<{
|
|
1128
|
-
PENDING: "PENDING";
|
|
1129
|
-
PARTIAL: "PARTIAL";
|
|
1130
|
-
FILLED: "FILLED";
|
|
1131
|
-
CANCELLED: "CANCELLED";
|
|
1132
|
-
REJECTED: "REJECTED";
|
|
1133
|
-
}>;
|
|
1134
|
-
error: z.ZodOptional<z.ZodString>;
|
|
1135
|
-
createdAt: z.ZodString;
|
|
1136
|
-
updatedAt: z.ZodString;
|
|
1137
|
-
type: z.ZodLiteral<"MARKET">;
|
|
1138
|
-
symbol: z.ZodString;
|
|
1139
|
-
side: z.ZodEnum<{
|
|
1140
|
-
BUY: "BUY";
|
|
1141
|
-
SELL: "SELL";
|
|
1142
|
-
}>;
|
|
1143
|
-
reduceOnly: z.ZodBoolean;
|
|
1144
|
-
quantity: z.ZodString;
|
|
1145
|
-
price: z.ZodString;
|
|
1146
|
-
filledQuantity: z.ZodString;
|
|
1147
|
-
filledPrice: z.ZodOptional<z.ZodString>;
|
|
1148
|
-
}, z.core.$strip>], "type">>>;
|
|
1149
|
-
intent: z.ZodLiteral<"OPEN">;
|
|
1150
|
-
orderType: z.ZodLiteral<"MARKET">;
|
|
1151
|
-
legs: z.ZodTuple<[z.ZodObject<{
|
|
1152
|
-
symbol: z.ZodString;
|
|
1153
|
-
side: z.ZodEnum<{
|
|
1154
|
-
BUY: "BUY";
|
|
1155
|
-
SELL: "SELL";
|
|
1156
|
-
}>;
|
|
1157
|
-
mode: z.ZodEnum<{
|
|
1158
|
-
QUANTITY: "QUANTITY";
|
|
1159
|
-
USD: "USD";
|
|
1160
|
-
}>;
|
|
1161
|
-
amount: z.ZodString;
|
|
1162
|
-
reduceOnly: z.ZodBoolean;
|
|
1163
|
-
}, z.core.$strip>], z.ZodObject<{
|
|
1164
|
-
symbol: z.ZodString;
|
|
1165
|
-
side: z.ZodEnum<{
|
|
1166
|
-
BUY: "BUY";
|
|
1167
|
-
SELL: "SELL";
|
|
1168
|
-
}>;
|
|
1169
|
-
mode: z.ZodEnum<{
|
|
1170
|
-
QUANTITY: "QUANTITY";
|
|
1171
|
-
USD: "USD";
|
|
1172
|
-
}>;
|
|
1173
|
-
amount: z.ZodString;
|
|
1174
|
-
reduceOnly: z.ZodBoolean;
|
|
1175
|
-
}, z.core.$strip>>;
|
|
1176
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1177
|
-
id: z.ZodUUID;
|
|
1178
|
-
connector: z.ZodEnum<{
|
|
1179
|
-
hyperliquid: "hyperliquid";
|
|
1180
|
-
binance: "binance";
|
|
1181
|
-
bybit: "bybit";
|
|
1182
|
-
okx: "okx";
|
|
1183
|
-
lighter: "lighter";
|
|
1184
|
-
}>;
|
|
1185
|
-
status: z.ZodEnum<{
|
|
1186
|
-
CANCELLED: "CANCELLED";
|
|
1187
|
-
IDLE: "IDLE";
|
|
1188
|
-
ACTIVE: "ACTIVE";
|
|
1189
|
-
COMPLETED: "COMPLETED";
|
|
1190
|
-
FAILED: "FAILED";
|
|
1191
|
-
}>;
|
|
1192
|
-
error: z.ZodOptional<z.ZodString>;
|
|
1193
|
-
createdAt: z.ZodString;
|
|
1194
|
-
updatedAt: z.ZodString;
|
|
1195
|
-
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1196
|
-
id: z.ZodUUID;
|
|
1197
|
-
connector: z.ZodEnum<{
|
|
1198
|
-
hyperliquid: "hyperliquid";
|
|
1199
|
-
binance: "binance";
|
|
1200
|
-
bybit: "bybit";
|
|
1201
|
-
okx: "okx";
|
|
1202
|
-
lighter: "lighter";
|
|
1203
|
-
}>;
|
|
1204
|
-
status: z.ZodEnum<{
|
|
1205
|
-
PENDING: "PENDING";
|
|
1206
|
-
PARTIAL: "PARTIAL";
|
|
1207
|
-
FILLED: "FILLED";
|
|
1208
|
-
CANCELLED: "CANCELLED";
|
|
1209
|
-
REJECTED: "REJECTED";
|
|
1210
|
-
}>;
|
|
1211
|
-
error: z.ZodOptional<z.ZodString>;
|
|
1212
|
-
createdAt: z.ZodString;
|
|
1213
|
-
updatedAt: z.ZodString;
|
|
1214
|
-
type: z.ZodLiteral<"MARKET">;
|
|
1215
|
-
symbol: z.ZodString;
|
|
1216
|
-
side: z.ZodEnum<{
|
|
1217
|
-
BUY: "BUY";
|
|
1218
|
-
SELL: "SELL";
|
|
1219
|
-
}>;
|
|
1220
|
-
reduceOnly: z.ZodBoolean;
|
|
1221
|
-
quantity: z.ZodString;
|
|
1222
|
-
price: z.ZodString;
|
|
1223
|
-
filledQuantity: z.ZodString;
|
|
1224
|
-
filledPrice: z.ZodOptional<z.ZodString>;
|
|
1225
|
-
}, z.core.$strip>], "type">>>;
|
|
1226
|
-
intent: z.ZodLiteral<"ADJUST">;
|
|
1227
|
-
orderType: z.ZodLiteral<"MARKET">;
|
|
1228
|
-
position: z.ZodObject<{
|
|
1229
|
-
id: z.ZodUUID;
|
|
1230
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
1231
|
-
}, z.core.$strip>;
|
|
1232
|
-
legs: z.ZodTuple<[z.ZodObject<{
|
|
1233
|
-
symbol: z.ZodString;
|
|
1234
|
-
side: z.ZodEnum<{
|
|
1235
|
-
BUY: "BUY";
|
|
1236
|
-
SELL: "SELL";
|
|
1237
|
-
}>;
|
|
1238
|
-
mode: z.ZodEnum<{
|
|
1239
|
-
QUANTITY: "QUANTITY";
|
|
1240
|
-
USD: "USD";
|
|
1241
|
-
}>;
|
|
1242
|
-
amount: z.ZodString;
|
|
1243
|
-
reduceOnly: z.ZodBoolean;
|
|
1244
|
-
}, z.core.$strip>], z.ZodObject<{
|
|
1245
|
-
symbol: z.ZodString;
|
|
1246
|
-
side: z.ZodEnum<{
|
|
1247
|
-
BUY: "BUY";
|
|
1248
|
-
SELL: "SELL";
|
|
1249
|
-
}>;
|
|
1250
|
-
mode: z.ZodEnum<{
|
|
1251
|
-
QUANTITY: "QUANTITY";
|
|
1252
|
-
USD: "USD";
|
|
1253
|
-
}>;
|
|
1254
|
-
amount: z.ZodString;
|
|
1255
|
-
reduceOnly: z.ZodBoolean;
|
|
1256
|
-
}, z.core.$strip>>;
|
|
1257
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1258
|
-
id: z.ZodUUID;
|
|
1259
|
-
connector: z.ZodEnum<{
|
|
1260
|
-
hyperliquid: "hyperliquid";
|
|
1261
|
-
binance: "binance";
|
|
1262
|
-
bybit: "bybit";
|
|
1263
|
-
okx: "okx";
|
|
1264
|
-
lighter: "lighter";
|
|
1265
|
-
}>;
|
|
1266
|
-
status: z.ZodEnum<{
|
|
1267
|
-
CANCELLED: "CANCELLED";
|
|
1268
|
-
IDLE: "IDLE";
|
|
1269
|
-
ACTIVE: "ACTIVE";
|
|
1270
|
-
COMPLETED: "COMPLETED";
|
|
1271
|
-
FAILED: "FAILED";
|
|
1272
|
-
}>;
|
|
1273
|
-
error: z.ZodOptional<z.ZodString>;
|
|
1274
|
-
createdAt: z.ZodString;
|
|
1275
|
-
updatedAt: z.ZodString;
|
|
1276
|
-
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1277
|
-
id: z.ZodUUID;
|
|
1278
|
-
connector: z.ZodEnum<{
|
|
1279
|
-
hyperliquid: "hyperliquid";
|
|
1280
|
-
binance: "binance";
|
|
1281
|
-
bybit: "bybit";
|
|
1282
|
-
okx: "okx";
|
|
1283
|
-
lighter: "lighter";
|
|
1284
|
-
}>;
|
|
1285
|
-
status: z.ZodEnum<{
|
|
1286
|
-
PENDING: "PENDING";
|
|
1287
|
-
PARTIAL: "PARTIAL";
|
|
1288
|
-
FILLED: "FILLED";
|
|
1289
|
-
CANCELLED: "CANCELLED";
|
|
1290
|
-
REJECTED: "REJECTED";
|
|
1291
|
-
}>;
|
|
1292
|
-
error: z.ZodOptional<z.ZodString>;
|
|
1293
|
-
createdAt: z.ZodString;
|
|
1294
|
-
updatedAt: z.ZodString;
|
|
1295
|
-
type: z.ZodLiteral<"MARKET">;
|
|
1296
|
-
symbol: z.ZodString;
|
|
1297
|
-
side: z.ZodEnum<{
|
|
1298
|
-
BUY: "BUY";
|
|
1299
|
-
SELL: "SELL";
|
|
1300
|
-
}>;
|
|
1301
|
-
reduceOnly: z.ZodBoolean;
|
|
1302
|
-
quantity: z.ZodString;
|
|
1303
|
-
price: z.ZodString;
|
|
1304
|
-
filledQuantity: z.ZodString;
|
|
1305
|
-
filledPrice: z.ZodOptional<z.ZodString>;
|
|
1306
|
-
}, z.core.$strip>], "type">>>;
|
|
1307
|
-
intent: z.ZodLiteral<"CLOSE">;
|
|
1308
|
-
orderType: z.ZodLiteral<"MARKET">;
|
|
1309
|
-
position: z.ZodObject<{
|
|
1310
|
-
id: z.ZodUUID;
|
|
1311
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
1312
|
-
}, z.core.$strip>;
|
|
1313
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1314
|
-
id: z.ZodUUID;
|
|
1315
|
-
connector: z.ZodEnum<{
|
|
1316
|
-
hyperliquid: "hyperliquid";
|
|
1317
|
-
binance: "binance";
|
|
1318
|
-
bybit: "bybit";
|
|
1319
|
-
okx: "okx";
|
|
1320
|
-
lighter: "lighter";
|
|
1321
|
-
}>;
|
|
1322
|
-
status: z.ZodEnum<{
|
|
1323
|
-
CANCELLED: "CANCELLED";
|
|
1324
|
-
IDLE: "IDLE";
|
|
1325
|
-
ACTIVE: "ACTIVE";
|
|
1326
|
-
COMPLETED: "COMPLETED";
|
|
1327
|
-
FAILED: "FAILED";
|
|
1328
|
-
}>;
|
|
1329
|
-
error: z.ZodOptional<z.ZodString>;
|
|
1330
|
-
createdAt: z.ZodString;
|
|
1331
|
-
updatedAt: z.ZodString;
|
|
1332
|
-
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1333
|
-
id: z.ZodUUID;
|
|
1334
|
-
connector: z.ZodEnum<{
|
|
1335
|
-
hyperliquid: "hyperliquid";
|
|
1336
|
-
binance: "binance";
|
|
1337
|
-
bybit: "bybit";
|
|
1338
|
-
okx: "okx";
|
|
1339
|
-
lighter: "lighter";
|
|
1340
|
-
}>;
|
|
1341
|
-
status: z.ZodEnum<{
|
|
1342
|
-
PENDING: "PENDING";
|
|
1343
|
-
PARTIAL: "PARTIAL";
|
|
1344
|
-
FILLED: "FILLED";
|
|
1345
|
-
CANCELLED: "CANCELLED";
|
|
1346
|
-
REJECTED: "REJECTED";
|
|
1347
|
-
}>;
|
|
1348
|
-
error: z.ZodOptional<z.ZodString>;
|
|
1349
|
-
createdAt: z.ZodString;
|
|
1350
|
-
updatedAt: z.ZodString;
|
|
1351
|
-
type: z.ZodLiteral<"MARKET">;
|
|
1352
|
-
symbol: z.ZodString;
|
|
1353
|
-
side: z.ZodEnum<{
|
|
1354
|
-
BUY: "BUY";
|
|
1355
|
-
SELL: "SELL";
|
|
1356
|
-
}>;
|
|
1357
|
-
reduceOnly: z.ZodBoolean;
|
|
1358
|
-
quantity: z.ZodString;
|
|
1359
|
-
price: z.ZodString;
|
|
1360
|
-
filledQuantity: z.ZodString;
|
|
1361
|
-
filledPrice: z.ZodOptional<z.ZodString>;
|
|
1362
|
-
}, z.core.$strip>], "type">>>;
|
|
1363
|
-
intent: z.ZodLiteral<"REVERSE">;
|
|
1364
|
-
orderType: z.ZodLiteral<"MARKET">;
|
|
1365
|
-
position: z.ZodObject<{
|
|
1366
|
-
id: z.ZodUUID;
|
|
1367
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
1368
|
-
}, z.core.$strip>;
|
|
1369
|
-
}, z.core.$strip>], "intent">], "orderType">>;
|
|
1370
|
-
}, z.core.$strip>;
|
|
1098
|
+
export declare const CreateTradeCloseAllResponse: z.ZodObject<{}, z.core.$strip>;
|
|
1371
1099
|
export type CreateTradeCloseAllResponse = z.output<typeof CreateTradeCloseAllResponse>;
|
package/dist/trade/responses.js
CHANGED
|
@@ -5,6 +5,6 @@ const CreateTradeOpenResponse = z.object({ execution: Execution });
|
|
|
5
5
|
const CreateTradeAdjustResponse = z.object({ execution: Execution });
|
|
6
6
|
const CreateTradeCloseResponse = z.object({ execution: Execution });
|
|
7
7
|
const CreateTradeReverseResponse = z.object({ execution: Execution });
|
|
8
|
-
const CreateTradeCloseAllResponse = z.object({
|
|
8
|
+
const CreateTradeCloseAllResponse = z.object({});
|
|
9
9
|
|
|
10
10
|
export { CreateTradeAdjustResponse, CreateTradeCloseAllResponse, CreateTradeCloseResponse, CreateTradeOpenResponse, CreateTradeReverseResponse };
|