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
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
export declare class Ctf extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Merges equal amounts of YES and NO outcome tokens back into USDC collateral. The
|
|
7
|
+
* transaction is submitted gaslessly through Polymarket's relayer.
|
|
8
|
+
* Polymarket-only.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const ctfResponse = await client.ctf.merge({
|
|
13
|
+
* amount: '1000000',
|
|
14
|
+
* condition_id:
|
|
15
|
+
* '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
merge(body: CtfMergeParams, options?: RequestOptions): APIPromise<CtfResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Redeems winning outcome tokens for USDC after a market has resolved. The
|
|
22
|
+
* transaction is submitted gaslessly through Polymarket's relayer. For neg-risk
|
|
23
|
+
* markets, set `neg_risk: true` and provide `amounts`. Polymarket-only.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const ctfResponse = await client.ctf.redeem({
|
|
28
|
+
* condition_id:
|
|
29
|
+
* '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
redeem(body: CtfRedeemParams, options?: RequestOptions): APIPromise<CtfResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Splits USDC collateral into YES and NO outcome tokens for a binary market
|
|
36
|
+
* condition. The transaction is submitted gaslessly through Polymarket's relayer.
|
|
37
|
+
* Polymarket-only.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const ctfResponse = await client.ctf.split({
|
|
42
|
+
* amount: '1000000',
|
|
43
|
+
* condition_id:
|
|
44
|
+
* '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
split(body: CtfSplitParams, options?: RequestOptions): APIPromise<CtfResponse>;
|
|
49
|
+
}
|
|
50
|
+
export interface CtfResponse {
|
|
51
|
+
/**
|
|
52
|
+
* Relayer transaction status.
|
|
53
|
+
*/
|
|
54
|
+
status?: string;
|
|
55
|
+
/**
|
|
56
|
+
* On-chain transaction hash.
|
|
57
|
+
*/
|
|
58
|
+
transaction_hash?: string | null;
|
|
59
|
+
}
|
|
60
|
+
export interface CtfMergeParams {
|
|
61
|
+
/**
|
|
62
|
+
* USDC amount in smallest unit (6 decimals).
|
|
63
|
+
*/
|
|
64
|
+
amount: string;
|
|
65
|
+
/**
|
|
66
|
+
* Condition ID (bytes32 hex).
|
|
67
|
+
*/
|
|
68
|
+
condition_id: string;
|
|
69
|
+
}
|
|
70
|
+
export interface CtfRedeemParams {
|
|
71
|
+
/**
|
|
72
|
+
* Condition ID (bytes32 hex).
|
|
73
|
+
*/
|
|
74
|
+
condition_id: string;
|
|
75
|
+
/**
|
|
76
|
+
* Token amounts for each outcome (required when neg_risk is true).
|
|
77
|
+
*/
|
|
78
|
+
amounts?: Array<string>;
|
|
79
|
+
/**
|
|
80
|
+
* Set to true for neg-risk (multi-outcome) markets.
|
|
81
|
+
*/
|
|
82
|
+
neg_risk?: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface CtfSplitParams {
|
|
85
|
+
/**
|
|
86
|
+
* USDC amount in smallest unit (6 decimals).
|
|
87
|
+
*/
|
|
88
|
+
amount: string;
|
|
89
|
+
/**
|
|
90
|
+
* Condition ID (bytes32 hex).
|
|
91
|
+
*/
|
|
92
|
+
condition_id: string;
|
|
93
|
+
}
|
|
94
|
+
export declare namespace Ctf {
|
|
95
|
+
export { type CtfResponse as CtfResponse, type CtfMergeParams as CtfMergeParams, type CtfRedeemParams as CtfRedeemParams, type CtfSplitParams as CtfSplitParams, };
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=ctf.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ctf.d.mts","sourceRoot":"","sources":["../src/resources/ctf.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,GAAI,SAAQ,WAAW;IAClC;;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estOptions } from "../internal/request-options.js";
|
|
4
|
+
export declare class Ctf extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Merges equal amounts of YES and NO outcome tokens back into USDC collateral. The
|
|
7
|
+
* transaction is submitted gaslessly through Polymarket's relayer.
|
|
8
|
+
* Polymarket-only.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const ctfResponse = await client.ctf.merge({
|
|
13
|
+
* amount: '1000000',
|
|
14
|
+
* condition_id:
|
|
15
|
+
* '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
merge(body: CtfMergeParams, options?: RequestOptions): APIPromise<CtfResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Redeems winning outcome tokens for USDC after a market has resolved. The
|
|
22
|
+
* transaction is submitted gaslessly through Polymarket's relayer. For neg-risk
|
|
23
|
+
* markets, set `neg_risk: true` and provide `amounts`. Polymarket-only.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const ctfResponse = await client.ctf.redeem({
|
|
28
|
+
* condition_id:
|
|
29
|
+
* '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
redeem(body: CtfRedeemParams, options?: RequestOptions): APIPromise<CtfResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Splits USDC collateral into YES and NO outcome tokens for a binary market
|
|
36
|
+
* condition. The transaction is submitted gaslessly through Polymarket's relayer.
|
|
37
|
+
* Polymarket-only.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const ctfResponse = await client.ctf.split({
|
|
42
|
+
* amount: '1000000',
|
|
43
|
+
* condition_id:
|
|
44
|
+
* '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
split(body: CtfSplitParams, options?: RequestOptions): APIPromise<CtfResponse>;
|
|
49
|
+
}
|
|
50
|
+
export interface CtfResponse {
|
|
51
|
+
/**
|
|
52
|
+
* Relayer transaction status.
|
|
53
|
+
*/
|
|
54
|
+
status?: string;
|
|
55
|
+
/**
|
|
56
|
+
* On-chain transaction hash.
|
|
57
|
+
*/
|
|
58
|
+
transaction_hash?: string | null;
|
|
59
|
+
}
|
|
60
|
+
export interface CtfMergeParams {
|
|
61
|
+
/**
|
|
62
|
+
* USDC amount in smallest unit (6 decimals).
|
|
63
|
+
*/
|
|
64
|
+
amount: string;
|
|
65
|
+
/**
|
|
66
|
+
* Condition ID (bytes32 hex).
|
|
67
|
+
*/
|
|
68
|
+
condition_id: string;
|
|
69
|
+
}
|
|
70
|
+
export interface CtfRedeemParams {
|
|
71
|
+
/**
|
|
72
|
+
* Condition ID (bytes32 hex).
|
|
73
|
+
*/
|
|
74
|
+
condition_id: string;
|
|
75
|
+
/**
|
|
76
|
+
* Token amounts for each outcome (required when neg_risk is true).
|
|
77
|
+
*/
|
|
78
|
+
amounts?: Array<string>;
|
|
79
|
+
/**
|
|
80
|
+
* Set to true for neg-risk (multi-outcome) markets.
|
|
81
|
+
*/
|
|
82
|
+
neg_risk?: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface CtfSplitParams {
|
|
85
|
+
/**
|
|
86
|
+
* USDC amount in smallest unit (6 decimals).
|
|
87
|
+
*/
|
|
88
|
+
amount: string;
|
|
89
|
+
/**
|
|
90
|
+
* Condition ID (bytes32 hex).
|
|
91
|
+
*/
|
|
92
|
+
condition_id: string;
|
|
93
|
+
}
|
|
94
|
+
export declare namespace Ctf {
|
|
95
|
+
export { type CtfResponse as CtfResponse, type CtfMergeParams as CtfMergeParams, type CtfRedeemParams as CtfRedeemParams, type CtfSplitParams as CtfSplitParams, };
|
|
96
|
+
}
|
|
97
|
+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WAAW,IAAI,WAAW,EAC/B,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
|
package/resources/ctf.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Ctf = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
class Ctf extends resource_1.APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Merges equal amounts of YES and NO outcome tokens back into USDC collateral. The
|
|
9
|
+
* transaction is submitted gaslessly through Polymarket's relayer.
|
|
10
|
+
* Polymarket-only.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const ctfResponse = await client.ctf.merge({
|
|
15
|
+
* amount: '1000000',
|
|
16
|
+
* condition_id:
|
|
17
|
+
* '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
merge(body, options) {
|
|
22
|
+
return this._client.post('/api/v1/polymarket/ctf/merge', { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Redeems winning outcome tokens for USDC after a market has resolved. The
|
|
26
|
+
* transaction is submitted gaslessly through Polymarket's relayer. For neg-risk
|
|
27
|
+
* markets, set `neg_risk: true` and provide `amounts`. Polymarket-only.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const ctfResponse = await client.ctf.redeem({
|
|
32
|
+
* condition_id:
|
|
33
|
+
* '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
redeem(body, options) {
|
|
38
|
+
return this._client.post('/api/v1/polymarket/ctf/redeem', { body, ...options });
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Splits USDC collateral into YES and NO outcome tokens for a binary market
|
|
42
|
+
* condition. The transaction is submitted gaslessly through Polymarket's relayer.
|
|
43
|
+
* Polymarket-only.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const ctfResponse = await client.ctf.split({
|
|
48
|
+
* amount: '1000000',
|
|
49
|
+
* condition_id:
|
|
50
|
+
* '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
split(body, options) {
|
|
55
|
+
return this._client.post('/api/v1/polymarket/ctf/split', { body, ...options });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.Ctf = Ctf;
|
|
59
|
+
//# sourceMappingURL=ctf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ctf.js","sourceRoot":"","sources":["../src/resources/ctf.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,GAAI,SAAQ,sBAAW;IAClC;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAoB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAoB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;CACF;AArDD,kBAqDC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
export class Ctf extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Merges equal amounts of YES and NO outcome tokens back into USDC collateral. The
|
|
6
|
+
* transaction is submitted gaslessly through Polymarket's relayer.
|
|
7
|
+
* Polymarket-only.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const ctfResponse = await client.ctf.merge({
|
|
12
|
+
* amount: '1000000',
|
|
13
|
+
* condition_id:
|
|
14
|
+
* '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
merge(body, options) {
|
|
19
|
+
return this._client.post('/api/v1/polymarket/ctf/merge', { body, ...options });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Redeems winning outcome tokens for USDC after a market has resolved. The
|
|
23
|
+
* transaction is submitted gaslessly through Polymarket's relayer. For neg-risk
|
|
24
|
+
* markets, set `neg_risk: true` and provide `amounts`. Polymarket-only.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const ctfResponse = await client.ctf.redeem({
|
|
29
|
+
* condition_id:
|
|
30
|
+
* '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
redeem(body, options) {
|
|
35
|
+
return this._client.post('/api/v1/polymarket/ctf/redeem', { body, ...options });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Splits USDC collateral into YES and NO outcome tokens for a binary market
|
|
39
|
+
* condition. The transaction is submitted gaslessly through Polymarket's relayer.
|
|
40
|
+
* Polymarket-only.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const ctfResponse = await client.ctf.split({
|
|
45
|
+
* amount: '1000000',
|
|
46
|
+
* condition_id:
|
|
47
|
+
* '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
split(body, options) {
|
|
52
|
+
return this._client.post('/api/v1/polymarket/ctf/split', { body, ...options });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=ctf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ctf.mjs","sourceRoot":"","sources":["../src/resources/ctf.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,GAAI,SAAQ,WAAW;IAClC;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAoB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAoB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;CACF"}
|
package/resources/events.d.mts
CHANGED
|
@@ -3,8 +3,9 @@ import { APIPromise } from "../core/api-promise.mjs";
|
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
4
|
export declare class Events extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
* Aggregates markets by event ID from the
|
|
7
|
-
* sorted by total volume (descending). Markets without an event_id are
|
|
6
|
+
* Aggregates markets by event ID from the DuckDB gold layer. Returns event
|
|
7
|
+
* summaries sorted by total volume (descending). Markets without an event_id are
|
|
8
|
+
* excluded.
|
|
8
9
|
*/
|
|
9
10
|
list(query?: EventListParams | null | undefined, options?: RequestOptions): APIPromise<EventListResponse>;
|
|
10
11
|
}
|
|
@@ -70,16 +71,6 @@ export declare namespace EventListResponse {
|
|
|
70
71
|
* Market outcomes with optional price and token ID.
|
|
71
72
|
*/
|
|
72
73
|
outcomes: Array<Market.Outcome>;
|
|
73
|
-
/**
|
|
74
|
-
* Convenience getter for binary markets: outcome where `name` is "Yes"
|
|
75
|
-
* (case-insensitive).
|
|
76
|
-
*/
|
|
77
|
-
readonly yes?: Market.Outcome;
|
|
78
|
-
/**
|
|
79
|
-
* Convenience getter for binary markets: outcome where `name` is "No"
|
|
80
|
-
* (case-insensitive).
|
|
81
|
-
*/
|
|
82
|
-
readonly no?: Market.Outcome;
|
|
83
74
|
/**
|
|
84
75
|
* Parsec group ID for cross-exchange event grouping.
|
|
85
76
|
*/
|
|
@@ -129,6 +120,14 @@ export declare namespace EventListResponse {
|
|
|
129
120
|
* Event start time.
|
|
130
121
|
*/
|
|
131
122
|
event_start_time?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Market icon URL.
|
|
125
|
+
*/
|
|
126
|
+
icon_url?: string | null;
|
|
127
|
+
/**
|
|
128
|
+
* Market image URL.
|
|
129
|
+
*/
|
|
130
|
+
image_url?: string | null;
|
|
132
131
|
/**
|
|
133
132
|
* Date of last data collection.
|
|
134
133
|
*/
|
|
@@ -141,6 +140,10 @@ export declare namespace EventListResponse {
|
|
|
141
140
|
* Current liquidity (USDC).
|
|
142
141
|
*/
|
|
143
142
|
liquidity?: number;
|
|
143
|
+
/**
|
|
144
|
+
* Cross-exchange same-market relations. Only included when `include_matches=true`.
|
|
145
|
+
*/
|
|
146
|
+
matched_markets?: Array<Market.MatchedMarket>;
|
|
144
147
|
/**
|
|
145
148
|
* Minimum order size in contracts. Varies per market on Polymarket (e.g. 5, 15);
|
|
146
149
|
* typically 1 on Kalshi.
|
|
@@ -154,6 +157,15 @@ export declare namespace EventListResponse {
|
|
|
154
157
|
* Number of outcomes in this market.
|
|
155
158
|
*/
|
|
156
159
|
outcome_count?: number;
|
|
160
|
+
/**
|
|
161
|
+
* When bid/ask/last_price was last refreshed (upgraded to now when live WS data
|
|
162
|
+
* overlays the snapshot).
|
|
163
|
+
*/
|
|
164
|
+
price_updated_at?: string | null;
|
|
165
|
+
/**
|
|
166
|
+
* Co-dependent market relations. Only included when `include_related=true`.
|
|
167
|
+
*/
|
|
168
|
+
related_markets?: Array<Market.RelatedMarket>;
|
|
157
169
|
/**
|
|
158
170
|
* Market resolution rules.
|
|
159
171
|
*/
|
|
@@ -194,6 +206,66 @@ export declare namespace EventListResponse {
|
|
|
194
206
|
*/
|
|
195
207
|
token_id?: string;
|
|
196
208
|
}
|
|
209
|
+
interface MatchedMarket {
|
|
210
|
+
/**
|
|
211
|
+
* Match confidence score (0.0–1.0).
|
|
212
|
+
*/
|
|
213
|
+
confidence: number;
|
|
214
|
+
/**
|
|
215
|
+
* Confidence tier: HIGH, MEDIUM, or LOW.
|
|
216
|
+
*/
|
|
217
|
+
confidence_tier: string;
|
|
218
|
+
/**
|
|
219
|
+
* Exchange of the related market.
|
|
220
|
+
*/
|
|
221
|
+
exchange: string;
|
|
222
|
+
/**
|
|
223
|
+
* Parsec ID of the related market.
|
|
224
|
+
*/
|
|
225
|
+
parsec_id: string;
|
|
226
|
+
/**
|
|
227
|
+
* Source of the match (e.g., embedding, llm).
|
|
228
|
+
*/
|
|
229
|
+
source: string;
|
|
230
|
+
/**
|
|
231
|
+
* Direction of dependency (for related markets only).
|
|
232
|
+
*/
|
|
233
|
+
dependency_direction?: string | null;
|
|
234
|
+
/**
|
|
235
|
+
* Type of dependency (for related markets only).
|
|
236
|
+
*/
|
|
237
|
+
dependency_type?: string | null;
|
|
238
|
+
}
|
|
239
|
+
interface RelatedMarket {
|
|
240
|
+
/**
|
|
241
|
+
* Match confidence score (0.0–1.0).
|
|
242
|
+
*/
|
|
243
|
+
confidence: number;
|
|
244
|
+
/**
|
|
245
|
+
* Confidence tier: HIGH, MEDIUM, or LOW.
|
|
246
|
+
*/
|
|
247
|
+
confidence_tier: string;
|
|
248
|
+
/**
|
|
249
|
+
* Exchange of the related market.
|
|
250
|
+
*/
|
|
251
|
+
exchange: string;
|
|
252
|
+
/**
|
|
253
|
+
* Parsec ID of the related market.
|
|
254
|
+
*/
|
|
255
|
+
parsec_id: string;
|
|
256
|
+
/**
|
|
257
|
+
* Source of the match (e.g., embedding, llm).
|
|
258
|
+
*/
|
|
259
|
+
source: string;
|
|
260
|
+
/**
|
|
261
|
+
* Direction of dependency (for related markets only).
|
|
262
|
+
*/
|
|
263
|
+
dependency_direction?: string | null;
|
|
264
|
+
/**
|
|
265
|
+
* Type of dependency (for related markets only).
|
|
266
|
+
*/
|
|
267
|
+
dependency_type?: string | null;
|
|
268
|
+
}
|
|
197
269
|
}
|
|
198
270
|
}
|
|
199
271
|
interface Pagination {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.mts","sourceRoot":"","sources":["../src/resources/events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;
|
|
1
|
+
{"version":3,"file":"events.d.mts","sourceRoot":"","sources":["../src/resources/events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACr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,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,QAAQ,EAAE,OAAO,CAAC;QAElB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;CACF;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE1B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,KAAK,eAAe,IAAI,eAAe,EAAE,CAAC;CACjG"}
|
package/resources/events.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import { APIPromise } from "../core/api-promise.js";
|
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
4
|
export declare class Events extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
* Aggregates markets by event ID from the
|
|
7
|
-
* sorted by total volume (descending). Markets without an event_id are
|
|
6
|
+
* Aggregates markets by event ID from the DuckDB gold layer. Returns event
|
|
7
|
+
* summaries sorted by total volume (descending). Markets without an event_id are
|
|
8
|
+
* excluded.
|
|
8
9
|
*/
|
|
9
10
|
list(query?: EventListParams | null | undefined, options?: RequestOptions): APIPromise<EventListResponse>;
|
|
10
11
|
}
|
|
@@ -70,16 +71,6 @@ export declare namespace EventListResponse {
|
|
|
70
71
|
* Market outcomes with optional price and token ID.
|
|
71
72
|
*/
|
|
72
73
|
outcomes: Array<Market.Outcome>;
|
|
73
|
-
/**
|
|
74
|
-
* Convenience getter for binary markets: outcome where `name` is "Yes"
|
|
75
|
-
* (case-insensitive).
|
|
76
|
-
*/
|
|
77
|
-
readonly yes?: Market.Outcome;
|
|
78
|
-
/**
|
|
79
|
-
* Convenience getter for binary markets: outcome where `name` is "No"
|
|
80
|
-
* (case-insensitive).
|
|
81
|
-
*/
|
|
82
|
-
readonly no?: Market.Outcome;
|
|
83
74
|
/**
|
|
84
75
|
* Parsec group ID for cross-exchange event grouping.
|
|
85
76
|
*/
|
|
@@ -129,6 +120,14 @@ export declare namespace EventListResponse {
|
|
|
129
120
|
* Event start time.
|
|
130
121
|
*/
|
|
131
122
|
event_start_time?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Market icon URL.
|
|
125
|
+
*/
|
|
126
|
+
icon_url?: string | null;
|
|
127
|
+
/**
|
|
128
|
+
* Market image URL.
|
|
129
|
+
*/
|
|
130
|
+
image_url?: string | null;
|
|
132
131
|
/**
|
|
133
132
|
* Date of last data collection.
|
|
134
133
|
*/
|
|
@@ -141,6 +140,10 @@ export declare namespace EventListResponse {
|
|
|
141
140
|
* Current liquidity (USDC).
|
|
142
141
|
*/
|
|
143
142
|
liquidity?: number;
|
|
143
|
+
/**
|
|
144
|
+
* Cross-exchange same-market relations. Only included when `include_matches=true`.
|
|
145
|
+
*/
|
|
146
|
+
matched_markets?: Array<Market.MatchedMarket>;
|
|
144
147
|
/**
|
|
145
148
|
* Minimum order size in contracts. Varies per market on Polymarket (e.g. 5, 15);
|
|
146
149
|
* typically 1 on Kalshi.
|
|
@@ -154,6 +157,15 @@ export declare namespace EventListResponse {
|
|
|
154
157
|
* Number of outcomes in this market.
|
|
155
158
|
*/
|
|
156
159
|
outcome_count?: number;
|
|
160
|
+
/**
|
|
161
|
+
* When bid/ask/last_price was last refreshed (upgraded to now when live WS data
|
|
162
|
+
* overlays the snapshot).
|
|
163
|
+
*/
|
|
164
|
+
price_updated_at?: string | null;
|
|
165
|
+
/**
|
|
166
|
+
* Co-dependent market relations. Only included when `include_related=true`.
|
|
167
|
+
*/
|
|
168
|
+
related_markets?: Array<Market.RelatedMarket>;
|
|
157
169
|
/**
|
|
158
170
|
* Market resolution rules.
|
|
159
171
|
*/
|
|
@@ -194,6 +206,66 @@ export declare namespace EventListResponse {
|
|
|
194
206
|
*/
|
|
195
207
|
token_id?: string;
|
|
196
208
|
}
|
|
209
|
+
interface MatchedMarket {
|
|
210
|
+
/**
|
|
211
|
+
* Match confidence score (0.0–1.0).
|
|
212
|
+
*/
|
|
213
|
+
confidence: number;
|
|
214
|
+
/**
|
|
215
|
+
* Confidence tier: HIGH, MEDIUM, or LOW.
|
|
216
|
+
*/
|
|
217
|
+
confidence_tier: string;
|
|
218
|
+
/**
|
|
219
|
+
* Exchange of the related market.
|
|
220
|
+
*/
|
|
221
|
+
exchange: string;
|
|
222
|
+
/**
|
|
223
|
+
* Parsec ID of the related market.
|
|
224
|
+
*/
|
|
225
|
+
parsec_id: string;
|
|
226
|
+
/**
|
|
227
|
+
* Source of the match (e.g., embedding, llm).
|
|
228
|
+
*/
|
|
229
|
+
source: string;
|
|
230
|
+
/**
|
|
231
|
+
* Direction of dependency (for related markets only).
|
|
232
|
+
*/
|
|
233
|
+
dependency_direction?: string | null;
|
|
234
|
+
/**
|
|
235
|
+
* Type of dependency (for related markets only).
|
|
236
|
+
*/
|
|
237
|
+
dependency_type?: string | null;
|
|
238
|
+
}
|
|
239
|
+
interface RelatedMarket {
|
|
240
|
+
/**
|
|
241
|
+
* Match confidence score (0.0–1.0).
|
|
242
|
+
*/
|
|
243
|
+
confidence: number;
|
|
244
|
+
/**
|
|
245
|
+
* Confidence tier: HIGH, MEDIUM, or LOW.
|
|
246
|
+
*/
|
|
247
|
+
confidence_tier: string;
|
|
248
|
+
/**
|
|
249
|
+
* Exchange of the related market.
|
|
250
|
+
*/
|
|
251
|
+
exchange: string;
|
|
252
|
+
/**
|
|
253
|
+
* Parsec ID of the related market.
|
|
254
|
+
*/
|
|
255
|
+
parsec_id: string;
|
|
256
|
+
/**
|
|
257
|
+
* Source of the match (e.g., embedding, llm).
|
|
258
|
+
*/
|
|
259
|
+
source: string;
|
|
260
|
+
/**
|
|
261
|
+
* Direction of dependency (for related markets only).
|
|
262
|
+
*/
|
|
263
|
+
dependency_direction?: string | null;
|
|
264
|
+
/**
|
|
265
|
+
* Type of dependency (for related markets only).
|
|
266
|
+
*/
|
|
267
|
+
dependency_type?: string | null;
|
|
268
|
+
}
|
|
197
269
|
}
|
|
198
270
|
}
|
|
199
271
|
interface Pagination {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/resources/events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/resources/events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;OAIG;IACH,IAAI,CACF,KAAK,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC;CAGjC;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAEvC,UAAU,EAAE,iBAAiB,CAAC,UAAU,CAAC;CAC1C;AAED,yBAAiB,iBAAiB,CAAC;IACjC,UAAiB,KAAK;QACpB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEzB;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,MAAM,EAAE,MAAM,CAA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EG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,KAAK,eAAe,IAAI,eAAe,EAAE,CAAC;CACjG"}
|
package/resources/events.js
CHANGED
|
@@ -3,25 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Events = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
|
-
const markets_1 = require("./markets.js");
|
|
7
6
|
class Events extends resource_1.APIResource {
|
|
8
7
|
/**
|
|
9
|
-
* Aggregates markets by event ID from the
|
|
10
|
-
* sorted by total volume (descending). Markets without an event_id are
|
|
8
|
+
* Aggregates markets by event ID from the DuckDB gold layer. Returns event
|
|
9
|
+
* summaries sorted by total volume (descending). Markets without an event_id are
|
|
10
|
+
* excluded.
|
|
11
11
|
*/
|
|
12
12
|
list(query = {}, options) {
|
|
13
|
-
|
|
14
|
-
query,
|
|
15
|
-
...options,
|
|
16
|
-
});
|
|
17
|
-
return request._thenUnwrap((data) => {
|
|
18
|
-
data.events.forEach((event) => {
|
|
19
|
-
if (!event.markets)
|
|
20
|
-
return;
|
|
21
|
-
event.markets = event.markets.map((market) => (0, markets_1.attachBinaryOutcomeGetters)(market));
|
|
22
|
-
});
|
|
23
|
-
return data;
|
|
24
|
-
});
|
|
13
|
+
return this._client.get('/api/v1/events', { query, ...options });
|
|
25
14
|
}
|
|
26
15
|
}
|
|
27
16
|
exports.Events = Events;
|