@varla/polymarket 1.1.3 → 2.0.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 +127 -0
- package/README.md +1 -34
- package/dist/abi/ctf-exchange.d.ts +329 -0
- package/dist/abi/ctf-exchange.d.ts.map +1 -0
- package/dist/abi/erc20.d.ts +152 -0
- package/dist/abi/erc20.d.ts.map +1 -0
- package/dist/abi/index.d.ts +8 -0
- package/dist/abi/index.d.ts.map +1 -0
- package/dist/bridge-client.d.ts +76 -0
- package/dist/bridge-client.d.ts.map +1 -0
- package/dist/clob-auth.d.ts +106 -0
- package/dist/clob-auth.d.ts.map +1 -0
- package/dist/clob-client.d.ts +83 -0
- package/dist/clob-client.d.ts.map +1 -0
- package/dist/clob-errors.d.ts +74 -0
- package/dist/clob-errors.d.ts.map +1 -0
- package/dist/clob-orders.d.ts +81 -0
- package/dist/clob-orders.d.ts.map +1 -0
- package/dist/clob-persistence.d.ts +83 -0
- package/dist/clob-persistence.d.ts.map +1 -0
- package/dist/clob-trading-client.d.ts +259 -0
- package/dist/clob-trading-client.d.ts.map +1 -0
- package/dist/clob-trading-types.d.ts +522 -0
- package/dist/clob-trading-types.d.ts.map +1 -0
- package/dist/clob-ws.d.ts +111 -0
- package/dist/clob-ws.d.ts.map +1 -0
- package/dist/clob.d.ts +22 -0
- package/dist/clob.d.ts.map +1 -0
- package/dist/config/contracts.d.ts +36 -0
- package/dist/config/contracts.d.ts.map +1 -0
- package/dist/config/endpoints.d.ts +135 -0
- package/dist/config/endpoints.d.ts.map +1 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/rounding.d.ts +109 -0
- package/dist/config/rounding.d.ts.map +1 -0
- package/dist/data-api-client.d.ts +190 -0
- package/dist/data-api-client.d.ts.map +1 -0
- package/dist/endpoints.d.ts +7 -0
- package/dist/endpoints.d.ts.map +1 -0
- package/dist/gamma-client.d.ts +211 -0
- package/dist/gamma-client.d.ts.map +1 -0
- package/dist/http.d.ts +26 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +83 -3
- package/dist/pnl.d.ts +38 -0
- package/dist/pnl.d.ts.map +1 -0
- package/dist/resolver.d.ts +26 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/sdk/client.d.ts +109 -0
- package/dist/sdk/client.d.ts.map +1 -0
- package/dist/sdk/constants.d.ts +2 -0
- package/dist/sdk/constants.d.ts.map +1 -0
- package/dist/sdk/errors.d.ts +5 -0
- package/dist/sdk/errors.d.ts.map +1 -0
- package/dist/sdk/headers.d.ts +6 -0
- package/dist/sdk/headers.d.ts.map +1 -0
- package/dist/sdk/http-helpers.d.ts +21 -0
- package/dist/sdk/http-helpers.d.ts.map +1 -0
- package/dist/sdk/index.d.ts +9 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/market-price.d.ts +13 -0
- package/dist/sdk/market-price.d.ts.map +1 -0
- package/dist/sdk/order-builder.d.ts +19 -0
- package/dist/sdk/order-builder.d.ts.map +1 -0
- package/dist/sdk/rfq-client.d.ts +19 -0
- package/dist/sdk/rfq-client.d.ts.map +1 -0
- package/dist/sdk/rfq-deps.d.ts +33 -0
- package/dist/sdk/rfq-deps.d.ts.map +1 -0
- package/dist/sdk/types.d.ts +261 -0
- package/dist/sdk/types.d.ts.map +1 -0
- package/dist/sdk/utilities.d.ts +8 -0
- package/dist/sdk/utilities.d.ts.map +1 -0
- package/dist/signing/clob-auth-eip712.d.ts +30 -0
- package/dist/signing/clob-auth-eip712.d.ts.map +1 -0
- package/dist/signing/ctf-order-eip712.d.ts +27 -0
- package/dist/signing/ctf-order-eip712.d.ts.map +1 -0
- package/dist/signing/hmac.d.ts +14 -0
- package/dist/signing/hmac.d.ts.map +1 -0
- package/dist/types.d.ts +652 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/concurrency.d.ts +10 -0
- package/dist/utils/concurrency.d.ts.map +1 -0
- package/dist/utils/retry.d.ts +24 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/package.json +8 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# @varla/polymarket
|
|
2
|
+
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- abd5339: Updated closed positions API types and endpoint handling while adding new PnL helper utilities.
|
|
8
|
+
|
|
9
|
+
- Updated `DataClosedPosition` to match the live `/closed-positions` response with new fields and numeric types.,- Changed `getClosedPositions` to use the `/closed-positions` endpoint and added filtering/sorting options for positions queries.,- Added PnL helper functions (`computeClosedPnl`, `computeOpenPnl`, `computePnlSummary`) and exported them from the package.
|
|
10
|
+
|
|
11
|
+
- 16ccb4b: Data API parsing now uses updated field names and numeric values across position responses.
|
|
12
|
+
|
|
13
|
+
- Updated position parsing to return numbers and new property names such as cashPnl, totalBought, and eventSlug
|
|
14
|
+
- Closed positions parsing now exposes avgPrice, curPrice, timestamp, and outcomeIndex fields
|
|
15
|
+
- Adjusted data API requests to use the market query parameter and /closed-positions endpoint
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 2a59485: No functional changes were made to the polymarket package.
|
|
20
|
+
|
|
21
|
+
- Reformat the package files list without altering published contents
|
|
22
|
+
|
|
23
|
+
- a17d263: Adjusted concurrency limiter error message and made live trading tests skip when no private key is set.
|
|
24
|
+
|
|
25
|
+
- Simplified the ConcurrencyLimiter invalid maxInFlight error message.
|
|
26
|
+
- Live CLOB trading tests now skip unless both live tests are enabled and a private key is provided.
|
|
27
|
+
|
|
28
|
+
## 1.1.7
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- 587916d: Adjust package.json formatting without functional changes.
|
|
33
|
+
|
|
34
|
+
- Reformat the published files list in package metadata
|
|
35
|
+
|
|
36
|
+
## 1.1.6
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Reformatted the package manifest file list with no functional changes.
|
|
41
|
+
|
|
42
|
+
- No functional changes; package.json formatting updated.
|
|
43
|
+
|
|
44
|
+
## 1.1.5
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- 5efcc9d: Update package metadata formatting without functional changes.
|
|
49
|
+
|
|
50
|
+
- Format the files list in package.json with a single-line array
|
|
51
|
+
|
|
52
|
+
## 1.1.4
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- cea1cf2: Added TypeScript declaration output and exports metadata for the Polymarket package.
|
|
57
|
+
|
|
58
|
+
- Publish generated type declarations and include them in the package exports
|
|
59
|
+
- Include CHANGELOG in published files and build types during prepack
|
|
60
|
+
|
|
61
|
+
## 1.1.3
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- 883517a: This release updates package metadata formatting with no functional changes.
|
|
66
|
+
|
|
67
|
+
- Reformatted the package.json files list without changing shipped contents.
|
|
68
|
+
|
|
69
|
+
## 1.1.2
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- 9bb27c7: No functional changes; updated package metadata formatting.
|
|
74
|
+
|
|
75
|
+
- Adjusted package.json files field formatting without affecting build output.
|
|
76
|
+
|
|
77
|
+
## 1.1.1
|
|
78
|
+
|
|
79
|
+
### Patch Changes
|
|
80
|
+
|
|
81
|
+
- 5fdc094: Updated README to correct ClobWsClient feature description wording.
|
|
82
|
+
|
|
83
|
+
- Adjusted documentation to list "Auto-connect" for the ClobWsClient diagram.
|
|
84
|
+
|
|
85
|
+
- 0d59e12: Updated package metadata formatting without functional changes.
|
|
86
|
+
|
|
87
|
+
- No functional changes; package file list formatting was adjusted.
|
|
88
|
+
|
|
89
|
+
## 1.1.0
|
|
90
|
+
|
|
91
|
+
### Minor Changes
|
|
92
|
+
|
|
93
|
+
- 04689a5: Added new SDK types and expanded EIP-712 signer compatibility while tightening internal checks.
|
|
94
|
+
|
|
95
|
+
- Introduced OrderMarketCancelParams in SDK types for market cancel requests
|
|
96
|
+
- Expanded ClobEip712Signer to accept raw address strings for EIP-712 signing
|
|
97
|
+
- Improved internal cursor comparisons and builder auth checks
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- 1cedbad: Align Polymarket API types with live responses and expand validation coverage while fixing a fetch usage bug.
|
|
102
|
+
|
|
103
|
+
- Updated DataApiClient to use the injected fetch function for book summaries.,- Expanded Gamma, CLOB, and Data API TypeScript types with additional optional fields and wider value shapes.,- Added comprehensive fixtures and schema-based tests to validate parsing against realistic and live API payloads.
|
|
104
|
+
|
|
105
|
+
## 1.0.4
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- 6857157: Package metadata formatting was updated with no functional changes.
|
|
110
|
+
|
|
111
|
+
- Reformatted the files list in package.json
|
|
112
|
+
|
|
113
|
+
## 1.0.3
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- 036a615: Release metadata updated with a new changelog and version bump.
|
|
118
|
+
|
|
119
|
+
- Added a changelog entry and bumped the package version to 1.0.2.
|
|
120
|
+
|
|
121
|
+
## 1.0.2
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- 803b77f: Updated README performance claims to a rounded value.
|
|
126
|
+
|
|
127
|
+
- Adjusted documented speed comparison from 139% to ~140% faster.
|
package/README.md
CHANGED
|
@@ -7,39 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
A modern, lightweight TypeScript client for Polymarket's CLOB and Gamma APIs with full trading support.
|
|
9
9
|
|
|
10
|
-
## Why @varla/polymarket?
|
|
11
|
-
|
|
12
|
-
| Metric | @varla/polymarket | @polymarket/clob-client |
|
|
13
|
-
|--------|-------------------|-------------------------|
|
|
14
|
-
| **Average Speed** | **~140% faster** | baseline |
|
|
15
|
-
| **Bundle Size** | ~50KB | ~500KB (ethers.js) |
|
|
16
|
-
| **Runtime** | Bun/Node/Edge | Node.js only |
|
|
17
|
-
| **Signing** | viem (native) | ethers.js |
|
|
18
|
-
| **HTTP** | fetch | axios |
|
|
19
|
-
|
|
20
|
-
### Benchmark Highlights
|
|
21
|
-
|
|
22
|
-
| Function | Speedup |
|
|
23
|
-
|----------|---------|
|
|
24
|
-
| `getLastTradePrice` | 261% faster |
|
|
25
|
-
| `getMidpoints` | 176% faster |
|
|
26
|
-
| `deleteApiKey` | 144% faster |
|
|
27
|
-
| `cancelOrder` | 73% faster |
|
|
28
|
-
| `getOpenOrders` | 56% faster |
|
|
29
|
-
|
|
30
|
-
<details>
|
|
31
|
-
<summary>Full benchmark results (88 functions)</summary>
|
|
32
|
-
|
|
33
|
-
- **81 functions faster** (92%)
|
|
34
|
-
- **7 functions slower** (8%)
|
|
35
|
-
- Best case: 1233% faster (RFQ operations)
|
|
36
|
-
|
|
37
|
-
Run benchmarks yourself:
|
|
38
|
-
```bash
|
|
39
|
-
POLYMARKET_BENCH=true bun test packages/polymarket/test/sdk
|
|
40
|
-
```
|
|
41
|
-
</details>
|
|
42
|
-
|
|
43
10
|
## Installation
|
|
44
11
|
|
|
45
12
|
```bash
|
|
@@ -50,7 +17,7 @@ npm install @varla/polymarket
|
|
|
50
17
|
pnpm add @varla/polymarket
|
|
51
18
|
```
|
|
52
19
|
|
|
53
|
-
|
|
20
|
+
### Peer dependencies:
|
|
54
21
|
- `viem` ^2.0.0
|
|
55
22
|
|
|
56
23
|
## Quick Start
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CTF Exchange ABI for Polymarket.
|
|
3
|
+
*
|
|
4
|
+
* This is the Conditional Token Framework Exchange contract ABI,
|
|
5
|
+
* used for order matching and settlement.
|
|
6
|
+
*
|
|
7
|
+
* Only includes functions needed for trading operations.
|
|
8
|
+
* Full ABI available in the official SDK examples.
|
|
9
|
+
*
|
|
10
|
+
* @see https://github.com/Polymarket/clob-client/blob/main/examples/abi/ctfAbi.ts
|
|
11
|
+
*/
|
|
12
|
+
export declare const ctfExchangeAbi: readonly [{
|
|
13
|
+
readonly inputs: readonly [{
|
|
14
|
+
readonly name: "owner";
|
|
15
|
+
readonly type: "address";
|
|
16
|
+
}, {
|
|
17
|
+
readonly name: "id";
|
|
18
|
+
readonly type: "uint256";
|
|
19
|
+
}];
|
|
20
|
+
readonly name: "balanceOf";
|
|
21
|
+
readonly outputs: readonly [{
|
|
22
|
+
readonly name: "";
|
|
23
|
+
readonly type: "uint256";
|
|
24
|
+
}];
|
|
25
|
+
readonly stateMutability: "view";
|
|
26
|
+
readonly type: "function";
|
|
27
|
+
}, {
|
|
28
|
+
readonly inputs: readonly [{
|
|
29
|
+
readonly name: "owners";
|
|
30
|
+
readonly type: "address[]";
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "ids";
|
|
33
|
+
readonly type: "uint256[]";
|
|
34
|
+
}];
|
|
35
|
+
readonly name: "balanceOfBatch";
|
|
36
|
+
readonly outputs: readonly [{
|
|
37
|
+
readonly name: "";
|
|
38
|
+
readonly type: "uint256[]";
|
|
39
|
+
}];
|
|
40
|
+
readonly stateMutability: "view";
|
|
41
|
+
readonly type: "function";
|
|
42
|
+
}, {
|
|
43
|
+
readonly inputs: readonly [{
|
|
44
|
+
readonly name: "owner";
|
|
45
|
+
readonly type: "address";
|
|
46
|
+
}, {
|
|
47
|
+
readonly name: "operator";
|
|
48
|
+
readonly type: "address";
|
|
49
|
+
}];
|
|
50
|
+
readonly name: "isApprovedForAll";
|
|
51
|
+
readonly outputs: readonly [{
|
|
52
|
+
readonly name: "";
|
|
53
|
+
readonly type: "bool";
|
|
54
|
+
}];
|
|
55
|
+
readonly stateMutability: "view";
|
|
56
|
+
readonly type: "function";
|
|
57
|
+
}, {
|
|
58
|
+
readonly inputs: readonly [{
|
|
59
|
+
readonly name: "operator";
|
|
60
|
+
readonly type: "address";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "approved";
|
|
63
|
+
readonly type: "bool";
|
|
64
|
+
}];
|
|
65
|
+
readonly name: "setApprovalForAll";
|
|
66
|
+
readonly outputs: readonly [];
|
|
67
|
+
readonly stateMutability: "nonpayable";
|
|
68
|
+
readonly type: "function";
|
|
69
|
+
}, {
|
|
70
|
+
readonly inputs: readonly [{
|
|
71
|
+
readonly name: "from";
|
|
72
|
+
readonly type: "address";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "to";
|
|
75
|
+
readonly type: "address";
|
|
76
|
+
}, {
|
|
77
|
+
readonly name: "id";
|
|
78
|
+
readonly type: "uint256";
|
|
79
|
+
}, {
|
|
80
|
+
readonly name: "value";
|
|
81
|
+
readonly type: "uint256";
|
|
82
|
+
}, {
|
|
83
|
+
readonly name: "data";
|
|
84
|
+
readonly type: "bytes";
|
|
85
|
+
}];
|
|
86
|
+
readonly name: "safeTransferFrom";
|
|
87
|
+
readonly outputs: readonly [];
|
|
88
|
+
readonly stateMutability: "nonpayable";
|
|
89
|
+
readonly type: "function";
|
|
90
|
+
}, {
|
|
91
|
+
readonly inputs: readonly [{
|
|
92
|
+
readonly name: "from";
|
|
93
|
+
readonly type: "address";
|
|
94
|
+
}, {
|
|
95
|
+
readonly name: "to";
|
|
96
|
+
readonly type: "address";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "ids";
|
|
99
|
+
readonly type: "uint256[]";
|
|
100
|
+
}, {
|
|
101
|
+
readonly name: "values";
|
|
102
|
+
readonly type: "uint256[]";
|
|
103
|
+
}, {
|
|
104
|
+
readonly name: "data";
|
|
105
|
+
readonly type: "bytes";
|
|
106
|
+
}];
|
|
107
|
+
readonly name: "safeBatchTransferFrom";
|
|
108
|
+
readonly outputs: readonly [];
|
|
109
|
+
readonly stateMutability: "nonpayable";
|
|
110
|
+
readonly type: "function";
|
|
111
|
+
}, {
|
|
112
|
+
readonly inputs: readonly [{
|
|
113
|
+
readonly name: "collateralToken";
|
|
114
|
+
readonly type: "address";
|
|
115
|
+
}, {
|
|
116
|
+
readonly name: "parentCollectionId";
|
|
117
|
+
readonly type: "bytes32";
|
|
118
|
+
}, {
|
|
119
|
+
readonly name: "conditionId";
|
|
120
|
+
readonly type: "bytes32";
|
|
121
|
+
}, {
|
|
122
|
+
readonly name: "partition";
|
|
123
|
+
readonly type: "uint256[]";
|
|
124
|
+
}, {
|
|
125
|
+
readonly name: "amount";
|
|
126
|
+
readonly type: "uint256";
|
|
127
|
+
}];
|
|
128
|
+
readonly name: "splitPosition";
|
|
129
|
+
readonly outputs: readonly [];
|
|
130
|
+
readonly stateMutability: "nonpayable";
|
|
131
|
+
readonly type: "function";
|
|
132
|
+
}, {
|
|
133
|
+
readonly inputs: readonly [{
|
|
134
|
+
readonly name: "collateralToken";
|
|
135
|
+
readonly type: "address";
|
|
136
|
+
}, {
|
|
137
|
+
readonly name: "parentCollectionId";
|
|
138
|
+
readonly type: "bytes32";
|
|
139
|
+
}, {
|
|
140
|
+
readonly name: "conditionId";
|
|
141
|
+
readonly type: "bytes32";
|
|
142
|
+
}, {
|
|
143
|
+
readonly name: "partition";
|
|
144
|
+
readonly type: "uint256[]";
|
|
145
|
+
}, {
|
|
146
|
+
readonly name: "amount";
|
|
147
|
+
readonly type: "uint256";
|
|
148
|
+
}];
|
|
149
|
+
readonly name: "mergePositions";
|
|
150
|
+
readonly outputs: readonly [];
|
|
151
|
+
readonly stateMutability: "nonpayable";
|
|
152
|
+
readonly type: "function";
|
|
153
|
+
}, {
|
|
154
|
+
readonly inputs: readonly [{
|
|
155
|
+
readonly name: "collateralToken";
|
|
156
|
+
readonly type: "address";
|
|
157
|
+
}, {
|
|
158
|
+
readonly name: "parentCollectionId";
|
|
159
|
+
readonly type: "bytes32";
|
|
160
|
+
}, {
|
|
161
|
+
readonly name: "conditionId";
|
|
162
|
+
readonly type: "bytes32";
|
|
163
|
+
}, {
|
|
164
|
+
readonly name: "indexSets";
|
|
165
|
+
readonly type: "uint256[]";
|
|
166
|
+
}];
|
|
167
|
+
readonly name: "redeemPositions";
|
|
168
|
+
readonly outputs: readonly [];
|
|
169
|
+
readonly stateMutability: "nonpayable";
|
|
170
|
+
readonly type: "function";
|
|
171
|
+
}, {
|
|
172
|
+
readonly inputs: readonly [{
|
|
173
|
+
readonly name: "conditionId";
|
|
174
|
+
readonly type: "bytes32";
|
|
175
|
+
}];
|
|
176
|
+
readonly name: "payoutDenominator";
|
|
177
|
+
readonly outputs: readonly [{
|
|
178
|
+
readonly name: "";
|
|
179
|
+
readonly type: "uint256";
|
|
180
|
+
}];
|
|
181
|
+
readonly stateMutability: "view";
|
|
182
|
+
readonly type: "function";
|
|
183
|
+
}, {
|
|
184
|
+
readonly inputs: readonly [{
|
|
185
|
+
readonly name: "conditionId";
|
|
186
|
+
readonly type: "bytes32";
|
|
187
|
+
}, {
|
|
188
|
+
readonly name: "outcomeIndex";
|
|
189
|
+
readonly type: "uint256";
|
|
190
|
+
}];
|
|
191
|
+
readonly name: "payoutNumerators";
|
|
192
|
+
readonly outputs: readonly [{
|
|
193
|
+
readonly name: "";
|
|
194
|
+
readonly type: "uint256";
|
|
195
|
+
}];
|
|
196
|
+
readonly stateMutability: "view";
|
|
197
|
+
readonly type: "function";
|
|
198
|
+
}, {
|
|
199
|
+
readonly inputs: readonly [{
|
|
200
|
+
readonly name: "conditionId";
|
|
201
|
+
readonly type: "bytes32";
|
|
202
|
+
}];
|
|
203
|
+
readonly name: "getOutcomeSlotCount";
|
|
204
|
+
readonly outputs: readonly [{
|
|
205
|
+
readonly name: "";
|
|
206
|
+
readonly type: "uint256";
|
|
207
|
+
}];
|
|
208
|
+
readonly stateMutability: "view";
|
|
209
|
+
readonly type: "function";
|
|
210
|
+
}, {
|
|
211
|
+
readonly inputs: readonly [{
|
|
212
|
+
readonly name: "oracle";
|
|
213
|
+
readonly type: "address";
|
|
214
|
+
}, {
|
|
215
|
+
readonly name: "questionId";
|
|
216
|
+
readonly type: "bytes32";
|
|
217
|
+
}, {
|
|
218
|
+
readonly name: "outcomeSlotCount";
|
|
219
|
+
readonly type: "uint256";
|
|
220
|
+
}];
|
|
221
|
+
readonly name: "getConditionId";
|
|
222
|
+
readonly outputs: readonly [{
|
|
223
|
+
readonly name: "";
|
|
224
|
+
readonly type: "bytes32";
|
|
225
|
+
}];
|
|
226
|
+
readonly stateMutability: "pure";
|
|
227
|
+
readonly type: "function";
|
|
228
|
+
}, {
|
|
229
|
+
readonly inputs: readonly [{
|
|
230
|
+
readonly name: "parentCollectionId";
|
|
231
|
+
readonly type: "bytes32";
|
|
232
|
+
}, {
|
|
233
|
+
readonly name: "conditionId";
|
|
234
|
+
readonly type: "bytes32";
|
|
235
|
+
}, {
|
|
236
|
+
readonly name: "indexSet";
|
|
237
|
+
readonly type: "uint256";
|
|
238
|
+
}];
|
|
239
|
+
readonly name: "getCollectionId";
|
|
240
|
+
readonly outputs: readonly [{
|
|
241
|
+
readonly name: "";
|
|
242
|
+
readonly type: "bytes32";
|
|
243
|
+
}];
|
|
244
|
+
readonly stateMutability: "view";
|
|
245
|
+
readonly type: "function";
|
|
246
|
+
}, {
|
|
247
|
+
readonly inputs: readonly [{
|
|
248
|
+
readonly name: "collateralToken";
|
|
249
|
+
readonly type: "address";
|
|
250
|
+
}, {
|
|
251
|
+
readonly name: "collectionId";
|
|
252
|
+
readonly type: "bytes32";
|
|
253
|
+
}];
|
|
254
|
+
readonly name: "getPositionId";
|
|
255
|
+
readonly outputs: readonly [{
|
|
256
|
+
readonly name: "";
|
|
257
|
+
readonly type: "uint256";
|
|
258
|
+
}];
|
|
259
|
+
readonly stateMutability: "pure";
|
|
260
|
+
readonly type: "function";
|
|
261
|
+
}, {
|
|
262
|
+
readonly anonymous: false;
|
|
263
|
+
readonly inputs: readonly [{
|
|
264
|
+
readonly indexed: true;
|
|
265
|
+
readonly name: "operator";
|
|
266
|
+
readonly type: "address";
|
|
267
|
+
}, {
|
|
268
|
+
readonly indexed: true;
|
|
269
|
+
readonly name: "from";
|
|
270
|
+
readonly type: "address";
|
|
271
|
+
}, {
|
|
272
|
+
readonly indexed: true;
|
|
273
|
+
readonly name: "to";
|
|
274
|
+
readonly type: "address";
|
|
275
|
+
}, {
|
|
276
|
+
readonly indexed: false;
|
|
277
|
+
readonly name: "id";
|
|
278
|
+
readonly type: "uint256";
|
|
279
|
+
}, {
|
|
280
|
+
readonly indexed: false;
|
|
281
|
+
readonly name: "value";
|
|
282
|
+
readonly type: "uint256";
|
|
283
|
+
}];
|
|
284
|
+
readonly name: "TransferSingle";
|
|
285
|
+
readonly type: "event";
|
|
286
|
+
}, {
|
|
287
|
+
readonly anonymous: false;
|
|
288
|
+
readonly inputs: readonly [{
|
|
289
|
+
readonly indexed: true;
|
|
290
|
+
readonly name: "operator";
|
|
291
|
+
readonly type: "address";
|
|
292
|
+
}, {
|
|
293
|
+
readonly indexed: true;
|
|
294
|
+
readonly name: "from";
|
|
295
|
+
readonly type: "address";
|
|
296
|
+
}, {
|
|
297
|
+
readonly indexed: true;
|
|
298
|
+
readonly name: "to";
|
|
299
|
+
readonly type: "address";
|
|
300
|
+
}, {
|
|
301
|
+
readonly indexed: false;
|
|
302
|
+
readonly name: "ids";
|
|
303
|
+
readonly type: "uint256[]";
|
|
304
|
+
}, {
|
|
305
|
+
readonly indexed: false;
|
|
306
|
+
readonly name: "values";
|
|
307
|
+
readonly type: "uint256[]";
|
|
308
|
+
}];
|
|
309
|
+
readonly name: "TransferBatch";
|
|
310
|
+
readonly type: "event";
|
|
311
|
+
}, {
|
|
312
|
+
readonly anonymous: false;
|
|
313
|
+
readonly inputs: readonly [{
|
|
314
|
+
readonly indexed: true;
|
|
315
|
+
readonly name: "owner";
|
|
316
|
+
readonly type: "address";
|
|
317
|
+
}, {
|
|
318
|
+
readonly indexed: true;
|
|
319
|
+
readonly name: "operator";
|
|
320
|
+
readonly type: "address";
|
|
321
|
+
}, {
|
|
322
|
+
readonly indexed: false;
|
|
323
|
+
readonly name: "approved";
|
|
324
|
+
readonly type: "bool";
|
|
325
|
+
}];
|
|
326
|
+
readonly name: "ApprovalForAll";
|
|
327
|
+
readonly type: "event";
|
|
328
|
+
}];
|
|
329
|
+
//# sourceMappingURL=ctf-exchange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ctf-exchange.d.ts","sourceRoot":"","sources":["../../src/abi/ctf-exchange.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4MjB,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard ERC20 ABI for USDC interactions.
|
|
3
|
+
*
|
|
4
|
+
* Used for checking balances, allowances, and approvals.
|
|
5
|
+
*/
|
|
6
|
+
export declare const erc20Abi: readonly [{
|
|
7
|
+
readonly inputs: readonly [];
|
|
8
|
+
readonly name: "name";
|
|
9
|
+
readonly outputs: readonly [{
|
|
10
|
+
readonly name: "";
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
}];
|
|
13
|
+
readonly stateMutability: "view";
|
|
14
|
+
readonly type: "function";
|
|
15
|
+
}, {
|
|
16
|
+
readonly inputs: readonly [];
|
|
17
|
+
readonly name: "symbol";
|
|
18
|
+
readonly outputs: readonly [{
|
|
19
|
+
readonly name: "";
|
|
20
|
+
readonly type: "string";
|
|
21
|
+
}];
|
|
22
|
+
readonly stateMutability: "view";
|
|
23
|
+
readonly type: "function";
|
|
24
|
+
}, {
|
|
25
|
+
readonly inputs: readonly [];
|
|
26
|
+
readonly name: "decimals";
|
|
27
|
+
readonly outputs: readonly [{
|
|
28
|
+
readonly name: "";
|
|
29
|
+
readonly type: "uint8";
|
|
30
|
+
}];
|
|
31
|
+
readonly stateMutability: "view";
|
|
32
|
+
readonly type: "function";
|
|
33
|
+
}, {
|
|
34
|
+
readonly inputs: readonly [];
|
|
35
|
+
readonly name: "totalSupply";
|
|
36
|
+
readonly outputs: readonly [{
|
|
37
|
+
readonly name: "";
|
|
38
|
+
readonly type: "uint256";
|
|
39
|
+
}];
|
|
40
|
+
readonly stateMutability: "view";
|
|
41
|
+
readonly type: "function";
|
|
42
|
+
}, {
|
|
43
|
+
readonly inputs: readonly [{
|
|
44
|
+
readonly name: "account";
|
|
45
|
+
readonly type: "address";
|
|
46
|
+
}];
|
|
47
|
+
readonly name: "balanceOf";
|
|
48
|
+
readonly outputs: readonly [{
|
|
49
|
+
readonly name: "";
|
|
50
|
+
readonly type: "uint256";
|
|
51
|
+
}];
|
|
52
|
+
readonly stateMutability: "view";
|
|
53
|
+
readonly type: "function";
|
|
54
|
+
}, {
|
|
55
|
+
readonly inputs: readonly [{
|
|
56
|
+
readonly name: "owner";
|
|
57
|
+
readonly type: "address";
|
|
58
|
+
}, {
|
|
59
|
+
readonly name: "spender";
|
|
60
|
+
readonly type: "address";
|
|
61
|
+
}];
|
|
62
|
+
readonly name: "allowance";
|
|
63
|
+
readonly outputs: readonly [{
|
|
64
|
+
readonly name: "";
|
|
65
|
+
readonly type: "uint256";
|
|
66
|
+
}];
|
|
67
|
+
readonly stateMutability: "view";
|
|
68
|
+
readonly type: "function";
|
|
69
|
+
}, {
|
|
70
|
+
readonly inputs: readonly [{
|
|
71
|
+
readonly name: "spender";
|
|
72
|
+
readonly type: "address";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "amount";
|
|
75
|
+
readonly type: "uint256";
|
|
76
|
+
}];
|
|
77
|
+
readonly name: "approve";
|
|
78
|
+
readonly outputs: readonly [{
|
|
79
|
+
readonly name: "";
|
|
80
|
+
readonly type: "bool";
|
|
81
|
+
}];
|
|
82
|
+
readonly stateMutability: "nonpayable";
|
|
83
|
+
readonly type: "function";
|
|
84
|
+
}, {
|
|
85
|
+
readonly inputs: readonly [{
|
|
86
|
+
readonly name: "to";
|
|
87
|
+
readonly type: "address";
|
|
88
|
+
}, {
|
|
89
|
+
readonly name: "amount";
|
|
90
|
+
readonly type: "uint256";
|
|
91
|
+
}];
|
|
92
|
+
readonly name: "transfer";
|
|
93
|
+
readonly outputs: readonly [{
|
|
94
|
+
readonly name: "";
|
|
95
|
+
readonly type: "bool";
|
|
96
|
+
}];
|
|
97
|
+
readonly stateMutability: "nonpayable";
|
|
98
|
+
readonly type: "function";
|
|
99
|
+
}, {
|
|
100
|
+
readonly inputs: readonly [{
|
|
101
|
+
readonly name: "from";
|
|
102
|
+
readonly type: "address";
|
|
103
|
+
}, {
|
|
104
|
+
readonly name: "to";
|
|
105
|
+
readonly type: "address";
|
|
106
|
+
}, {
|
|
107
|
+
readonly name: "amount";
|
|
108
|
+
readonly type: "uint256";
|
|
109
|
+
}];
|
|
110
|
+
readonly name: "transferFrom";
|
|
111
|
+
readonly outputs: readonly [{
|
|
112
|
+
readonly name: "";
|
|
113
|
+
readonly type: "bool";
|
|
114
|
+
}];
|
|
115
|
+
readonly stateMutability: "nonpayable";
|
|
116
|
+
readonly type: "function";
|
|
117
|
+
}, {
|
|
118
|
+
readonly anonymous: false;
|
|
119
|
+
readonly inputs: readonly [{
|
|
120
|
+
readonly indexed: true;
|
|
121
|
+
readonly name: "from";
|
|
122
|
+
readonly type: "address";
|
|
123
|
+
}, {
|
|
124
|
+
readonly indexed: true;
|
|
125
|
+
readonly name: "to";
|
|
126
|
+
readonly type: "address";
|
|
127
|
+
}, {
|
|
128
|
+
readonly indexed: false;
|
|
129
|
+
readonly name: "value";
|
|
130
|
+
readonly type: "uint256";
|
|
131
|
+
}];
|
|
132
|
+
readonly name: "Transfer";
|
|
133
|
+
readonly type: "event";
|
|
134
|
+
}, {
|
|
135
|
+
readonly anonymous: false;
|
|
136
|
+
readonly inputs: readonly [{
|
|
137
|
+
readonly indexed: true;
|
|
138
|
+
readonly name: "owner";
|
|
139
|
+
readonly type: "address";
|
|
140
|
+
}, {
|
|
141
|
+
readonly indexed: true;
|
|
142
|
+
readonly name: "spender";
|
|
143
|
+
readonly type: "address";
|
|
144
|
+
}, {
|
|
145
|
+
readonly indexed: false;
|
|
146
|
+
readonly name: "value";
|
|
147
|
+
readonly type: "uint256";
|
|
148
|
+
}];
|
|
149
|
+
readonly name: "Approval";
|
|
150
|
+
readonly type: "event";
|
|
151
|
+
}];
|
|
152
|
+
//# sourceMappingURL=erc20.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc20.d.ts","sourceRoot":"","sources":["../../src/abi/erc20.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsGX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/abi/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|