@pear-protocol/types 0.0.8 → 0.0.10
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.
|
@@ -9,10 +9,14 @@ export type Connector = z.infer<typeof Connector>;
|
|
|
9
9
|
export type HyperliquidCredentialsDTO = {
|
|
10
10
|
signer_key: `0x${string}`;
|
|
11
11
|
};
|
|
12
|
-
export type
|
|
12
|
+
export type BinanceApiKeyPair = {
|
|
13
13
|
api_key: string;
|
|
14
14
|
api_secret: string;
|
|
15
15
|
};
|
|
16
|
+
export type BinanceCredentialsDTO = {
|
|
17
|
+
read: BinanceApiKeyPair;
|
|
18
|
+
write: BinanceApiKeyPair;
|
|
19
|
+
};
|
|
16
20
|
export type BybitCredentialsDTO = {
|
|
17
21
|
api_key: string;
|
|
18
22
|
api_secret: string;
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { Connector } from '../connector';
|
|
3
3
|
import { InstrumentPrecision } from '../instrument-precision';
|
|
4
4
|
|
|
5
|
-
const InstrumentId = z.string().trim().min(1, "Instrument ID is required").max(64, "Instrument ID must be at most 64 characters").regex(/^[
|
|
5
|
+
const InstrumentId = z.string().trim().min(1, "Instrument ID is required").max(64, "Instrument ID must be at most 64 characters").regex(/^[^\s][^\s]*$/, "Instrument ID contains invalid characters");
|
|
6
6
|
const InstrumentType = z.enum(["spot", "perp", "hip3"]);
|
|
7
7
|
const Instrument = z.object({
|
|
8
8
|
/**
|
|
@@ -12,12 +12,15 @@ declare const CreateHyperliquidMetadata: z.ZodObject<{
|
|
|
12
12
|
agentWalletAddress: z.ZodString;
|
|
13
13
|
isSubaccount: z.ZodBoolean;
|
|
14
14
|
}, z.core.$strip>;
|
|
15
|
-
/**
|
|
16
|
-
* Binance USDM connector credentials
|
|
17
|
-
*/
|
|
18
15
|
declare const CreateBinanceCredentials: z.ZodObject<{
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
read: z.ZodObject<{
|
|
17
|
+
api_key: z.ZodString;
|
|
18
|
+
api_secret: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
write: z.ZodObject<{
|
|
21
|
+
api_key: z.ZodString;
|
|
22
|
+
api_secret: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
21
24
|
}, z.core.$strip>;
|
|
22
25
|
/**
|
|
23
26
|
* Bybit connector credentials
|
|
@@ -52,8 +55,14 @@ export declare const CreateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
52
55
|
connector: z.ZodLiteral<"binance">;
|
|
53
56
|
alias: z.ZodString;
|
|
54
57
|
credentials: z.ZodObject<{
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
read: z.ZodObject<{
|
|
59
|
+
api_key: z.ZodString;
|
|
60
|
+
api_secret: z.ZodString;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
write: z.ZodObject<{
|
|
63
|
+
api_key: z.ZodString;
|
|
64
|
+
api_secret: z.ZodString;
|
|
65
|
+
}, z.core.$strip>;
|
|
57
66
|
}, z.core.$strip>;
|
|
58
67
|
metadata: z.ZodPipe<z.ZodVoid, z.ZodTransform<undefined, void>>;
|
|
59
68
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -91,8 +100,14 @@ export declare const UpdateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
91
100
|
connector: z.ZodLiteral<"binance">;
|
|
92
101
|
alias: z.ZodOptional<z.ZodString>;
|
|
93
102
|
credentials: z.ZodOptional<z.ZodObject<{
|
|
94
|
-
|
|
95
|
-
|
|
103
|
+
read: z.ZodObject<{
|
|
104
|
+
api_key: z.ZodString;
|
|
105
|
+
api_secret: z.ZodString;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
write: z.ZodObject<{
|
|
108
|
+
api_key: z.ZodString;
|
|
109
|
+
api_secret: z.ZodString;
|
|
110
|
+
}, z.core.$strip>;
|
|
96
111
|
}, z.core.$strip>>;
|
|
97
112
|
metadata: z.ZodPipe<z.ZodVoid, z.ZodTransform<undefined, void>>;
|
|
98
113
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -7,10 +7,14 @@ const CreateHyperliquidMetadata = z.object({
|
|
|
7
7
|
agentWalletAddress: z.string().regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address"),
|
|
8
8
|
isSubaccount: z.boolean()
|
|
9
9
|
});
|
|
10
|
-
const
|
|
10
|
+
const BinanceApiKeyPair = z.object({
|
|
11
11
|
api_key: z.string().min(1, "API key is required"),
|
|
12
12
|
api_secret: z.string().min(1, "API secret is required")
|
|
13
13
|
});
|
|
14
|
+
const CreateBinanceCredentials = z.object({
|
|
15
|
+
read: BinanceApiKeyPair,
|
|
16
|
+
write: BinanceApiKeyPair
|
|
17
|
+
});
|
|
14
18
|
const CreateBybitCredentials = z.object({
|
|
15
19
|
api_key: z.string().min(1, "API key is required"),
|
|
16
20
|
api_secret: z.string().min(1, "API secret is required")
|
|
@@ -49,8 +49,14 @@ export declare const ExchangeCredentialsResponse: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
49
49
|
}, z.core.$strip>, z.ZodObject<{
|
|
50
50
|
connector: z.ZodLiteral<"binance">;
|
|
51
51
|
credentials: z.ZodObject<{
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
read: z.ZodObject<{
|
|
53
|
+
api_key: z.ZodString;
|
|
54
|
+
api_secret: z.ZodString;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
write: z.ZodObject<{
|
|
57
|
+
api_key: z.ZodString;
|
|
58
|
+
api_secret: z.ZodString;
|
|
59
|
+
}, z.core.$strip>;
|
|
54
60
|
}, z.core.$strip>;
|
|
55
61
|
}, z.core.$strip>, z.ZodObject<{
|
|
56
62
|
connector: z.ZodLiteral<"bybit">;
|
|
@@ -9,11 +9,15 @@ const HyperliquidCredentialsResponse = z.object({
|
|
|
9
9
|
signer_key: z.string()
|
|
10
10
|
})
|
|
11
11
|
});
|
|
12
|
+
const BinanceApiKeyPairResponse = z.object({
|
|
13
|
+
api_key: z.string(),
|
|
14
|
+
api_secret: z.string()
|
|
15
|
+
});
|
|
12
16
|
const BinanceCredentialsResponse = z.object({
|
|
13
17
|
connector: z.literal("binance"),
|
|
14
18
|
credentials: z.object({
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
read: BinanceApiKeyPairResponse,
|
|
20
|
+
write: BinanceApiKeyPairResponse
|
|
17
21
|
})
|
|
18
22
|
});
|
|
19
23
|
const BybitCredentialsResponse = z.object({
|