@klappay/types 1.0.4 → 1.0.5
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/README.md +9 -8
- package/dist/index.d.mts +709 -30
- package/dist/index.d.ts +709 -30
- package/dist/index.js +454 -156
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +430 -156
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -82,7 +82,7 @@ function paginatedSchema(itemSchema) {
|
|
|
82
82
|
// src/tokens.ts
|
|
83
83
|
import { z as z5 } from "zod";
|
|
84
84
|
var TokenSchema = z5.enum(["USDC", "USDT"]).describe(
|
|
85
|
-
`Which stablecoin the payer will send. Support depends on both \`network\` and \`environment\` \u2014 not every token/network/environment combination is deployed; today, both \`USDC\` and \`USDT\` are deployed on every operational network's \`live\` side except BNB Chain (\`${OPERATIONAL_NETWORKS.join(", ")}\`), but \`test\` coverage varies per network \u2014 Base, Optimism, and Ethereum each have a \`test\` environment (\`USDC\` only; none has an official Sepolia USDT), Arbitrum, Polygon, Avalanche, and BNB Chain have none yet (0xSplits hasn't deployed on Arbitrum Sepolia and has no Polygon, Avalanche Fuji, or BNB testnet support at all). An unconfigured combination is rejected with \`422 token_not_supported\`, not silently accepted. **BNB Chain's \`USDC\` address is Binance-Peg USDC, not an official Circle deployment** \u2014 Circle does not issue native USDC on BNB Chain at all; this is a Binance-custodied, 1:1-pegged BEP-20 token, a materially different trust model than every other \`TOKEN_ADDRESSES\` entry (all verified directly against their real issuer). Accepted at the payer's own risk \u2014
|
|
85
|
+
`Which stablecoin the payer will send. Support depends on both \`network\` and \`environment\` \u2014 not every token/network/environment combination is deployed; today, both \`USDC\` and \`USDT\` are deployed on every operational network's \`live\` side except BNB Chain (\`${OPERATIONAL_NETWORKS.join(", ")}\`), but \`test\` coverage varies per network \u2014 Base, Optimism, and Ethereum each have a \`test\` environment (\`USDC\` only; none has an official Sepolia USDT), Arbitrum, Polygon, Avalanche, and BNB Chain have none yet (0xSplits hasn't deployed on Arbitrum Sepolia and has no Polygon, Avalanche Fuji, or BNB testnet support at all). An unconfigured combination is rejected with \`422 token_not_supported\`, not silently accepted. **BNB Chain's \`USDC\` address is Binance-Peg USDC, not an official Circle deployment** \u2014 Circle does not issue native USDC on BNB Chain at all; this is a Binance-custodied, 1:1-pegged BEP-20 token, a materially different trust model than every other \`TOKEN_ADDRESSES\` entry (all verified directly against their real issuer). Accepted at the payer's own risk \u2014 Klappay does not verify or guarantee Binance's collateral backing it. \`USDT\` on BNB Chain is Tether's own official issuance, same trust model as everywhere else. More tokens/networks are expected to be added over time \u2014 check \`TOKEN_ADDRESSES\` in \`@klappay/types\` (or a future \`GET /v1/networks\` capabilities endpoint) for the exact current matrix rather than assuming full coverage.`
|
|
86
86
|
);
|
|
87
87
|
var TOKEN_DECIMALS = 6;
|
|
88
88
|
var TOKEN_ADDRESSES = {
|
|
@@ -171,7 +171,7 @@ var CreateChargeSchema = z6.object({
|
|
|
171
171
|
"Scoped to your organization. Replaying the same key returns the original charge unchanged instead of creating a duplicate \u2014 safe to retry a request after a timeout without double-charging."
|
|
172
172
|
),
|
|
173
173
|
externalRef: z6.string().min(1).max(255).optional().describe(
|
|
174
|
-
"An opaque correlation id from your own system (e.g. an order id) \u2014 echoed back on the charge and in every webhook payload. Not interpreted or validated by
|
|
174
|
+
"An opaque correlation id from your own system (e.g. an order id) \u2014 echoed back on the charge and in every webhook payload. Not interpreted or validated by Klappay."
|
|
175
175
|
),
|
|
176
176
|
source: z6.string().min(1).max(64).optional().describe(
|
|
177
177
|
'Free-form label for what created this charge (e.g. `"checkout"`, `"invoice"`) \u2014 useful if you create charges from more than one flow and want to tell them apart later. Not a fixed enum; use whatever values make sense to you.'
|
|
@@ -187,7 +187,7 @@ var CreateChargeSchema = z6.object({
|
|
|
187
187
|
}
|
|
188
188
|
});
|
|
189
189
|
var ChargeSchema = z6.object({
|
|
190
|
-
id: z6.string().describe("
|
|
190
|
+
id: z6.string().describe("Klappay-generated id, e.g. `ch_...`. Use this to look up the charge later."),
|
|
191
191
|
mode: ChargeModeSchema,
|
|
192
192
|
amount: z6.number().nullable().describe(
|
|
193
193
|
"The amount originally requested, in `currency` units (up to 6 decimal places). `null` if `amount` was omitted at creation \u2014 this charge accepts any amount, and the first credited transfer confirms it."
|
|
@@ -196,7 +196,7 @@ var ChargeSchema = z6.object({
|
|
|
196
196
|
"Cumulative amount actually received on-chain so far, in `currency` units (up to 6 decimal places). `null` until the first transfer arrives. Can exceed `amount` \u2014 see `isOverpaid` \u2014 unless `amount` itself is `null`, in which case `isOverpaid` never applies."
|
|
197
197
|
),
|
|
198
198
|
isOverpaid: z6.boolean().describe(
|
|
199
|
-
"`true` if `amountReceived` ended up greater than `amount`.
|
|
199
|
+
"`true` if `amountReceived` ended up greater than `amount`. Klappay never refunds the difference automatically \u2014 see the docs for why."
|
|
200
200
|
),
|
|
201
201
|
currency: z6.string().describe("Always `USD` today \u2014 the only supported currency."),
|
|
202
202
|
acceptedPayments: z6.array(AcceptedPaymentSchema).describe(
|
|
@@ -206,7 +206,7 @@ var ChargeSchema = z6.object({
|
|
|
206
206
|
"Every distinct `(token, network)` pair that has actually contributed a credited transfer so far \u2014 empty until the first one arrives. Can hold more than one entry: a charge accepting several pairs can be paid across a combination of them, and every entry here sums toward `amountReceived`."
|
|
207
207
|
),
|
|
208
208
|
address: z6.string().describe(
|
|
209
|
-
"The on-chain address the payer must send funds to \u2014 identical across every accepted network (0xSplits addresses are chain-agnostic). Unique per charge, predicted at creation time \u2014 funds sent here go directly to the merchant,
|
|
209
|
+
"The on-chain address the payer must send funds to \u2014 identical across every accepted network (0xSplits addresses are chain-agnostic). Unique per charge, predicted at creation time \u2014 funds sent here go directly to the merchant, Klappay never custodies them."
|
|
210
210
|
),
|
|
211
211
|
status: ChargeStatusSchema,
|
|
212
212
|
settlementStatus: SettlementStatusSchema.nullable(),
|
|
@@ -232,7 +232,7 @@ var ChargeSchema = z6.object({
|
|
|
232
232
|
"When a transfer was last credited toward this charge, or `createdAt` if none has arrived yet. Only meaningful for a charge with no `expiresAt` \u2014 see `pausedAt`."
|
|
233
233
|
),
|
|
234
234
|
pausedAt: z6.string().datetime().nullable().describe(
|
|
235
|
-
"Only ever set for a charge with no `expiresAt`: `null` means
|
|
235
|
+
"Only ever set for a charge with no `expiresAt`: `null` means Klappay is actively watching this address in real time (the normal case). A timestamp means no contribution arrived for longer than the inactivity window (90 days for a charge with a goal `amount`, 365 days for one without), so real-time watching was stopped \u2014 the charge itself is never closed, a transfer can still arrive and land, just detected on a much slower fallback poll instead of instantly. Clears automatically (and real-time watching resumes) the moment that happens."
|
|
236
236
|
)
|
|
237
237
|
});
|
|
238
238
|
var ListChargesSchema = z6.object({
|
|
@@ -261,6 +261,9 @@ var ChargeStatusEventSchema = z6.object({
|
|
|
261
261
|
|
|
262
262
|
// src/distributions.ts
|
|
263
263
|
import { z as z7 } from "zod";
|
|
264
|
+
var SplitDistributionStatusSchema = z7.enum(["pending", "processing", "completed", "failed"]).describe(
|
|
265
|
+
"Status of one payout attempt to the merchant, for a single `(token, network)` pair \u2014 a charge that settles across more than one pair has one of these per pair. `pending`: queued, not yet claimed by a distributor. `processing`: a distributor (Klappay's own worker, or anyone racing to call `distribute()` first, see `PendingDistributionSchema`) has claimed it and is submitting the on-chain transaction. `completed`: the merchant's wallet has the funds. `failed`: every automatic retry was exhausted."
|
|
266
|
+
);
|
|
264
267
|
var PendingDistributionRecipientSchema = z7.object({
|
|
265
268
|
address: z7.string().describe("On-chain recipient address."),
|
|
266
269
|
percentAllocation: z7.number().describe("This recipient's share of the split, as a percentage (e.g. `99.0991` = 99.0991%).")
|
|
@@ -276,11 +279,11 @@ var PendingDistributionSchema = z7.object({
|
|
|
276
279
|
"Percentage of the split balance paid to whoever calls `distribute()` first (e.g. `0.1` = 0.1%). Frozen at charge creation, same for every distribution today."
|
|
277
280
|
),
|
|
278
281
|
estimatedRewardAmount: z7.number().describe(
|
|
279
|
-
"Estimate only, in the charge's `currency` units, based on the amount
|
|
282
|
+
"Estimate only, in the charge's `currency` units, based on the amount Klappay detected on-chain \u2014 not a live read of the split's current balance. Read the balance yourself before submitting a transaction; a stale estimate is harmless (see the docs), never a reason to skip that check."
|
|
280
283
|
),
|
|
281
284
|
availableSince: z7.string().datetime().describe("When this distribution entered its grace period."),
|
|
282
285
|
graceEndsAt: z7.string().datetime().describe(
|
|
283
|
-
"When
|
|
286
|
+
"When Klappay's own worker may claim this distribution. Racing to call `distribute()` after this timestamp is possible but increasingly likely to lose to the worker."
|
|
284
287
|
)
|
|
285
288
|
});
|
|
286
289
|
var PendingDistributionEventSchema = z7.discriminatedUnion("type", [
|
|
@@ -294,9 +297,252 @@ var PendingDistributionEventSchema = z7.discriminatedUnion("type", [
|
|
|
294
297
|
})
|
|
295
298
|
]);
|
|
296
299
|
|
|
297
|
-
// src/
|
|
300
|
+
// src/metrics.ts
|
|
298
301
|
import { z as z8 } from "zod";
|
|
299
|
-
var
|
|
302
|
+
var MetricsResourceSchema = z8.enum(["charges", "transactions", "distributions"]).describe(
|
|
303
|
+
"Which underlying dataset to query. `charges`: one row per charge. `transactions`: one row per detected on-chain transfer \u2014 a charge paid in installments has more than one. `distributions`: one row per payout attempt to the merchant, one per `(token, network)` pair a charge settled across."
|
|
304
|
+
);
|
|
305
|
+
var MetricsAggregationSchema = z8.enum(["count", "sum", "avg", "min", "max"]).describe(
|
|
306
|
+
"`count` counts matching rows and never takes `field`. `sum`/`avg`/`min`/`max` require `field` to be set to one of the resource\u2019s numeric fields."
|
|
307
|
+
);
|
|
308
|
+
var MetricsFilterOperatorSchema = z8.enum(["eq", "neq", "in", "gt", "gte", "lt", "lte"]).describe(
|
|
309
|
+
"`in` expects an array value (max 50 entries); every other operator expects a single scalar."
|
|
310
|
+
);
|
|
311
|
+
var MetricsDateGranularitySchema = z8.enum(["day", "week", "month"]).describe(
|
|
312
|
+
"Bucket width for a `date_bucket` `groupBy` entry \u2014 Postgres `date_trunc` semantics (UTC)."
|
|
313
|
+
);
|
|
314
|
+
var metricsQueryEnvironmentSchema = EnvironmentSchema.describe(
|
|
315
|
+
"Which environment's data to query \u2014 `live` or `test`. Independent of your session (a dashboard user isn't scoped to one environment the way an API key is) \u2014 scopes the query to charges/transactions/distributions created under a `live` or `test` API key respectively."
|
|
316
|
+
);
|
|
317
|
+
var MAX_METRICS_QUERY_DATE_RANGE_DAYS = 366;
|
|
318
|
+
var METRICS_QUERY_MAX_ROW_LIMIT = 1e3;
|
|
319
|
+
var METRICS_QUERY_DEFAULT_ROW_LIMIT = 100;
|
|
320
|
+
var METRICS_QUERY_MAX_GROUP_BY = 3;
|
|
321
|
+
var METRICS_QUERY_MAX_FILTERS = 20;
|
|
322
|
+
var METRICS_QUERY_MAX_METRICS = 10;
|
|
323
|
+
var METRIC_ALIAS_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
324
|
+
var metricAliasSchema = z8.string().min(1).max(64).regex(
|
|
325
|
+
METRIC_ALIAS_PATTERN,
|
|
326
|
+
"Must start with a letter or underscore, and contain only letters, digits, and underscores \u2014 this becomes a SQL column alias."
|
|
327
|
+
).optional();
|
|
328
|
+
var MetricsFilterValueSchema = z8.union([
|
|
329
|
+
z8.string().max(255),
|
|
330
|
+
z8.number(),
|
|
331
|
+
z8.boolean(),
|
|
332
|
+
z8.array(z8.union([z8.string().max(255), z8.number()])).min(1).max(50)
|
|
333
|
+
]);
|
|
334
|
+
var orderBySchema = z8.object({
|
|
335
|
+
key: z8.string().min(1).max(64).describe(
|
|
336
|
+
"An output column name from this same query \u2014 either a `groupBy` field name, or a metric\u2019s `alias` (or its default name: `${aggregation}` for `count`, `${aggregation}_${field}` otherwise, e.g. `sum_amount`)."
|
|
337
|
+
),
|
|
338
|
+
direction: z8.enum(["asc", "desc"])
|
|
339
|
+
}).describe(
|
|
340
|
+
"Sort the result rows by any output column \u2014 including the bucket field itself for a `date_bucket` query (e.g. `createdAt`). Omit to get ascending-by-bucket order for a date-bucketed query, or implementation-defined (not guaranteed stable) order otherwise."
|
|
341
|
+
);
|
|
342
|
+
var limitSchema = z8.number().int().min(1).max(METRICS_QUERY_MAX_ROW_LIMIT).default(METRICS_QUERY_DEFAULT_ROW_LIMIT).describe(
|
|
343
|
+
`Max rows to return, ${1}\u2013${METRICS_QUERY_MAX_ROW_LIMIT}, default ${METRICS_QUERY_DEFAULT_ROW_LIMIT}. If more rows matched, \`meta.truncated\` is \`true\` on the response \u2014 narrow the query instead of just raising this.`
|
|
344
|
+
);
|
|
345
|
+
var ChargesQueryFieldSchema = z8.enum(["status", "mode", "source", "apiKeyId", "currency", "isOverpaid", "externalRef"]).describe(
|
|
346
|
+
"A `Charge` field to filter or group by \u2014 see `ChargeStatusSchema`/`ChargeModeSchema` for `status`/`mode`'s own possible values (charges.md). `source`/`externalRef` are free-form strings your own integration set at creation, not a fixed enum."
|
|
347
|
+
);
|
|
348
|
+
var ChargesMetricFieldSchema = z8.enum(["amount", "amountReceived", "feePercent"]).describe(
|
|
349
|
+
"A `Charge` numeric field to aggregate. `amount`/`amountReceived` are decimal currency amounts (requested vs. actually received \u2014 see `charges.md`). `feePercent` is the platform fee frozen on the charge at creation, e.g. `1.5` means 1.5%."
|
|
350
|
+
);
|
|
351
|
+
var ChargesDateFieldSchema = z8.enum(["createdAt", "confirmedAt", "lastActivityAt"]).describe(
|
|
352
|
+
"A `Charge` timestamp to filter/bucket by. `confirmedAt` is `null` until the charge reaches `confirmed` \u2014 a `dateRange`/`date_bucket` on it implicitly excludes every charge that never confirmed."
|
|
353
|
+
);
|
|
354
|
+
var ChargesFilterSchema = z8.object({
|
|
355
|
+
field: ChargesQueryFieldSchema,
|
|
356
|
+
operator: MetricsFilterOperatorSchema,
|
|
357
|
+
value: MetricsFilterValueSchema
|
|
358
|
+
});
|
|
359
|
+
var ChargesGroupBySchema = z8.union([
|
|
360
|
+
z8.object({ type: z8.literal("field"), field: ChargesQueryFieldSchema }),
|
|
361
|
+
z8.object({
|
|
362
|
+
type: z8.literal("date_bucket"),
|
|
363
|
+
field: ChargesDateFieldSchema,
|
|
364
|
+
granularity: MetricsDateGranularitySchema
|
|
365
|
+
})
|
|
366
|
+
]);
|
|
367
|
+
var ChargesMetricSchema = z8.object({
|
|
368
|
+
aggregation: MetricsAggregationSchema,
|
|
369
|
+
field: ChargesMetricFieldSchema.optional(),
|
|
370
|
+
alias: metricAliasSchema
|
|
371
|
+
});
|
|
372
|
+
var ChargesMetricsQuerySchema = z8.object({
|
|
373
|
+
resource: z8.literal("charges"),
|
|
374
|
+
environment: metricsQueryEnvironmentSchema,
|
|
375
|
+
dateRange: z8.object({
|
|
376
|
+
field: ChargesDateFieldSchema,
|
|
377
|
+
from: z8.string().max(64).datetime(),
|
|
378
|
+
to: z8.string().max(64).datetime()
|
|
379
|
+
}),
|
|
380
|
+
groupBy: z8.array(ChargesGroupBySchema).max(METRICS_QUERY_MAX_GROUP_BY).default([]),
|
|
381
|
+
metrics: z8.array(ChargesMetricSchema).min(1).max(METRICS_QUERY_MAX_METRICS),
|
|
382
|
+
filters: z8.array(ChargesFilterSchema).max(METRICS_QUERY_MAX_FILTERS).default([]),
|
|
383
|
+
orderBy: orderBySchema.optional(),
|
|
384
|
+
limit: limitSchema
|
|
385
|
+
});
|
|
386
|
+
var TransactionsQueryFieldSchema = z8.enum(["network", "token", "source", "causedTransition"]).describe(
|
|
387
|
+
"A `Transaction` field to filter or group by \u2014 see `NetworkSchema`/`TokenSchema`/`TransactionSourceSchema` for their possible values. `causedTransition` is `true` only for the transfer(s) that actually flipped the charge's `status` \u2014 a charge paid in installments can have more than one; filtering/grouping on it excludes no-op duplicate transfers (see `TimelineEvent.causedTransition` in charges.md for the full explanation)."
|
|
388
|
+
);
|
|
389
|
+
var TransactionsMetricFieldSchema = z8.enum(["amount"]).describe("The transfer amount, in the charge's `currency` units.");
|
|
390
|
+
var TransactionsDateFieldSchema = z8.enum(["detectedAt"]).describe("When Klappay detected this transfer on-chain (not when it was mined).");
|
|
391
|
+
var TransactionsFilterSchema = z8.object({
|
|
392
|
+
field: TransactionsQueryFieldSchema,
|
|
393
|
+
operator: MetricsFilterOperatorSchema,
|
|
394
|
+
value: MetricsFilterValueSchema
|
|
395
|
+
});
|
|
396
|
+
var TransactionsGroupBySchema = z8.union([
|
|
397
|
+
z8.object({ type: z8.literal("field"), field: TransactionsQueryFieldSchema }),
|
|
398
|
+
z8.object({
|
|
399
|
+
type: z8.literal("date_bucket"),
|
|
400
|
+
field: TransactionsDateFieldSchema,
|
|
401
|
+
granularity: MetricsDateGranularitySchema
|
|
402
|
+
})
|
|
403
|
+
]);
|
|
404
|
+
var TransactionsMetricSchema = z8.object({
|
|
405
|
+
aggregation: MetricsAggregationSchema,
|
|
406
|
+
field: TransactionsMetricFieldSchema.optional(),
|
|
407
|
+
alias: metricAliasSchema
|
|
408
|
+
});
|
|
409
|
+
var TransactionsMetricsQuerySchema = z8.object({
|
|
410
|
+
resource: z8.literal("transactions"),
|
|
411
|
+
environment: metricsQueryEnvironmentSchema,
|
|
412
|
+
dateRange: z8.object({
|
|
413
|
+
field: TransactionsDateFieldSchema,
|
|
414
|
+
from: z8.string().max(64).datetime(),
|
|
415
|
+
to: z8.string().max(64).datetime()
|
|
416
|
+
}),
|
|
417
|
+
groupBy: z8.array(TransactionsGroupBySchema).max(METRICS_QUERY_MAX_GROUP_BY).default([]),
|
|
418
|
+
metrics: z8.array(TransactionsMetricSchema).min(1).max(METRICS_QUERY_MAX_METRICS),
|
|
419
|
+
filters: z8.array(TransactionsFilterSchema).max(METRICS_QUERY_MAX_FILTERS).default([]),
|
|
420
|
+
orderBy: orderBySchema.optional(),
|
|
421
|
+
limit: limitSchema
|
|
422
|
+
});
|
|
423
|
+
var DistributionsQueryFieldSchema = z8.enum(["status", "network", "token"]).describe(
|
|
424
|
+
"A `SplitDistribution` field to filter or group by \u2014 see `SplitDistributionStatusSchema`/`NetworkSchema`/`TokenSchema` for their possible values."
|
|
425
|
+
);
|
|
426
|
+
var DistributionsMetricFieldSchema = z8.enum(["attempts"]).describe(
|
|
427
|
+
"How many times a payout was attempted for this settlement so far \u2014 incremented on every attempt, whether it succeeded or is being retried after failing. A high `attempts` alongside `status: 'failed'` means every automatic retry was exhausted."
|
|
428
|
+
);
|
|
429
|
+
var DistributionsDateFieldSchema = z8.enum(["createdAt", "completedAt"]).describe(
|
|
430
|
+
"`createdAt`: when this settlement was queued. `completedAt`: when it actually paid out \u2014 `null` until `status` reaches `completed`, so a `dateRange`/`date_bucket` on it implicitly excludes every distribution still pending/processing/failed."
|
|
431
|
+
);
|
|
432
|
+
var DistributionsFilterSchema = z8.object({
|
|
433
|
+
field: DistributionsQueryFieldSchema,
|
|
434
|
+
operator: MetricsFilterOperatorSchema,
|
|
435
|
+
value: MetricsFilterValueSchema
|
|
436
|
+
});
|
|
437
|
+
var DistributionsGroupBySchema = z8.union([
|
|
438
|
+
z8.object({ type: z8.literal("field"), field: DistributionsQueryFieldSchema }),
|
|
439
|
+
z8.object({
|
|
440
|
+
type: z8.literal("date_bucket"),
|
|
441
|
+
field: DistributionsDateFieldSchema,
|
|
442
|
+
granularity: MetricsDateGranularitySchema
|
|
443
|
+
})
|
|
444
|
+
]);
|
|
445
|
+
var DistributionsMetricSchema = z8.object({
|
|
446
|
+
aggregation: MetricsAggregationSchema,
|
|
447
|
+
field: DistributionsMetricFieldSchema.optional(),
|
|
448
|
+
alias: metricAliasSchema
|
|
449
|
+
});
|
|
450
|
+
var DistributionsMetricsQuerySchema = z8.object({
|
|
451
|
+
resource: z8.literal("distributions"),
|
|
452
|
+
environment: metricsQueryEnvironmentSchema,
|
|
453
|
+
dateRange: z8.object({
|
|
454
|
+
field: DistributionsDateFieldSchema,
|
|
455
|
+
from: z8.string().max(64).datetime(),
|
|
456
|
+
to: z8.string().max(64).datetime()
|
|
457
|
+
}),
|
|
458
|
+
groupBy: z8.array(DistributionsGroupBySchema).max(METRICS_QUERY_MAX_GROUP_BY).default([]),
|
|
459
|
+
metrics: z8.array(DistributionsMetricSchema).min(1).max(METRICS_QUERY_MAX_METRICS),
|
|
460
|
+
filters: z8.array(DistributionsFilterSchema).max(METRICS_QUERY_MAX_FILTERS).default([]),
|
|
461
|
+
orderBy: orderBySchema.optional(),
|
|
462
|
+
limit: limitSchema
|
|
463
|
+
});
|
|
464
|
+
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
465
|
+
var MetricsQuerySchema = z8.discriminatedUnion("resource", [
|
|
466
|
+
ChargesMetricsQuerySchema,
|
|
467
|
+
TransactionsMetricsQuerySchema,
|
|
468
|
+
DistributionsMetricsQuerySchema
|
|
469
|
+
]).superRefine((input, ctx) => {
|
|
470
|
+
const from = new Date(input.dateRange.from);
|
|
471
|
+
const to = new Date(input.dateRange.to);
|
|
472
|
+
if (from >= to) {
|
|
473
|
+
ctx.addIssue({
|
|
474
|
+
code: z8.ZodIssueCode.custom,
|
|
475
|
+
message: "`dateRange.from` must be before `dateRange.to`.",
|
|
476
|
+
path: ["dateRange", "from"]
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
const spanDays = (to.getTime() - from.getTime()) / ONE_DAY_MS;
|
|
480
|
+
if (spanDays > MAX_METRICS_QUERY_DATE_RANGE_DAYS) {
|
|
481
|
+
ctx.addIssue({
|
|
482
|
+
code: z8.ZodIssueCode.custom,
|
|
483
|
+
message: `\`dateRange\` cannot span more than ${MAX_METRICS_QUERY_DATE_RANGE_DAYS} days.`,
|
|
484
|
+
path: ["dateRange", "to"]
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
const dateBucketCount = input.groupBy.filter((entry) => entry.type === "date_bucket").length;
|
|
488
|
+
if (dateBucketCount > 1) {
|
|
489
|
+
ctx.addIssue({
|
|
490
|
+
code: z8.ZodIssueCode.custom,
|
|
491
|
+
message: "At most one `date_bucket` entry is allowed in `groupBy`.",
|
|
492
|
+
path: ["groupBy"]
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
input.metrics.forEach((metric, index) => {
|
|
496
|
+
if (metric.aggregation !== "count" && metric.field === void 0) {
|
|
497
|
+
ctx.addIssue({
|
|
498
|
+
code: z8.ZodIssueCode.custom,
|
|
499
|
+
message: "`field` is required unless `aggregation` is `count`.",
|
|
500
|
+
path: ["metrics", index, "field"]
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
const aliases = input.metrics.map((metric) => metric.alias).filter((alias) => alias !== void 0);
|
|
505
|
+
if (new Set(aliases).size !== aliases.length) {
|
|
506
|
+
ctx.addIssue({
|
|
507
|
+
code: z8.ZodIssueCode.custom,
|
|
508
|
+
message: "Every `metrics[].alias` must be unique.",
|
|
509
|
+
path: ["metrics"]
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
const reservedNames = /* @__PURE__ */ new Set(["bucket", ...input.groupBy.map((entry) => entry.field)]);
|
|
513
|
+
input.metrics.forEach((metric, index) => {
|
|
514
|
+
if (metric.alias !== void 0 && reservedNames.has(metric.alias)) {
|
|
515
|
+
ctx.addIssue({
|
|
516
|
+
code: z8.ZodIssueCode.custom,
|
|
517
|
+
message: `\`alias\` "${metric.alias}" collides with a \`groupBy\` field name (or the reserved word "bucket") \u2014 choose a different alias.`,
|
|
518
|
+
path: ["metrics", index, "alias"]
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
});
|
|
523
|
+
var MetricsQueryResultRowSchema = z8.record(
|
|
524
|
+
z8.string(),
|
|
525
|
+
z8.union([z8.string(), z8.number(), z8.boolean(), z8.null()])
|
|
526
|
+
);
|
|
527
|
+
var MetricsQueryScopeSchema = z8.enum(["owner_admin", "member"]).describe(
|
|
528
|
+
"`member`: results were automatically restricted to data tied to API keys you personally created \u2014 rows with no resolvable creator were excluded, not counted, and not surfaced any other way. `owner_admin`: the full organization\u2019s data was queried, no restriction applied."
|
|
529
|
+
);
|
|
530
|
+
var MetricsQueryResultSchema = z8.object({
|
|
531
|
+
data: z8.array(MetricsQueryResultRowSchema),
|
|
532
|
+
meta: z8.object({
|
|
533
|
+
resource: MetricsResourceSchema,
|
|
534
|
+
environment: EnvironmentSchema,
|
|
535
|
+
scope: MetricsQueryScopeSchema,
|
|
536
|
+
rowCount: z8.number().int().describe("Number of rows in `data`."),
|
|
537
|
+
truncated: z8.boolean().describe(
|
|
538
|
+
"`true` if more rows matched than `limit` allowed \u2014 `data` holds only the first `limit`."
|
|
539
|
+
)
|
|
540
|
+
})
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
// src/webhook-events.ts
|
|
544
|
+
import { z as z9 } from "zod";
|
|
545
|
+
var ChargeWebhookEventTypeSchema = z9.enum([
|
|
300
546
|
"charge.created",
|
|
301
547
|
"charge.partially_paid",
|
|
302
548
|
"charge.confirmed",
|
|
@@ -310,9 +556,9 @@ var ChargeWebhookEventTypeSchema = z8.enum([
|
|
|
310
556
|
"charge.contribution_received",
|
|
311
557
|
"charge.contribution_settled"
|
|
312
558
|
]).describe(
|
|
313
|
-
'Note the distinction between `charge.confirmed` and `charge.settled`: `confirmed` means the payment was detected on-chain; `settled` means the merchant\'s wallet actually received the funds \u2014 a separate, later step. Subscribe to `confirmed` if you only need "will I get paid," or `settled` if you need "has the money actually arrived." `charge.overpaid` fires alongside `charge.confirmed`/`charge.partially_paid` whenever the cumulative amount received ends up above `amount` (see `Charge.isOverpaid`). Every event in this category carries the full `Charge` object as `data`, except `charge.paused`/`charge.reactivated`/`charge.contribution_received`/`charge.contribution_settled` (see below). `charge.paused` fires when a charge with no `expiresAt` has had no contribution for longer than its inactivity window (90 days for a charge with a goal `amount`, 365 days for one without) \u2014
|
|
559
|
+
'Note the distinction between `charge.confirmed` and `charge.settled`: `confirmed` means the payment was detected on-chain; `settled` means the merchant\'s wallet actually received the funds \u2014 a separate, later step. Subscribe to `confirmed` if you only need "will I get paid," or `settled` if you need "has the money actually arrived." `charge.overpaid` fires alongside `charge.confirmed`/`charge.partially_paid` whenever the cumulative amount received ends up above `amount` (see `Charge.isOverpaid`). Every event in this category carries the full `Charge` object as `data`, except `charge.paused`/`charge.reactivated`/`charge.contribution_received`/`charge.contribution_settled` (see below). `charge.paused` fires when a charge with no `expiresAt` has had no contribution for longer than its inactivity window (90 days for a charge with a goal `amount`, 365 days for one without) \u2014 Klappay stops watching its address in real time, but the charge itself is never closed; `charge.reactivated` fires the moment a transfer lands on a paused charge, detected by the same fallback poller used for missed webhooks (so with much higher latency than normal \u2014 pausing trades that away deliberately, see `docs/payments.md`). `charge.contribution_received`/`charge.contribution_settled` are exclusive to `mode: continuous` charges (see `Charge.mode`) \u2014 a continuous charge never fires `charge.confirmed`/`charge.settled` at all, since `status` never leaves `pending`; instead every individual transfer fires `contribution_received` on detection and `contribution_settled` once its payout completes, one pair-scoped event per contribution instead of one event for the whole charge. `data` for `charge.paused`: `{ chargeId, lastActivityAt, pausedAt }`; for `charge.reactivated`: `{ chargeId, reactivatedAt }`; for `charge.contribution_received`: `{ chargeId, token, network, amount, txHash, payerAddress }`; for `charge.contribution_settled`: `{ chargeId, token, network, amount, txHash, distributorAddress }`.'
|
|
314
560
|
);
|
|
315
|
-
var AccountWebhookEventTypeSchema =
|
|
561
|
+
var AccountWebhookEventTypeSchema = z9.enum([
|
|
316
562
|
"payout_address.changed",
|
|
317
563
|
"api_key.created",
|
|
318
564
|
"api_key.revoked",
|
|
@@ -326,10 +572,10 @@ var AccountWebhookEventTypeSchema = z8.enum([
|
|
|
326
572
|
]).describe(
|
|
327
573
|
"Account and configuration changes \u2014 not tied to any single charge. `data` per event: `payout_address.changed`: `{ organizationId, from, to }` (`from` nullable); `api_key.created`/`api_key.revoked`: `{ apiKeyId, name, environment, hint }`; `webhook.created`/`webhook.deleted`/`webhook.secret_rotated`: `{ webhookId, url }`; `fee_tier.updated`: `{ organizationId, previousFeePercent, newFeePercent }`; `member.removed`: `{ userId, email, role }`; `member.role_changed`: `{ userId, email, role, previousRole }`; `member.invited`: `{ organizationId, email, role, invitedByUserId }`."
|
|
328
574
|
);
|
|
329
|
-
var WebhookDeliveryEventTypeSchema =
|
|
575
|
+
var WebhookDeliveryEventTypeSchema = z9.enum(["webhook.delivery_failed", "webhook.delivery_recovered", "webhook.endpoint_unhealthy"]).describe(
|
|
330
576
|
"Meta-events about the health of your own webhook endpoints \u2014 useful for monitoring without polling `GET /v1/webhooks/{id}/deliveries`. `webhook.endpoint_unhealthy` fires once when a webhook's failure rate over the trailing 24h crosses 20%, and `webhook.delivery_recovered` fires once when a delivery to that webhook next succeeds. `data` for every event in this category: `{ webhookId, url, failureRatio? }` (`failureRatio` only present on `webhook.endpoint_unhealthy`)."
|
|
331
577
|
);
|
|
332
|
-
var SecurityWebhookEventTypeSchema =
|
|
578
|
+
var SecurityWebhookEventTypeSchema = z9.enum([
|
|
333
579
|
"auth.login",
|
|
334
580
|
"auth.login_failed",
|
|
335
581
|
"auth.suspicious_activity",
|
|
@@ -339,13 +585,13 @@ var SecurityWebhookEventTypeSchema = z8.enum([
|
|
|
339
585
|
]).describe(
|
|
340
586
|
"Account security signals. `auth.suspicious_activity` is a soft heuristic (login from an IP not seen on this account before), not a block \u2014 evaluate it, not enforce against it. `auth.password_reset_requested` only ever dispatches when the requested email actually matches an account (there is nowhere to notify otherwise) \u2014 `POST /v1/auth/forgot-password` itself always returns the same generic response either way, so this event never becomes a second channel for the same enumeration question the endpoint response deliberately avoids answering. `data` per event: `auth.login`: `{ userId, ipAddress }`; `auth.login_failed`: `{ email, ipAddress }`; `auth.suspicious_activity`: `{ userId, ipAddress, previousIpAddress }`; `auth.email_verified`/`auth.password_reset_requested`/`auth.password_reset_completed`: `{ userId, email }`."
|
|
341
587
|
);
|
|
342
|
-
var WebhookEventTypeSchema =
|
|
588
|
+
var WebhookEventTypeSchema = z9.union([
|
|
343
589
|
ChargeWebhookEventTypeSchema,
|
|
344
590
|
AccountWebhookEventTypeSchema,
|
|
345
591
|
WebhookDeliveryEventTypeSchema,
|
|
346
592
|
SecurityWebhookEventTypeSchema
|
|
347
593
|
]);
|
|
348
|
-
var WebhookCategorySchema =
|
|
594
|
+
var WebhookCategorySchema = z9.enum(["payments", "account", "webhooks", "security"]).describe(
|
|
349
595
|
"Subscribe to every event in a category via `eventCategories` instead of listing events one by one \u2014 new events added to a category later arrive automatically, no subscription update needed."
|
|
350
596
|
);
|
|
351
597
|
function buildCategoryMap() {
|
|
@@ -372,99 +618,101 @@ var TriggerableChargeEventSchema = ChargeWebhookEventTypeSchema.exclude([
|
|
|
372
618
|
]).describe(
|
|
373
619
|
"Every charge event that represents a payment-progress state transition a sandbox charge can be pushed into \u2014 everything except `charge.created` (a charge already exists by the time you have an id to trigger against), `charge.paused`/`charge.reactivated` (driven by a background worker on real inactivity, not a payment state \u2014 nothing meaningful to simulate or wait for on a fresh sandbox charge), and `charge.contribution_received`/`charge.contribution_settled` (exclusive to `mode: continuous` charges, which this trigger endpoint does not support simulating today \u2014 see `POST /v1/charges/{id}/trigger`'s own description)."
|
|
374
620
|
);
|
|
375
|
-
var NonChargeTriggerableEventSchema =
|
|
621
|
+
var NonChargeTriggerableEventSchema = z9.union([
|
|
376
622
|
AccountWebhookEventTypeSchema,
|
|
377
623
|
WebhookDeliveryEventTypeSchema,
|
|
378
624
|
SecurityWebhookEventTypeSchema
|
|
379
625
|
]);
|
|
380
626
|
|
|
381
627
|
// src/webhooks.ts
|
|
382
|
-
import { z as
|
|
628
|
+
import { z as z10 } from "zod";
|
|
383
629
|
var WEBHOOK_EVENTS_WILDCARD = "*";
|
|
384
|
-
var CreateWebhookSchema =
|
|
385
|
-
url:
|
|
630
|
+
var CreateWebhookSchema = z10.object({
|
|
631
|
+
url: z10.string().max(2048).url().describe(
|
|
386
632
|
"Must be HTTPS and resolve to a public address \u2014 private/internal IPs are rejected."
|
|
387
633
|
),
|
|
388
|
-
events:
|
|
634
|
+
events: z10.array(z10.union([WebhookEventTypeSchema, z10.literal(WEBHOOK_EVENTS_WILDCARD)])).max(Object.keys(EVENT_CATEGORY_MAP).length + 1).default([]).describe(
|
|
389
635
|
'Individual event types to receive, or `"*"` for every event (combine with `excludeEvents` to opt back out of specific ones). Omit in favor of `eventCategories` if you want whole categories instead.'
|
|
390
636
|
),
|
|
391
|
-
eventCategories:
|
|
637
|
+
eventCategories: z10.array(WebhookCategorySchema).max(WebhookCategorySchema.options.length).default([]).describe(
|
|
392
638
|
"Subscribe to every event in these categories. At least one of `events` or `eventCategories` is required."
|
|
393
639
|
),
|
|
394
|
-
excludeEvents:
|
|
640
|
+
excludeEvents: z10.array(WebhookEventTypeSchema).max(Object.keys(EVENT_CATEGORY_MAP).length).default([]).describe(
|
|
395
641
|
'Event types to exclude even if selected via `events: ["*"]` or `eventCategories`.'
|
|
396
642
|
)
|
|
397
643
|
}).refine((v) => v.events.length > 0 || v.eventCategories.length > 0, {
|
|
398
644
|
message: "must select at least one event via `events` or `eventCategories`",
|
|
399
645
|
path: ["events"]
|
|
400
646
|
});
|
|
401
|
-
var WebhookSchema =
|
|
402
|
-
id:
|
|
403
|
-
url:
|
|
404
|
-
events:
|
|
405
|
-
eventCategories:
|
|
406
|
-
excludeEvents:
|
|
407
|
-
isWildcard:
|
|
408
|
-
secret:
|
|
409
|
-
"The signing secret, used to verify the `X-
|
|
647
|
+
var WebhookSchema = z10.object({
|
|
648
|
+
id: z10.string(),
|
|
649
|
+
url: z10.string(),
|
|
650
|
+
events: z10.array(WebhookEventTypeSchema),
|
|
651
|
+
eventCategories: z10.array(WebhookCategorySchema),
|
|
652
|
+
excludeEvents: z10.array(WebhookEventTypeSchema),
|
|
653
|
+
isWildcard: z10.boolean(),
|
|
654
|
+
secret: z10.string().describe(
|
|
655
|
+
"The signing secret, used to verify the `X-Klappay-Signature` header on every delivery. Returned in full only this once \u2014 store it now, it is not recoverable afterward. Header format: `t=<unix-seconds>,v1=<hex-encoded HMAC-SHA256>`. Compute the expected signature as `HMAC-SHA256(secret, \"${t}.${raw request body}\")` (hex-encoded) and compare it to `v1` using a constant-time comparison; as a replay-protection measure, also reject if `t` is too far from the current time \u2014 Klappay does not enforce or check any particular tolerance server-side, so the exact threshold is entirely the receiver's own policy call. An official SDK's `constructEvent()`/`verifySignature()` do this for you, defaulting to a 300-second tolerance, overridable via `constructEvent`'s `toleranceSeconds` option \u2014 see github.com/klappay for available SDKs."
|
|
410
656
|
),
|
|
411
|
-
createdAt:
|
|
657
|
+
createdAt: z10.string().datetime()
|
|
412
658
|
});
|
|
413
659
|
var WebhookListItemSchema = WebhookSchema.omit({ secret: true }).extend({
|
|
414
|
-
hint:
|
|
660
|
+
hint: z10.string().describe("A truncated, safe-to-display form of the secret (e.g. `whsec_...ab12`).")
|
|
415
661
|
});
|
|
416
|
-
var WebhookPayloadSchema =
|
|
417
|
-
id:
|
|
662
|
+
var WebhookPayloadSchema = z10.object({
|
|
663
|
+
id: z10.string().describe(
|
|
664
|
+
"Unique id for this specific delivery \u2014 also sent as the `X-Klappay-Delivery` header."
|
|
665
|
+
),
|
|
418
666
|
event: WebhookEventTypeSchema,
|
|
419
|
-
createdAt:
|
|
420
|
-
data:
|
|
667
|
+
createdAt: z10.string().datetime(),
|
|
668
|
+
data: z10.unknown().describe(
|
|
421
669
|
"Event-specific data. Charge events (`charge.*`) carry the full `Charge` object; account/security/webhook-delivery events carry a smaller, event-specific object \u2014 see `WebhookEventDataMap`/`TypedWebhookPayload` for the exact shape per event, or docs/webhooks.md."
|
|
422
670
|
)
|
|
423
671
|
});
|
|
424
|
-
var WebhookDeliveryStatusSchema =
|
|
425
|
-
var WebhookDeliverySchema =
|
|
426
|
-
id:
|
|
427
|
-
webhookId:
|
|
672
|
+
var WebhookDeliveryStatusSchema = z10.enum(["pending", "delivered", "failed"]);
|
|
673
|
+
var WebhookDeliverySchema = z10.object({
|
|
674
|
+
id: z10.string(),
|
|
675
|
+
webhookId: z10.string(),
|
|
428
676
|
event: WebhookEventTypeSchema,
|
|
429
677
|
status: WebhookDeliveryStatusSchema.describe(
|
|
430
678
|
"`pending`: still retrying. `delivered`: got a 2xx response. `failed`: retries exhausted (5 attempts over ~24h) \u2014 use `POST /v1/webhooks/{id}/deliveries/{deliveryId}/retry` to try again manually."
|
|
431
679
|
),
|
|
432
|
-
attempts:
|
|
433
|
-
responseCode:
|
|
680
|
+
attempts: z10.number(),
|
|
681
|
+
responseCode: z10.number().nullable().describe(
|
|
434
682
|
"HTTP status your endpoint returned on the most recent attempt. `null` if every attempt failed to connect at all."
|
|
435
683
|
),
|
|
436
|
-
nextRetryAt:
|
|
437
|
-
deliveredAt:
|
|
438
|
-
createdAt:
|
|
684
|
+
nextRetryAt: z10.string().datetime().nullable(),
|
|
685
|
+
deliveredAt: z10.string().datetime().nullable(),
|
|
686
|
+
createdAt: z10.string().datetime()
|
|
439
687
|
});
|
|
440
688
|
var ListWebhookDeliveriesSchema = PaginationQuerySchema;
|
|
441
689
|
var PaginatedWebhookDeliveriesSchema = paginatedSchema(WebhookDeliverySchema);
|
|
442
690
|
|
|
443
691
|
// src/api-keys.ts
|
|
444
|
-
import { z as
|
|
445
|
-
var CreateApiKeySchema =
|
|
446
|
-
name:
|
|
692
|
+
import { z as z11 } from "zod";
|
|
693
|
+
var CreateApiKeySchema = z11.object({
|
|
694
|
+
name: z11.string().min(1).max(64).describe(
|
|
447
695
|
'A label to help you tell keys apart (e.g. `"production backend"`). Not used for anything functional.'
|
|
448
696
|
),
|
|
449
697
|
environment: EnvironmentSchema.describe(
|
|
450
698
|
"`live` keys move real funds on Base mainnet; `test` keys settle on Base Sepolia (a real testnet, no real money) and additionally unlock `POST /v1/sandbox/*` for simulating events with zero on-chain activity at all."
|
|
451
699
|
)
|
|
452
700
|
});
|
|
453
|
-
var ApiKeySchema =
|
|
454
|
-
id:
|
|
455
|
-
name:
|
|
701
|
+
var ApiKeySchema = z11.object({
|
|
702
|
+
id: z11.string(),
|
|
703
|
+
name: z11.string(),
|
|
456
704
|
environment: EnvironmentSchema.describe(
|
|
457
705
|
"`live` keys authenticate real charges on Base mainnet; `test` keys authenticate the same charge lifecycle on Base Sepolia (a real testnet) and additionally unlock `/v1/sandbox/*` for synthetic event simulation."
|
|
458
706
|
),
|
|
459
|
-
key:
|
|
707
|
+
key: z11.string().optional().describe(
|
|
460
708
|
"The full secret key (`klap_live_...` / `klap_test_...`), used as the `Authorization: Bearer` value on `/v1/charges`, `/v1/webhooks`, and `/v1/sandbox` requests. Present only in the response to `POST /v1/api-keys` \u2014 never returned again afterward, so store it immediately."
|
|
461
709
|
),
|
|
462
|
-
hint:
|
|
710
|
+
hint: z11.string().describe(
|
|
463
711
|
"A truncated, always-safe-to-display form of the key (e.g. `klap_live_...ab12`), returned everywhere the full key isn't."
|
|
464
712
|
),
|
|
465
|
-
createdAt:
|
|
466
|
-
lastUsedAt:
|
|
467
|
-
createdByUserId:
|
|
713
|
+
createdAt: z11.string().datetime(),
|
|
714
|
+
lastUsedAt: z11.string().datetime().nullable().describe("Updated on every successful authenticated request. `null` if never used."),
|
|
715
|
+
createdByUserId: z11.string().nullable().describe(
|
|
468
716
|
"Which member of the organization created this key. `null` for a key created before this field existed."
|
|
469
717
|
)
|
|
470
718
|
});
|
|
@@ -472,76 +720,78 @@ var ListApiKeysSchema = PaginationQuerySchema;
|
|
|
472
720
|
var PaginatedApiKeysSchema = paginatedSchema(ApiKeySchema);
|
|
473
721
|
|
|
474
722
|
// src/users.ts
|
|
475
|
-
import { z as
|
|
476
|
-
var UserRoleSchema =
|
|
723
|
+
import { z as z12 } from "zod";
|
|
724
|
+
var UserRoleSchema = z12.enum(["owner", "admin", "member"]).describe(
|
|
477
725
|
"`owner`: full access, and the organization must always keep at least one. `admin`: can manage `member`s but not other `admin`s. `member`: no management permissions. You can only manage a member with a strictly lower role than your own, unless you're an `owner`."
|
|
478
726
|
);
|
|
479
|
-
var UpdateUserRoleSchema =
|
|
727
|
+
var UpdateUserRoleSchema = z12.object({
|
|
480
728
|
role: UserRoleSchema
|
|
481
729
|
});
|
|
482
|
-
var UserSchema =
|
|
483
|
-
id:
|
|
484
|
-
email:
|
|
485
|
-
name:
|
|
730
|
+
var UserSchema = z12.object({
|
|
731
|
+
id: z12.string(),
|
|
732
|
+
email: z12.string(),
|
|
733
|
+
name: z12.string().nullable(),
|
|
486
734
|
role: UserRoleSchema.describe("Your role within the organization this user was fetched from."),
|
|
487
|
-
emailVerifiedAt:
|
|
735
|
+
emailVerifiedAt: z12.string().datetime().nullable().describe(
|
|
488
736
|
"When this address was confirmed via the emailed verification link. `null` until then. Required (non-null) for two specific actions: creating a `live` API key (`POST /v1/api-keys`) and changing `Organization.payoutAddress` (`PATCH /v1/organization`) \u2014 everything else works regardless of verification status."
|
|
489
737
|
),
|
|
490
|
-
createdAt:
|
|
738
|
+
createdAt: z12.string().datetime()
|
|
491
739
|
});
|
|
492
740
|
var ListUsersSchema = PaginationQuerySchema;
|
|
493
741
|
var PaginatedUsersSchema = paginatedSchema(UserSchema);
|
|
494
742
|
|
|
495
743
|
// src/auth.ts
|
|
496
|
-
import { z as
|
|
497
|
-
var NormalizedEmailSchema =
|
|
744
|
+
import { z as z13 } from "zod";
|
|
745
|
+
var NormalizedEmailSchema = z13.string().trim().max(255).toLowerCase().email().transform((email) => email.normalize("NFC")).describe(
|
|
498
746
|
"Trimmed, lowercased, and NFC-normalized server-side before use \u2014 case/whitespace don't matter."
|
|
499
747
|
);
|
|
500
|
-
var SignupSchema =
|
|
748
|
+
var SignupSchema = z13.object({
|
|
501
749
|
email: NormalizedEmailSchema,
|
|
502
|
-
password:
|
|
750
|
+
password: z13.string().min(8).max(128).describe("8-128 characters. No other complexity rule.")
|
|
503
751
|
});
|
|
504
|
-
var LoginSchema =
|
|
752
|
+
var LoginSchema = z13.object({
|
|
505
753
|
email: NormalizedEmailSchema,
|
|
506
|
-
password:
|
|
754
|
+
password: z13.string().min(1).max(128)
|
|
507
755
|
});
|
|
508
|
-
var VerifyEmailSchema =
|
|
509
|
-
token:
|
|
756
|
+
var VerifyEmailSchema = z13.object({
|
|
757
|
+
token: z13.string().min(1).describe("The token from the verification email \u2014 passed as-is, not the account email.")
|
|
510
758
|
});
|
|
511
|
-
var ForgotPasswordSchema =
|
|
759
|
+
var ForgotPasswordSchema = z13.object({
|
|
512
760
|
email: NormalizedEmailSchema
|
|
513
761
|
});
|
|
514
|
-
var ResetPasswordSchema =
|
|
515
|
-
token:
|
|
516
|
-
newPassword:
|
|
762
|
+
var ResetPasswordSchema = z13.object({
|
|
763
|
+
token: z13.string().min(1).describe("The token from the password reset email."),
|
|
764
|
+
newPassword: z13.string().min(8).max(128)
|
|
517
765
|
});
|
|
518
|
-
var MessageResponseSchema =
|
|
519
|
-
message:
|
|
766
|
+
var MessageResponseSchema = z13.object({
|
|
767
|
+
message: z13.string().describe("Human-readable confirmation, safe to show a user directly.")
|
|
520
768
|
});
|
|
521
|
-
var AuthResponseSchema =
|
|
522
|
-
token:
|
|
769
|
+
var AuthResponseSchema = z13.object({
|
|
770
|
+
token: z13.string().describe(
|
|
523
771
|
"Session JWT, valid 7 days \u2014 use as `Authorization: Bearer <token>` on every `/v1/organizations/*` request (which nests API keys, members, and invitations \u2014 see `GET /v1/organizations`). This token identifies only you; it carries no organization or role \u2014 every `/v1/organizations/{id}/*` request is authorized fresh against your actual membership in that specific organization. This is a separate credential from an API key: it authenticates a human/dashboard session, not payment operations. Create an API key with it before you can create charges."
|
|
524
772
|
),
|
|
525
773
|
user: UserSchema.omit({ createdAt: true, role: true })
|
|
526
774
|
});
|
|
527
775
|
|
|
528
776
|
// src/organization.ts
|
|
529
|
-
import { z as
|
|
530
|
-
var UpdateOrganizationSchema =
|
|
531
|
-
name:
|
|
532
|
-
payoutAddress:
|
|
777
|
+
import { z as z14 } from "zod";
|
|
778
|
+
var UpdateOrganizationSchema = z14.object({
|
|
779
|
+
name: z14.string().min(1).max(255).optional().describe("The organization's display name."),
|
|
780
|
+
payoutAddress: z14.string().regex(/^0x[a-fA-F0-9]{40}$/, "must be a valid EVM address").optional().describe(
|
|
533
781
|
"The wallet that receives the merchant's share of every future charge. Changing this only affects charges created after the change \u2014 an already-created charge's payout split is frozen from creation and is never retroactively affected. Required before you can create any charge. Any casing is accepted \u2014 EIP-55 checksum casing is not required or verified."
|
|
534
782
|
)
|
|
535
783
|
});
|
|
536
|
-
var OrganizationSchema =
|
|
537
|
-
id:
|
|
538
|
-
name:
|
|
539
|
-
payoutAddress:
|
|
540
|
-
currentFeePercent:
|
|
541
|
-
"Your current platform fee percentage, based on trailing monthly volume
|
|
784
|
+
var OrganizationSchema = z14.object({
|
|
785
|
+
id: z14.string(),
|
|
786
|
+
name: z14.string(),
|
|
787
|
+
payoutAddress: z14.string().nullable().describe("`null` until configured \u2014 `POST /v1/charges` fails until this is set."),
|
|
788
|
+
currentFeePercent: z14.number().describe(
|
|
789
|
+
"Your current platform fee percentage \u2014 `1.5` means 1.5%, not a 0\u20131 fraction. Funds the infrastructure Klappay runs on your behalf (on-chain monitoring, settlement, webhook delivery, support) the same way any payment processor's fee does; this is not optional or removable. Dynamic, not fixed: it's based on your trailing monthly volume, with lower volume paying a higher percentage \u2014 higher-volume organizations, or ones with a specific negotiated arrangement, can be assigned a different rate at Klappay's discretion. Frozen onto each charge at creation, so a rate change never retroactively affects a charge already created; see `feeUpdatedAt` for when it last changed. Contact Klappay if you'd like your rate reviewed."
|
|
542
790
|
),
|
|
543
|
-
feeUpdatedAt:
|
|
544
|
-
|
|
791
|
+
feeUpdatedAt: z14.string().datetime().nullable().describe(
|
|
792
|
+
"When `currentFeePercent` last changed. `null` if it has never changed since this organization signed up."
|
|
793
|
+
),
|
|
794
|
+
createdAt: z14.string().datetime()
|
|
545
795
|
});
|
|
546
796
|
var OrganizationWithRoleSchema = OrganizationSchema.extend({
|
|
547
797
|
role: UserRoleSchema.describe("Your own role within this specific organization.")
|
|
@@ -550,35 +800,35 @@ var PaginatedOrganizationsSchema = paginatedSchema(OrganizationWithRoleSchema);
|
|
|
550
800
|
var ListOrganizationsSchema = PaginationQuerySchema;
|
|
551
801
|
|
|
552
802
|
// src/invitations.ts
|
|
553
|
-
import { z as
|
|
554
|
-
var InviteUserSchema =
|
|
803
|
+
import { z as z15 } from "zod";
|
|
804
|
+
var InviteUserSchema = z15.object({
|
|
555
805
|
email: NormalizedEmailSchema,
|
|
556
806
|
role: UserRoleSchema.default("member").describe(
|
|
557
807
|
"The role the invitee will hold once they accept \u2014 subject to the same management-hierarchy rule as `PATCH /v1/organizations/{id}/users/{userId}`: an `admin` inviter cannot invite an `admin` or `owner`."
|
|
558
808
|
)
|
|
559
809
|
});
|
|
560
|
-
var AcceptInvitationSchema =
|
|
561
|
-
token:
|
|
562
|
-
password:
|
|
563
|
-
"Required only if the invited email has no existing
|
|
810
|
+
var AcceptInvitationSchema = z15.object({
|
|
811
|
+
token: z15.string().min(1).describe("The token from the invitation email."),
|
|
812
|
+
password: z15.string().min(8).max(128).optional().describe(
|
|
813
|
+
"Required only if the invited email has no existing Klappay account \u2014 a new account is created along with the membership. Ignored if the account already exists."
|
|
564
814
|
)
|
|
565
815
|
});
|
|
566
|
-
var InvitationSchema =
|
|
567
|
-
id:
|
|
568
|
-
organizationId:
|
|
569
|
-
email:
|
|
816
|
+
var InvitationSchema = z15.object({
|
|
817
|
+
id: z15.string(),
|
|
818
|
+
organizationId: z15.string(),
|
|
819
|
+
email: z15.string(),
|
|
570
820
|
role: UserRoleSchema,
|
|
571
|
-
invitedByUserId:
|
|
572
|
-
expiresAt:
|
|
573
|
-
createdAt:
|
|
821
|
+
invitedByUserId: z15.string().describe("Which member of the organization sent this invitation."),
|
|
822
|
+
expiresAt: z15.string().datetime(),
|
|
823
|
+
createdAt: z15.string().datetime()
|
|
574
824
|
});
|
|
575
825
|
|
|
576
826
|
// src/timeline.ts
|
|
577
|
-
import { z as
|
|
578
|
-
var TransactionSourceSchema =
|
|
827
|
+
import { z as z16 } from "zod";
|
|
828
|
+
var TransactionSourceSchema = z16.enum(["moralis_webhook", "reconciliation_job", "sandbox"]).describe(
|
|
579
829
|
"How this transfer was detected: `moralis_webhook` (the normal path), `reconciliation_job` (a fallback poller caught it after the webhook was missed or delayed), or `sandbox` (simulated via `POST /v1/sandbox/charges/{id}/trigger`, no real on-chain transfer)."
|
|
580
830
|
);
|
|
581
|
-
var TimelineEventTypeSchema =
|
|
831
|
+
var TimelineEventTypeSchema = z16.enum([
|
|
582
832
|
"charge.created",
|
|
583
833
|
"charge.expired",
|
|
584
834
|
"transaction.detected",
|
|
@@ -589,11 +839,11 @@ var TimelineEventTypeSchema = z15.enum([
|
|
|
589
839
|
]).describe(
|
|
590
840
|
"`charge.created`: the charge was created. `charge.expired`: `expiresAt` passed with no full payment. `transaction.detected`: a raw on-chain transfer was seen (see the `event`-shaped fields below for details \u2014 a charge can have more than one, e.g. a partial payment followed by the rest). `split.distributed`: a payout to the merchant completed on-chain, for one contributing `(token, network)` pair \u2014 a charge settled across more than one pair emits one of these per pair (see the `token`/`network` fields below). `webhook.dispatched`/`webhook.delivered`/`webhook.failed`: one specific delivery *attempt* for one webhook subscription \u2014 `failed` here means this single attempt failed, not that all retries were exhausted (see `WebhookDeliveryStatusSchema` for the exhausted-all-retries state)."
|
|
591
841
|
);
|
|
592
|
-
var TimelineEventSchema =
|
|
842
|
+
var TimelineEventSchema = z16.object({
|
|
593
843
|
type: TimelineEventTypeSchema,
|
|
594
|
-
at:
|
|
595
|
-
txHash:
|
|
596
|
-
amount:
|
|
844
|
+
at: z16.string().datetime(),
|
|
845
|
+
txHash: z16.string().optional().describe("Present for `transaction.detected` and `split.distributed` events only."),
|
|
846
|
+
amount: z16.number().optional().describe(
|
|
597
847
|
"Present for `transaction.detected` events only \u2014 the amount that specific transfer carried."
|
|
598
848
|
),
|
|
599
849
|
source: TransactionSourceSchema.optional().describe(
|
|
@@ -605,100 +855,100 @@ var TimelineEventSchema = z15.object({
|
|
|
605
855
|
network: NetworkSchema.optional().describe(
|
|
606
856
|
"Present for `transaction.detected` and `split.distributed` events \u2014 which network this specific transfer, or settlement, used."
|
|
607
857
|
),
|
|
608
|
-
causedTransition:
|
|
858
|
+
causedTransition: z16.boolean().optional().describe(
|
|
609
859
|
"Present for `transaction.detected` events only. `true` if this specific transfer changed the charge's status (e.g. PENDING\u2192CONFIRMED) \u2014 a charge paid in installments can have more than one such event."
|
|
610
860
|
),
|
|
611
861
|
event: WebhookEventTypeSchema.optional().describe(
|
|
612
862
|
"Present for `webhook.*` events only \u2014 which event type this delivery was for."
|
|
613
863
|
),
|
|
614
|
-
responseCode:
|
|
864
|
+
responseCode: z16.number().nullable().optional().describe(
|
|
615
865
|
"Present for `webhook.*` events only \u2014 HTTP status your endpoint returned, or `null` if the request never connected."
|
|
616
866
|
),
|
|
617
|
-
attempts:
|
|
867
|
+
attempts: z16.number().optional().describe(
|
|
618
868
|
"Present for `webhook.*` events only \u2014 how many delivery attempts have been made so far."
|
|
619
869
|
)
|
|
620
870
|
});
|
|
621
871
|
|
|
622
872
|
// src/verify.ts
|
|
623
|
-
import { z as
|
|
624
|
-
var SplitRecipientRoleSchema =
|
|
625
|
-
"`merchant`: the payout recipient. `klap_fee`: the platform fee. `distributor_incentive`: the (usually small) reward paid to whoever triggered the on-chain settlement \u2014 may be
|
|
873
|
+
import { z as z17 } from "zod";
|
|
874
|
+
var SplitRecipientRoleSchema = z17.enum(["merchant", "klap_fee", "distributor_incentive"]).describe(
|
|
875
|
+
"`merchant`: the payout recipient. `klap_fee`: the platform fee. `distributor_incentive`: the (usually small) reward paid to whoever triggered the on-chain settlement \u2014 may be Klappay or a third party, see `address`."
|
|
626
876
|
);
|
|
627
|
-
var VerifySplitEntrySchema =
|
|
877
|
+
var VerifySplitEntrySchema = z17.object({
|
|
628
878
|
role: SplitRecipientRoleSchema,
|
|
629
|
-
address:
|
|
879
|
+
address: z17.string().nullable().describe(
|
|
630
880
|
"On-chain recipient address for this share. For `distributor_incentive`, this is `null` until settlement actually happens \u2014 there is no fixed address, it goes to whoever calls the settlement transaction."
|
|
631
881
|
),
|
|
632
|
-
percentAllocation:
|
|
633
|
-
amountUSD:
|
|
882
|
+
percentAllocation: z17.number().describe("This entry's share of `amountReceived`, as a percentage (e.g. `99` = 99%)."),
|
|
883
|
+
amountUSD: z17.number()
|
|
634
884
|
});
|
|
635
|
-
var VerifyPaymentSchema =
|
|
885
|
+
var VerifyPaymentSchema = z17.object({
|
|
636
886
|
token: TokenSchema,
|
|
637
887
|
network: NetworkSchema,
|
|
638
|
-
amountReceived:
|
|
639
|
-
txHash:
|
|
640
|
-
explorerTxUrl:
|
|
641
|
-
split:
|
|
642
|
-
"The exact breakdown of where this pair's payment went \u2014 merchant's share,
|
|
888
|
+
amountReceived: z17.number().describe("Cumulative amount received on this specific `(token, network)` pair."),
|
|
889
|
+
txHash: z17.string().describe("The on-chain transaction hash of the most recent transfer on this pair."),
|
|
890
|
+
explorerTxUrl: z17.string().describe("Direct link to `txHash` on the relevant block explorer."),
|
|
891
|
+
split: z17.array(VerifySplitEntrySchema).describe(
|
|
892
|
+
"The exact breakdown of where this pair's payment went \u2014 merchant's share, Klappay's fee, and (once settled) the settlement incentive."
|
|
643
893
|
),
|
|
644
|
-
splitTxHash:
|
|
894
|
+
splitTxHash: z17.string().nullable().describe(
|
|
645
895
|
"Transaction hash of the payout to the merchant for this pair, once settlement has happened. `null` until then."
|
|
646
896
|
),
|
|
647
|
-
settledAt:
|
|
897
|
+
settledAt: z17.string().datetime().nullable().describe(
|
|
648
898
|
"When settlement completed for this pair \u2014 the merchant's wallet actually has the funds. `null` until then."
|
|
649
899
|
)
|
|
650
900
|
});
|
|
651
|
-
var VerifyChargeSchema =
|
|
652
|
-
id:
|
|
653
|
-
amount:
|
|
654
|
-
amountReceived:
|
|
901
|
+
var VerifyChargeSchema = z17.object({
|
|
902
|
+
id: z17.string(),
|
|
903
|
+
amount: z17.number().nullable().describe("The amount originally requested. `null` if the charge accepted any amount."),
|
|
904
|
+
amountReceived: z17.number().describe(
|
|
655
905
|
"The actual cumulative amount received across every contributing pair \u2014 can exceed `amount` on an overpayment."
|
|
656
906
|
),
|
|
657
|
-
confirmedAt:
|
|
907
|
+
confirmedAt: z17.string().datetime().nullable().describe(
|
|
658
908
|
"When the charge reached `confirmed`. `null` for a `mode: continuous` charge \u2014 it never reaches a single confirmed moment (`status` stays `pending` for its whole life, see `Charge.mode`); use each entry in `payments[].settledAt` for per-contribution timing instead."
|
|
659
909
|
),
|
|
660
|
-
splitAddress:
|
|
910
|
+
splitAddress: z17.string().describe(
|
|
661
911
|
"The on-chain address the payment was sent to \u2014 identical across every accepted network."
|
|
662
912
|
),
|
|
663
|
-
payments:
|
|
913
|
+
payments: z17.array(VerifyPaymentSchema).describe(
|
|
664
914
|
"One entry per `(token, network)` pair that actually contributed funds \u2014 a charge accepting several pairs can be confirmed by a combination of them, each proven and settled independently."
|
|
665
915
|
)
|
|
666
916
|
});
|
|
667
917
|
|
|
668
918
|
// src/health.ts
|
|
669
|
-
import { z as
|
|
670
|
-
var HealthSchema =
|
|
671
|
-
status:
|
|
919
|
+
import { z as z18 } from "zod";
|
|
920
|
+
var HealthSchema = z18.object({
|
|
921
|
+
status: z18.enum(["ok", "error"]).describe(
|
|
672
922
|
"`error` when the database connectivity check fails \u2014 the HTTP status code mirrors this (503 instead of 200), so a plain uptime check (not just a JSON-aware one) still catches a DB outage."
|
|
673
923
|
),
|
|
674
|
-
version:
|
|
675
|
-
timestamp:
|
|
676
|
-
db:
|
|
677
|
-
pendingWebhooks:
|
|
678
|
-
oldestPendingChargeAgeSeconds:
|
|
679
|
-
lastMoralisEventAgeSeconds:
|
|
924
|
+
version: z18.string(),
|
|
925
|
+
timestamp: z18.string().datetime(),
|
|
926
|
+
db: z18.enum(["ok", "error"]).describe("Result of a real database connectivity check, not just a process-alive check."),
|
|
927
|
+
pendingWebhooks: z18.number().describe("Count of webhook deliveries still awaiting a successful attempt."),
|
|
928
|
+
oldestPendingChargeAgeSeconds: z18.number().nullable().describe("Age of the oldest still-unpaid charge, in seconds. `null` if there are none."),
|
|
929
|
+
lastMoralisEventAgeSeconds: z18.number().nullable().describe(
|
|
680
930
|
"Seconds since the last on-chain payment notification was received \u2014 a cheap signal for whether payment detection is currently working. `null` if none have ever been received."
|
|
681
931
|
)
|
|
682
932
|
});
|
|
683
933
|
|
|
684
934
|
// src/sandbox.ts
|
|
685
|
-
import { z as
|
|
686
|
-
var SandboxTriggerSchema =
|
|
935
|
+
import { z as z19 } from "zod";
|
|
936
|
+
var SandboxTriggerSchema = z19.object({
|
|
687
937
|
event: TriggerableChargeEventSchema,
|
|
688
|
-
amount:
|
|
938
|
+
amount: z19.number().positive().max(CHARGE_AMOUNT_MAX).optional().describe(
|
|
689
939
|
"Used with `charge.partially_paid` (amount to simulate as received so far \u2014 must be less than the charge amount, defaults to half of it if omitted) and with `charge.overpaid` (amount received \u2014 must be greater than the charge amount, defaults to 1.5x it if omitted). Ignored for every other event."
|
|
690
940
|
)
|
|
691
941
|
});
|
|
692
|
-
var SandboxEventTriggerSchema =
|
|
942
|
+
var SandboxEventTriggerSchema = z19.object({
|
|
693
943
|
event: NonChargeTriggerableEventSchema.describe(
|
|
694
944
|
"Any account, security, or webhook-delivery event \u2014 simulates it with synthetic data against your own webhooks, no real state change or precondition required (unlike `POST /v1/sandbox/charges/{id}/trigger`, which acts on a real charge)."
|
|
695
945
|
)
|
|
696
946
|
});
|
|
697
947
|
|
|
698
948
|
// src/capabilities.ts
|
|
699
|
-
import { z as
|
|
700
|
-
var CapabilitiesSchema =
|
|
701
|
-
acceptedPayments:
|
|
949
|
+
import { z as z20 } from "zod";
|
|
950
|
+
var CapabilitiesSchema = z20.object({
|
|
951
|
+
acceptedPayments: z20.array(AcceptedPaymentSchema).describe(
|
|
702
952
|
"Every `(token, network)` pair actually configured for your environment right now \u2014 read straight from the same lookup `POST /v1/charges` validates `acceptedPayments` against, so it can never list a pair that charge creation would then reject. Use this to build a picker UI instead of hardcoding the matrix client-side."
|
|
703
953
|
)
|
|
704
954
|
});
|
|
@@ -718,9 +968,15 @@ export {
|
|
|
718
968
|
ChargeStatusEventSchema,
|
|
719
969
|
ChargeStatusSchema,
|
|
720
970
|
ChargeWebhookEventTypeSchema,
|
|
971
|
+
ChargesDateFieldSchema,
|
|
972
|
+
ChargesMetricFieldSchema,
|
|
973
|
+
ChargesQueryFieldSchema,
|
|
721
974
|
CreateApiKeySchema,
|
|
722
975
|
CreateChargeSchema,
|
|
723
976
|
CreateWebhookSchema,
|
|
977
|
+
DistributionsDateFieldSchema,
|
|
978
|
+
DistributionsMetricFieldSchema,
|
|
979
|
+
DistributionsQueryFieldSchema,
|
|
724
980
|
EVENT_CATEGORY_MAP,
|
|
725
981
|
EVM_NETWORKS,
|
|
726
982
|
EnvironmentSchema,
|
|
@@ -735,7 +991,21 @@ export {
|
|
|
735
991
|
ListUsersSchema,
|
|
736
992
|
ListWebhookDeliveriesSchema,
|
|
737
993
|
LoginSchema,
|
|
994
|
+
MAX_METRICS_QUERY_DATE_RANGE_DAYS,
|
|
995
|
+
METRICS_QUERY_DEFAULT_ROW_LIMIT,
|
|
996
|
+
METRICS_QUERY_MAX_FILTERS,
|
|
997
|
+
METRICS_QUERY_MAX_GROUP_BY,
|
|
998
|
+
METRICS_QUERY_MAX_METRICS,
|
|
999
|
+
METRICS_QUERY_MAX_ROW_LIMIT,
|
|
738
1000
|
MessageResponseSchema,
|
|
1001
|
+
MetricsAggregationSchema,
|
|
1002
|
+
MetricsDateGranularitySchema,
|
|
1003
|
+
MetricsFilterOperatorSchema,
|
|
1004
|
+
MetricsQueryResultRowSchema,
|
|
1005
|
+
MetricsQueryResultSchema,
|
|
1006
|
+
MetricsQuerySchema,
|
|
1007
|
+
MetricsQueryScopeSchema,
|
|
1008
|
+
MetricsResourceSchema,
|
|
739
1009
|
NETWORK_EXPLORERS,
|
|
740
1010
|
NETWORK_LABELS,
|
|
741
1011
|
NetworkSchema,
|
|
@@ -762,6 +1032,7 @@ export {
|
|
|
762
1032
|
SecurityWebhookEventTypeSchema,
|
|
763
1033
|
SettlementStatusSchema,
|
|
764
1034
|
SignupSchema,
|
|
1035
|
+
SplitDistributionStatusSchema,
|
|
765
1036
|
SplitRecipientRoleSchema,
|
|
766
1037
|
TOKEN_ADDRESSES,
|
|
767
1038
|
TOKEN_DECIMALS,
|
|
@@ -769,6 +1040,9 @@ export {
|
|
|
769
1040
|
TimelineEventTypeSchema,
|
|
770
1041
|
TokenSchema,
|
|
771
1042
|
TransactionSourceSchema,
|
|
1043
|
+
TransactionsDateFieldSchema,
|
|
1044
|
+
TransactionsMetricFieldSchema,
|
|
1045
|
+
TransactionsQueryFieldSchema,
|
|
772
1046
|
TriggerableChargeEventSchema,
|
|
773
1047
|
UpdateOrganizationSchema,
|
|
774
1048
|
UpdateUserRoleSchema,
|