polyedge 1.0.0 → 1.1.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 +46 -58
- package/dist/index.d.ts +46 -58
- package/dist/index.js +9 -9
- package/package.json +1 -1
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
|
/**
|
|
@@ -350,6 +362,19 @@ interface QuoteSubscriptionResponse {
|
|
|
350
362
|
prorated_credit?: number;
|
|
351
363
|
tier?: string;
|
|
352
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* Data model for RecentDeposit
|
|
367
|
+
*/
|
|
368
|
+
interface RecentDeposit {
|
|
369
|
+
/** Deposited collateral amount in micro-USD (6 decimals, e.g. 100000000 for 100 USDC) */
|
|
370
|
+
amount?: number;
|
|
371
|
+
/** Source funding address (0x...) */
|
|
372
|
+
from?: string;
|
|
373
|
+
/** Deposit execution timestamp in RFC3339 UTC format */
|
|
374
|
+
time?: string;
|
|
375
|
+
/** On-chain transaction hash (0x...) */
|
|
376
|
+
tx_hash?: string;
|
|
377
|
+
}
|
|
353
378
|
/**
|
|
354
379
|
* Data model for SubscribeRequest
|
|
355
380
|
*/
|
|
@@ -485,9 +510,9 @@ interface TraderProfileResponse {
|
|
|
485
510
|
profile?: TraderIdentity;
|
|
486
511
|
/** Trader's pUSD balance in micro-pUSD (6 decimals, e.g. 1000000 = 1 pUSD) */
|
|
487
512
|
pusd_balance?: number;
|
|
488
|
-
/** Polymarket Taker Rebate
|
|
513
|
+
/** Polymarket Taker Rebate tier level (0-6: 0=Tier 0, 1=Bronze, 2=Silver, 3=Gold, 4=Platinum, 5=Diamond, 6=Obsidian) */
|
|
489
514
|
taker_tier?: number;
|
|
490
|
-
/** Descriptive taker rebate tier name ("Tier 0", "Bronze", "Silver", "Gold", "Platinum", "Diamond", "Obsidian", or
|
|
515
|
+
/** Descriptive taker rebate tier name ("Tier 0", "Bronze", "Silver", "Gold", "Platinum", "Diamond", "Obsidian", or "" if unsynced) */
|
|
491
516
|
taker_tier_name?: string;
|
|
492
517
|
/** Performance breakdown across top 5 categories in last 30 days */
|
|
493
518
|
top_tags?: TagStat[];
|
|
@@ -552,6 +577,14 @@ interface UserCreateStreamRequest {
|
|
|
552
577
|
series?: string[];
|
|
553
578
|
tags?: string[];
|
|
554
579
|
}
|
|
580
|
+
/**
|
|
581
|
+
* Data model for UserDisconnectSessionResponse
|
|
582
|
+
*/
|
|
583
|
+
interface UserDisconnectSessionResponse {
|
|
584
|
+
conn_id?: string;
|
|
585
|
+
message?: string;
|
|
586
|
+
status?: string;
|
|
587
|
+
}
|
|
555
588
|
/**
|
|
556
589
|
* Data model for UserKeysResponse
|
|
557
590
|
*/
|
|
@@ -711,21 +744,6 @@ interface UserUpdateStreamMetadataRequest {
|
|
|
711
744
|
enabled?: boolean;
|
|
712
745
|
name?: string;
|
|
713
746
|
}
|
|
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
747
|
/**
|
|
730
748
|
* Data model for ValidatePromoCodeRequest
|
|
731
749
|
*/
|
|
@@ -746,36 +764,6 @@ interface ValidatePromoCodeResponse {
|
|
|
746
764
|
prorated_credit?: number;
|
|
747
765
|
valid?: boolean;
|
|
748
766
|
}
|
|
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
767
|
|
|
780
768
|
interface StreamOptions {
|
|
781
769
|
apiKey: string;
|
|
@@ -892,6 +880,13 @@ declare class StreamsService {
|
|
|
892
880
|
* @returns Models.UserActiveSessionsResponse
|
|
893
881
|
*/
|
|
894
882
|
getActiveSessions(): Promise<UserActiveSessionsResponse>;
|
|
883
|
+
/**
|
|
884
|
+
* Disconnect User Stream Connection
|
|
885
|
+
* Terminates an active SSE stream connection owned by this account, identified by its conn_id from getActiveSessions.
|
|
886
|
+
* @param id Connection ID (conn_...)
|
|
887
|
+
* @returns Models.UserDisconnectSessionResponse
|
|
888
|
+
*/
|
|
889
|
+
disconnectSession(id: string): Promise<UserDisconnectSessionResponse>;
|
|
895
890
|
/**
|
|
896
891
|
* List User Stream Session History
|
|
897
892
|
* Returns historical SSE connection logs including duration and pushed transactions count.
|
|
@@ -1038,13 +1033,6 @@ declare class AccountService {
|
|
|
1038
1033
|
* @returns Models.UserTelemetryResponse
|
|
1039
1034
|
*/
|
|
1040
1035
|
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
1036
|
}
|
|
1049
1037
|
/** Subscription Service: APIs for subscription operations */
|
|
1050
1038
|
declare class SubscriptionService {
|
|
@@ -1103,4 +1091,4 @@ declare class PolyEdgeClient {
|
|
|
1103
1091
|
stream(streamId: string, options?: Partial<StreamOptions>): PolyEdgeStream;
|
|
1104
1092
|
}
|
|
1105
1093
|
|
|
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
|
|
1094
|
+
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
|
/**
|
|
@@ -350,6 +362,19 @@ interface QuoteSubscriptionResponse {
|
|
|
350
362
|
prorated_credit?: number;
|
|
351
363
|
tier?: string;
|
|
352
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* Data model for RecentDeposit
|
|
367
|
+
*/
|
|
368
|
+
interface RecentDeposit {
|
|
369
|
+
/** Deposited collateral amount in micro-USD (6 decimals, e.g. 100000000 for 100 USDC) */
|
|
370
|
+
amount?: number;
|
|
371
|
+
/** Source funding address (0x...) */
|
|
372
|
+
from?: string;
|
|
373
|
+
/** Deposit execution timestamp in RFC3339 UTC format */
|
|
374
|
+
time?: string;
|
|
375
|
+
/** On-chain transaction hash (0x...) */
|
|
376
|
+
tx_hash?: string;
|
|
377
|
+
}
|
|
353
378
|
/**
|
|
354
379
|
* Data model for SubscribeRequest
|
|
355
380
|
*/
|
|
@@ -485,9 +510,9 @@ interface TraderProfileResponse {
|
|
|
485
510
|
profile?: TraderIdentity;
|
|
486
511
|
/** Trader's pUSD balance in micro-pUSD (6 decimals, e.g. 1000000 = 1 pUSD) */
|
|
487
512
|
pusd_balance?: number;
|
|
488
|
-
/** Polymarket Taker Rebate
|
|
513
|
+
/** Polymarket Taker Rebate tier level (0-6: 0=Tier 0, 1=Bronze, 2=Silver, 3=Gold, 4=Platinum, 5=Diamond, 6=Obsidian) */
|
|
489
514
|
taker_tier?: number;
|
|
490
|
-
/** Descriptive taker rebate tier name ("Tier 0", "Bronze", "Silver", "Gold", "Platinum", "Diamond", "Obsidian", or
|
|
515
|
+
/** Descriptive taker rebate tier name ("Tier 0", "Bronze", "Silver", "Gold", "Platinum", "Diamond", "Obsidian", or "" if unsynced) */
|
|
491
516
|
taker_tier_name?: string;
|
|
492
517
|
/** Performance breakdown across top 5 categories in last 30 days */
|
|
493
518
|
top_tags?: TagStat[];
|
|
@@ -552,6 +577,14 @@ interface UserCreateStreamRequest {
|
|
|
552
577
|
series?: string[];
|
|
553
578
|
tags?: string[];
|
|
554
579
|
}
|
|
580
|
+
/**
|
|
581
|
+
* Data model for UserDisconnectSessionResponse
|
|
582
|
+
*/
|
|
583
|
+
interface UserDisconnectSessionResponse {
|
|
584
|
+
conn_id?: string;
|
|
585
|
+
message?: string;
|
|
586
|
+
status?: string;
|
|
587
|
+
}
|
|
555
588
|
/**
|
|
556
589
|
* Data model for UserKeysResponse
|
|
557
590
|
*/
|
|
@@ -711,21 +744,6 @@ interface UserUpdateStreamMetadataRequest {
|
|
|
711
744
|
enabled?: boolean;
|
|
712
745
|
name?: string;
|
|
713
746
|
}
|
|
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
747
|
/**
|
|
730
748
|
* Data model for ValidatePromoCodeRequest
|
|
731
749
|
*/
|
|
@@ -746,36 +764,6 @@ interface ValidatePromoCodeResponse {
|
|
|
746
764
|
prorated_credit?: number;
|
|
747
765
|
valid?: boolean;
|
|
748
766
|
}
|
|
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
767
|
|
|
780
768
|
interface StreamOptions {
|
|
781
769
|
apiKey: string;
|
|
@@ -892,6 +880,13 @@ declare class StreamsService {
|
|
|
892
880
|
* @returns Models.UserActiveSessionsResponse
|
|
893
881
|
*/
|
|
894
882
|
getActiveSessions(): Promise<UserActiveSessionsResponse>;
|
|
883
|
+
/**
|
|
884
|
+
* Disconnect User Stream Connection
|
|
885
|
+
* Terminates an active SSE stream connection owned by this account, identified by its conn_id from getActiveSessions.
|
|
886
|
+
* @param id Connection ID (conn_...)
|
|
887
|
+
* @returns Models.UserDisconnectSessionResponse
|
|
888
|
+
*/
|
|
889
|
+
disconnectSession(id: string): Promise<UserDisconnectSessionResponse>;
|
|
895
890
|
/**
|
|
896
891
|
* List User Stream Session History
|
|
897
892
|
* Returns historical SSE connection logs including duration and pushed transactions count.
|
|
@@ -1038,13 +1033,6 @@ declare class AccountService {
|
|
|
1038
1033
|
* @returns Models.UserTelemetryResponse
|
|
1039
1034
|
*/
|
|
1040
1035
|
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
1036
|
}
|
|
1049
1037
|
/** Subscription Service: APIs for subscription operations */
|
|
1050
1038
|
declare class SubscriptionService {
|
|
@@ -1103,4 +1091,4 @@ declare class PolyEdgeClient {
|
|
|
1103
1091
|
stream(streamId: string, options?: Partial<StreamOptions>): PolyEdgeStream;
|
|
1104
1092
|
}
|
|
1105
1093
|
|
|
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
|
|
1094
|
+
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.1.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",
|