@privy-io/api-types 0.6.1 → 0.8.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 +72 -0
- package/client.d.mts +53 -29
- package/client.d.mts.map +1 -1
- package/client.d.ts +53 -29
- package/client.d.ts.map +1 -1
- package/client.js +32 -7
- package/client.js.map +1 -1
- package/client.mjs +34 -9
- package/client.mjs.map +1 -1
- package/package.json +12 -1
- package/resources/accounts.d.mts +146 -4
- package/resources/accounts.d.mts.map +1 -1
- package/resources/accounts.d.ts +146 -4
- package/resources/accounts.d.ts.map +1 -1
- package/resources/accounts.js.map +1 -1
- package/resources/accounts.mjs.map +1 -1
- package/resources/aggregations.d.mts +18 -392
- package/resources/aggregations.d.mts.map +1 -1
- package/resources/aggregations.d.ts +18 -392
- package/resources/aggregations.d.ts.map +1 -1
- package/resources/aggregations.js.map +1 -1
- package/resources/aggregations.mjs.map +1 -1
- package/resources/apps.d.mts +197 -70
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +197 -70
- package/resources/apps.d.ts.map +1 -1
- package/resources/apps.js.map +1 -1
- package/resources/apps.mjs.map +1 -1
- package/resources/client-auth.d.mts +975 -463
- package/resources/client-auth.d.mts.map +1 -1
- package/resources/client-auth.d.ts +975 -463
- package/resources/client-auth.d.ts.map +1 -1
- package/resources/client-auth.js.map +1 -1
- package/resources/client-auth.mjs.map +1 -1
- package/resources/cross-app.d.mts +14 -13
- package/resources/cross-app.d.mts.map +1 -1
- package/resources/cross-app.d.ts +14 -13
- package/resources/cross-app.d.ts.map +1 -1
- package/resources/embedded-wallets.d.mts +165 -81
- package/resources/embedded-wallets.d.mts.map +1 -1
- package/resources/embedded-wallets.d.ts +165 -81
- package/resources/embedded-wallets.d.ts.map +1 -1
- package/resources/embedded-wallets.js.map +1 -1
- package/resources/embedded-wallets.mjs.map +1 -1
- package/resources/funding.d.mts +150 -64
- package/resources/funding.d.mts.map +1 -1
- package/resources/funding.d.ts +150 -64
- package/resources/funding.d.ts.map +1 -1
- package/resources/funding.js.map +1 -1
- package/resources/funding.mjs.map +1 -1
- package/resources/index.d.mts +18 -14
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +18 -14
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +6 -2
- package/resources/index.mjs.map +1 -1
- package/resources/intents.d.mts +446 -31
- package/resources/intents.d.mts.map +1 -1
- package/resources/intents.d.ts +446 -31
- package/resources/intents.d.ts.map +1 -1
- package/resources/intents.js.map +1 -1
- package/resources/intents.mjs.map +1 -1
- package/resources/key-quorums.d.mts +108 -17
- package/resources/key-quorums.d.mts.map +1 -1
- package/resources/key-quorums.d.ts +108 -17
- package/resources/key-quorums.d.ts.map +1 -1
- package/resources/key-quorums.js +26 -9
- package/resources/key-quorums.js.map +1 -1
- package/resources/key-quorums.mjs +26 -9
- package/resources/key-quorums.mjs.map +1 -1
- package/resources/kraken-embed.d.mts +62 -0
- package/resources/kraken-embed.d.mts.map +1 -0
- package/resources/kraken-embed.d.ts +62 -0
- package/resources/kraken-embed.d.ts.map +1 -0
- package/resources/kraken-embed.js +9 -0
- package/resources/kraken-embed.js.map +1 -0
- package/resources/kraken-embed.mjs +5 -0
- package/resources/kraken-embed.mjs.map +1 -0
- package/resources/policies.d.mts +342 -926
- package/resources/policies.d.mts.map +1 -1
- package/resources/policies.d.ts +342 -926
- package/resources/policies.d.ts.map +1 -1
- package/resources/policies.js +51 -41
- package/resources/policies.js.map +1 -1
- package/resources/policies.mjs +51 -41
- package/resources/policies.mjs.map +1 -1
- package/resources/shared.d.mts +59 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +59 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +9 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +5 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/swaps.d.mts +108 -0
- package/resources/swaps.d.mts.map +1 -0
- package/resources/swaps.d.ts +108 -0
- package/resources/swaps.d.ts.map +1 -0
- package/resources/swaps.js +9 -0
- package/resources/swaps.js.map +1 -0
- package/resources/swaps.mjs +5 -0
- package/resources/swaps.mjs.map +1 -0
- package/resources/transactions.d.mts +158 -93
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +158 -93
- package/resources/transactions.d.ts.map +1 -1
- package/resources/transactions.js +3 -0
- package/resources/transactions.js.map +1 -1
- package/resources/transactions.mjs +3 -0
- package/resources/transactions.mjs.map +1 -1
- package/resources/users.d.mts +64 -94
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +64 -94
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js +3 -0
- package/resources/users.js.map +1 -1
- package/resources/users.mjs +3 -0
- package/resources/users.mjs.map +1 -1
- package/resources/wallet-actions.d.mts +187 -0
- package/resources/wallet-actions.d.mts.map +1 -0
- package/resources/wallet-actions.d.ts +187 -0
- package/resources/wallet-actions.d.ts.map +1 -0
- package/resources/wallet-actions.js +9 -0
- package/resources/wallet-actions.js.map +1 -0
- package/resources/wallet-actions.mjs +5 -0
- package/resources/wallet-actions.mjs.map +1 -0
- package/resources/wallets/balance.d.mts +7 -4
- package/resources/wallets/balance.d.mts.map +1 -1
- package/resources/wallets/balance.d.ts +7 -4
- package/resources/wallets/balance.d.ts.map +1 -1
- package/resources/wallets/balance.js +3 -0
- package/resources/wallets/balance.js.map +1 -1
- package/resources/wallets/balance.mjs +3 -0
- package/resources/wallets/balance.mjs.map +1 -1
- package/resources/wallets/index.d.mts +1 -1
- package/resources/wallets/index.d.mts.map +1 -1
- package/resources/wallets/index.d.ts +1 -1
- package/resources/wallets/index.d.ts.map +1 -1
- package/resources/wallets/index.js.map +1 -1
- package/resources/wallets/index.mjs.map +1 -1
- package/resources/wallets/transactions.d.mts +10 -6
- package/resources/wallets/transactions.d.mts.map +1 -1
- package/resources/wallets/transactions.d.ts +10 -6
- package/resources/wallets/transactions.d.ts.map +1 -1
- package/resources/wallets/transactions.js +3 -0
- package/resources/wallets/transactions.js.map +1 -1
- package/resources/wallets/transactions.mjs +3 -0
- package/resources/wallets/transactions.mjs.map +1 -1
- package/resources/wallets/wallets.d.mts +2399 -936
- package/resources/wallets/wallets.d.mts.map +1 -1
- package/resources/wallets/wallets.d.ts +2399 -936
- package/resources/wallets/wallets.d.ts.map +1 -1
- package/resources/wallets/wallets.js +28 -10
- package/resources/wallets/wallets.js.map +1 -1
- package/resources/wallets/wallets.mjs +28 -10
- package/resources/wallets/wallets.mjs.map +1 -1
- package/resources/webhooks.d.mts +780 -339
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +780 -339
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/resources/yield.d.mts +50 -9
- package/resources/yield.d.mts.map +1 -1
- package/resources/yield.d.ts +50 -9
- package/resources/yield.d.ts.map +1 -1
- package/src/client.ts +884 -99
- package/src/resources/accounts.ts +179 -3
- package/src/resources/aggregations.ts +18 -702
- package/src/resources/apps.ts +250 -85
- package/src/resources/client-auth.ts +1453 -786
- package/src/resources/cross-app.ts +19 -15
- package/src/resources/embedded-wallets.ts +219 -123
- package/src/resources/funding.ts +263 -173
- package/src/resources/index.ts +444 -61
- package/src/resources/intents.ts +575 -37
- package/src/resources/key-quorums.ts +137 -21
- package/src/resources/kraken-embed.ts +85 -0
- package/src/resources/policies.ts +582 -1550
- package/src/resources/shared.ts +79 -0
- package/src/resources/swaps.ts +136 -0
- package/src/resources/transactions.ts +188 -91
- package/src/resources/users.ts +82 -132
- package/src/resources/wallet-actions.ts +251 -0
- package/src/resources/wallets/balance.ts +9 -2
- package/src/resources/wallets/index.ts +146 -16
- package/src/resources/wallets/transactions.ts +12 -4
- package/src/resources/wallets/wallets.ts +2922 -974
- package/src/resources/webhooks.ts +970 -454
- package/src/resources/yield.ts +68 -10
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as SharedAPI from './shared';
|
|
4
5
|
import { APIPromise } from '../core/api-promise';
|
|
5
6
|
import { buildHeaders } from '../internal/headers';
|
|
6
7
|
import { RequestOptions } from '../internal/request-options';
|
|
7
8
|
import { path } from '../internal/utils/path';
|
|
8
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Operations related to key quorums
|
|
12
|
+
*/
|
|
9
13
|
export class KeyQuorums extends APIResource {
|
|
10
14
|
/**
|
|
11
15
|
* Create a new key quorum.
|
|
12
16
|
*
|
|
13
17
|
* @example
|
|
14
18
|
* ```ts
|
|
15
|
-
* const keyQuorum = await client.keyQuorums.create(
|
|
19
|
+
* const keyQuorum = await client.keyQuorums.create({
|
|
20
|
+
* authorization_threshold: 1,
|
|
21
|
+
* display_name: 'Prod key quorum',
|
|
22
|
+
* public_keys: [
|
|
23
|
+
* 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEx4aoeD72yykviK+f/ckqE2CItVIG\n1rCnvC3/XZ1HgpOcMEMialRmTrqIK4oZlYd1RfxU3za/C9yjhboIuoPD3g==',
|
|
24
|
+
* 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAErzZtQr/bMIh3Y8f9ZqseB9i/AfjQ\nhu+agbNqXcJy/TfoNqvc/Y3Mh7gIZ8ZLXQEykycx4mYSpqrxp1lBKqsZDQ==',
|
|
25
|
+
* ],
|
|
26
|
+
* });
|
|
16
27
|
* ```
|
|
17
28
|
*/
|
|
18
29
|
create(body: KeyQuorumCreateParams, options?: RequestOptions): APIPromise<KeyQuorum> {
|
|
@@ -24,17 +35,20 @@ export class KeyQuorums extends APIResource {
|
|
|
24
35
|
*
|
|
25
36
|
* @example
|
|
26
37
|
* ```ts
|
|
27
|
-
* const
|
|
28
|
-
* '
|
|
38
|
+
* const successResponse = await client.keyQuorums._delete(
|
|
39
|
+
* 'string',
|
|
29
40
|
* );
|
|
30
41
|
* ```
|
|
31
42
|
*/
|
|
32
43
|
_delete(
|
|
33
|
-
keyQuorumID:
|
|
44
|
+
keyQuorumID: SharedAPI.KeyQuorumID,
|
|
34
45
|
params: KeyQuorumDeleteParams | null | undefined = {},
|
|
35
46
|
options?: RequestOptions,
|
|
36
|
-
): APIPromise<
|
|
37
|
-
const {
|
|
47
|
+
): APIPromise<SharedAPI.SuccessResponse> {
|
|
48
|
+
const {
|
|
49
|
+
'privy-authorization-signature': privyAuthorizationSignature,
|
|
50
|
+
'privy-request-expiry': privyRequestExpiry,
|
|
51
|
+
} = params ?? {};
|
|
38
52
|
return this._client.delete(path`/v1/key_quorums/${keyQuorumID}`, {
|
|
39
53
|
...options,
|
|
40
54
|
headers: buildHeaders([
|
|
@@ -42,6 +56,7 @@ export class KeyQuorums extends APIResource {
|
|
|
42
56
|
...(privyAuthorizationSignature != null ?
|
|
43
57
|
{ 'privy-authorization-signature': privyAuthorizationSignature }
|
|
44
58
|
: undefined),
|
|
59
|
+
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
|
|
45
60
|
},
|
|
46
61
|
options?.headers,
|
|
47
62
|
]),
|
|
@@ -54,16 +69,27 @@ export class KeyQuorums extends APIResource {
|
|
|
54
69
|
* @example
|
|
55
70
|
* ```ts
|
|
56
71
|
* const keyQuorum = await client.keyQuorums._update(
|
|
57
|
-
* '
|
|
72
|
+
* 'string',
|
|
73
|
+
* {
|
|
74
|
+
* authorization_threshold: 1,
|
|
75
|
+
* display_name: 'Prod key quorum',
|
|
76
|
+
* public_keys: [
|
|
77
|
+
* 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEx4aoeD72yykviK+f/ckqE2CItVIG\n1rCnvC3/XZ1HgpOcMEMialRmTrqIK4oZlYd1RfxU3za/C9yjhboIuoPD3g==',
|
|
78
|
+
* ],
|
|
79
|
+
* },
|
|
58
80
|
* );
|
|
59
81
|
* ```
|
|
60
82
|
*/
|
|
61
83
|
_update(
|
|
62
|
-
keyQuorumID:
|
|
84
|
+
keyQuorumID: SharedAPI.KeyQuorumID,
|
|
63
85
|
params: KeyQuorumUpdateParams,
|
|
64
86
|
options?: RequestOptions,
|
|
65
87
|
): APIPromise<KeyQuorum> {
|
|
66
|
-
const {
|
|
88
|
+
const {
|
|
89
|
+
'privy-authorization-signature': privyAuthorizationSignature,
|
|
90
|
+
'privy-request-expiry': privyRequestExpiry,
|
|
91
|
+
...body
|
|
92
|
+
} = params;
|
|
67
93
|
return this._client.patch(path`/v1/key_quorums/${keyQuorumID}`, {
|
|
68
94
|
body,
|
|
69
95
|
...options,
|
|
@@ -72,6 +98,7 @@ export class KeyQuorums extends APIResource {
|
|
|
72
98
|
...(privyAuthorizationSignature != null ?
|
|
73
99
|
{ 'privy-authorization-signature': privyAuthorizationSignature }
|
|
74
100
|
: undefined),
|
|
101
|
+
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
|
|
75
102
|
},
|
|
76
103
|
options?.headers,
|
|
77
104
|
]),
|
|
@@ -83,12 +110,10 @@ export class KeyQuorums extends APIResource {
|
|
|
83
110
|
*
|
|
84
111
|
* @example
|
|
85
112
|
* ```ts
|
|
86
|
-
* const keyQuorum = await client.keyQuorums.get(
|
|
87
|
-
* 'key_quorum_id',
|
|
88
|
-
* );
|
|
113
|
+
* const keyQuorum = await client.keyQuorums.get('string');
|
|
89
114
|
* ```
|
|
90
115
|
*/
|
|
91
|
-
get(keyQuorumID:
|
|
116
|
+
get(keyQuorumID: SharedAPI.KeyQuorumID, options?: RequestOptions): APIPromise<KeyQuorum> {
|
|
92
117
|
return this._client.get(path`/v1/key_quorums/${keyQuorumID}`, options);
|
|
93
118
|
}
|
|
94
119
|
}
|
|
@@ -101,16 +126,16 @@ export interface KeyQuorum {
|
|
|
101
126
|
|
|
102
127
|
authorization_keys: Array<KeyQuorum.AuthorizationKey>;
|
|
103
128
|
|
|
104
|
-
authorization_threshold
|
|
129
|
+
authorization_threshold: number | null;
|
|
105
130
|
|
|
106
|
-
display_name
|
|
131
|
+
display_name: string | null;
|
|
132
|
+
|
|
133
|
+
user_ids: Array<string> | null;
|
|
107
134
|
|
|
108
135
|
/**
|
|
109
136
|
* List of nested key quorum IDs that are members of this key quorum.
|
|
110
137
|
*/
|
|
111
138
|
key_quorum_ids?: Array<string>;
|
|
112
|
-
|
|
113
|
-
user_ids?: Array<string>;
|
|
114
139
|
}
|
|
115
140
|
|
|
116
141
|
export namespace KeyQuorum {
|
|
@@ -121,11 +146,88 @@ export namespace KeyQuorum {
|
|
|
121
146
|
}
|
|
122
147
|
}
|
|
123
148
|
|
|
124
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Request input for creating a key quorum.
|
|
151
|
+
*/
|
|
152
|
+
export interface KeyQuorumCreateRequestBody {
|
|
153
|
+
/**
|
|
154
|
+
* The number of keys that must sign for an action to be valid. Must be less than
|
|
155
|
+
* or equal to total number of key quorum members.
|
|
156
|
+
*/
|
|
157
|
+
authorization_threshold?: number;
|
|
158
|
+
|
|
159
|
+
display_name?: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* List of key quorum IDs that should be members of this key quorum. Key quorums
|
|
163
|
+
* can only be nested 1 level deep.
|
|
164
|
+
*/
|
|
165
|
+
key_quorum_ids?: Array<string>;
|
|
166
|
+
|
|
125
167
|
/**
|
|
126
|
-
*
|
|
168
|
+
* List of P-256 public keys of the keys that should be authorized to sign on the
|
|
169
|
+
* key quorum, in base64-encoded DER format.
|
|
170
|
+
*/
|
|
171
|
+
public_keys?: Array<string>;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* List of user IDs of the users that should be authorized to sign on the key
|
|
175
|
+
* quorum.
|
|
127
176
|
*/
|
|
128
|
-
|
|
177
|
+
user_ids?: Array<string>;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Request input for updating an existing key quorum.
|
|
182
|
+
*/
|
|
183
|
+
export interface KeyQuorumUpdateRequestBody {
|
|
184
|
+
/**
|
|
185
|
+
* The number of keys that must sign for an action to be valid. Must be less than
|
|
186
|
+
* or equal to total number of key quorum members.
|
|
187
|
+
*/
|
|
188
|
+
authorization_threshold?: number;
|
|
189
|
+
|
|
190
|
+
display_name?: string;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* List of key quorum IDs that should be members of this key quorum. Key quorums
|
|
194
|
+
* can only be nested 1 level deep.
|
|
195
|
+
*/
|
|
196
|
+
key_quorum_ids?: Array<string>;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* List of P-256 public keys of the keys that should be authorized to sign on the
|
|
200
|
+
* key quorum, in base64-encoded DER format.
|
|
201
|
+
*/
|
|
202
|
+
public_keys?: Array<string>;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* List of user IDs of the users that should be authorized to sign on the key
|
|
206
|
+
* quorum.
|
|
207
|
+
*/
|
|
208
|
+
user_ids?: Array<string>;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Headers required to authorize modifications to key quorums.
|
|
213
|
+
*/
|
|
214
|
+
export interface KeyQuorumAuthorizationHeaders {
|
|
215
|
+
/**
|
|
216
|
+
* ID of your Privy app.
|
|
217
|
+
*/
|
|
218
|
+
'privy-app-id': string;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Request authorization signature. If multiple signatures are required, they
|
|
222
|
+
* should be comma separated.
|
|
223
|
+
*/
|
|
224
|
+
'privy-authorization-signature'?: string;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Request expiry. Value is a Unix timestamp in milliseconds representing the
|
|
228
|
+
* deadline by which the request must be processed.
|
|
229
|
+
*/
|
|
230
|
+
'privy-request-expiry'?: string;
|
|
129
231
|
}
|
|
130
232
|
|
|
131
233
|
export interface KeyQuorumCreateParams {
|
|
@@ -162,6 +264,12 @@ export interface KeyQuorumDeleteParams {
|
|
|
162
264
|
* should be comma separated.
|
|
163
265
|
*/
|
|
164
266
|
'privy-authorization-signature'?: string;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Request expiry. Value is a Unix timestamp in milliseconds representing the
|
|
270
|
+
* deadline by which the request must be processed.
|
|
271
|
+
*/
|
|
272
|
+
'privy-request-expiry'?: string;
|
|
165
273
|
}
|
|
166
274
|
|
|
167
275
|
export interface KeyQuorumUpdateParams {
|
|
@@ -199,12 +307,20 @@ export interface KeyQuorumUpdateParams {
|
|
|
199
307
|
* required, they should be comma separated.
|
|
200
308
|
*/
|
|
201
309
|
'privy-authorization-signature'?: string;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Header param: Request expiry. Value is a Unix timestamp in milliseconds
|
|
313
|
+
* representing the deadline by which the request must be processed.
|
|
314
|
+
*/
|
|
315
|
+
'privy-request-expiry'?: string;
|
|
202
316
|
}
|
|
203
317
|
|
|
204
318
|
export declare namespace KeyQuorums {
|
|
205
319
|
export {
|
|
206
320
|
type KeyQuorum as KeyQuorum,
|
|
207
|
-
type
|
|
321
|
+
type KeyQuorumCreateRequestBody as KeyQuorumCreateRequestBody,
|
|
322
|
+
type KeyQuorumUpdateRequestBody as KeyQuorumUpdateRequestBody,
|
|
323
|
+
type KeyQuorumAuthorizationHeaders as KeyQuorumAuthorizationHeaders,
|
|
208
324
|
type KeyQuorumCreateParams as KeyQuorumCreateParams,
|
|
209
325
|
type KeyQuorumDeleteParams as KeyQuorumDeleteParams,
|
|
210
326
|
type KeyQuorumUpdateParams as KeyQuorumUpdateParams,
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as KrakenEmbedAPI from './kraken-embed';
|
|
5
|
+
|
|
6
|
+
export class KrakenEmbed extends APIResource {}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Query parameters for getting a portfolio summary.
|
|
10
|
+
*/
|
|
11
|
+
export interface KrakenEmbedGetPortfolioSummaryQueryParams {
|
|
12
|
+
'include[current_day_pnl]'?: 'true' | 'false';
|
|
13
|
+
|
|
14
|
+
quote?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Current day profit and loss for a portfolio, calculated from the most recent
|
|
19
|
+
* available balance.
|
|
20
|
+
*/
|
|
21
|
+
export interface KrakenEmbedCurrentDayPnl {
|
|
22
|
+
pnl: string;
|
|
23
|
+
|
|
24
|
+
since: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* High-level summary of a user's portfolio including total value, available
|
|
29
|
+
* balance, and unrealized P&L.
|
|
30
|
+
*/
|
|
31
|
+
export interface KrakenEmbedGetPortfolioSummaryResponse {
|
|
32
|
+
data: KrakenEmbedGetPortfolioSummaryResponse.Data;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export namespace KrakenEmbedGetPortfolioSummaryResponse {
|
|
36
|
+
export interface Data {
|
|
37
|
+
result: Data.Result | null;
|
|
38
|
+
|
|
39
|
+
error?: Array<unknown>;
|
|
40
|
+
|
|
41
|
+
errors?: Array<unknown>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export namespace Data {
|
|
45
|
+
export interface Result {
|
|
46
|
+
available_balance: string;
|
|
47
|
+
|
|
48
|
+
currency: string;
|
|
49
|
+
|
|
50
|
+
open_orders: string;
|
|
51
|
+
|
|
52
|
+
portfolio_value: string;
|
|
53
|
+
|
|
54
|
+
timestamp: string;
|
|
55
|
+
|
|
56
|
+
withheld_value: string;
|
|
57
|
+
|
|
58
|
+
cost_basis?: string | null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Current day profit and loss for a portfolio, calculated from the most recent
|
|
62
|
+
* available balance.
|
|
63
|
+
*/
|
|
64
|
+
current_day_pnl?: Result.CurrentDayPnl;
|
|
65
|
+
|
|
66
|
+
lots_upnl?: string | null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export namespace Result {
|
|
70
|
+
/**
|
|
71
|
+
* Current day profit and loss for a portfolio, calculated from the most recent
|
|
72
|
+
* available balance.
|
|
73
|
+
*/
|
|
74
|
+
export interface CurrentDayPnl extends KrakenEmbedAPI.KrakenEmbedCurrentDayPnl {}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export declare namespace KrakenEmbed {
|
|
80
|
+
export {
|
|
81
|
+
type KrakenEmbedGetPortfolioSummaryQueryParams as KrakenEmbedGetPortfolioSummaryQueryParams,
|
|
82
|
+
type KrakenEmbedCurrentDayPnl as KrakenEmbedCurrentDayPnl,
|
|
83
|
+
type KrakenEmbedGetPortfolioSummaryResponse as KrakenEmbedGetPortfolioSummaryResponse,
|
|
84
|
+
};
|
|
85
|
+
}
|