parsec-api 0.8.1 → 0.11.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 +57 -0
- package/README.md +0 -117
- package/client.d.mts +21 -28
- package/client.d.mts.map +1 -1
- package/client.d.ts +21 -28
- package/client.d.ts.map +1 -1
- package/client.js +21 -41
- package/client.js.map +1 -1
- package/client.mjs +21 -41
- package/client.mjs.map +1 -1
- package/core/error.d.mts +0 -12
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +0 -12
- package/core/error.d.ts.map +1 -1
- package/core/error.js +0 -24
- package/core/error.js.map +1 -1
- package/core/error.mjs +0 -24
- package/core/error.mjs.map +1 -1
- package/index.d.mts +0 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +0 -1
- package/index.d.ts.map +1 -1
- package/index.js +1 -3
- package/index.js.map +1 -1
- package/index.mjs +0 -1
- package/index.mjs.map +1 -1
- package/internal/tslib.js +21 -21
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +2 -3
- package/resources/account.d.mts +72 -27
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +72 -27
- package/resources/account.d.ts.map +1 -1
- package/resources/account.js +17 -15
- package/resources/account.js.map +1 -1
- package/resources/account.mjs +17 -15
- package/resources/account.mjs.map +1 -1
- package/resources/builder/builder.d.mts +40 -0
- package/resources/builder/builder.d.mts.map +1 -0
- package/resources/builder/builder.d.ts +40 -0
- package/resources/builder/builder.d.ts.map +1 -0
- package/resources/builder/builder.js +32 -0
- package/resources/builder/builder.js.map +1 -0
- package/resources/builder/builder.mjs +27 -0
- package/resources/builder/builder.mjs.map +1 -0
- package/resources/builder/escrow.d.mts +49 -0
- package/resources/builder/escrow.d.mts.map +1 -0
- package/resources/builder/escrow.d.ts +49 -0
- package/resources/builder/escrow.d.ts.map +1 -0
- package/resources/builder/escrow.js +17 -0
- package/resources/builder/escrow.js.map +1 -0
- package/resources/builder/escrow.mjs +13 -0
- package/resources/builder/escrow.mjs.map +1 -0
- package/resources/builder/index.d.mts +5 -0
- package/resources/builder/index.d.mts.map +1 -0
- package/resources/builder/index.d.ts +5 -0
- package/resources/builder/index.d.ts.map +1 -0
- package/resources/builder/index.js +13 -0
- package/resources/builder/index.js.map +1 -0
- package/resources/builder/index.mjs +6 -0
- package/resources/builder/index.mjs.map +1 -0
- package/resources/builder/onboard.d.mts +163 -0
- package/resources/builder/onboard.d.mts.map +1 -0
- package/resources/builder/onboard.d.ts +163 -0
- package/resources/builder/onboard.d.ts.map +1 -0
- package/resources/builder/onboard.js +16 -0
- package/resources/builder/onboard.js.map +1 -0
- package/resources/builder/onboard.mjs +12 -0
- package/resources/builder/onboard.mjs.map +1 -0
- package/resources/builder/users.d.mts +469 -0
- package/resources/builder/users.d.mts.map +1 -0
- package/resources/builder/users.d.ts +469 -0
- package/resources/builder/users.d.ts.map +1 -0
- package/resources/builder/users.js +46 -0
- package/resources/builder/users.js.map +1 -0
- package/resources/builder/users.mjs +42 -0
- package/resources/builder/users.mjs.map +1 -0
- package/resources/builder.d.mts +2 -0
- package/resources/builder.d.mts.map +1 -0
- package/resources/builder.d.ts +2 -0
- package/resources/builder.d.ts.map +1 -0
- package/resources/builder.js +6 -0
- package/resources/builder.js.map +1 -0
- package/resources/builder.mjs +3 -0
- package/resources/builder.mjs.map +1 -0
- package/resources/ctf.d.mts +97 -0
- package/resources/ctf.d.mts.map +1 -0
- package/resources/ctf.d.ts +97 -0
- package/resources/ctf.d.ts.map +1 -0
- package/resources/ctf.js +59 -0
- package/resources/ctf.js.map +1 -0
- package/resources/ctf.mjs +55 -0
- package/resources/ctf.mjs.map +1 -0
- package/resources/events.d.mts +84 -12
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +84 -12
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js +4 -15
- package/resources/events.js.map +1 -1
- package/resources/events.mjs +4 -15
- package/resources/events.mjs.map +1 -1
- package/resources/exchanges.d.mts +2 -1
- package/resources/exchanges.d.mts.map +1 -1
- package/resources/exchanges.d.ts +2 -1
- package/resources/exchanges.d.ts.map +1 -1
- package/resources/fills.d.mts +76 -0
- package/resources/fills.d.mts.map +1 -0
- package/resources/fills.d.ts +76 -0
- package/resources/fills.d.ts.map +1 -0
- package/resources/fills.js +27 -0
- package/resources/fills.js.map +1 -0
- package/resources/fills.mjs +23 -0
- package/resources/fills.mjs.map +1 -0
- package/resources/index.d.mts +8 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +13 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +7 -3
- package/resources/index.mjs.map +1 -1
- package/resources/markets.d.mts +92 -19
- package/resources/markets.d.mts.map +1 -1
- package/resources/markets.d.ts +92 -19
- package/resources/markets.d.ts.map +1 -1
- package/resources/markets.js +1 -30
- package/resources/markets.js.map +1 -1
- package/resources/markets.mjs +1 -29
- package/resources/markets.mjs.map +1 -1
- package/resources/onboard.d.mts +91 -0
- package/resources/onboard.d.mts.map +1 -0
- package/resources/onboard.d.ts +91 -0
- package/resources/onboard.d.ts.map +1 -0
- package/resources/onboard.js +17 -0
- package/resources/onboard.js.map +1 -0
- package/resources/onboard.mjs +13 -0
- package/resources/onboard.mjs.map +1 -0
- package/resources/orderbook.d.mts +21 -11
- package/resources/orderbook.d.mts.map +1 -1
- package/resources/orderbook.d.ts +21 -11
- package/resources/orderbook.d.ts.map +1 -1
- package/resources/orderbook.js +5 -1
- package/resources/orderbook.js.map +1 -1
- package/resources/orderbook.mjs +5 -1
- package/resources/orderbook.mjs.map +1 -1
- package/resources/orders.d.mts +65 -6
- package/resources/orders.d.mts.map +1 -1
- package/resources/orders.d.ts +65 -6
- package/resources/orders.d.ts.map +1 -1
- package/resources/orders.js +48 -8
- package/resources/orders.js.map +1 -1
- package/resources/orders.mjs +48 -8
- package/resources/orders.mjs.map +1 -1
- package/resources/positions.d.mts +9 -3
- package/resources/positions.d.mts.map +1 -1
- package/resources/positions.d.ts +9 -3
- package/resources/positions.d.ts.map +1 -1
- package/resources/positions.js +13 -2
- package/resources/positions.js.map +1 -1
- package/resources/positions.mjs +13 -2
- package/resources/positions.mjs.map +1 -1
- package/resources/{price-history.d.mts → price.d.mts} +19 -13
- package/resources/price.d.mts.map +1 -0
- package/resources/{price-history.d.ts → price.d.ts} +19 -13
- package/resources/price.d.ts.map +1 -0
- package/resources/{price-history.js → price.js} +6 -5
- package/resources/price.js.map +1 -0
- package/resources/{price-history.mjs → price.mjs} +4 -3
- package/resources/price.mjs.map +1 -0
- package/resources/trades.d.mts +44 -2
- package/resources/trades.d.mts.map +1 -1
- package/resources/trades.d.ts +44 -2
- package/resources/trades.d.ts.map +1 -1
- package/resources/trades.js +2 -1
- package/resources/trades.js.map +1 -1
- package/resources/trades.mjs +2 -1
- package/resources/trades.mjs.map +1 -1
- package/resources/wallet.d.mts +177 -0
- package/resources/wallet.d.mts.map +1 -0
- package/resources/wallet.d.ts +177 -0
- package/resources/wallet.d.ts.map +1 -0
- package/resources/wallet.js +26 -0
- package/resources/wallet.js.map +1 -0
- package/resources/wallet.mjs +22 -0
- package/resources/wallet.mjs.map +1 -0
- package/src/client.ts +55 -73
- package/src/core/error.ts +0 -29
- package/src/index.ts +0 -14
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/account.ts +99 -44
- package/src/resources/builder/builder.ts +78 -0
- package/src/resources/builder/escrow.ts +62 -0
- package/src/resources/builder/index.ts +15 -0
- package/src/resources/builder/onboard.ts +206 -0
- package/src/resources/builder/users.ts +606 -0
- package/src/resources/builder.ts +3 -0
- package/src/resources/ctf.ts +122 -0
- package/src/resources/events.ts +104 -26
- package/src/resources/exchanges.ts +4 -2
- package/src/resources/fills.ts +107 -0
- package/src/resources/index.ts +13 -20
- package/src/resources/markets.ts +114 -49
- package/src/resources/onboard.ts +116 -0
- package/src/resources/orderbook.ts +23 -12
- package/src/resources/orders.ts +121 -12
- package/src/resources/positions.ts +22 -4
- package/src/resources/{price-history.ts → price.ts} +21 -17
- package/src/resources/trades.ts +54 -3
- package/src/resources/wallet.ts +224 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/approvals.d.mts +0 -74
- package/resources/approvals.d.mts.map +0 -1
- package/resources/approvals.d.ts +0 -74
- package/resources/approvals.d.ts.map +0 -1
- package/resources/approvals.js +0 -22
- package/resources/approvals.js.map +0 -1
- package/resources/approvals.mjs +0 -18
- package/resources/approvals.mjs.map +0 -1
- package/resources/price-history.d.mts.map +0 -1
- package/resources/price-history.d.ts.map +0 -1
- package/resources/price-history.js.map +0 -1
- package/resources/price-history.mjs.map +0 -1
- package/src/resources/approvals.ts +0 -107
package/src/resources/account.ts
CHANGED
|
@@ -9,15 +9,18 @@ export class Account extends APIResource {
|
|
|
9
9
|
/**
|
|
10
10
|
* Returns the raw balance payload from the exchange (opaque JSON).
|
|
11
11
|
*/
|
|
12
|
-
balance(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
balance(params: AccountBalanceParams, options?: RequestOptions): APIPromise<AccountBalanceResponse> {
|
|
13
|
+
const { 'X-Exchange-Credentials': xExchangeCredentials, ...query } = params;
|
|
14
|
+
return this._client.get('/api/v1/balance', {
|
|
15
|
+
query,
|
|
16
|
+
...options,
|
|
17
|
+
headers: buildHeaders([
|
|
18
|
+
{
|
|
19
|
+
...(xExchangeCredentials != null ? { 'X-Exchange-Credentials': xExchangeCredentials } : undefined),
|
|
20
|
+
},
|
|
21
|
+
options?.headers,
|
|
22
|
+
]),
|
|
23
|
+
});
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
/**
|
|
@@ -32,14 +35,12 @@ export class Account extends APIResource {
|
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
/**
|
|
35
|
-
*
|
|
38
|
+
* Returns the authenticated customer's tier, billing period, rate limits, and
|
|
39
|
+
* current consumption (monthly requests, WebSocket connections/subscriptions).
|
|
40
|
+
* Values of 0 for limits indicate unlimited.
|
|
36
41
|
*/
|
|
37
|
-
|
|
38
|
-
return this._client.
|
|
39
|
-
body,
|
|
40
|
-
...options,
|
|
41
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
42
|
-
});
|
|
42
|
+
usage(options?: RequestOptions): APIPromise<AccountUsageResponse> {
|
|
43
|
+
return this._client.get('/api/v1/usage', options);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
/**
|
|
@@ -58,18 +59,6 @@ export interface AccountBalanceResponse {
|
|
|
58
59
|
raw: { [key: string]: unknown };
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
export interface AccountCapabilitiesResponse {
|
|
62
|
-
/**
|
|
63
|
-
* Exchange IDs the customer has credentials linked for.
|
|
64
|
-
*/
|
|
65
|
-
linked_exchanges: Array<string>;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Customer tier (e.g., "free", "pro", "admin").
|
|
69
|
-
*/
|
|
70
|
-
tier: string;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
62
|
export type AccountPingResponse = Array<AccountPingResponse.AccountPingResponseItem>;
|
|
74
63
|
|
|
75
64
|
export namespace AccountPingResponse {
|
|
@@ -84,6 +73,78 @@ export namespace AccountPingResponse {
|
|
|
84
73
|
}
|
|
85
74
|
}
|
|
86
75
|
|
|
76
|
+
export interface AccountUsageResponse {
|
|
77
|
+
/**
|
|
78
|
+
* Unix seconds — 1st of next month UTC.
|
|
79
|
+
*/
|
|
80
|
+
billing_period_end: number;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Unix seconds — 1st of current month UTC.
|
|
84
|
+
*/
|
|
85
|
+
billing_period_start: number;
|
|
86
|
+
|
|
87
|
+
limits: AccountUsageResponse.Limits;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Current tier (free, pro, scale).
|
|
91
|
+
*/
|
|
92
|
+
tier: string;
|
|
93
|
+
|
|
94
|
+
usage: AccountUsageResponse.Usage;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export namespace AccountUsageResponse {
|
|
98
|
+
export interface Limits {
|
|
99
|
+
/**
|
|
100
|
+
* Max historical data age in days. 0 = unlimited.
|
|
101
|
+
*/
|
|
102
|
+
history_max_age_days: number;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Monthly REST request cap. 0 = unlimited.
|
|
106
|
+
*/
|
|
107
|
+
monthly_requests: number;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* REST queries per second. 0 = unlimited.
|
|
111
|
+
*/
|
|
112
|
+
rest_qps: number;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* REST burst QPS allowance. 0 = unlimited.
|
|
116
|
+
*/
|
|
117
|
+
rest_qps_burst: number;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Max orderbook depth per WebSocket subscription.
|
|
121
|
+
*/
|
|
122
|
+
ws_max_depth: number;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Max WebSocket subscriptions across all connections. 0 = unlimited.
|
|
126
|
+
*/
|
|
127
|
+
ws_max_subscriptions: number;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface Usage {
|
|
131
|
+
/**
|
|
132
|
+
* REST requests consumed this billing period.
|
|
133
|
+
*/
|
|
134
|
+
monthly_requests: number;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Currently active WebSocket connections.
|
|
138
|
+
*/
|
|
139
|
+
ws_active_connections: number;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Currently active WebSocket subscriptions.
|
|
143
|
+
*/
|
|
144
|
+
ws_active_subscriptions: number;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
87
148
|
export interface AccountUserActivityResponse {
|
|
88
149
|
exchanges: { [key: string]: unknown };
|
|
89
150
|
|
|
@@ -100,14 +161,21 @@ export namespace AccountUserActivityResponse {
|
|
|
100
161
|
|
|
101
162
|
export interface AccountBalanceParams {
|
|
102
163
|
/**
|
|
103
|
-
* Exchange identifier (e.g., kalshi, polymarket).
|
|
164
|
+
* Query param: Exchange identifier (e.g., kalshi, polymarket).
|
|
104
165
|
*/
|
|
105
166
|
exchange: string;
|
|
106
167
|
|
|
107
168
|
/**
|
|
108
|
-
* Refresh balance before returning (default false).
|
|
169
|
+
* Query param: Refresh balance before returning (default false).
|
|
109
170
|
*/
|
|
110
171
|
refresh?: boolean;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Header param: Base64-encoded JSON of per-request exchange credentials (Mode B).
|
|
175
|
+
* When provided, Parsec creates a transient exchange session instead of using
|
|
176
|
+
* stored credentials. The JSON shape matches the RequestCredentials schema.
|
|
177
|
+
*/
|
|
178
|
+
'X-Exchange-Credentials'?: string;
|
|
111
179
|
}
|
|
112
180
|
|
|
113
181
|
export interface AccountPingParams {
|
|
@@ -117,18 +185,6 @@ export interface AccountPingParams {
|
|
|
117
185
|
exchange?: string;
|
|
118
186
|
}
|
|
119
187
|
|
|
120
|
-
export interface AccountUpdateCredentialsParams {
|
|
121
|
-
evm_private_key?: string | null;
|
|
122
|
-
|
|
123
|
-
kalshi_api_key_id?: string | null;
|
|
124
|
-
|
|
125
|
-
kalshi_private_key?: string | null;
|
|
126
|
-
|
|
127
|
-
poly_funder?: string | null;
|
|
128
|
-
|
|
129
|
-
poly_signature_type?: string | null;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
188
|
export interface AccountUserActivityParams {
|
|
133
189
|
/**
|
|
134
190
|
* User address (typically an EVM address).
|
|
@@ -150,12 +206,11 @@ export interface AccountUserActivityParams {
|
|
|
150
206
|
export declare namespace Account {
|
|
151
207
|
export {
|
|
152
208
|
type AccountBalanceResponse as AccountBalanceResponse,
|
|
153
|
-
type AccountCapabilitiesResponse as AccountCapabilitiesResponse,
|
|
154
209
|
type AccountPingResponse as AccountPingResponse,
|
|
210
|
+
type AccountUsageResponse as AccountUsageResponse,
|
|
155
211
|
type AccountUserActivityResponse as AccountUserActivityResponse,
|
|
156
212
|
type AccountBalanceParams as AccountBalanceParams,
|
|
157
213
|
type AccountPingParams as AccountPingParams,
|
|
158
|
-
type AccountUpdateCredentialsParams as AccountUpdateCredentialsParams,
|
|
159
214
|
type AccountUserActivityParams as AccountUserActivityParams,
|
|
160
215
|
};
|
|
161
216
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as EscrowAPI from './escrow';
|
|
5
|
+
import { Escrow, EscrowConfigResponse } from './escrow';
|
|
6
|
+
import * as OnboardAPI from './onboard';
|
|
7
|
+
import { Onboard, OnboardCreateParams, OnboardCreateResponse } from './onboard';
|
|
8
|
+
import * as UsersAPI from './users';
|
|
9
|
+
import {
|
|
10
|
+
UserCreateParams,
|
|
11
|
+
UserCreateResponse,
|
|
12
|
+
UserListParams,
|
|
13
|
+
UserListResponse,
|
|
14
|
+
UserRetrieveResponse,
|
|
15
|
+
UserUpdateParams,
|
|
16
|
+
UserUpdateResponse,
|
|
17
|
+
Users,
|
|
18
|
+
} from './users';
|
|
19
|
+
import { APIPromise } from '../../core/api-promise';
|
|
20
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
21
|
+
|
|
22
|
+
export class Builder extends APIResource {
|
|
23
|
+
users: UsersAPI.Users = new UsersAPI.Users(this._client);
|
|
24
|
+
onboard: OnboardAPI.Onboard = new OnboardAPI.Onboard(this._client);
|
|
25
|
+
escrow: EscrowAPI.Escrow = new EscrowAPI.Escrow(this._client);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Returns the builder's QPS pool allocation, end-user count, and total allocated
|
|
29
|
+
* QPS.
|
|
30
|
+
*/
|
|
31
|
+
pool(options?: RequestOptions): APIPromise<BuilderPoolResponse> {
|
|
32
|
+
return this._client.get('/api/v1/builder/pool', options);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface BuilderPoolResponse {
|
|
37
|
+
/**
|
|
38
|
+
* Number of end-users created by this builder.
|
|
39
|
+
*/
|
|
40
|
+
end_user_count: number;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Total QPS available to this builder.
|
|
44
|
+
*/
|
|
45
|
+
qps_pool: number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Total QPS allocated to end-users.
|
|
49
|
+
*/
|
|
50
|
+
total_allocated_qps: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
Builder.Users = Users;
|
|
54
|
+
Builder.Onboard = Onboard;
|
|
55
|
+
Builder.Escrow = Escrow;
|
|
56
|
+
|
|
57
|
+
export declare namespace Builder {
|
|
58
|
+
export { type BuilderPoolResponse as BuilderPoolResponse };
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
Users as Users,
|
|
62
|
+
type UserCreateResponse as UserCreateResponse,
|
|
63
|
+
type UserRetrieveResponse as UserRetrieveResponse,
|
|
64
|
+
type UserUpdateResponse as UserUpdateResponse,
|
|
65
|
+
type UserListResponse as UserListResponse,
|
|
66
|
+
type UserCreateParams as UserCreateParams,
|
|
67
|
+
type UserUpdateParams as UserUpdateParams,
|
|
68
|
+
type UserListParams as UserListParams,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
Onboard as Onboard,
|
|
73
|
+
type OnboardCreateResponse as OnboardCreateResponse,
|
|
74
|
+
type OnboardCreateParams as OnboardCreateParams,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export { Escrow as Escrow, type EscrowConfigResponse as EscrowConfigResponse };
|
|
78
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Escrow extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Returns the builder's fee escrow configuration including contract address, fee
|
|
10
|
+
* rates, and treasury address. Read-only — fee escrow is configured by Parsec
|
|
11
|
+
* admins during onboarding.
|
|
12
|
+
*/
|
|
13
|
+
config(options?: RequestOptions): APIPromise<EscrowConfigResponse> {
|
|
14
|
+
return this._client.get('/api/v1/builder/escrow/config', options);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface EscrowConfigResponse {
|
|
19
|
+
/**
|
|
20
|
+
* Affiliate fee rate in basis points.
|
|
21
|
+
*/
|
|
22
|
+
affiliate_fee_bps: number;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Escrow smart contract address.
|
|
26
|
+
*/
|
|
27
|
+
escrow_contract_address: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Whether fee escrow is enabled for this builder.
|
|
31
|
+
*/
|
|
32
|
+
fee_escrow_enabled: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Minimum fee in basis points.
|
|
36
|
+
*/
|
|
37
|
+
min_fee_bps: number;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Minimum fee in USDC (human-readable).
|
|
41
|
+
*/
|
|
42
|
+
min_fee_usdc: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Treasury address for fee distribution.
|
|
46
|
+
*/
|
|
47
|
+
treasury_address: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Affiliate fee recipient address.
|
|
51
|
+
*/
|
|
52
|
+
affiliate_address?: string | null;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Fee rate in basis points.
|
|
56
|
+
*/
|
|
57
|
+
fee_bps?: number | null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export declare namespace Escrow {
|
|
61
|
+
export { type EscrowConfigResponse as EscrowConfigResponse };
|
|
62
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Builder, type BuilderPoolResponse } from './builder';
|
|
4
|
+
export { Escrow, type EscrowConfigResponse } from './escrow';
|
|
5
|
+
export { Onboard, type OnboardCreateResponse, type OnboardCreateParams } from './onboard';
|
|
6
|
+
export {
|
|
7
|
+
Users,
|
|
8
|
+
type UserCreateResponse,
|
|
9
|
+
type UserRetrieveResponse,
|
|
10
|
+
type UserUpdateResponse,
|
|
11
|
+
type UserListResponse,
|
|
12
|
+
type UserCreateParams,
|
|
13
|
+
type UserUpdateParams,
|
|
14
|
+
type UserListParams,
|
|
15
|
+
} from './users';
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Onboard extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Sets up an end-user for trading on a specific exchange. Managed mode creates
|
|
10
|
+
* wallet + exchange credentials. Self mode stores user-provided credentials.
|
|
11
|
+
*/
|
|
12
|
+
create(body: OnboardCreateParams, options?: RequestOptions): APIPromise<OnboardCreateResponse> {
|
|
13
|
+
return this._client.post('/api/v1/builder/onboard', { body, ...options });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface OnboardCreateResponse {
|
|
18
|
+
/**
|
|
19
|
+
* Parsec customer ID of the onboarded user.
|
|
20
|
+
*/
|
|
21
|
+
customer_id: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Exchange that was onboarded.
|
|
25
|
+
*/
|
|
26
|
+
exchange: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Whether fee escrow is enabled for this user.
|
|
30
|
+
*/
|
|
31
|
+
fee_escrow_enabled: boolean;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* All exchanges linked to this user.
|
|
35
|
+
*/
|
|
36
|
+
linked_exchanges: Array<string>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Onboard mode used ("managed" or "self").
|
|
40
|
+
*/
|
|
41
|
+
mode: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Onboard status ("complete").
|
|
45
|
+
*/
|
|
46
|
+
status: string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Steps completed during this call.
|
|
50
|
+
*/
|
|
51
|
+
steps_completed: Array<string>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Affiliate fee recipient address.
|
|
55
|
+
*/
|
|
56
|
+
affiliate_address?: string | null;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* EOA wallet address (managed mode only).
|
|
60
|
+
*/
|
|
61
|
+
eoa_address?: string | null;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Fee rate in basis points.
|
|
65
|
+
*/
|
|
66
|
+
fee_bps?: number | null;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Safe wallet address (present when wallet_type is "safe").
|
|
70
|
+
*/
|
|
71
|
+
safe_address?: string | null;
|
|
72
|
+
|
|
73
|
+
wallet?: OnboardCreateResponse.Wallet;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export namespace OnboardCreateResponse {
|
|
77
|
+
export interface Wallet {
|
|
78
|
+
/**
|
|
79
|
+
* EVM wallet address on Polygon.
|
|
80
|
+
*/
|
|
81
|
+
eoa_address: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Privy wallet identifier.
|
|
85
|
+
*/
|
|
86
|
+
privy_wallet_id: string;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Wallet type ("eoa" or "safe").
|
|
90
|
+
*/
|
|
91
|
+
wallet_type: string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Token balances for this wallet.
|
|
95
|
+
*/
|
|
96
|
+
balances?: Array<Wallet.Balance> | null;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Chain ID for the wallet (e.g. 137 for Polygon).
|
|
100
|
+
*/
|
|
101
|
+
chain_id?: number | null;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Wallet creation timestamp.
|
|
105
|
+
*/
|
|
106
|
+
created_at?: string | null;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Safe wallet address (present when wallet_type is "safe").
|
|
110
|
+
*/
|
|
111
|
+
safe_address?: string | null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export namespace Wallet {
|
|
115
|
+
export interface Balance {
|
|
116
|
+
/**
|
|
117
|
+
* Token symbol (e.g. "USDC").
|
|
118
|
+
*/
|
|
119
|
+
token: string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Human-readable balance (e.g. "100.50").
|
|
123
|
+
*/
|
|
124
|
+
balance: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Token decimal places.
|
|
128
|
+
*/
|
|
129
|
+
decimals: number;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Raw balance in smallest unit (e.g. "100500000").
|
|
133
|
+
*/
|
|
134
|
+
raw_balance: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* ERC-20 contract address. Null for native token.
|
|
138
|
+
*/
|
|
139
|
+
contract_address?: string | null;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface OnboardCreateParams {
|
|
145
|
+
/**
|
|
146
|
+
* Parsec customer ID of the end-user to onboard.
|
|
147
|
+
*/
|
|
148
|
+
customer_id: string;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Exchange to onboard ("polymarket" or "kalshi").
|
|
152
|
+
*/
|
|
153
|
+
exchange: string;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Managed = Parsec creates wallet + credentials. Self = you provide credentials.
|
|
157
|
+
*/
|
|
158
|
+
mode: 'managed' | 'self';
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Kalshi API key ID (self mode).
|
|
162
|
+
*/
|
|
163
|
+
api_key_id?: string;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Chain ID for Safe wallet creation.
|
|
167
|
+
*/
|
|
168
|
+
chain_id?: number;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Polymarket CLOB API key (self mode).
|
|
172
|
+
*/
|
|
173
|
+
clob_api_key?: string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Polymarket CLOB API passphrase (self mode).
|
|
177
|
+
*/
|
|
178
|
+
clob_api_passphrase?: string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Polymarket CLOB API secret (self mode).
|
|
182
|
+
*/
|
|
183
|
+
clob_api_secret?: string;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* External wallet address (required when wallet_type is "safe").
|
|
187
|
+
*/
|
|
188
|
+
eoa_address?: string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Kalshi RSA private key in PEM format (self mode).
|
|
192
|
+
*/
|
|
193
|
+
private_key?: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Wallet type for managed mode ("eoa" or "safe").
|
|
197
|
+
*/
|
|
198
|
+
wallet_type?: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export declare namespace Onboard {
|
|
202
|
+
export {
|
|
203
|
+
type OnboardCreateResponse as OnboardCreateResponse,
|
|
204
|
+
type OnboardCreateParams as OnboardCreateParams,
|
|
205
|
+
};
|
|
206
|
+
}
|