@catalyst-team/poly-sdk 0.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/.env +0 -0
- package/README.md +803 -0
- package/dist/__tests__/clob-api.test.d.ts +5 -0
- package/dist/__tests__/clob-api.test.d.ts.map +1 -0
- package/dist/__tests__/clob-api.test.js +240 -0
- package/dist/__tests__/clob-api.test.js.map +1 -0
- package/dist/__tests__/integration/bridge-client.integration.test.d.ts +11 -0
- package/dist/__tests__/integration/bridge-client.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/bridge-client.integration.test.js +260 -0
- package/dist/__tests__/integration/bridge-client.integration.test.js.map +1 -0
- package/dist/__tests__/integration/clob-api.integration.test.d.ts +13 -0
- package/dist/__tests__/integration/clob-api.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/clob-api.integration.test.js +170 -0
- package/dist/__tests__/integration/clob-api.integration.test.js.map +1 -0
- package/dist/__tests__/integration/ctf-client.integration.test.d.ts +17 -0
- package/dist/__tests__/integration/ctf-client.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/ctf-client.integration.test.js +234 -0
- package/dist/__tests__/integration/ctf-client.integration.test.js.map +1 -0
- package/dist/__tests__/integration/data-api.integration.test.d.ts +9 -0
- package/dist/__tests__/integration/data-api.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/data-api.integration.test.js +161 -0
- package/dist/__tests__/integration/data-api.integration.test.js.map +1 -0
- package/dist/__tests__/integration/gamma-api.integration.test.d.ts +9 -0
- package/dist/__tests__/integration/gamma-api.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/gamma-api.integration.test.js +170 -0
- package/dist/__tests__/integration/gamma-api.integration.test.js.map +1 -0
- package/dist/__tests__/test-utils.d.ts +92 -0
- package/dist/__tests__/test-utils.d.ts.map +1 -0
- package/dist/__tests__/test-utils.js +143 -0
- package/dist/__tests__/test-utils.js.map +1 -0
- package/dist/clients/bridge-client.d.ts +388 -0
- package/dist/clients/bridge-client.d.ts.map +1 -0
- package/dist/clients/bridge-client.js +587 -0
- package/dist/clients/bridge-client.js.map +1 -0
- package/dist/clients/clob-api.d.ts +318 -0
- package/dist/clients/clob-api.d.ts.map +1 -0
- package/dist/clients/clob-api.js +388 -0
- package/dist/clients/clob-api.js.map +1 -0
- package/dist/clients/ctf-client.d.ts +473 -0
- package/dist/clients/ctf-client.d.ts.map +1 -0
- package/dist/clients/ctf-client.js +915 -0
- package/dist/clients/ctf-client.js.map +1 -0
- package/dist/clients/data-api.d.ts +134 -0
- package/dist/clients/data-api.d.ts.map +1 -0
- package/dist/clients/data-api.js +265 -0
- package/dist/clients/data-api.js.map +1 -0
- package/dist/clients/gamma-api.d.ts +401 -0
- package/dist/clients/gamma-api.d.ts.map +1 -0
- package/dist/clients/gamma-api.js +352 -0
- package/dist/clients/gamma-api.js.map +1 -0
- package/dist/clients/trading-client.d.ts +252 -0
- package/dist/clients/trading-client.d.ts.map +1 -0
- package/dist/clients/trading-client.js +543 -0
- package/dist/clients/trading-client.js.map +1 -0
- package/dist/clients/websocket-manager.d.ts +100 -0
- package/dist/clients/websocket-manager.d.ts.map +1 -0
- package/dist/clients/websocket-manager.js +193 -0
- package/dist/clients/websocket-manager.js.map +1 -0
- package/dist/core/cache-adapter-bridge.d.ts +36 -0
- package/dist/core/cache-adapter-bridge.d.ts.map +1 -0
- package/dist/core/cache-adapter-bridge.js +81 -0
- package/dist/core/cache-adapter-bridge.js.map +1 -0
- package/dist/core/cache.d.ts +40 -0
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/cache.js +71 -0
- package/dist/core/cache.js.map +1 -0
- package/dist/core/errors.d.ts +38 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +84 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/rate-limiter.d.ts +31 -0
- package/dist/core/rate-limiter.d.ts.map +1 -0
- package/dist/core/rate-limiter.js +70 -0
- package/dist/core/rate-limiter.js.map +1 -0
- package/dist/core/types.d.ts +314 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +19 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/unified-cache.d.ts +63 -0
- package/dist/core/unified-cache.d.ts.map +1 -0
- package/dist/core/unified-cache.js +114 -0
- package/dist/core/unified-cache.js.map +1 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +258 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/errors.d.ts +33 -0
- package/dist/mcp/errors.d.ts.map +1 -0
- package/dist/mcp/errors.js +86 -0
- package/dist/mcp/errors.js.map +1 -0
- package/dist/mcp/index.d.ts +62 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +173 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +17 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +155 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/guide.d.ts +12 -0
- package/dist/mcp/tools/guide.d.ts.map +1 -0
- package/dist/mcp/tools/guide.js +801 -0
- package/dist/mcp/tools/guide.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +11 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +27 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/market.d.ts +11 -0
- package/dist/mcp/tools/market.d.ts.map +1 -0
- package/dist/mcp/tools/market.js +314 -0
- package/dist/mcp/tools/market.js.map +1 -0
- package/dist/mcp/tools/order.d.ts +10 -0
- package/dist/mcp/tools/order.d.ts.map +1 -0
- package/dist/mcp/tools/order.js +258 -0
- package/dist/mcp/tools/order.js.map +1 -0
- package/dist/mcp/tools/trade.d.ts +38 -0
- package/dist/mcp/tools/trade.d.ts.map +1 -0
- package/dist/mcp/tools/trade.js +314 -0
- package/dist/mcp/tools/trade.js.map +1 -0
- package/dist/mcp/tools/trader.d.ts +11 -0
- package/dist/mcp/tools/trader.d.ts.map +1 -0
- package/dist/mcp/tools/trader.js +277 -0
- package/dist/mcp/tools/trader.js.map +1 -0
- package/dist/mcp/tools/wallet.d.ts +274 -0
- package/dist/mcp/tools/wallet.d.ts.map +1 -0
- package/dist/mcp/tools/wallet.js +579 -0
- package/dist/mcp/tools/wallet.js.map +1 -0
- package/dist/mcp/types.d.ts +413 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +5 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/services/authorization-service.d.ts +97 -0
- package/dist/services/authorization-service.d.ts.map +1 -0
- package/dist/services/authorization-service.js +279 -0
- package/dist/services/authorization-service.js.map +1 -0
- package/dist/services/market-service.d.ts +108 -0
- package/dist/services/market-service.d.ts.map +1 -0
- package/dist/services/market-service.js +458 -0
- package/dist/services/market-service.js.map +1 -0
- package/dist/services/realtime-service.d.ts +82 -0
- package/dist/services/realtime-service.d.ts.map +1 -0
- package/dist/services/realtime-service.js +150 -0
- package/dist/services/realtime-service.js.map +1 -0
- package/dist/services/swap-service.d.ts +217 -0
- package/dist/services/swap-service.d.ts.map +1 -0
- package/dist/services/swap-service.js +695 -0
- package/dist/services/swap-service.js.map +1 -0
- package/dist/services/wallet-service.d.ts +94 -0
- package/dist/services/wallet-service.d.ts.map +1 -0
- package/dist/services/wallet-service.js +173 -0
- package/dist/services/wallet-service.js.map +1 -0
- package/dist/utils/price-utils.d.ts +153 -0
- package/dist/utils/price-utils.d.ts.map +1 -0
- package/dist/utils/price-utils.js +236 -0
- package/dist/utils/price-utils.js.map +1 -0
- package/docs/00-design.md +760 -0
- package/docs/01-mcp.md +2041 -0
- package/docs/02-API.md +1148 -0
- package/docs/e2e/01-trader-tools.md +159 -0
- package/docs/e2e/02-market-tools.md +180 -0
- package/docs/e2e/03-order-tools.md +166 -0
- package/docs/e2e/04-wallet-tools.md +224 -0
- package/docs/e2e/05-trading-tools.md +327 -0
- package/docs/e2e/06-integration-scenarios.md +481 -0
- package/docs/e2e/coordinator.md +376 -0
- package/examples/01-basic-usage.ts +68 -0
- package/examples/02-smart-money.ts +95 -0
- package/examples/03-market-analysis.ts +108 -0
- package/examples/04-kline-aggregation.ts +158 -0
- package/examples/05-follow-wallet-strategy.ts +156 -0
- package/examples/06-services-demo.ts +124 -0
- package/examples/07-realtime-websocket.ts +117 -0
- package/examples/08-trading-orders.ts +278 -0
- package/examples/09-rewards-tracking.ts +187 -0
- package/examples/10-ctf-operations.ts +336 -0
- package/examples/11-live-arbitrage-scan.ts +221 -0
- package/examples/12-trending-arb-monitor.ts +406 -0
- package/examples/README.md +179 -0
- package/package.json +62 -0
- package/scripts/README.md +163 -0
- package/scripts/approvals/approve-erc1155.ts +129 -0
- package/scripts/approvals/approve-neg-risk-erc1155.ts +149 -0
- package/scripts/approvals/approve-neg-risk.ts +102 -0
- package/scripts/approvals/check-all-allowances.ts +150 -0
- package/scripts/approvals/check-allowance.ts +129 -0
- package/scripts/approvals/check-ctf-approval.ts +158 -0
- package/scripts/datas/001-report.md +486 -0
- package/scripts/datas/clone-modal-screenshot.png +0 -0
- package/scripts/deposit/deposit-native-usdc.ts +179 -0
- package/scripts/deposit/deposit-usdc.ts +155 -0
- package/scripts/deposit/swap-usdc-to-usdce.ts +375 -0
- package/scripts/research/research-markets.ts +166 -0
- package/scripts/trading/check-orders.ts +50 -0
- package/scripts/trading/sell-nvidia-positions.ts +206 -0
- package/scripts/trading/test-order.ts +172 -0
- package/scripts/truth.md +440 -0
- package/scripts/verify/test-approve-trading.ts +98 -0
- package/scripts/verify/test-provider-fix.ts +43 -0
- package/scripts/verify/test-search-mcp.ts +113 -0
- package/scripts/verify/verify-all-apis.ts +160 -0
- package/scripts/wallet/check-wallet-balances.ts +75 -0
- package/scripts/wallet/test-wallet-operations.ts +191 -0
- package/scripts/wallet/verify-wallet-tools.ts +124 -0
- package/src/__tests__/clob-api.test.ts +301 -0
- package/src/__tests__/integration/bridge-client.integration.test.ts +314 -0
- package/src/__tests__/integration/clob-api.integration.test.ts +218 -0
- package/src/__tests__/integration/ctf-client.integration.test.ts +331 -0
- package/src/__tests__/integration/data-api.integration.test.ts +194 -0
- package/src/__tests__/integration/gamma-api.integration.test.ts +206 -0
- package/src/__tests__/test-utils.ts +170 -0
- package/src/clients/bridge-client.ts +841 -0
- package/src/clients/clob-api.ts +629 -0
- package/src/clients/ctf-client.ts +1216 -0
- package/src/clients/data-api.ts +469 -0
- package/src/clients/gamma-api.ts +597 -0
- package/src/clients/trading-client.ts +749 -0
- package/src/clients/websocket-manager.ts +267 -0
- package/src/core/cache-adapter-bridge.ts +94 -0
- package/src/core/cache.ts +85 -0
- package/src/core/errors.ts +117 -0
- package/src/core/rate-limiter.ts +74 -0
- package/src/core/types.ts +360 -0
- package/src/core/unified-cache.ts +153 -0
- package/src/index.ts +455 -0
- package/src/mcp/README.md +380 -0
- package/src/mcp/errors.ts +124 -0
- package/src/mcp/index.ts +309 -0
- package/src/mcp/server.ts +183 -0
- package/src/mcp/tools/guide.ts +821 -0
- package/src/mcp/tools/index.ts +73 -0
- package/src/mcp/tools/market.ts +363 -0
- package/src/mcp/tools/order.ts +326 -0
- package/src/mcp/tools/trade.ts +417 -0
- package/src/mcp/tools/trader.ts +322 -0
- package/src/mcp/tools/wallet.ts +683 -0
- package/src/mcp/types.ts +472 -0
- package/src/services/authorization-service.ts +357 -0
- package/src/services/market-service.ts +544 -0
- package/src/services/realtime-service.ts +196 -0
- package/src/services/swap-service.ts +896 -0
- package/src/services/wallet-service.ts +259 -0
- package/src/utils/price-utils.ts +307 -0
- package/tsconfig.json +8 -0
- package/vitest.config.ts +19 -0
- package/vitest.integration.config.ts +18 -0
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CTF (Conditional Token Framework) Client
|
|
3
|
+
*
|
|
4
|
+
* Provides on-chain operations for Polymarket's conditional tokens:
|
|
5
|
+
* - Split: USDC → YES + NO token pair
|
|
6
|
+
* - Merge: YES + NO → USDC
|
|
7
|
+
* - Redeem: Winning tokens → USDC (after market resolution)
|
|
8
|
+
*
|
|
9
|
+
* ⚠️ CRITICAL: Polymarket CTF uses USDC.e (bridged), NOT native USDC!
|
|
10
|
+
*
|
|
11
|
+
* | Token | Address | CTF Compatible |
|
|
12
|
+
* |---------------|--------------------------------------------|-----------------
|
|
13
|
+
* | USDC.e | 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 | ✅ Yes |
|
|
14
|
+
* | Native USDC | 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359 | ❌ No |
|
|
15
|
+
*
|
|
16
|
+
* Common Mistake:
|
|
17
|
+
* - Your wallet has native USDC but CTF operations fail
|
|
18
|
+
* - Solution: Use SwapService.transferUsdcE() or swap native USDC to USDC.e
|
|
19
|
+
*
|
|
20
|
+
* Based on: docs/01-product-research/06-poly-sdk/05-ctf-integration-plan.md
|
|
21
|
+
*
|
|
22
|
+
* Contract: Gnosis Conditional Tokens on Polygon
|
|
23
|
+
* https://docs.polymarket.com/developers/CTF/overview
|
|
24
|
+
*/
|
|
25
|
+
import { BigNumber } from 'ethers';
|
|
26
|
+
export declare const CTF_CONTRACT = "0x4D97DCd97eC945f40cF65F87097ACe5EA0476045";
|
|
27
|
+
/**
|
|
28
|
+
* USDC.e (Bridged USDC) - The ONLY USDC accepted by Polymarket CTF
|
|
29
|
+
*
|
|
30
|
+
* ⚠️ WARNING: This is NOT native USDC (0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359)
|
|
31
|
+
*
|
|
32
|
+
* If your wallet has native USDC but CTF operations fail with "Insufficient USDC balance",
|
|
33
|
+
* you need to swap your native USDC to USDC.e first using:
|
|
34
|
+
* - SwapService.swap('USDC', 'USDC_E', amount)
|
|
35
|
+
* - Or transfer USDC.e using SwapService.transferUsdcE()
|
|
36
|
+
*/
|
|
37
|
+
export declare const USDC_CONTRACT = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174";
|
|
38
|
+
/** Native USDC on Polygon - NOT compatible with CTF */
|
|
39
|
+
export declare const NATIVE_USDC_CONTRACT = "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359";
|
|
40
|
+
export declare const NEG_RISK_CTF_EXCHANGE = "0xC5d563A36AE78145C45a50134d48A1215220f80a";
|
|
41
|
+
export declare const NEG_RISK_ADAPTER = "0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296";
|
|
42
|
+
export declare const USDC_DECIMALS = 6;
|
|
43
|
+
export interface CTFConfig {
|
|
44
|
+
/** Private key for signing transactions */
|
|
45
|
+
privateKey: string;
|
|
46
|
+
/** RPC URL (default: Polygon mainnet) */
|
|
47
|
+
rpcUrl?: string;
|
|
48
|
+
/** Chain ID (default: 137 for Polygon) */
|
|
49
|
+
chainId?: number;
|
|
50
|
+
/** Gas price multiplier (default: 1.2) */
|
|
51
|
+
gasPriceMultiplier?: number;
|
|
52
|
+
/** Transaction confirmation blocks (default: 1) */
|
|
53
|
+
confirmations?: number;
|
|
54
|
+
/** Transaction timeout in ms (default: 60000) */
|
|
55
|
+
txTimeout?: number;
|
|
56
|
+
}
|
|
57
|
+
export interface GasEstimate {
|
|
58
|
+
/** Estimated gas units */
|
|
59
|
+
gasUnits: string;
|
|
60
|
+
/** Gas price in gwei */
|
|
61
|
+
gasPriceGwei: string;
|
|
62
|
+
/** Estimated cost in MATIC */
|
|
63
|
+
costMatic: string;
|
|
64
|
+
/** Estimated cost in USDC (at current MATIC price) */
|
|
65
|
+
costUsdc: string;
|
|
66
|
+
/** MATIC/USDC price used */
|
|
67
|
+
maticPrice: number;
|
|
68
|
+
}
|
|
69
|
+
export interface TransactionStatus {
|
|
70
|
+
txHash: string;
|
|
71
|
+
status: 'pending' | 'confirmed' | 'failed' | 'reverted';
|
|
72
|
+
confirmations: number;
|
|
73
|
+
blockNumber?: number;
|
|
74
|
+
gasUsed?: string;
|
|
75
|
+
effectiveGasPrice?: string;
|
|
76
|
+
errorReason?: string;
|
|
77
|
+
}
|
|
78
|
+
/** Common revert reasons */
|
|
79
|
+
export declare enum RevertReason {
|
|
80
|
+
INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
|
|
81
|
+
INSUFFICIENT_ALLOWANCE = "INSUFFICIENT_ALLOWANCE",
|
|
82
|
+
CONDITION_NOT_RESOLVED = "CONDITION_NOT_RESOLVED",
|
|
83
|
+
INVALID_PARTITION = "INVALID_PARTITION",
|
|
84
|
+
INVALID_CONDITION = "INVALID_CONDITION",
|
|
85
|
+
EXECUTION_REVERTED = "EXECUTION_REVERTED",
|
|
86
|
+
TIMEOUT = "TIMEOUT",
|
|
87
|
+
UNKNOWN = "UNKNOWN"
|
|
88
|
+
}
|
|
89
|
+
export interface SplitResult {
|
|
90
|
+
success: boolean;
|
|
91
|
+
txHash: string;
|
|
92
|
+
amount: string;
|
|
93
|
+
yesTokens: string;
|
|
94
|
+
noTokens: string;
|
|
95
|
+
gasUsed?: string;
|
|
96
|
+
}
|
|
97
|
+
export interface MergeResult {
|
|
98
|
+
success: boolean;
|
|
99
|
+
txHash: string;
|
|
100
|
+
amount: string;
|
|
101
|
+
usdcReceived: string;
|
|
102
|
+
gasUsed?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface RedeemResult {
|
|
105
|
+
success: boolean;
|
|
106
|
+
txHash: string;
|
|
107
|
+
outcome: 'YES' | 'NO';
|
|
108
|
+
tokensRedeemed: string;
|
|
109
|
+
usdcReceived: string;
|
|
110
|
+
gasUsed?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface PositionBalance {
|
|
113
|
+
conditionId: string;
|
|
114
|
+
yesBalance: string;
|
|
115
|
+
noBalance: string;
|
|
116
|
+
yesPositionId: string;
|
|
117
|
+
noPositionId: string;
|
|
118
|
+
}
|
|
119
|
+
export interface TokenIds {
|
|
120
|
+
yesTokenId: string;
|
|
121
|
+
noTokenId: string;
|
|
122
|
+
}
|
|
123
|
+
export interface MarketResolution {
|
|
124
|
+
conditionId: string;
|
|
125
|
+
isResolved: boolean;
|
|
126
|
+
winningOutcome?: 'YES' | 'NO';
|
|
127
|
+
payoutNumerators: [number, number];
|
|
128
|
+
payoutDenominator: number;
|
|
129
|
+
}
|
|
130
|
+
export declare class CTFClient {
|
|
131
|
+
private provider;
|
|
132
|
+
private wallet;
|
|
133
|
+
private ctfContract;
|
|
134
|
+
private usdcContract;
|
|
135
|
+
private gasPriceMultiplier;
|
|
136
|
+
private confirmations;
|
|
137
|
+
private txTimeout;
|
|
138
|
+
private cachedMaticPrice;
|
|
139
|
+
private maticPriceLastUpdated;
|
|
140
|
+
constructor(config: CTFConfig);
|
|
141
|
+
/**
|
|
142
|
+
* Get wallet address
|
|
143
|
+
*/
|
|
144
|
+
getAddress(): string;
|
|
145
|
+
/**
|
|
146
|
+
* Get USDC.e (bridged USDC) balance - the token used by Polymarket CTF
|
|
147
|
+
*
|
|
148
|
+
* ⚠️ Note: This returns USDC.e balance, NOT native USDC balance.
|
|
149
|
+
* Polymarket CTF only accepts USDC.e (0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174).
|
|
150
|
+
*
|
|
151
|
+
* Common issue: Your wallet shows USDC balance but this returns 0
|
|
152
|
+
* - This means you have native USDC, not USDC.e
|
|
153
|
+
* - Use SwapService.swap('USDC', 'USDC_E', amount) to convert
|
|
154
|
+
*/
|
|
155
|
+
getUsdcBalance(): Promise<string>;
|
|
156
|
+
/**
|
|
157
|
+
* Get native USDC balance (for comparison/debugging)
|
|
158
|
+
*
|
|
159
|
+
* This is NOT the token used by CTF. Use getUsdcBalance() for CTF operations.
|
|
160
|
+
*/
|
|
161
|
+
getNativeUsdcBalance(): Promise<string>;
|
|
162
|
+
/**
|
|
163
|
+
* Check if wallet is ready for CTF trading operations
|
|
164
|
+
*
|
|
165
|
+
* Verifies:
|
|
166
|
+
* - Has sufficient USDC.e (not native USDC)
|
|
167
|
+
* - Has MATIC for gas fees
|
|
168
|
+
*
|
|
169
|
+
* @param amount - Minimum USDC.e amount needed (e.g., "100" for 100 USDC.e)
|
|
170
|
+
* @returns Ready status with balances and suggestions
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```typescript
|
|
174
|
+
* const status = await ctf.checkReadyForCTF('100');
|
|
175
|
+
* if (!status.ready) {
|
|
176
|
+
* console.log(status.suggestion);
|
|
177
|
+
* // "You have 50 native USDC but 0 USDC.e. Swap native USDC to USDC.e first."
|
|
178
|
+
* }
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
checkReadyForCTF(amount: string): Promise<{
|
|
182
|
+
ready: boolean;
|
|
183
|
+
usdcEBalance: string;
|
|
184
|
+
nativeUsdcBalance: string;
|
|
185
|
+
maticBalance: string;
|
|
186
|
+
suggestion?: string;
|
|
187
|
+
}>;
|
|
188
|
+
/**
|
|
189
|
+
* Split USDC into YES + NO tokens
|
|
190
|
+
*
|
|
191
|
+
* @param conditionId - Market condition ID
|
|
192
|
+
* @param amount - USDC amount (e.g., "100" for 100 USDC)
|
|
193
|
+
* @returns SplitResult with transaction details
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* const result = await ctf.split(conditionId, "100");
|
|
198
|
+
* console.log(`Split ${result.amount} USDC into tokens`);
|
|
199
|
+
* console.log(`TX: ${result.txHash}`);
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
split(conditionId: string, amount: string): Promise<SplitResult>;
|
|
203
|
+
/**
|
|
204
|
+
* Merge YES + NO tokens back to USDC
|
|
205
|
+
*
|
|
206
|
+
* @param conditionId - Market condition ID
|
|
207
|
+
* @param amount - Number of token pairs to merge (e.g., "100" for 100 YES + 100 NO)
|
|
208
|
+
* @returns MergeResult with transaction details
|
|
209
|
+
*
|
|
210
|
+
* @example
|
|
211
|
+
* ```typescript
|
|
212
|
+
* // After buying 100 YES and 100 NO via TradingClient
|
|
213
|
+
* const result = await ctf.merge(conditionId, "100");
|
|
214
|
+
* console.log(`Received ${result.usdcReceived} USDC`);
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
merge(conditionId: string, amount: string): Promise<MergeResult>;
|
|
218
|
+
/**
|
|
219
|
+
* Merge YES and NO tokens back into USDC using explicit token IDs
|
|
220
|
+
*
|
|
221
|
+
* This method uses the provided token IDs for balance checking, which is
|
|
222
|
+
* necessary when working with Polymarket CLOB markets where token IDs
|
|
223
|
+
* don't match the calculated position IDs.
|
|
224
|
+
*
|
|
225
|
+
* @param conditionId - Market condition ID
|
|
226
|
+
* @param tokenIds - Token IDs from CLOB API
|
|
227
|
+
* @param amount - Amount of tokens to merge
|
|
228
|
+
* @returns MergeResult with transaction details
|
|
229
|
+
*/
|
|
230
|
+
mergeByTokenIds(conditionId: string, tokenIds: TokenIds, amount: string): Promise<MergeResult>;
|
|
231
|
+
/**
|
|
232
|
+
* Redeem winning tokens after market resolution (Standard CTF)
|
|
233
|
+
*
|
|
234
|
+
* ⚠️ IMPORTANT: This method uses standard CTF position ID calculation.
|
|
235
|
+
* It is ONLY suitable for:
|
|
236
|
+
* - Standard Gnosis CTF markets (non-Polymarket)
|
|
237
|
+
* - Markets where position IDs are calculated from conditionId using standard formula
|
|
238
|
+
* - Direct CTF contract interactions without CLOB
|
|
239
|
+
*
|
|
240
|
+
* ❌ DO NOT USE for Polymarket CLOB markets!
|
|
241
|
+
* Polymarket uses custom token IDs that differ from standard CTF position IDs.
|
|
242
|
+
* For Polymarket, use `redeemByTokenIds()` instead.
|
|
243
|
+
*
|
|
244
|
+
* Position ID calculation: keccak256(collectionId, conditionId, indexSet)
|
|
245
|
+
* - This formula may NOT match Polymarket's token IDs
|
|
246
|
+
*
|
|
247
|
+
* @param conditionId - Market condition ID
|
|
248
|
+
* @param outcome - 'YES' or 'NO' (optional, auto-detects if not provided)
|
|
249
|
+
* @returns RedeemResult with transaction details
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```typescript
|
|
253
|
+
* // For standard CTF markets (NOT Polymarket)
|
|
254
|
+
* const result = await ctf.redeem(conditionId);
|
|
255
|
+
* console.log(`Redeemed ${result.tokensRedeemed} ${result.outcome} tokens`);
|
|
256
|
+
* ```
|
|
257
|
+
*
|
|
258
|
+
* @see redeemByTokenIds - Use this for Polymarket CLOB markets
|
|
259
|
+
*/
|
|
260
|
+
redeem(conditionId: string, outcome?: 'YES' | 'NO'): Promise<RedeemResult>;
|
|
261
|
+
/**
|
|
262
|
+
* Redeem winning tokens using Polymarket token IDs (Polymarket CLOB)
|
|
263
|
+
*
|
|
264
|
+
* ✅ USE THIS for Polymarket CLOB markets!
|
|
265
|
+
*
|
|
266
|
+
* Polymarket uses custom token IDs that are different from standard CTF position IDs.
|
|
267
|
+
* These token IDs are provided by the CLOB API and must be used for:
|
|
268
|
+
* - Querying balances (getPositionBalanceByTokenIds)
|
|
269
|
+
* - Redeeming positions (this method)
|
|
270
|
+
* - Trading via CLOB API
|
|
271
|
+
*
|
|
272
|
+
* Why Polymarket token IDs differ:
|
|
273
|
+
* - Polymarket wraps CTF positions into ERC-1155 tokens with custom IDs
|
|
274
|
+
* - The token IDs from CLOB API (e.g., "25064375...") are NOT the same as
|
|
275
|
+
* calculated position IDs from keccak256(collectionId, conditionId, indexSet)
|
|
276
|
+
*
|
|
277
|
+
* @param conditionId - The condition ID of the market
|
|
278
|
+
* @param tokenIds - The Polymarket token IDs for YES and NO outcomes (from CLOB API)
|
|
279
|
+
* @param outcome - Optional: which outcome to redeem ('YES' or 'NO'). Auto-detects if not provided.
|
|
280
|
+
* @returns RedeemResult with transaction details
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```typescript
|
|
284
|
+
* // For Polymarket CLOB markets
|
|
285
|
+
* const tokenIds = {
|
|
286
|
+
* yesTokenId: '25064375110792967023484002819116042931016336431092144471807003884255851454283',
|
|
287
|
+
* noTokenId: '98190367690492181203391990709979106077460946443309150166954079213761598385827',
|
|
288
|
+
* };
|
|
289
|
+
* const result = await ctf.redeemByTokenIds(conditionId, tokenIds);
|
|
290
|
+
* console.log(`Redeemed ${result.tokensRedeemed} ${result.outcome} tokens`);
|
|
291
|
+
* console.log(`Received ${result.usdcReceived} USDC`);
|
|
292
|
+
* ```
|
|
293
|
+
*
|
|
294
|
+
* @see redeem - Only use for standard CTF markets (non-Polymarket)
|
|
295
|
+
*/
|
|
296
|
+
redeemByTokenIds(conditionId: string, tokenIds: TokenIds, outcome?: 'YES' | 'NO'): Promise<RedeemResult>;
|
|
297
|
+
/**
|
|
298
|
+
* Get token balances for a market using calculated position IDs
|
|
299
|
+
*
|
|
300
|
+
* NOTE: This method calculates position IDs from conditionId, which may not match
|
|
301
|
+
* the token IDs used by Polymarket's CLOB API. For accurate balances when working
|
|
302
|
+
* with CLOB markets, use getPositionBalanceByTokenIds() with the token IDs from
|
|
303
|
+
* the CLOB API.
|
|
304
|
+
*
|
|
305
|
+
* @deprecated Use getPositionBalanceByTokenIds for CLOB markets
|
|
306
|
+
*/
|
|
307
|
+
getPositionBalance(conditionId: string): Promise<PositionBalance>;
|
|
308
|
+
/**
|
|
309
|
+
* Get token balances using CLOB API token IDs
|
|
310
|
+
*
|
|
311
|
+
* This is the recommended method for checking balances when working with
|
|
312
|
+
* Polymarket CLOB markets. The token IDs should be obtained from the CLOB API
|
|
313
|
+
* (e.g., from ClobApiClient.getMarket()).
|
|
314
|
+
*
|
|
315
|
+
* @param conditionId - Market condition ID (for reference)
|
|
316
|
+
* @param tokenIds - Token IDs from CLOB API { yesTokenId, noTokenId }
|
|
317
|
+
* @returns PositionBalance with accurate balances
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```typescript
|
|
321
|
+
* // Get token IDs from CLOB API
|
|
322
|
+
* const market = await clobApi.getMarket(conditionId);
|
|
323
|
+
* const tokenIds = {
|
|
324
|
+
* yesTokenId: market.tokens[0].tokenId,
|
|
325
|
+
* noTokenId: market.tokens[1].tokenId,
|
|
326
|
+
* };
|
|
327
|
+
*
|
|
328
|
+
* // Check balances
|
|
329
|
+
* const balance = await ctf.getPositionBalanceByTokenIds(conditionId, tokenIds);
|
|
330
|
+
* console.log(`YES: ${balance.yesBalance}, NO: ${balance.noBalance}`);
|
|
331
|
+
* ```
|
|
332
|
+
*/
|
|
333
|
+
getPositionBalanceByTokenIds(conditionId: string, tokenIds: TokenIds): Promise<PositionBalance>;
|
|
334
|
+
/**
|
|
335
|
+
* Check if a market is resolved and get payout info
|
|
336
|
+
*/
|
|
337
|
+
getMarketResolution(conditionId: string): Promise<MarketResolution>;
|
|
338
|
+
/**
|
|
339
|
+
* Estimate gas for split operation
|
|
340
|
+
*/
|
|
341
|
+
estimateSplitGas(conditionId: string, amount: string): Promise<string>;
|
|
342
|
+
/**
|
|
343
|
+
* Estimate gas for merge operation
|
|
344
|
+
*/
|
|
345
|
+
estimateMergeGas(conditionId: string, amount: string): Promise<string>;
|
|
346
|
+
/**
|
|
347
|
+
* Get detailed gas estimate for a split operation
|
|
348
|
+
*/
|
|
349
|
+
getDetailedSplitGasEstimate(conditionId: string, amount: string): Promise<GasEstimate>;
|
|
350
|
+
/**
|
|
351
|
+
* Get detailed gas estimate for a merge operation
|
|
352
|
+
*/
|
|
353
|
+
getDetailedMergeGasEstimate(conditionId: string, amount: string): Promise<GasEstimate>;
|
|
354
|
+
/**
|
|
355
|
+
* Get current gas price info
|
|
356
|
+
*/
|
|
357
|
+
getGasPrice(): Promise<{
|
|
358
|
+
gwei: string;
|
|
359
|
+
wei: string;
|
|
360
|
+
}>;
|
|
361
|
+
/**
|
|
362
|
+
* Get or refresh MATIC price (cached for 5 minutes)
|
|
363
|
+
*/
|
|
364
|
+
getMaticPrice(): Promise<number>;
|
|
365
|
+
/**
|
|
366
|
+
* Set MATIC price manually (for testing or when external price is available)
|
|
367
|
+
*/
|
|
368
|
+
setMaticPrice(price: number): void;
|
|
369
|
+
/**
|
|
370
|
+
* Get transaction status with detailed info
|
|
371
|
+
*/
|
|
372
|
+
getTransactionStatus(txHash: string): Promise<TransactionStatus>;
|
|
373
|
+
/**
|
|
374
|
+
* Wait for transaction confirmation with timeout
|
|
375
|
+
*/
|
|
376
|
+
waitForTransaction(txHash: string, confirmations?: number): Promise<TransactionStatus>;
|
|
377
|
+
/**
|
|
378
|
+
* Parse revert reason from transaction
|
|
379
|
+
*/
|
|
380
|
+
getRevertReason(txHash: string): Promise<string>;
|
|
381
|
+
/**
|
|
382
|
+
* Get all positions for the wallet across multiple markets
|
|
383
|
+
*/
|
|
384
|
+
getAllPositions(conditionIds: string[]): Promise<PositionBalance[]>;
|
|
385
|
+
/**
|
|
386
|
+
* Check if wallet has sufficient tokens for merge
|
|
387
|
+
*
|
|
388
|
+
* @deprecated Use canMergeWithTokenIds for CLOB markets
|
|
389
|
+
*/
|
|
390
|
+
canMerge(conditionId: string, amount: string): Promise<{
|
|
391
|
+
canMerge: boolean;
|
|
392
|
+
reason?: string;
|
|
393
|
+
}>;
|
|
394
|
+
/**
|
|
395
|
+
* Check if wallet has sufficient tokens for merge using CLOB token IDs
|
|
396
|
+
*
|
|
397
|
+
* @param conditionId - Market condition ID
|
|
398
|
+
* @param tokenIds - Token IDs from CLOB API
|
|
399
|
+
* @param amount - Amount to merge
|
|
400
|
+
*/
|
|
401
|
+
canMergeWithTokenIds(conditionId: string, tokenIds: TokenIds, amount: string): Promise<{
|
|
402
|
+
canMerge: boolean;
|
|
403
|
+
reason?: string;
|
|
404
|
+
}>;
|
|
405
|
+
private checkMergeBalance;
|
|
406
|
+
/**
|
|
407
|
+
* Check if wallet has sufficient USDC for split
|
|
408
|
+
*/
|
|
409
|
+
canSplit(amount: string): Promise<{
|
|
410
|
+
canSplit: boolean;
|
|
411
|
+
reason?: string;
|
|
412
|
+
}>;
|
|
413
|
+
/**
|
|
414
|
+
* Get total portfolio value across positions
|
|
415
|
+
*/
|
|
416
|
+
getPortfolioValue(positions: PositionBalance[], prices: Map<string, {
|
|
417
|
+
yes: number;
|
|
418
|
+
no: number;
|
|
419
|
+
}>): Promise<{
|
|
420
|
+
totalValue: number;
|
|
421
|
+
breakdown: Array<{
|
|
422
|
+
conditionId: string;
|
|
423
|
+
yesValue: number;
|
|
424
|
+
noValue: number;
|
|
425
|
+
totalValue: number;
|
|
426
|
+
}>;
|
|
427
|
+
}>;
|
|
428
|
+
/**
|
|
429
|
+
* Calculate position ID for a given outcome (INTERNAL USE ONLY)
|
|
430
|
+
*
|
|
431
|
+
* ⚠️ WARNING: This calculation does NOT produce correct Polymarket token IDs!
|
|
432
|
+
*
|
|
433
|
+
* Polymarket uses custom token IDs that differ from standard CTF position ID calculation.
|
|
434
|
+
* The token IDs from CLOB API (e.g., "104173557214744537570424345347209544585775842950109756851652855913015295701992")
|
|
435
|
+
* are NOT the same as what this function calculates.
|
|
436
|
+
*
|
|
437
|
+
* For Polymarket CLOB markets, ALWAYS:
|
|
438
|
+
* 1. Get token IDs from CLOB API: https://clob.polymarket.com/markets/{conditionId}
|
|
439
|
+
* 2. Use getPositionBalanceByTokenIds() instead of getPositionBalance()
|
|
440
|
+
* 3. Use mergeByTokenIds() instead of merge()
|
|
441
|
+
* 4. Use redeemByTokenIds() instead of redeem()
|
|
442
|
+
*
|
|
443
|
+
* This method is kept for potential non-Polymarket CTF markets only.
|
|
444
|
+
*
|
|
445
|
+
* @deprecated Use CLOB API token IDs for Polymarket markets
|
|
446
|
+
*/
|
|
447
|
+
private calculatePositionId;
|
|
448
|
+
/**
|
|
449
|
+
* Get gas options for Polygon network using EIP-1559
|
|
450
|
+
*
|
|
451
|
+
* Polygon requires higher priority fees than default ethers.js estimates.
|
|
452
|
+
* Uses minimum 30 gwei priority fee to ensure transactions don't get stuck.
|
|
453
|
+
*/
|
|
454
|
+
private getGasOptions;
|
|
455
|
+
/**
|
|
456
|
+
* Calculate gas cost from gas units
|
|
457
|
+
*/
|
|
458
|
+
private calculateGasCost;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Calculate condition ID from oracle, question ID, and outcome count
|
|
462
|
+
* This is rarely needed as Polymarket provides conditionId directly
|
|
463
|
+
*/
|
|
464
|
+
export declare function calculateConditionId(oracle: string, questionId: string, outcomeSlotCount?: number): string;
|
|
465
|
+
/**
|
|
466
|
+
* Parse USDC amount to BigNumber (6 decimals)
|
|
467
|
+
*/
|
|
468
|
+
export declare function parseUsdc(amount: string): BigNumber;
|
|
469
|
+
/**
|
|
470
|
+
* Format BigNumber to USDC string (6 decimals)
|
|
471
|
+
*/
|
|
472
|
+
export declare function formatUsdc(amount: BigNumber): string;
|
|
473
|
+
//# sourceMappingURL=ctf-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ctf-client.d.ts","sourceRoot":"","sources":["../../src/clients/ctf-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAA4B,SAAS,EAAE,MAAM,QAAQ,CAAC;AAI7D,eAAO,MAAM,YAAY,+CAA+C,CAAC;AAEzE;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,+CAA+C,CAAC;AAE1E,uDAAuD;AACvD,eAAO,MAAM,oBAAoB,+CAA+C,CAAC;AAEjF,eAAO,MAAM,qBAAqB,+CAA+C,CAAC;AAClF,eAAO,MAAM,gBAAgB,+CAA+C,CAAC;AAG7E,eAAO,MAAM,aAAa,IAAI,CAAC;AA2B/B,MAAM,WAAW,SAAS;IACxB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,8BAA8B;I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