polyedge 1.0.0 → 1.2.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/README.md +2 -2
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +53 -59
- package/dist/index.d.ts +53 -59
- package/dist/index.js +9 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PolyEdge TypeScript / Node.js SDK
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/polyedge)
|
|
3
|
+
[](https://www.npmjs.com/package/polyedge)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://polyedge.dev/docs)
|
|
6
6
|
[](https://github.com/PolyEdgeDev/polyedge-stream-benchmark)
|
|
@@ -130,6 +130,7 @@ console.log(`Today's requests: ${telemetry.total_requests}`);
|
|
|
130
130
|
| `updateSubscription(id, req)` | `PUT /streams/{id}/subscription` | Hot-reload market filters (addresses, tags, series) on active stream |
|
|
131
131
|
| `delete(id)` | `DELETE /streams/{id}` | Delete stream by ID |
|
|
132
132
|
| `getActiveSessions()` | `GET /sessions` | List all active live SSE connections across streams |
|
|
133
|
+
| `disconnectSession(connId)` | `DELETE /sessions/{id}` | Disconnect one of your active SSE connections by `conn_id` |
|
|
133
134
|
| `getSessionHistory(params)` | `GET /sessions/history` | Query historical SSE connection logs and durations |
|
|
134
135
|
|
|
135
136
|
### 2. Analytics Service (`client.analytics`)
|
|
@@ -155,7 +156,6 @@ console.log(`Today's requests: ${telemetry.total_requests}`);
|
|
|
155
156
|
| `deleteKey(key)` | `DELETE /v2/user/keys/{key}` | Revoke and delete an API key |
|
|
156
157
|
| `getLedger(params)` | `GET /v2/user/ledger` | Balance ledger transaction records |
|
|
157
158
|
| `getTelemetry()` | `GET /v2/user/telemetry` | Daily request count and per-endpoint usage telemetry |
|
|
158
|
-
| `withdraw(req)` | `POST /v2/user/withdraw` | Request balance withdrawal |
|
|
159
159
|
|
|
160
160
|
### 4. Subscription Service (`client.subscription`)
|
|
161
161
|
|
package/dist/index.cjs
CHANGED
|
@@ -342,6 +342,15 @@ var StreamsService = class {
|
|
|
342
342
|
async getActiveSessions() {
|
|
343
343
|
return this.request(this.streamBaseUrl, `/sessions`, { method: "GET" });
|
|
344
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
* Disconnect User Stream Connection
|
|
347
|
+
* Terminates an active SSE stream connection owned by this account, identified by its conn_id from getActiveSessions.
|
|
348
|
+
* @param id Connection ID (conn_...)
|
|
349
|
+
* @returns Models.UserDisconnectSessionResponse
|
|
350
|
+
*/
|
|
351
|
+
async disconnectSession(id) {
|
|
352
|
+
return this.request(this.streamBaseUrl, `/sessions/${id}`, { method: "DELETE" });
|
|
353
|
+
}
|
|
345
354
|
/**
|
|
346
355
|
* List User Stream Session History
|
|
347
356
|
* Returns historical SSE connection logs including duration and pushed transactions count.
|
|
@@ -532,15 +541,6 @@ var AccountService = class {
|
|
|
532
541
|
async getTelemetry() {
|
|
533
542
|
return this.request(this.apiBaseUrl, `/v2/user/telemetry`, { method: "GET" });
|
|
534
543
|
}
|
|
535
|
-
/**
|
|
536
|
-
* Request Balance Withdrawal
|
|
537
|
-
* Submits a request to withdraw unspent USDC balance to a designated Polygon address.
|
|
538
|
-
* @param req Request payload
|
|
539
|
-
* @returns Models.UserWithdrawResponse
|
|
540
|
-
*/
|
|
541
|
-
async withdraw(req) {
|
|
542
|
-
return this.request(this.apiBaseUrl, `/v2/user/withdraw`, { method: "POST", body: JSON.stringify(req) });
|
|
543
|
-
}
|
|
544
544
|
};
|
|
545
545
|
var SubscriptionService = class {
|
|
546
546
|
request;
|
package/dist/index.d.cts
CHANGED
|
@@ -14,6 +14,8 @@ interface ActiveSessionInfo {
|
|
|
14
14
|
api_key?: string;
|
|
15
15
|
/** Remote IP address of the connected client */
|
|
16
16
|
client_ip?: string;
|
|
17
|
+
/** In-memory unique connection ID (prefixed with conn_) */
|
|
18
|
+
conn_id?: string;
|
|
17
19
|
/** ISO 8601 timestamp when the SSE connection was established */
|
|
18
20
|
connected_at?: string;
|
|
19
21
|
/** Total active connection uptime in seconds */
|
|
@@ -48,15 +50,25 @@ interface DeleteStreamResponse {
|
|
|
48
50
|
* Data model for DepositItem
|
|
49
51
|
*/
|
|
50
52
|
interface DepositItem {
|
|
53
|
+
/** Trader's Ethereum wallet address */
|
|
51
54
|
address?: string;
|
|
55
|
+
/** Total number of deposits within the 60-day window */
|
|
52
56
|
deposit_count?: number;
|
|
53
|
-
/** Earliest deposit
|
|
57
|
+
/** Earliest deposit timestamp in 60-day window (RFC3339 UTC) */
|
|
54
58
|
first_deposit_at?: string;
|
|
59
|
+
/** First executed trade timestamp (RFC3339 UTC) */
|
|
55
60
|
first_trade_at?: string;
|
|
56
|
-
/** Most recent deposit
|
|
61
|
+
/** Most recent deposit timestamp (RFC3339 UTC) */
|
|
57
62
|
last_deposit_at?: string;
|
|
63
|
+
/** Most recent executed trade timestamp (RFC3339 UTC) */
|
|
58
64
|
last_trade_at?: string;
|
|
59
|
-
/**
|
|
65
|
+
/** Current pUSD wallet balance in micro-USD (6 decimals) */
|
|
66
|
+
pusd_balance?: number;
|
|
67
|
+
/** Net cumulative pUSD cashflow generated from trading activities (6 decimals) */
|
|
68
|
+
pusd_trade_balance?: number;
|
|
69
|
+
/** Up to 10 latest on-chain deposit transactions (newest first) */
|
|
70
|
+
recent_deposits?: RecentDeposit[];
|
|
71
|
+
/** Cumulative 60-day deposit amount in micro-USD (6 decimals) */
|
|
60
72
|
total_deposit?: string;
|
|
61
73
|
}
|
|
62
74
|
/**
|
|
@@ -191,6 +203,8 @@ interface Market {
|
|
|
191
203
|
tags_slug?: string[];
|
|
192
204
|
/** ERC-1155 token IDs: [Token 1, Token 2] */
|
|
193
205
|
token_ids?: [string, string];
|
|
206
|
+
/** Polymarket protocol version: "v1" (CTF tokens) or "v2" (protocol v2 positions) */
|
|
207
|
+
version?: string;
|
|
194
208
|
}
|
|
195
209
|
/**
|
|
196
210
|
* Data model for MarketDetailResponse
|
|
@@ -260,6 +274,8 @@ interface MarketMetadata {
|
|
|
260
274
|
neg_risk?: boolean;
|
|
261
275
|
/** Raw JSON array of outcome display names, e.g. ["Yes", "No"] */
|
|
262
276
|
outcomes?: [string, string];
|
|
277
|
+
/** Array of 2 on-chain position IDs corresponding to outcomes */
|
|
278
|
+
position_ids?: string[];
|
|
263
279
|
/** Full title question describing the market condition */
|
|
264
280
|
question?: string;
|
|
265
281
|
/** Source URL or oracle specification for resolution */
|
|
@@ -278,8 +294,10 @@ interface MarketMetadata {
|
|
|
278
294
|
start_date?: string;
|
|
279
295
|
/** Raw JSON array of topic tag URL slugs */
|
|
280
296
|
tags_slug?: string[];
|
|
281
|
-
/** Array of 2 ERC-1155 token IDs corresponding to outcomes */
|
|
297
|
+
/** Array of 2 ERC-1155 token IDs corresponding to outcomes (clobTokenIds) */
|
|
282
298
|
token_ids?: [string, string];
|
|
299
|
+
/** Polymarket protocol version: "v1" (CTF tokens) or "v2" (protocol v2 positions) */
|
|
300
|
+
version?: string;
|
|
283
301
|
}
|
|
284
302
|
/**
|
|
285
303
|
* Data model for MarketSettlementDetail
|
|
@@ -350,6 +368,19 @@ interface QuoteSubscriptionResponse {
|
|
|
350
368
|
prorated_credit?: number;
|
|
351
369
|
tier?: string;
|
|
352
370
|
}
|
|
371
|
+
/**
|
|
372
|
+
* Data model for RecentDeposit
|
|
373
|
+
*/
|
|
374
|
+
interface RecentDeposit {
|
|
375
|
+
/** Deposited collateral amount in micro-USD (6 decimals, e.g. 100000000 for 100 USDC) */
|
|
376
|
+
amount?: number;
|
|
377
|
+
/** Source funding address (0x...) */
|
|
378
|
+
from?: string;
|
|
379
|
+
/** Deposit execution timestamp in RFC3339 UTC format */
|
|
380
|
+
time?: string;
|
|
381
|
+
/** On-chain transaction hash (0x...) */
|
|
382
|
+
tx_hash?: string;
|
|
383
|
+
}
|
|
353
384
|
/**
|
|
354
385
|
* Data model for SubscribeRequest
|
|
355
386
|
*/
|
|
@@ -485,9 +516,9 @@ interface TraderProfileResponse {
|
|
|
485
516
|
profile?: TraderIdentity;
|
|
486
517
|
/** Trader's pUSD balance in micro-pUSD (6 decimals, e.g. 1000000 = 1 pUSD) */
|
|
487
518
|
pusd_balance?: number;
|
|
488
|
-
/** Polymarket Taker Rebate
|
|
519
|
+
/** Polymarket Taker Rebate tier level (0-6: 0=Tier 0, 1=Bronze, 2=Silver, 3=Gold, 4=Platinum, 5=Diamond, 6=Obsidian) */
|
|
489
520
|
taker_tier?: number;
|
|
490
|
-
/** Descriptive taker rebate tier name ("Tier 0", "Bronze", "Silver", "Gold", "Platinum", "Diamond", "Obsidian", or
|
|
521
|
+
/** Descriptive taker rebate tier name ("Tier 0", "Bronze", "Silver", "Gold", "Platinum", "Diamond", "Obsidian", or "" if unsynced) */
|
|
491
522
|
taker_tier_name?: string;
|
|
492
523
|
/** Performance breakdown across top 5 categories in last 30 days */
|
|
493
524
|
top_tags?: TagStat[];
|
|
@@ -552,6 +583,14 @@ interface UserCreateStreamRequest {
|
|
|
552
583
|
series?: string[];
|
|
553
584
|
tags?: string[];
|
|
554
585
|
}
|
|
586
|
+
/**
|
|
587
|
+
* Data model for UserDisconnectSessionResponse
|
|
588
|
+
*/
|
|
589
|
+
interface UserDisconnectSessionResponse {
|
|
590
|
+
conn_id?: string;
|
|
591
|
+
message?: string;
|
|
592
|
+
status?: string;
|
|
593
|
+
}
|
|
555
594
|
/**
|
|
556
595
|
* Data model for UserKeysResponse
|
|
557
596
|
*/
|
|
@@ -711,21 +750,6 @@ interface UserUpdateStreamMetadataRequest {
|
|
|
711
750
|
enabled?: boolean;
|
|
712
751
|
name?: string;
|
|
713
752
|
}
|
|
714
|
-
/**
|
|
715
|
-
* Data model for UserWithdrawRequest
|
|
716
|
-
*/
|
|
717
|
-
interface UserWithdrawRequest {
|
|
718
|
-
network: string;
|
|
719
|
-
to_address: string;
|
|
720
|
-
token: string;
|
|
721
|
-
}
|
|
722
|
-
/**
|
|
723
|
-
* Data model for UserWithdrawResponse
|
|
724
|
-
*/
|
|
725
|
-
interface UserWithdrawResponse {
|
|
726
|
-
user?: UserProfile;
|
|
727
|
-
withdrawal?: Withdrawal;
|
|
728
|
-
}
|
|
729
753
|
/**
|
|
730
754
|
* Data model for ValidatePromoCodeRequest
|
|
731
755
|
*/
|
|
@@ -746,36 +770,6 @@ interface ValidatePromoCodeResponse {
|
|
|
746
770
|
prorated_credit?: number;
|
|
747
771
|
valid?: boolean;
|
|
748
772
|
}
|
|
749
|
-
/**
|
|
750
|
-
* Data model for Withdrawal
|
|
751
|
-
*/
|
|
752
|
-
interface Withdrawal {
|
|
753
|
-
/** Full balance amount withdrawn in micro-USD */
|
|
754
|
-
amount?: number;
|
|
755
|
-
/** Withdrawal request creation timestamp */
|
|
756
|
-
created_at?: string;
|
|
757
|
-
id?: number;
|
|
758
|
-
/** User's most recent deposit timestamp */
|
|
759
|
-
last_deposit_at?: string;
|
|
760
|
-
/** "bsc" or "polygon" */
|
|
761
|
-
network?: string;
|
|
762
|
-
/** Reason recorded upon rejection */
|
|
763
|
-
reject_reason?: string;
|
|
764
|
-
/** Administrative review timestamp */
|
|
765
|
-
reviewed_at?: string;
|
|
766
|
-
/** "pending", "completed", "rejected" */
|
|
767
|
-
status?: string;
|
|
768
|
-
/** Destination EVM wallet address */
|
|
769
|
-
to_address?: string;
|
|
770
|
-
/** "USDC" or "USDT" */
|
|
771
|
-
token?: string;
|
|
772
|
-
/** Transaction hash on destination network */
|
|
773
|
-
tx_hash?: string;
|
|
774
|
-
/** Last modification timestamp */
|
|
775
|
-
updated_at?: string;
|
|
776
|
-
user_email?: string;
|
|
777
|
-
user_id?: number;
|
|
778
|
-
}
|
|
779
773
|
|
|
780
774
|
interface StreamOptions {
|
|
781
775
|
apiKey: string;
|
|
@@ -892,6 +886,13 @@ declare class StreamsService {
|
|
|
892
886
|
* @returns Models.UserActiveSessionsResponse
|
|
893
887
|
*/
|
|
894
888
|
getActiveSessions(): Promise<UserActiveSessionsResponse>;
|
|
889
|
+
/**
|
|
890
|
+
* Disconnect User Stream Connection
|
|
891
|
+
* Terminates an active SSE stream connection owned by this account, identified by its conn_id from getActiveSessions.
|
|
892
|
+
* @param id Connection ID (conn_...)
|
|
893
|
+
* @returns Models.UserDisconnectSessionResponse
|
|
894
|
+
*/
|
|
895
|
+
disconnectSession(id: string): Promise<UserDisconnectSessionResponse>;
|
|
895
896
|
/**
|
|
896
897
|
* List User Stream Session History
|
|
897
898
|
* Returns historical SSE connection logs including duration and pushed transactions count.
|
|
@@ -1038,13 +1039,6 @@ declare class AccountService {
|
|
|
1038
1039
|
* @returns Models.UserTelemetryResponse
|
|
1039
1040
|
*/
|
|
1040
1041
|
getTelemetry(): Promise<UserTelemetryResponse>;
|
|
1041
|
-
/**
|
|
1042
|
-
* Request Balance Withdrawal
|
|
1043
|
-
* Submits a request to withdraw unspent USDC balance to a designated Polygon address.
|
|
1044
|
-
* @param req Request payload
|
|
1045
|
-
* @returns Models.UserWithdrawResponse
|
|
1046
|
-
*/
|
|
1047
|
-
withdraw(req: UserWithdrawRequest): Promise<UserWithdrawResponse>;
|
|
1048
1042
|
}
|
|
1049
1043
|
/** Subscription Service: APIs for subscription operations */
|
|
1050
1044
|
declare class SubscriptionService {
|
|
@@ -1103,4 +1097,4 @@ declare class PolyEdgeClient {
|
|
|
1103
1097
|
stream(streamId: string, options?: Partial<StreamOptions>): PolyEdgeStream;
|
|
1104
1098
|
}
|
|
1105
1099
|
|
|
1106
|
-
export { AccountService, type ActiveSessionInfo, AnalyticsService, type CreateAPIKeyRequest, type DeleteKeyResponse, type DeleteStreamResponse, type DepositItem, type DepositQueryResult, type ErrorResponse, type HistoryMarket, type HourlyStat, type LeaderboardResponse, type LiveOrder, type LiveTransaction, type Market, type MarketDetailResponse, type MarketEarner, type MarketMetadata, type MarketSettlementDetail, type MonitorTrader, type OrderInfo, PolyEdgeClient, type PolyEdgeClientOptions, PolyEdgeStream, type QuoteSubscriptionRequest, type QuoteSubscriptionResponse, type Requester, type Side, type StreamEvents, type StreamOptions, StreamsService, type SubscribeRequest, type SubscribeResponse, SubscriptionService, type TagStat, type Tier, type TokenIndex, type TraderHistoryResponse, type TraderHourlyStatsResponse, type TraderIdentity, type TraderProfileResponse, type TraderSummary, type UpdateSubscriptionRequest, type UserAPIKey, type UserActiveSessionsResponse, type UserCreateStreamRequest, type UserKeysResponse, type UserLedgerEntry, type UserLedgerResponse, type UserOrder, type UserOrdersResponse, type UserProfile, type UserSessionHistoryResponse, type UserSessionRecord, type UserStreamResponse, type UserStreamsResponse, type UserSubscription, type UserTelemetryResponse, type UserUpdateKeyRequest, type UserUpdateStreamMetadataRequest, type
|
|
1100
|
+
export { AccountService, type ActiveSessionInfo, AnalyticsService, type CreateAPIKeyRequest, type DeleteKeyResponse, type DeleteStreamResponse, type DepositItem, type DepositQueryResult, type ErrorResponse, type HistoryMarket, type HourlyStat, type LeaderboardResponse, type LiveOrder, type LiveTransaction, type Market, type MarketDetailResponse, type MarketEarner, type MarketMetadata, type MarketSettlementDetail, type MonitorTrader, type OrderInfo, PolyEdgeClient, type PolyEdgeClientOptions, PolyEdgeStream, type QuoteSubscriptionRequest, type QuoteSubscriptionResponse, type RecentDeposit, type Requester, type Side, type StreamEvents, type StreamOptions, StreamsService, type SubscribeRequest, type SubscribeResponse, SubscriptionService, type TagStat, type Tier, type TokenIndex, type TraderHistoryResponse, type TraderHourlyStatsResponse, type TraderIdentity, type TraderProfileResponse, type TraderSummary, type UpdateSubscriptionRequest, type UserAPIKey, type UserActiveSessionsResponse, type UserCreateStreamRequest, type UserDisconnectSessionResponse, type UserKeysResponse, type UserLedgerEntry, type UserLedgerResponse, type UserOrder, type UserOrdersResponse, type UserProfile, type UserSessionHistoryResponse, type UserSessionRecord, type UserStreamResponse, type UserStreamsResponse, type UserSubscription, type UserTelemetryResponse, type UserUpdateKeyRequest, type UserUpdateStreamMetadataRequest, type ValidatePromoCodeRequest, type ValidatePromoCodeResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ interface ActiveSessionInfo {
|
|
|
14
14
|
api_key?: string;
|
|
15
15
|
/** Remote IP address of the connected client */
|
|
16
16
|
client_ip?: string;
|
|
17
|
+
/** In-memory unique connection ID (prefixed with conn_) */
|
|
18
|
+
conn_id?: string;
|
|
17
19
|
/** ISO 8601 timestamp when the SSE connection was established */
|
|
18
20
|
connected_at?: string;
|
|
19
21
|
/** Total active connection uptime in seconds */
|
|
@@ -48,15 +50,25 @@ interface DeleteStreamResponse {
|
|
|
48
50
|
* Data model for DepositItem
|
|
49
51
|
*/
|
|
50
52
|
interface DepositItem {
|
|
53
|
+
/** Trader's Ethereum wallet address */
|
|
51
54
|
address?: string;
|
|
55
|
+
/** Total number of deposits within the 60-day window */
|
|
52
56
|
deposit_count?: number;
|
|
53
|
-
/** Earliest deposit
|
|
57
|
+
/** Earliest deposit timestamp in 60-day window (RFC3339 UTC) */
|
|
54
58
|
first_deposit_at?: string;
|
|
59
|
+
/** First executed trade timestamp (RFC3339 UTC) */
|
|
55
60
|
first_trade_at?: string;
|
|
56
|
-
/** Most recent deposit
|
|
61
|
+
/** Most recent deposit timestamp (RFC3339 UTC) */
|
|
57
62
|
last_deposit_at?: string;
|
|
63
|
+
/** Most recent executed trade timestamp (RFC3339 UTC) */
|
|
58
64
|
last_trade_at?: string;
|
|
59
|
-
/**
|
|
65
|
+
/** Current pUSD wallet balance in micro-USD (6 decimals) */
|
|
66
|
+
pusd_balance?: number;
|
|
67
|
+
/** Net cumulative pUSD cashflow generated from trading activities (6 decimals) */
|
|
68
|
+
pusd_trade_balance?: number;
|
|
69
|
+
/** Up to 10 latest on-chain deposit transactions (newest first) */
|
|
70
|
+
recent_deposits?: RecentDeposit[];
|
|
71
|
+
/** Cumulative 60-day deposit amount in micro-USD (6 decimals) */
|
|
60
72
|
total_deposit?: string;
|
|
61
73
|
}
|
|
62
74
|
/**
|
|
@@ -191,6 +203,8 @@ interface Market {
|
|
|
191
203
|
tags_slug?: string[];
|
|
192
204
|
/** ERC-1155 token IDs: [Token 1, Token 2] */
|
|
193
205
|
token_ids?: [string, string];
|
|
206
|
+
/** Polymarket protocol version: "v1" (CTF tokens) or "v2" (protocol v2 positions) */
|
|
207
|
+
version?: string;
|
|
194
208
|
}
|
|
195
209
|
/**
|
|
196
210
|
* Data model for MarketDetailResponse
|
|
@@ -260,6 +274,8 @@ interface MarketMetadata {
|
|
|
260
274
|
neg_risk?: boolean;
|
|
261
275
|
/** Raw JSON array of outcome display names, e.g. ["Yes", "No"] */
|
|
262
276
|
outcomes?: [string, string];
|
|
277
|
+
/** Array of 2 on-chain position IDs corresponding to outcomes */
|
|
278
|
+
position_ids?: string[];
|
|
263
279
|
/** Full title question describing the market condition */
|
|
264
280
|
question?: string;
|
|
265
281
|
/** Source URL or oracle specification for resolution */
|
|
@@ -278,8 +294,10 @@ interface MarketMetadata {
|
|
|
278
294
|
start_date?: string;
|
|
279
295
|
/** Raw JSON array of topic tag URL slugs */
|
|
280
296
|
tags_slug?: string[];
|
|
281
|
-
/** Array of 2 ERC-1155 token IDs corresponding to outcomes */
|
|
297
|
+
/** Array of 2 ERC-1155 token IDs corresponding to outcomes (clobTokenIds) */
|
|
282
298
|
token_ids?: [string, string];
|
|
299
|
+
/** Polymarket protocol version: "v1" (CTF tokens) or "v2" (protocol v2 positions) */
|
|
300
|
+
version?: string;
|
|
283
301
|
}
|
|
284
302
|
/**
|
|
285
303
|
* Data model for MarketSettlementDetail
|
|
@@ -350,6 +368,19 @@ interface QuoteSubscriptionResponse {
|
|
|
350
368
|
prorated_credit?: number;
|
|
351
369
|
tier?: string;
|
|
352
370
|
}
|
|
371
|
+
/**
|
|
372
|
+
* Data model for RecentDeposit
|
|
373
|
+
*/
|
|
374
|
+
interface RecentDeposit {
|
|
375
|
+
/** Deposited collateral amount in micro-USD (6 decimals, e.g. 100000000 for 100 USDC) */
|
|
376
|
+
amount?: number;
|
|
377
|
+
/** Source funding address (0x...) */
|
|
378
|
+
from?: string;
|
|
379
|
+
/** Deposit execution timestamp in RFC3339 UTC format */
|
|
380
|
+
time?: string;
|
|
381
|
+
/** On-chain transaction hash (0x...) */
|
|
382
|
+
tx_hash?: string;
|
|
383
|
+
}
|
|
353
384
|
/**
|
|
354
385
|
* Data model for SubscribeRequest
|
|
355
386
|
*/
|
|
@@ -485,9 +516,9 @@ interface TraderProfileResponse {
|
|
|
485
516
|
profile?: TraderIdentity;
|
|
486
517
|
/** Trader's pUSD balance in micro-pUSD (6 decimals, e.g. 1000000 = 1 pUSD) */
|
|
487
518
|
pusd_balance?: number;
|
|
488
|
-
/** Polymarket Taker Rebate
|
|
519
|
+
/** Polymarket Taker Rebate tier level (0-6: 0=Tier 0, 1=Bronze, 2=Silver, 3=Gold, 4=Platinum, 5=Diamond, 6=Obsidian) */
|
|
489
520
|
taker_tier?: number;
|
|
490
|
-
/** Descriptive taker rebate tier name ("Tier 0", "Bronze", "Silver", "Gold", "Platinum", "Diamond", "Obsidian", or
|
|
521
|
+
/** Descriptive taker rebate tier name ("Tier 0", "Bronze", "Silver", "Gold", "Platinum", "Diamond", "Obsidian", or "" if unsynced) */
|
|
491
522
|
taker_tier_name?: string;
|
|
492
523
|
/** Performance breakdown across top 5 categories in last 30 days */
|
|
493
524
|
top_tags?: TagStat[];
|
|
@@ -552,6 +583,14 @@ interface UserCreateStreamRequest {
|
|
|
552
583
|
series?: string[];
|
|
553
584
|
tags?: string[];
|
|
554
585
|
}
|
|
586
|
+
/**
|
|
587
|
+
* Data model for UserDisconnectSessionResponse
|
|
588
|
+
*/
|
|
589
|
+
interface UserDisconnectSessionResponse {
|
|
590
|
+
conn_id?: string;
|
|
591
|
+
message?: string;
|
|
592
|
+
status?: string;
|
|
593
|
+
}
|
|
555
594
|
/**
|
|
556
595
|
* Data model for UserKeysResponse
|
|
557
596
|
*/
|
|
@@ -711,21 +750,6 @@ interface UserUpdateStreamMetadataRequest {
|
|
|
711
750
|
enabled?: boolean;
|
|
712
751
|
name?: string;
|
|
713
752
|
}
|
|
714
|
-
/**
|
|
715
|
-
* Data model for UserWithdrawRequest
|
|
716
|
-
*/
|
|
717
|
-
interface UserWithdrawRequest {
|
|
718
|
-
network: string;
|
|
719
|
-
to_address: string;
|
|
720
|
-
token: string;
|
|
721
|
-
}
|
|
722
|
-
/**
|
|
723
|
-
* Data model for UserWithdrawResponse
|
|
724
|
-
*/
|
|
725
|
-
interface UserWithdrawResponse {
|
|
726
|
-
user?: UserProfile;
|
|
727
|
-
withdrawal?: Withdrawal;
|
|
728
|
-
}
|
|
729
753
|
/**
|
|
730
754
|
* Data model for ValidatePromoCodeRequest
|
|
731
755
|
*/
|
|
@@ -746,36 +770,6 @@ interface ValidatePromoCodeResponse {
|
|
|
746
770
|
prorated_credit?: number;
|
|
747
771
|
valid?: boolean;
|
|
748
772
|
}
|
|
749
|
-
/**
|
|
750
|
-
* Data model for Withdrawal
|
|
751
|
-
*/
|
|
752
|
-
interface Withdrawal {
|
|
753
|
-
/** Full balance amount withdrawn in micro-USD */
|
|
754
|
-
amount?: number;
|
|
755
|
-
/** Withdrawal request creation timestamp */
|
|
756
|
-
created_at?: string;
|
|
757
|
-
id?: number;
|
|
758
|
-
/** User's most recent deposit timestamp */
|
|
759
|
-
last_deposit_at?: string;
|
|
760
|
-
/** "bsc" or "polygon" */
|
|
761
|
-
network?: string;
|
|
762
|
-
/** Reason recorded upon rejection */
|
|
763
|
-
reject_reason?: string;
|
|
764
|
-
/** Administrative review timestamp */
|
|
765
|
-
reviewed_at?: string;
|
|
766
|
-
/** "pending", "completed", "rejected" */
|
|
767
|
-
status?: string;
|
|
768
|
-
/** Destination EVM wallet address */
|
|
769
|
-
to_address?: string;
|
|
770
|
-
/** "USDC" or "USDT" */
|
|
771
|
-
token?: string;
|
|
772
|
-
/** Transaction hash on destination network */
|
|
773
|
-
tx_hash?: string;
|
|
774
|
-
/** Last modification timestamp */
|
|
775
|
-
updated_at?: string;
|
|
776
|
-
user_email?: string;
|
|
777
|
-
user_id?: number;
|
|
778
|
-
}
|
|
779
773
|
|
|
780
774
|
interface StreamOptions {
|
|
781
775
|
apiKey: string;
|
|
@@ -892,6 +886,13 @@ declare class StreamsService {
|
|
|
892
886
|
* @returns Models.UserActiveSessionsResponse
|
|
893
887
|
*/
|
|
894
888
|
getActiveSessions(): Promise<UserActiveSessionsResponse>;
|
|
889
|
+
/**
|
|
890
|
+
* Disconnect User Stream Connection
|
|
891
|
+
* Terminates an active SSE stream connection owned by this account, identified by its conn_id from getActiveSessions.
|
|
892
|
+
* @param id Connection ID (conn_...)
|
|
893
|
+
* @returns Models.UserDisconnectSessionResponse
|
|
894
|
+
*/
|
|
895
|
+
disconnectSession(id: string): Promise<UserDisconnectSessionResponse>;
|
|
895
896
|
/**
|
|
896
897
|
* List User Stream Session History
|
|
897
898
|
* Returns historical SSE connection logs including duration and pushed transactions count.
|
|
@@ -1038,13 +1039,6 @@ declare class AccountService {
|
|
|
1038
1039
|
* @returns Models.UserTelemetryResponse
|
|
1039
1040
|
*/
|
|
1040
1041
|
getTelemetry(): Promise<UserTelemetryResponse>;
|
|
1041
|
-
/**
|
|
1042
|
-
* Request Balance Withdrawal
|
|
1043
|
-
* Submits a request to withdraw unspent USDC balance to a designated Polygon address.
|
|
1044
|
-
* @param req Request payload
|
|
1045
|
-
* @returns Models.UserWithdrawResponse
|
|
1046
|
-
*/
|
|
1047
|
-
withdraw(req: UserWithdrawRequest): Promise<UserWithdrawResponse>;
|
|
1048
1042
|
}
|
|
1049
1043
|
/** Subscription Service: APIs for subscription operations */
|
|
1050
1044
|
declare class SubscriptionService {
|
|
@@ -1103,4 +1097,4 @@ declare class PolyEdgeClient {
|
|
|
1103
1097
|
stream(streamId: string, options?: Partial<StreamOptions>): PolyEdgeStream;
|
|
1104
1098
|
}
|
|
1105
1099
|
|
|
1106
|
-
export { AccountService, type ActiveSessionInfo, AnalyticsService, type CreateAPIKeyRequest, type DeleteKeyResponse, type DeleteStreamResponse, type DepositItem, type DepositQueryResult, type ErrorResponse, type HistoryMarket, type HourlyStat, type LeaderboardResponse, type LiveOrder, type LiveTransaction, type Market, type MarketDetailResponse, type MarketEarner, type MarketMetadata, type MarketSettlementDetail, type MonitorTrader, type OrderInfo, PolyEdgeClient, type PolyEdgeClientOptions, PolyEdgeStream, type QuoteSubscriptionRequest, type QuoteSubscriptionResponse, type Requester, type Side, type StreamEvents, type StreamOptions, StreamsService, type SubscribeRequest, type SubscribeResponse, SubscriptionService, type TagStat, type Tier, type TokenIndex, type TraderHistoryResponse, type TraderHourlyStatsResponse, type TraderIdentity, type TraderProfileResponse, type TraderSummary, type UpdateSubscriptionRequest, type UserAPIKey, type UserActiveSessionsResponse, type UserCreateStreamRequest, type UserKeysResponse, type UserLedgerEntry, type UserLedgerResponse, type UserOrder, type UserOrdersResponse, type UserProfile, type UserSessionHistoryResponse, type UserSessionRecord, type UserStreamResponse, type UserStreamsResponse, type UserSubscription, type UserTelemetryResponse, type UserUpdateKeyRequest, type UserUpdateStreamMetadataRequest, type
|
|
1100
|
+
export { AccountService, type ActiveSessionInfo, AnalyticsService, type CreateAPIKeyRequest, type DeleteKeyResponse, type DeleteStreamResponse, type DepositItem, type DepositQueryResult, type ErrorResponse, type HistoryMarket, type HourlyStat, type LeaderboardResponse, type LiveOrder, type LiveTransaction, type Market, type MarketDetailResponse, type MarketEarner, type MarketMetadata, type MarketSettlementDetail, type MonitorTrader, type OrderInfo, PolyEdgeClient, type PolyEdgeClientOptions, PolyEdgeStream, type QuoteSubscriptionRequest, type QuoteSubscriptionResponse, type RecentDeposit, type Requester, type Side, type StreamEvents, type StreamOptions, StreamsService, type SubscribeRequest, type SubscribeResponse, SubscriptionService, type TagStat, type Tier, type TokenIndex, type TraderHistoryResponse, type TraderHourlyStatsResponse, type TraderIdentity, type TraderProfileResponse, type TraderSummary, type UpdateSubscriptionRequest, type UserAPIKey, type UserActiveSessionsResponse, type UserCreateStreamRequest, type UserDisconnectSessionResponse, type UserKeysResponse, type UserLedgerEntry, type UserLedgerResponse, type UserOrder, type UserOrdersResponse, type UserProfile, type UserSessionHistoryResponse, type UserSessionRecord, type UserStreamResponse, type UserStreamsResponse, type UserSubscription, type UserTelemetryResponse, type UserUpdateKeyRequest, type UserUpdateStreamMetadataRequest, type ValidatePromoCodeRequest, type ValidatePromoCodeResponse };
|
package/dist/index.js
CHANGED
|
@@ -311,6 +311,15 @@ var StreamsService = class {
|
|
|
311
311
|
async getActiveSessions() {
|
|
312
312
|
return this.request(this.streamBaseUrl, `/sessions`, { method: "GET" });
|
|
313
313
|
}
|
|
314
|
+
/**
|
|
315
|
+
* Disconnect User Stream Connection
|
|
316
|
+
* Terminates an active SSE stream connection owned by this account, identified by its conn_id from getActiveSessions.
|
|
317
|
+
* @param id Connection ID (conn_...)
|
|
318
|
+
* @returns Models.UserDisconnectSessionResponse
|
|
319
|
+
*/
|
|
320
|
+
async disconnectSession(id) {
|
|
321
|
+
return this.request(this.streamBaseUrl, `/sessions/${id}`, { method: "DELETE" });
|
|
322
|
+
}
|
|
314
323
|
/**
|
|
315
324
|
* List User Stream Session History
|
|
316
325
|
* Returns historical SSE connection logs including duration and pushed transactions count.
|
|
@@ -501,15 +510,6 @@ var AccountService = class {
|
|
|
501
510
|
async getTelemetry() {
|
|
502
511
|
return this.request(this.apiBaseUrl, `/v2/user/telemetry`, { method: "GET" });
|
|
503
512
|
}
|
|
504
|
-
/**
|
|
505
|
-
* Request Balance Withdrawal
|
|
506
|
-
* Submits a request to withdraw unspent USDC balance to a designated Polygon address.
|
|
507
|
-
* @param req Request payload
|
|
508
|
-
* @returns Models.UserWithdrawResponse
|
|
509
|
-
*/
|
|
510
|
-
async withdraw(req) {
|
|
511
|
-
return this.request(this.apiBaseUrl, `/v2/user/withdraw`, { method: "POST", body: JSON.stringify(req) });
|
|
512
|
-
}
|
|
513
513
|
};
|
|
514
514
|
var SubscriptionService = class {
|
|
515
515
|
request;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polyedge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Official TypeScript/Node.js SDK for PolyEdge ultra-low latency Polymarket mempool trade streaming and real-time on-chain analytics API.",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"homepage": "https://polyedge.dev",
|
|
46
46
|
"repository": {
|
|
47
47
|
"type": "git",
|
|
48
|
-
"url": "https://github.com/PolyEdgeDev/polyedge-ts.git"
|
|
48
|
+
"url": "git+https://github.com/PolyEdgeDev/polyedge-ts.git"
|
|
49
49
|
},
|
|
50
50
|
"bugs": {
|
|
51
51
|
"url": "https://github.com/PolyEdgeDev/polyedge-ts/issues"
|