@varla/polymarket 1.1.2 → 1.1.4
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 +78 -0
- package/dist/abi/ctf-exchange.d.ts +302 -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 +157 -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 +18 -0
- package/dist/index.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 +624 -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,78 @@
|
|
|
1
|
+
# @varla/polymarket
|
|
2
|
+
|
|
3
|
+
## 1.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- cea1cf2: Added TypeScript declaration output and exports metadata for the Polymarket package.
|
|
8
|
+
|
|
9
|
+
- Publish generated type declarations and include them in the package exports
|
|
10
|
+
- Include CHANGELOG in published files and build types during prepack
|
|
11
|
+
|
|
12
|
+
## 1.1.3
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 883517a: This release updates package metadata formatting with no functional changes.
|
|
17
|
+
|
|
18
|
+
- Reformatted the package.json files list without changing shipped contents.
|
|
19
|
+
|
|
20
|
+
## 1.1.2
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- 9bb27c7: No functional changes; updated package metadata formatting.
|
|
25
|
+
|
|
26
|
+
- Adjusted package.json files field formatting without affecting build output.
|
|
27
|
+
|
|
28
|
+
## 1.1.1
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- 5fdc094: Updated README to correct ClobWsClient feature description wording.
|
|
33
|
+
|
|
34
|
+
- Adjusted documentation to list "Auto-connect" for the ClobWsClient diagram.
|
|
35
|
+
|
|
36
|
+
- 0d59e12: Updated package metadata formatting without functional changes.
|
|
37
|
+
|
|
38
|
+
- No functional changes; package file list formatting was adjusted.
|
|
39
|
+
|
|
40
|
+
## 1.1.0
|
|
41
|
+
|
|
42
|
+
### Minor Changes
|
|
43
|
+
|
|
44
|
+
- 04689a5: Added new SDK types and expanded EIP-712 signer compatibility while tightening internal checks.
|
|
45
|
+
|
|
46
|
+
- Introduced OrderMarketCancelParams in SDK types for market cancel requests
|
|
47
|
+
- Expanded ClobEip712Signer to accept raw address strings for EIP-712 signing
|
|
48
|
+
- Improved internal cursor comparisons and builder auth checks
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 1cedbad: Align Polymarket API types with live responses and expand validation coverage while fixing a fetch usage bug.
|
|
53
|
+
|
|
54
|
+
- 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.
|
|
55
|
+
|
|
56
|
+
## 1.0.4
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- 6857157: Package metadata formatting was updated with no functional changes.
|
|
61
|
+
|
|
62
|
+
- Reformatted the files list in package.json
|
|
63
|
+
|
|
64
|
+
## 1.0.3
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- 036a615: Release metadata updated with a new changelog and version bump.
|
|
69
|
+
|
|
70
|
+
- Added a changelog entry and bumped the package version to 1.0.2.
|
|
71
|
+
|
|
72
|
+
## 1.0.2
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- 803b77f: Updated README performance claims to a rounded value.
|
|
77
|
+
|
|
78
|
+
- Adjusted documented speed comparison from 139% to ~140% faster.
|
|
@@ -0,0 +1,302 @@
|
|
|
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: "getOutcomeSlotCount";
|
|
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: "oracle";
|
|
186
|
+
readonly type: "address";
|
|
187
|
+
}, {
|
|
188
|
+
readonly name: "questionId";
|
|
189
|
+
readonly type: "bytes32";
|
|
190
|
+
}, {
|
|
191
|
+
readonly name: "outcomeSlotCount";
|
|
192
|
+
readonly type: "uint256";
|
|
193
|
+
}];
|
|
194
|
+
readonly name: "getConditionId";
|
|
195
|
+
readonly outputs: readonly [{
|
|
196
|
+
readonly name: "";
|
|
197
|
+
readonly type: "bytes32";
|
|
198
|
+
}];
|
|
199
|
+
readonly stateMutability: "pure";
|
|
200
|
+
readonly type: "function";
|
|
201
|
+
}, {
|
|
202
|
+
readonly inputs: readonly [{
|
|
203
|
+
readonly name: "parentCollectionId";
|
|
204
|
+
readonly type: "bytes32";
|
|
205
|
+
}, {
|
|
206
|
+
readonly name: "conditionId";
|
|
207
|
+
readonly type: "bytes32";
|
|
208
|
+
}, {
|
|
209
|
+
readonly name: "indexSet";
|
|
210
|
+
readonly type: "uint256";
|
|
211
|
+
}];
|
|
212
|
+
readonly name: "getCollectionId";
|
|
213
|
+
readonly outputs: readonly [{
|
|
214
|
+
readonly name: "";
|
|
215
|
+
readonly type: "bytes32";
|
|
216
|
+
}];
|
|
217
|
+
readonly stateMutability: "view";
|
|
218
|
+
readonly type: "function";
|
|
219
|
+
}, {
|
|
220
|
+
readonly inputs: readonly [{
|
|
221
|
+
readonly name: "collateralToken";
|
|
222
|
+
readonly type: "address";
|
|
223
|
+
}, {
|
|
224
|
+
readonly name: "collectionId";
|
|
225
|
+
readonly type: "bytes32";
|
|
226
|
+
}];
|
|
227
|
+
readonly name: "getPositionId";
|
|
228
|
+
readonly outputs: readonly [{
|
|
229
|
+
readonly name: "";
|
|
230
|
+
readonly type: "uint256";
|
|
231
|
+
}];
|
|
232
|
+
readonly stateMutability: "pure";
|
|
233
|
+
readonly type: "function";
|
|
234
|
+
}, {
|
|
235
|
+
readonly anonymous: false;
|
|
236
|
+
readonly inputs: readonly [{
|
|
237
|
+
readonly indexed: true;
|
|
238
|
+
readonly name: "operator";
|
|
239
|
+
readonly type: "address";
|
|
240
|
+
}, {
|
|
241
|
+
readonly indexed: true;
|
|
242
|
+
readonly name: "from";
|
|
243
|
+
readonly type: "address";
|
|
244
|
+
}, {
|
|
245
|
+
readonly indexed: true;
|
|
246
|
+
readonly name: "to";
|
|
247
|
+
readonly type: "address";
|
|
248
|
+
}, {
|
|
249
|
+
readonly indexed: false;
|
|
250
|
+
readonly name: "id";
|
|
251
|
+
readonly type: "uint256";
|
|
252
|
+
}, {
|
|
253
|
+
readonly indexed: false;
|
|
254
|
+
readonly name: "value";
|
|
255
|
+
readonly type: "uint256";
|
|
256
|
+
}];
|
|
257
|
+
readonly name: "TransferSingle";
|
|
258
|
+
readonly type: "event";
|
|
259
|
+
}, {
|
|
260
|
+
readonly anonymous: false;
|
|
261
|
+
readonly inputs: readonly [{
|
|
262
|
+
readonly indexed: true;
|
|
263
|
+
readonly name: "operator";
|
|
264
|
+
readonly type: "address";
|
|
265
|
+
}, {
|
|
266
|
+
readonly indexed: true;
|
|
267
|
+
readonly name: "from";
|
|
268
|
+
readonly type: "address";
|
|
269
|
+
}, {
|
|
270
|
+
readonly indexed: true;
|
|
271
|
+
readonly name: "to";
|
|
272
|
+
readonly type: "address";
|
|
273
|
+
}, {
|
|
274
|
+
readonly indexed: false;
|
|
275
|
+
readonly name: "ids";
|
|
276
|
+
readonly type: "uint256[]";
|
|
277
|
+
}, {
|
|
278
|
+
readonly indexed: false;
|
|
279
|
+
readonly name: "values";
|
|
280
|
+
readonly type: "uint256[]";
|
|
281
|
+
}];
|
|
282
|
+
readonly name: "TransferBatch";
|
|
283
|
+
readonly type: "event";
|
|
284
|
+
}, {
|
|
285
|
+
readonly anonymous: false;
|
|
286
|
+
readonly inputs: readonly [{
|
|
287
|
+
readonly indexed: true;
|
|
288
|
+
readonly name: "owner";
|
|
289
|
+
readonly type: "address";
|
|
290
|
+
}, {
|
|
291
|
+
readonly indexed: true;
|
|
292
|
+
readonly name: "operator";
|
|
293
|
+
readonly type: "address";
|
|
294
|
+
}, {
|
|
295
|
+
readonly indexed: false;
|
|
296
|
+
readonly name: "approved";
|
|
297
|
+
readonly type: "bool";
|
|
298
|
+
}];
|
|
299
|
+
readonly name: "ApprovalForAll";
|
|
300
|
+
readonly type: "event";
|
|
301
|
+
}];
|
|
302
|
+
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyLjB,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"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge API Client for Polymarket
|
|
3
|
+
*
|
|
4
|
+
* Provides access to deposit/withdrawal functionality through the Relay bridge.
|
|
5
|
+
*
|
|
6
|
+
* @see https://docs.polymarket.com/api-reference/bridge/create-deposit-addresses
|
|
7
|
+
*/
|
|
8
|
+
import type { BridgeDepositAddress, BridgeQuote, BridgeSupportedAsset, BridgeTransactionStatus, BridgeWithdrawalAddress } from "./types.js";
|
|
9
|
+
export type BridgeClientOpts = {
|
|
10
|
+
/** Optional override for Bridge base URL. */
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
maxAttempts?: number;
|
|
14
|
+
fetchFn?: typeof fetch;
|
|
15
|
+
retry?: {
|
|
16
|
+
baseBackoffMs?: number;
|
|
17
|
+
maxBackoffMs?: number;
|
|
18
|
+
multiplier?: number;
|
|
19
|
+
jitterFactor?: number;
|
|
20
|
+
};
|
|
21
|
+
log?: (level: "debug" | "info" | "warn" | "error", msg: string, fields?: Record<string, unknown>) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare class BridgeClient {
|
|
24
|
+
readonly baseUrl: string;
|
|
25
|
+
readonly timeoutMs: number;
|
|
26
|
+
readonly maxAttempts: number;
|
|
27
|
+
readonly fetchFn: typeof fetch;
|
|
28
|
+
readonly retry: Required<NonNullable<BridgeClientOpts["retry"]>>;
|
|
29
|
+
readonly log?: BridgeClientOpts["log"];
|
|
30
|
+
constructor(opts?: BridgeClientOpts);
|
|
31
|
+
private isRetryable;
|
|
32
|
+
private requestGet;
|
|
33
|
+
private requestPost;
|
|
34
|
+
/**
|
|
35
|
+
* Create deposit addresses for a user.
|
|
36
|
+
* @see https://docs.polymarket.com/api-reference/bridge/create-deposit-addresses
|
|
37
|
+
*/
|
|
38
|
+
createDepositAddresses(params: {
|
|
39
|
+
userAddress: string;
|
|
40
|
+
chain: string;
|
|
41
|
+
asset?: string;
|
|
42
|
+
}): Promise<BridgeDepositAddress>;
|
|
43
|
+
/**
|
|
44
|
+
* Create withdrawal addresses for a user.
|
|
45
|
+
* @see https://docs.polymarket.com/api-reference/bridge/create-withdrawal-addresses
|
|
46
|
+
*/
|
|
47
|
+
createWithdrawalAddresses(params: {
|
|
48
|
+
userAddress: string;
|
|
49
|
+
destinationAddress: string;
|
|
50
|
+
chain: string;
|
|
51
|
+
asset: string;
|
|
52
|
+
amount: string;
|
|
53
|
+
}): Promise<BridgeWithdrawalAddress>;
|
|
54
|
+
/**
|
|
55
|
+
* Get a quote for a bridge transaction.
|
|
56
|
+
* @see https://docs.polymarket.com/api-reference/bridge/get-a-quote
|
|
57
|
+
*/
|
|
58
|
+
getQuote(params: {
|
|
59
|
+
fromChain: string;
|
|
60
|
+
toChain: string;
|
|
61
|
+
fromAsset: string;
|
|
62
|
+
toAsset: string;
|
|
63
|
+
amount: string;
|
|
64
|
+
}): Promise<BridgeQuote>;
|
|
65
|
+
/**
|
|
66
|
+
* Get supported assets for bridging.
|
|
67
|
+
* @see https://docs.polymarket.com/api-reference/bridge/get-supported-assets
|
|
68
|
+
*/
|
|
69
|
+
getSupportedAssets(): Promise<BridgeSupportedAsset[]>;
|
|
70
|
+
/**
|
|
71
|
+
* Get transaction status.
|
|
72
|
+
* @see https://docs.polymarket.com/api-reference/bridge/get-transaction-status
|
|
73
|
+
*/
|
|
74
|
+
getTransactionStatus(transactionId: string): Promise<BridgeTransactionStatus>;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=bridge-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge-client.d.ts","sourceRoot":"","sources":["../src/bridge-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAapB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB,KAAK,CAAC,EAAE;QACN,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,GAAG,CAAC,EAAE,CACJ,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,EAC1C,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,IAAI,CAAC;CACX,CAAC;AAEF,qBAAa,YAAY;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,OAAO,KAAK,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACjE,QAAQ,CAAC,GAAG,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;gBAE3B,IAAI,GAAE,gBAAqB;IAcvC,OAAO,CAAC,WAAW;YASL,UAAU;YAuBV,WAAW;IAsCzB;;;OAGG;IACG,sBAAsB,CAAC,MAAM,EAAE;QACnC,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAajC;;;OAGG;IACG,yBAAyB,CAAC,MAAM,EAAE;QACtC,WAAW,EAAE,MAAM,CAAC;QACpB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAepC;;;OAGG;IACG,QAAQ,CAAC,MAAM,EAAE;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,WAAW,CAAC;IAexB;;;OAGG;IACG,kBAAkB,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAS3D;;;OAGG;IACG,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAIpF"}
|