@pear-protocol/core-sdk 0.0.1 → 0.0.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/dist/info/index.d.ts +15 -11
- package/dist/info/index.js +6 -0
- package/dist/utils.js +3 -0
- package/package.json +3 -3
package/dist/info/index.d.ts
CHANGED
|
@@ -11,38 +11,41 @@ declare class Info {
|
|
|
11
11
|
id: string;
|
|
12
12
|
alias: string;
|
|
13
13
|
connector: "hyperliquid" | "binanceusdm" | "bybit" | "okx";
|
|
14
|
+
exchangeIdentifier: string;
|
|
14
15
|
createdAt: string;
|
|
15
16
|
updatedAt: string;
|
|
16
|
-
metadata?:
|
|
17
|
-
|
|
17
|
+
metadata?: {
|
|
18
|
+
agentWalletAddress: string;
|
|
18
19
|
isSubaccount: boolean;
|
|
19
|
-
} |
|
|
20
|
+
} | undefined;
|
|
20
21
|
}[];
|
|
21
22
|
}>;
|
|
22
|
-
create: (body: HttpTypes.
|
|
23
|
+
create: (body: HttpTypes.CreateTradeAccountInput, headers?: ClientHeaders) => Promise<{
|
|
23
24
|
account: {
|
|
24
25
|
id: string;
|
|
25
26
|
alias: string;
|
|
26
27
|
connector: "hyperliquid" | "binanceusdm" | "bybit" | "okx";
|
|
28
|
+
exchangeIdentifier: string;
|
|
27
29
|
createdAt: string;
|
|
28
30
|
updatedAt: string;
|
|
29
|
-
metadata?:
|
|
30
|
-
|
|
31
|
+
metadata?: {
|
|
32
|
+
agentWalletAddress: string;
|
|
31
33
|
isSubaccount: boolean;
|
|
32
|
-
} |
|
|
34
|
+
} | undefined;
|
|
33
35
|
};
|
|
34
36
|
}>;
|
|
35
|
-
update: (id: string, body: HttpTypes.
|
|
37
|
+
update: (id: string, body: HttpTypes.UpdateTradeAccountInput, headers?: ClientHeaders) => Promise<{
|
|
36
38
|
account: {
|
|
37
39
|
id: string;
|
|
38
40
|
alias: string;
|
|
39
41
|
connector: "hyperliquid" | "binanceusdm" | "bybit" | "okx";
|
|
42
|
+
exchangeIdentifier: string;
|
|
40
43
|
createdAt: string;
|
|
41
44
|
updatedAt: string;
|
|
42
|
-
metadata?:
|
|
43
|
-
|
|
45
|
+
metadata?: {
|
|
46
|
+
agentWalletAddress: string;
|
|
44
47
|
isSubaccount: boolean;
|
|
45
|
-
} |
|
|
48
|
+
} | undefined;
|
|
46
49
|
};
|
|
47
50
|
}>;
|
|
48
51
|
delete: (id: string, headers?: ClientHeaders) => Promise<void>;
|
|
@@ -71,6 +74,7 @@ declare class Info {
|
|
|
71
74
|
api_pass: string;
|
|
72
75
|
};
|
|
73
76
|
}>;
|
|
77
|
+
restore: (id: string, headers?: ClientHeaders) => Promise<void>;
|
|
74
78
|
};
|
|
75
79
|
users: {
|
|
76
80
|
profile: (headers?: ClientHeaders) => Promise<{
|
package/dist/info/index.js
CHANGED
package/dist/utils.js
CHANGED
|
@@ -29,6 +29,9 @@ async function normalizeResponseData(resp, reqHeaders) {
|
|
|
29
29
|
const jsonError = await resp.json().catch(() => ({}));
|
|
30
30
|
throw new FetchError(jsonError.message ?? resp.statusText, resp.statusText, resp.status);
|
|
31
31
|
}
|
|
32
|
+
if (resp.status === 204 || resp.status === 205) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
32
35
|
const isJsonRequest = reqHeaders.get("accept")?.includes("application/json");
|
|
33
36
|
return isJsonRequest ? await resp.json() : resp;
|
|
34
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pear-protocol/core-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Pear Protocol Core SDK",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@pear-protocol/types": "0.0.
|
|
29
|
-
"@pear-protocol/utils": "0.0.
|
|
28
|
+
"@pear-protocol/types": "0.0.2",
|
|
29
|
+
"@pear-protocol/utils": "0.0.2",
|
|
30
30
|
"qs": "^6.14.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|