@predictasiax/api 2.2.0 → 2.4.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/dist/index.cjs CHANGED
@@ -1165,6 +1165,55 @@ var ApplyResource = class extends Resource {
1165
1165
  var SandboxResource = class extends Resource {
1166
1166
  };
1167
1167
 
1168
+ // src/resources/settle.ts
1169
+ var SettleResource = class extends Resource {
1170
+ /** Builder self-serve settle — POST /v1/builders/me/settle. */
1171
+ me(params, opts) {
1172
+ const body = {
1173
+ address: params.address,
1174
+ asset: params.asset ?? "USDT",
1175
+ network: params.network ?? "polygon",
1176
+ min_amount: params.min_amount ?? 0
1177
+ };
1178
+ return this._apiPromise(
1179
+ () => this._http.request("POST", "/v1/builders/me/settle", void 0, body, opts)
1180
+ );
1181
+ }
1182
+ /** Admin settle a specific builder's fees — POST /v1/admin/builders/{userId}/settle.
1183
+ * Requires X-Admin-Key header. */
1184
+ adminBuilder(userId, params, adminKey, opts) {
1185
+ const body = {
1186
+ address: params.address,
1187
+ asset: params.asset ?? "USDT",
1188
+ network: params.network ?? "polygon",
1189
+ min_amount: params.min_amount ?? 0
1190
+ };
1191
+ const mergedOpts = {
1192
+ ...opts || {},
1193
+ headers: { ...opts?.headers || {}, "X-Admin-Key": adminKey }
1194
+ };
1195
+ return this._apiPromise(
1196
+ () => this._http.request("POST", `/v1/admin/builders/${encodeURIComponent(userId)}/settle`, void 0, body, mergedOpts)
1197
+ );
1198
+ }
1199
+ /** Admin settle a market creator's fees — POST /v1/admin/creators/{userId}/settle. */
1200
+ adminCreator(userId, params, adminKey, opts) {
1201
+ const body = {
1202
+ address: params.address,
1203
+ asset: params.asset ?? "USDT",
1204
+ network: params.network ?? "polygon",
1205
+ min_amount: params.min_amount ?? 0
1206
+ };
1207
+ const mergedOpts = {
1208
+ ...opts || {},
1209
+ headers: { ...opts?.headers || {}, "X-Admin-Key": adminKey }
1210
+ };
1211
+ return this._apiPromise(
1212
+ () => this._http.request("POST", `/v1/admin/creators/${encodeURIComponent(userId)}/settle`, void 0, body, mergedOpts)
1213
+ );
1214
+ }
1215
+ };
1216
+
1168
1217
  // src/resources/templates.ts
1169
1218
  var TemplatesResource = class extends Resource {
1170
1219
  list(params = {}, opts) {
@@ -1203,6 +1252,8 @@ var PaxClient = class {
1203
1252
  // v2.1+: GET /v1/fees/estimate
1204
1253
  audit;
1205
1254
  // v2.2+: public Merkle chain verifier (no-auth)
1255
+ settle;
1256
+ // v2.4+: claim accrued fee revenue
1206
1257
  constructor(opts) {
1207
1258
  this._http = new HttpClient(opts);
1208
1259
  this.markets = new MarketsResource(this._http);
@@ -1216,6 +1267,7 @@ var PaxClient = class {
1216
1267
  this.grants = new GrantsResource(this._http);
1217
1268
  this.fees = new FeesResource(this._http);
1218
1269
  this.audit = new AuditResource(this._http);
1270
+ this.settle = new SettleResource(this._http);
1219
1271
  }
1220
1272
  get baseUrl() {
1221
1273
  return this._http.baseUrl;