@klappay/types 2.0.4 → 3.0.1
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.d.mts +179 -10
- package/dist/index.d.ts +179 -10
- package/dist/index.js +382 -223
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +370 -223
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -1
package/dist/index.d.mts
CHANGED
|
@@ -32,9 +32,11 @@ type ErrorPayload = z.infer<typeof ErrorPayloadSchema>;
|
|
|
32
32
|
declare const EnvironmentSchema: z.ZodEnum<["live", "test"]>;
|
|
33
33
|
type Environment = z.infer<typeof EnvironmentSchema>;
|
|
34
34
|
|
|
35
|
-
declare const ApiKeyScopeSchema: z.ZodEnum<["charges:read", "charges:write", "webhooks:read", "webhooks:write", "webhooks:manage_secret", "metrics:read", "metrics:charges:read", "metrics:transactions:read", "metrics:distributions:read", "sandbox:trigger"]>;
|
|
35
|
+
declare const ApiKeyScopeSchema: z.ZodEnum<["charges:read", "charges:write", "webhooks:read", "webhooks:write", "webhooks:manage_secret", "metrics:read", "metrics:charges:read", "metrics:transactions:read", "metrics:distributions:read", "sandbox:trigger", "charges:split_write", "recipients:read", "recipients:write", "recipients:manage_payout"]>;
|
|
36
36
|
type ApiKeyScope = z.infer<typeof ApiKeyScopeSchema>;
|
|
37
|
-
declare const API_KEY_SCOPES: ["charges:read", "charges:write", "webhooks:read", "webhooks:write", "webhooks:manage_secret", "metrics:read", "metrics:charges:read", "metrics:transactions:read", "metrics:distributions:read", "sandbox:trigger"];
|
|
37
|
+
declare const API_KEY_SCOPES: ["charges:read", "charges:write", "webhooks:read", "webhooks:write", "webhooks:manage_secret", "metrics:read", "metrics:charges:read", "metrics:transactions:read", "metrics:distributions:read", "sandbox:trigger", "charges:split_write", "recipients:read", "recipients:write", "recipients:manage_payout"];
|
|
38
|
+
declare const CONFLICTING_SCOPE_PAIRS: ReadonlyArray<readonly [ApiKeyScope, ApiKeyScope]>;
|
|
39
|
+
declare function findConflictingScopes(scopes: readonly ApiKeyScope[]): readonly [ApiKeyScope, ApiKeyScope] | null;
|
|
38
40
|
|
|
39
41
|
declare const NetworkSchema: z.ZodEnum<["base", "optimism", "polygon", "ethereum", "arbitrum", "avalanche", "bnb"]>;
|
|
40
42
|
type Network = z.infer<typeof NetworkSchema>;
|
|
@@ -79,6 +81,12 @@ type Token = z.infer<typeof TokenSchema>;
|
|
|
79
81
|
declare const TOKEN_DECIMALS = 6;
|
|
80
82
|
declare const TOKEN_ADDRESSES: Record<Token, Partial<Record<Network, Partial<Record<Environment, `0x${string}`>>>>>;
|
|
81
83
|
|
|
84
|
+
declare const AltTokenSchema: z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>;
|
|
85
|
+
type AltToken = z.infer<typeof AltTokenSchema>;
|
|
86
|
+
declare const ALT_TOKEN_DECIMALS: Record<AltToken, number>;
|
|
87
|
+
declare const ALT_TOKEN_ADDRESSES: Record<Network, Partial<Record<AltToken, 'native' | `0x${string}`>>>;
|
|
88
|
+
declare function listAltTokensForNetworks(networks: readonly Network[]): AltToken[];
|
|
89
|
+
|
|
82
90
|
declare const ChargeStatusSchema: z.ZodEnum<["pending", "partially_paid", "confirmed", "expired", "underpaid"]>;
|
|
83
91
|
type ChargeStatus = z.infer<typeof ChargeStatusSchema>;
|
|
84
92
|
declare const SettlementStatusSchema: z.ZodEnum<["pending", "completed", "failed"]>;
|
|
@@ -112,6 +120,20 @@ declare const SplitRecipientSchema: z.ZodObject<{
|
|
|
112
120
|
label?: string | undefined;
|
|
113
121
|
}>;
|
|
114
122
|
type SplitRecipient = z.infer<typeof SplitRecipientSchema>;
|
|
123
|
+
declare const SplitRecipientInputSchema: z.ZodObject<{
|
|
124
|
+
recipientId: z.ZodString;
|
|
125
|
+
percent: z.ZodNumber;
|
|
126
|
+
label: z.ZodOptional<z.ZodString>;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
percent: number;
|
|
129
|
+
recipientId: string;
|
|
130
|
+
label?: string | undefined;
|
|
131
|
+
}, {
|
|
132
|
+
percent: number;
|
|
133
|
+
recipientId: string;
|
|
134
|
+
label?: string | undefined;
|
|
135
|
+
}>;
|
|
136
|
+
type SplitRecipientInput = z.infer<typeof SplitRecipientInputSchema>;
|
|
115
137
|
declare const CHARGE_AMOUNT_MAX = 999999999999;
|
|
116
138
|
declare const CreateChargeSchema: z.ZodObject<{
|
|
117
139
|
amount: z.ZodNumber;
|
|
@@ -223,24 +245,24 @@ declare const CreateChargeSchema: z.ZodObject<{
|
|
|
223
245
|
}, z.ZodUnknown, "strip">>>;
|
|
224
246
|
redirectUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
225
247
|
splitRecipients: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
226
|
-
|
|
248
|
+
recipientId: z.ZodString;
|
|
227
249
|
percent: z.ZodNumber;
|
|
228
250
|
label: z.ZodOptional<z.ZodString>;
|
|
229
251
|
}, "strip", z.ZodTypeAny, {
|
|
230
|
-
address: string;
|
|
231
252
|
percent: number;
|
|
253
|
+
recipientId: string;
|
|
232
254
|
label?: string | undefined;
|
|
233
255
|
}, {
|
|
234
|
-
address: string;
|
|
235
256
|
percent: number;
|
|
257
|
+
recipientId: string;
|
|
236
258
|
label?: string | undefined;
|
|
237
259
|
}>, "many">, {
|
|
238
|
-
address: string;
|
|
239
260
|
percent: number;
|
|
261
|
+
recipientId: string;
|
|
240
262
|
label?: string | undefined;
|
|
241
263
|
}[], {
|
|
242
|
-
address: string;
|
|
243
264
|
percent: number;
|
|
265
|
+
recipientId: string;
|
|
244
266
|
label?: string | undefined;
|
|
245
267
|
}[]>>;
|
|
246
268
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -285,8 +307,8 @@ declare const CreateChargeSchema: z.ZodObject<{
|
|
|
285
307
|
}, z.ZodUnknown, "strip"> | undefined;
|
|
286
308
|
redirectUrl?: string | undefined;
|
|
287
309
|
splitRecipients?: {
|
|
288
|
-
address: string;
|
|
289
310
|
percent: number;
|
|
311
|
+
recipientId: string;
|
|
290
312
|
label?: string | undefined;
|
|
291
313
|
}[] | undefined;
|
|
292
314
|
}, {
|
|
@@ -331,8 +353,8 @@ declare const CreateChargeSchema: z.ZodObject<{
|
|
|
331
353
|
}, z.ZodUnknown, "strip"> | undefined;
|
|
332
354
|
redirectUrl?: string | undefined;
|
|
333
355
|
splitRecipients?: {
|
|
334
|
-
address: string;
|
|
335
356
|
percent: number;
|
|
357
|
+
recipientId: string;
|
|
336
358
|
label?: string | undefined;
|
|
337
359
|
}[] | undefined;
|
|
338
360
|
}>;
|
|
@@ -364,6 +386,7 @@ declare const ChargeSchema: z.ZodObject<{
|
|
|
364
386
|
token: "USDC" | "USDT";
|
|
365
387
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
366
388
|
}>, "many">;
|
|
389
|
+
swapAlternatives: z.ZodArray<z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>, "many">;
|
|
367
390
|
address: z.ZodString;
|
|
368
391
|
status: z.ZodEnum<["pending", "partially_paid", "confirmed", "expired", "underpaid"]>;
|
|
369
392
|
settlementStatus: z.ZodNullable<z.ZodEnum<["pending", "completed", "failed"]>>;
|
|
@@ -530,6 +553,7 @@ declare const ChargeSchema: z.ZodObject<{
|
|
|
530
553
|
token: "USDC" | "USDT";
|
|
531
554
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
532
555
|
}[];
|
|
556
|
+
swapAlternatives: ("ETH" | "BNB" | "MATIC" | "AVAX" | "BTC")[];
|
|
533
557
|
settlementStatus: "pending" | "completed" | "failed" | null;
|
|
534
558
|
environment: "live" | "test";
|
|
535
559
|
apiKeyId: string | null;
|
|
@@ -593,6 +617,7 @@ declare const ChargeSchema: z.ZodObject<{
|
|
|
593
617
|
token: "USDC" | "USDT";
|
|
594
618
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
595
619
|
}[];
|
|
620
|
+
swapAlternatives: ("ETH" | "BNB" | "MATIC" | "AVAX" | "BTC")[];
|
|
596
621
|
settlementStatus: "pending" | "completed" | "failed" | null;
|
|
597
622
|
environment: "live" | "test";
|
|
598
623
|
apiKeyId: string | null;
|
|
@@ -663,6 +688,7 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
663
688
|
token: "USDC" | "USDT";
|
|
664
689
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
665
690
|
}>, "many">;
|
|
691
|
+
swapAlternatives: z.ZodArray<z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>, "many">;
|
|
666
692
|
address: z.ZodString;
|
|
667
693
|
status: z.ZodEnum<["pending", "partially_paid", "confirmed", "expired", "underpaid"]>;
|
|
668
694
|
settlementStatus: z.ZodNullable<z.ZodEnum<["pending", "completed", "failed"]>>;
|
|
@@ -829,6 +855,7 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
829
855
|
token: "USDC" | "USDT";
|
|
830
856
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
831
857
|
}[];
|
|
858
|
+
swapAlternatives: ("ETH" | "BNB" | "MATIC" | "AVAX" | "BTC")[];
|
|
832
859
|
settlementStatus: "pending" | "completed" | "failed" | null;
|
|
833
860
|
environment: "live" | "test";
|
|
834
861
|
apiKeyId: string | null;
|
|
@@ -892,6 +919,7 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
892
919
|
token: "USDC" | "USDT";
|
|
893
920
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
894
921
|
}[];
|
|
922
|
+
swapAlternatives: ("ETH" | "BNB" | "MATIC" | "AVAX" | "BTC")[];
|
|
895
923
|
settlementStatus: "pending" | "completed" | "failed" | null;
|
|
896
924
|
environment: "live" | "test";
|
|
897
925
|
apiKeyId: string | null;
|
|
@@ -959,6 +987,7 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
959
987
|
token: "USDC" | "USDT";
|
|
960
988
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
961
989
|
}[];
|
|
990
|
+
swapAlternatives: ("ETH" | "BNB" | "MATIC" | "AVAX" | "BTC")[];
|
|
962
991
|
settlementStatus: "pending" | "completed" | "failed" | null;
|
|
963
992
|
environment: "live" | "test";
|
|
964
993
|
apiKeyId: string | null;
|
|
@@ -1026,6 +1055,7 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
1026
1055
|
token: "USDC" | "USDT";
|
|
1027
1056
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
1028
1057
|
}[];
|
|
1058
|
+
swapAlternatives: ("ETH" | "BNB" | "MATIC" | "AVAX" | "BTC")[];
|
|
1029
1059
|
settlementStatus: "pending" | "completed" | "failed" | null;
|
|
1030
1060
|
environment: "live" | "test";
|
|
1031
1061
|
apiKeyId: string | null;
|
|
@@ -2346,6 +2376,50 @@ declare const PaginatedWebhookDeliveriesSchema: z.ZodObject<{
|
|
|
2346
2376
|
}>;
|
|
2347
2377
|
type PaginatedWebhookDeliveries = z.infer<typeof PaginatedWebhookDeliveriesSchema>;
|
|
2348
2378
|
|
|
2379
|
+
declare const CreateRecipientSchema: z.ZodObject<{
|
|
2380
|
+
address: z.ZodString;
|
|
2381
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2382
|
+
}, "strip", z.ZodTypeAny, {
|
|
2383
|
+
address: string;
|
|
2384
|
+
label?: string | undefined;
|
|
2385
|
+
}, {
|
|
2386
|
+
address: string;
|
|
2387
|
+
label?: string | undefined;
|
|
2388
|
+
}>;
|
|
2389
|
+
type CreateRecipientInput = z.infer<typeof CreateRecipientSchema>;
|
|
2390
|
+
type CreateRecipientRequest = z.input<typeof CreateRecipientSchema>;
|
|
2391
|
+
declare const RecipientSchema: z.ZodObject<{
|
|
2392
|
+
id: z.ZodString;
|
|
2393
|
+
environment: z.ZodEnum<["live", "test"]>;
|
|
2394
|
+
address: z.ZodString;
|
|
2395
|
+
label: z.ZodNullable<z.ZodString>;
|
|
2396
|
+
payout: z.ZodBoolean;
|
|
2397
|
+
createdAt: z.ZodString;
|
|
2398
|
+
}, "strip", z.ZodTypeAny, {
|
|
2399
|
+
address: string;
|
|
2400
|
+
label: string | null;
|
|
2401
|
+
id: string;
|
|
2402
|
+
environment: "live" | "test";
|
|
2403
|
+
createdAt: string;
|
|
2404
|
+
payout: boolean;
|
|
2405
|
+
}, {
|
|
2406
|
+
address: string;
|
|
2407
|
+
label: string | null;
|
|
2408
|
+
id: string;
|
|
2409
|
+
environment: "live" | "test";
|
|
2410
|
+
createdAt: string;
|
|
2411
|
+
payout: boolean;
|
|
2412
|
+
}>;
|
|
2413
|
+
type Recipient = z.infer<typeof RecipientSchema>;
|
|
2414
|
+
declare const SetRecipientPayoutSchema: z.ZodObject<{
|
|
2415
|
+
payout: z.ZodBoolean;
|
|
2416
|
+
}, "strip", z.ZodTypeAny, {
|
|
2417
|
+
payout: boolean;
|
|
2418
|
+
}, {
|
|
2419
|
+
payout: boolean;
|
|
2420
|
+
}>;
|
|
2421
|
+
type SetRecipientPayoutInput = z.infer<typeof SetRecipientPayoutSchema>;
|
|
2422
|
+
|
|
2349
2423
|
declare const TransactionSourceSchema: z.ZodEnum<["moralis_webhook", "reconciliation_job", "sandbox"]>;
|
|
2350
2424
|
type TransactionSource = z.infer<typeof TransactionSourceSchema>;
|
|
2351
2425
|
declare const TimelineEventTypeSchema: z.ZodEnum<["charge.created", "charge.expired", "transaction.detected", "split.distributed", "webhook.dispatched", "webhook.delivered", "webhook.failed"]>;
|
|
@@ -2452,4 +2526,99 @@ declare const CapabilitiesSchema: z.ZodObject<{
|
|
|
2452
2526
|
}>;
|
|
2453
2527
|
type Capabilities = z.infer<typeof CapabilitiesSchema>;
|
|
2454
2528
|
|
|
2455
|
-
|
|
2529
|
+
declare const CreateSwapQuoteSchema: z.ZodObject<{
|
|
2530
|
+
inputToken: z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>;
|
|
2531
|
+
inputNetwork: z.ZodEnum<["base", "optimism", "polygon", "ethereum", "arbitrum", "avalanche", "bnb"]>;
|
|
2532
|
+
takerAddress: z.ZodString;
|
|
2533
|
+
}, "strip", z.ZodTypeAny, {
|
|
2534
|
+
inputToken: "ETH" | "BNB" | "MATIC" | "AVAX" | "BTC";
|
|
2535
|
+
inputNetwork: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
2536
|
+
takerAddress: string;
|
|
2537
|
+
}, {
|
|
2538
|
+
inputToken: "ETH" | "BNB" | "MATIC" | "AVAX" | "BTC";
|
|
2539
|
+
inputNetwork: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
2540
|
+
takerAddress: string;
|
|
2541
|
+
}>;
|
|
2542
|
+
type CreateSwapQuoteInput = z.infer<typeof CreateSwapQuoteSchema>;
|
|
2543
|
+
declare const SwapQuoteSchema: z.ZodObject<{
|
|
2544
|
+
inputToken: z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>;
|
|
2545
|
+
inputNetwork: z.ZodEnum<["base", "optimism", "polygon", "ethereum", "arbitrum", "avalanche", "bnb"]>;
|
|
2546
|
+
inputAmount: z.ZodNumber;
|
|
2547
|
+
outputToken: z.ZodEnum<["USDC", "USDT"]>;
|
|
2548
|
+
outputNetwork: z.ZodEnum<["base", "optimism", "polygon", "ethereum", "arbitrum", "avalanche", "bnb"]>;
|
|
2549
|
+
outputAmount: z.ZodNumber;
|
|
2550
|
+
fees: z.ZodObject<{
|
|
2551
|
+
klappayFee: z.ZodNumber;
|
|
2552
|
+
zeroExFee: z.ZodNullable<z.ZodNumber>;
|
|
2553
|
+
}, "strip", z.ZodTypeAny, {
|
|
2554
|
+
klappayFee: number;
|
|
2555
|
+
zeroExFee: number | null;
|
|
2556
|
+
}, {
|
|
2557
|
+
klappayFee: number;
|
|
2558
|
+
zeroExFee: number | null;
|
|
2559
|
+
}>;
|
|
2560
|
+
expiresAt: z.ZodString;
|
|
2561
|
+
transaction: z.ZodObject<{
|
|
2562
|
+
to: z.ZodString;
|
|
2563
|
+
data: z.ZodString;
|
|
2564
|
+
value: z.ZodString;
|
|
2565
|
+
}, "strip", z.ZodTypeAny, {
|
|
2566
|
+
value: string;
|
|
2567
|
+
data: string;
|
|
2568
|
+
to: string;
|
|
2569
|
+
}, {
|
|
2570
|
+
value: string;
|
|
2571
|
+
data: string;
|
|
2572
|
+
to: string;
|
|
2573
|
+
}>;
|
|
2574
|
+
permit2: z.ZodOptional<z.ZodObject<{
|
|
2575
|
+
eip712: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2576
|
+
}, "strip", z.ZodTypeAny, {
|
|
2577
|
+
eip712: Record<string, unknown>;
|
|
2578
|
+
}, {
|
|
2579
|
+
eip712: Record<string, unknown>;
|
|
2580
|
+
}>>;
|
|
2581
|
+
}, "strip", z.ZodTypeAny, {
|
|
2582
|
+
expiresAt: string;
|
|
2583
|
+
inputToken: "ETH" | "BNB" | "MATIC" | "AVAX" | "BTC";
|
|
2584
|
+
inputNetwork: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
2585
|
+
inputAmount: number;
|
|
2586
|
+
outputToken: "USDC" | "USDT";
|
|
2587
|
+
outputNetwork: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
2588
|
+
outputAmount: number;
|
|
2589
|
+
fees: {
|
|
2590
|
+
klappayFee: number;
|
|
2591
|
+
zeroExFee: number | null;
|
|
2592
|
+
};
|
|
2593
|
+
transaction: {
|
|
2594
|
+
value: string;
|
|
2595
|
+
data: string;
|
|
2596
|
+
to: string;
|
|
2597
|
+
};
|
|
2598
|
+
permit2?: {
|
|
2599
|
+
eip712: Record<string, unknown>;
|
|
2600
|
+
} | undefined;
|
|
2601
|
+
}, {
|
|
2602
|
+
expiresAt: string;
|
|
2603
|
+
inputToken: "ETH" | "BNB" | "MATIC" | "AVAX" | "BTC";
|
|
2604
|
+
inputNetwork: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
2605
|
+
inputAmount: number;
|
|
2606
|
+
outputToken: "USDC" | "USDT";
|
|
2607
|
+
outputNetwork: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
2608
|
+
outputAmount: number;
|
|
2609
|
+
fees: {
|
|
2610
|
+
klappayFee: number;
|
|
2611
|
+
zeroExFee: number | null;
|
|
2612
|
+
};
|
|
2613
|
+
transaction: {
|
|
2614
|
+
value: string;
|
|
2615
|
+
data: string;
|
|
2616
|
+
to: string;
|
|
2617
|
+
};
|
|
2618
|
+
permit2?: {
|
|
2619
|
+
eip712: Record<string, unknown>;
|
|
2620
|
+
} | undefined;
|
|
2621
|
+
}>;
|
|
2622
|
+
type SwapQuote = z.infer<typeof SwapQuoteSchema>;
|
|
2623
|
+
|
|
2624
|
+
export { ALT_TOKEN_ADDRESSES, ALT_TOKEN_DECIMALS, API_KEY_SCOPES, type AcceptedPayment, AcceptedPaymentSchema, type AltToken, AltTokenSchema, type ApiKeyScope, ApiKeyScopeSchema, CHARGE_ACCEPTED_PAYMENTS_MAX, CHARGE_AMOUNT_MAX, CHARGE_EXPIRES_IN_MAX_SECONDS, CHARGE_EXPIRES_IN_MIN_SECONDS, CHARGE_SPLIT_RECIPIENTS_MAX, CHECKOUT_PRODUCTS_MAX, CONFLICTING_SCOPE_PAIRS, type Capabilities, CapabilitiesSchema, type Charge, ChargeSchema, type ChargeStatus, ChargeStatusSchema, ChargeWebhookEventTypeSchema, type ChargesDateField, ChargesDateFieldSchema, type ChargesMetricField, ChargesMetricFieldSchema, type ChargesQueryField, ChargesQueryFieldSchema, type CheckoutProduct, CheckoutProductSchema, type CreateChargeInput, type CreateChargeRequest, CreateChargeSchema, type CreateRecipientInput, type CreateRecipientRequest, CreateRecipientSchema, type CreateSwapQuoteInput, CreateSwapQuoteSchema, type CreateWebhookInput, type CreateWebhookRequest, CreateWebhookSchema, type DistributionsDateField, DistributionsDateFieldSchema, type DistributionsMetricField, DistributionsMetricFieldSchema, type DistributionsQueryField, DistributionsQueryFieldSchema, EVENT_CATEGORY_MAP, EVM_NETWORKS, type Environment, EnvironmentSchema, type ErrorPayload, ErrorPayloadSchema, type EvmNetwork, type GetChargeQrCodeQuery, type GetChargeQrCodeQueryRequest, GetChargeQrCodeQuerySchema, type Health, HealthSchema, type KlappayCheckoutMetadata, KlappayCheckoutMetadataSchema, type ListChargesInput, type ListChargesRequest, ListChargesSchema, type ListWebhookDeliveriesInput, type ListWebhookDeliveriesRequest, ListWebhookDeliveriesSchema, type ListenPendingDistributionsQuery, ListenPendingDistributionsQuerySchema, MAX_METRICS_QUERY_DATE_RANGE_DAYS, METRICS_QUERY_DEFAULT_ROW_LIMIT, METRICS_QUERY_MAX_FILTERS, METRICS_QUERY_MAX_GROUP_BY, METRICS_QUERY_MAX_METRICS, METRICS_QUERY_MAX_ROW_LIMIT, MetadataWithKlappaySchema, type MetricsAggregation, MetricsAggregationSchema, type MetricsDateGranularity, MetricsDateGranularitySchema, type MetricsFilterOperator, MetricsFilterOperatorSchema, type MetricsQuery, type MetricsQueryRequest, type MetricsQueryResult, type MetricsQueryResultRow, MetricsQueryResultRowSchema, MetricsQueryResultSchema, MetricsQuerySchema, type MetricsResource, MetricsResourceSchema, NETWORK_EXPLORERS, NETWORK_LABELS, type Network, NetworkSchema, OPERATIONAL_NETWORKS, type OperationalNetwork, PAGINATION_LIMIT_DEFAULT, PAGINATION_LIMIT_MAX, PAGINATION_LIMIT_MIN, type PaginatedCharges, PaginatedChargesSchema, type PaginatedPendingDistributions, PaginatedPendingDistributionsSchema, type PaginatedWebhookDeliveries, PaginatedWebhookDeliveriesSchema, type PaginationQuery, type PaginationQueryRequest, PaginationQuerySchema, type PendingDistribution, type PendingDistributionEvent, PendingDistributionEventSchema, PendingDistributionRecipientSchema, PendingDistributionSchema, type Recipient, RecipientSchema, type SandboxTriggerInput, SandboxTriggerSchema, type SetRecipientPayoutInput, SetRecipientPayoutSchema, type SettlementStatus, SettlementStatusSchema, type SplitDistributionStatus, SplitDistributionStatusSchema, type SplitRecipient, type SplitRecipientInput, SplitRecipientInputSchema, SplitRecipientSchema, type SwapQuote, SwapQuoteSchema, TOKEN_ADDRESSES, TOKEN_DECIMALS, type TimelineEvent, TimelineEventSchema, type TimelineEventType, TimelineEventTypeSchema, type Token, TokenSchema, type TransactionSource, TransactionSourceSchema, type TransactionsDateField, TransactionsDateFieldSchema, type TransactionsMetricField, TransactionsMetricFieldSchema, type TransactionsQueryField, TransactionsQueryFieldSchema, type TriggerableChargeEvent, TriggerableChargeEventSchema, type TypedWebhookPayload, WEBHOOK_EVENTS_WILDCARD, WEBHOOK_EVENT_CATEGORIES, type Webhook, type WebhookCategory, WebhookCategorySchema, type WebhookDelivery, WebhookDeliveryEventTypeSchema, WebhookDeliverySchema, type WebhookDeliveryStatus, WebhookDeliveryStatusSchema, type WebhookEventDataMap, type WebhookEventType, WebhookEventTypeSchema, type WebhookHealthEventData, type WebhookListItem, WebhookListItemSchema, type WebhookPayload, WebhookPayloadSchema, WebhookSchema, findConflictingScopes, listAltTokensForNetworks, paginatedSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -32,9 +32,11 @@ type ErrorPayload = z.infer<typeof ErrorPayloadSchema>;
|
|
|
32
32
|
declare const EnvironmentSchema: z.ZodEnum<["live", "test"]>;
|
|
33
33
|
type Environment = z.infer<typeof EnvironmentSchema>;
|
|
34
34
|
|
|
35
|
-
declare const ApiKeyScopeSchema: z.ZodEnum<["charges:read", "charges:write", "webhooks:read", "webhooks:write", "webhooks:manage_secret", "metrics:read", "metrics:charges:read", "metrics:transactions:read", "metrics:distributions:read", "sandbox:trigger"]>;
|
|
35
|
+
declare const ApiKeyScopeSchema: z.ZodEnum<["charges:read", "charges:write", "webhooks:read", "webhooks:write", "webhooks:manage_secret", "metrics:read", "metrics:charges:read", "metrics:transactions:read", "metrics:distributions:read", "sandbox:trigger", "charges:split_write", "recipients:read", "recipients:write", "recipients:manage_payout"]>;
|
|
36
36
|
type ApiKeyScope = z.infer<typeof ApiKeyScopeSchema>;
|
|
37
|
-
declare const API_KEY_SCOPES: ["charges:read", "charges:write", "webhooks:read", "webhooks:write", "webhooks:manage_secret", "metrics:read", "metrics:charges:read", "metrics:transactions:read", "metrics:distributions:read", "sandbox:trigger"];
|
|
37
|
+
declare const API_KEY_SCOPES: ["charges:read", "charges:write", "webhooks:read", "webhooks:write", "webhooks:manage_secret", "metrics:read", "metrics:charges:read", "metrics:transactions:read", "metrics:distributions:read", "sandbox:trigger", "charges:split_write", "recipients:read", "recipients:write", "recipients:manage_payout"];
|
|
38
|
+
declare const CONFLICTING_SCOPE_PAIRS: ReadonlyArray<readonly [ApiKeyScope, ApiKeyScope]>;
|
|
39
|
+
declare function findConflictingScopes(scopes: readonly ApiKeyScope[]): readonly [ApiKeyScope, ApiKeyScope] | null;
|
|
38
40
|
|
|
39
41
|
declare const NetworkSchema: z.ZodEnum<["base", "optimism", "polygon", "ethereum", "arbitrum", "avalanche", "bnb"]>;
|
|
40
42
|
type Network = z.infer<typeof NetworkSchema>;
|
|
@@ -79,6 +81,12 @@ type Token = z.infer<typeof TokenSchema>;
|
|
|
79
81
|
declare const TOKEN_DECIMALS = 6;
|
|
80
82
|
declare const TOKEN_ADDRESSES: Record<Token, Partial<Record<Network, Partial<Record<Environment, `0x${string}`>>>>>;
|
|
81
83
|
|
|
84
|
+
declare const AltTokenSchema: z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>;
|
|
85
|
+
type AltToken = z.infer<typeof AltTokenSchema>;
|
|
86
|
+
declare const ALT_TOKEN_DECIMALS: Record<AltToken, number>;
|
|
87
|
+
declare const ALT_TOKEN_ADDRESSES: Record<Network, Partial<Record<AltToken, 'native' | `0x${string}`>>>;
|
|
88
|
+
declare function listAltTokensForNetworks(networks: readonly Network[]): AltToken[];
|
|
89
|
+
|
|
82
90
|
declare const ChargeStatusSchema: z.ZodEnum<["pending", "partially_paid", "confirmed", "expired", "underpaid"]>;
|
|
83
91
|
type ChargeStatus = z.infer<typeof ChargeStatusSchema>;
|
|
84
92
|
declare const SettlementStatusSchema: z.ZodEnum<["pending", "completed", "failed"]>;
|
|
@@ -112,6 +120,20 @@ declare const SplitRecipientSchema: z.ZodObject<{
|
|
|
112
120
|
label?: string | undefined;
|
|
113
121
|
}>;
|
|
114
122
|
type SplitRecipient = z.infer<typeof SplitRecipientSchema>;
|
|
123
|
+
declare const SplitRecipientInputSchema: z.ZodObject<{
|
|
124
|
+
recipientId: z.ZodString;
|
|
125
|
+
percent: z.ZodNumber;
|
|
126
|
+
label: z.ZodOptional<z.ZodString>;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
percent: number;
|
|
129
|
+
recipientId: string;
|
|
130
|
+
label?: string | undefined;
|
|
131
|
+
}, {
|
|
132
|
+
percent: number;
|
|
133
|
+
recipientId: string;
|
|
134
|
+
label?: string | undefined;
|
|
135
|
+
}>;
|
|
136
|
+
type SplitRecipientInput = z.infer<typeof SplitRecipientInputSchema>;
|
|
115
137
|
declare const CHARGE_AMOUNT_MAX = 999999999999;
|
|
116
138
|
declare const CreateChargeSchema: z.ZodObject<{
|
|
117
139
|
amount: z.ZodNumber;
|
|
@@ -223,24 +245,24 @@ declare const CreateChargeSchema: z.ZodObject<{
|
|
|
223
245
|
}, z.ZodUnknown, "strip">>>;
|
|
224
246
|
redirectUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
225
247
|
splitRecipients: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
226
|
-
|
|
248
|
+
recipientId: z.ZodString;
|
|
227
249
|
percent: z.ZodNumber;
|
|
228
250
|
label: z.ZodOptional<z.ZodString>;
|
|
229
251
|
}, "strip", z.ZodTypeAny, {
|
|
230
|
-
address: string;
|
|
231
252
|
percent: number;
|
|
253
|
+
recipientId: string;
|
|
232
254
|
label?: string | undefined;
|
|
233
255
|
}, {
|
|
234
|
-
address: string;
|
|
235
256
|
percent: number;
|
|
257
|
+
recipientId: string;
|
|
236
258
|
label?: string | undefined;
|
|
237
259
|
}>, "many">, {
|
|
238
|
-
address: string;
|
|
239
260
|
percent: number;
|
|
261
|
+
recipientId: string;
|
|
240
262
|
label?: string | undefined;
|
|
241
263
|
}[], {
|
|
242
|
-
address: string;
|
|
243
264
|
percent: number;
|
|
265
|
+
recipientId: string;
|
|
244
266
|
label?: string | undefined;
|
|
245
267
|
}[]>>;
|
|
246
268
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -285,8 +307,8 @@ declare const CreateChargeSchema: z.ZodObject<{
|
|
|
285
307
|
}, z.ZodUnknown, "strip"> | undefined;
|
|
286
308
|
redirectUrl?: string | undefined;
|
|
287
309
|
splitRecipients?: {
|
|
288
|
-
address: string;
|
|
289
310
|
percent: number;
|
|
311
|
+
recipientId: string;
|
|
290
312
|
label?: string | undefined;
|
|
291
313
|
}[] | undefined;
|
|
292
314
|
}, {
|
|
@@ -331,8 +353,8 @@ declare const CreateChargeSchema: z.ZodObject<{
|
|
|
331
353
|
}, z.ZodUnknown, "strip"> | undefined;
|
|
332
354
|
redirectUrl?: string | undefined;
|
|
333
355
|
splitRecipients?: {
|
|
334
|
-
address: string;
|
|
335
356
|
percent: number;
|
|
357
|
+
recipientId: string;
|
|
336
358
|
label?: string | undefined;
|
|
337
359
|
}[] | undefined;
|
|
338
360
|
}>;
|
|
@@ -364,6 +386,7 @@ declare const ChargeSchema: z.ZodObject<{
|
|
|
364
386
|
token: "USDC" | "USDT";
|
|
365
387
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
366
388
|
}>, "many">;
|
|
389
|
+
swapAlternatives: z.ZodArray<z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>, "many">;
|
|
367
390
|
address: z.ZodString;
|
|
368
391
|
status: z.ZodEnum<["pending", "partially_paid", "confirmed", "expired", "underpaid"]>;
|
|
369
392
|
settlementStatus: z.ZodNullable<z.ZodEnum<["pending", "completed", "failed"]>>;
|
|
@@ -530,6 +553,7 @@ declare const ChargeSchema: z.ZodObject<{
|
|
|
530
553
|
token: "USDC" | "USDT";
|
|
531
554
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
532
555
|
}[];
|
|
556
|
+
swapAlternatives: ("ETH" | "BNB" | "MATIC" | "AVAX" | "BTC")[];
|
|
533
557
|
settlementStatus: "pending" | "completed" | "failed" | null;
|
|
534
558
|
environment: "live" | "test";
|
|
535
559
|
apiKeyId: string | null;
|
|
@@ -593,6 +617,7 @@ declare const ChargeSchema: z.ZodObject<{
|
|
|
593
617
|
token: "USDC" | "USDT";
|
|
594
618
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
595
619
|
}[];
|
|
620
|
+
swapAlternatives: ("ETH" | "BNB" | "MATIC" | "AVAX" | "BTC")[];
|
|
596
621
|
settlementStatus: "pending" | "completed" | "failed" | null;
|
|
597
622
|
environment: "live" | "test";
|
|
598
623
|
apiKeyId: string | null;
|
|
@@ -663,6 +688,7 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
663
688
|
token: "USDC" | "USDT";
|
|
664
689
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
665
690
|
}>, "many">;
|
|
691
|
+
swapAlternatives: z.ZodArray<z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>, "many">;
|
|
666
692
|
address: z.ZodString;
|
|
667
693
|
status: z.ZodEnum<["pending", "partially_paid", "confirmed", "expired", "underpaid"]>;
|
|
668
694
|
settlementStatus: z.ZodNullable<z.ZodEnum<["pending", "completed", "failed"]>>;
|
|
@@ -829,6 +855,7 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
829
855
|
token: "USDC" | "USDT";
|
|
830
856
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
831
857
|
}[];
|
|
858
|
+
swapAlternatives: ("ETH" | "BNB" | "MATIC" | "AVAX" | "BTC")[];
|
|
832
859
|
settlementStatus: "pending" | "completed" | "failed" | null;
|
|
833
860
|
environment: "live" | "test";
|
|
834
861
|
apiKeyId: string | null;
|
|
@@ -892,6 +919,7 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
892
919
|
token: "USDC" | "USDT";
|
|
893
920
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
894
921
|
}[];
|
|
922
|
+
swapAlternatives: ("ETH" | "BNB" | "MATIC" | "AVAX" | "BTC")[];
|
|
895
923
|
settlementStatus: "pending" | "completed" | "failed" | null;
|
|
896
924
|
environment: "live" | "test";
|
|
897
925
|
apiKeyId: string | null;
|
|
@@ -959,6 +987,7 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
959
987
|
token: "USDC" | "USDT";
|
|
960
988
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
961
989
|
}[];
|
|
990
|
+
swapAlternatives: ("ETH" | "BNB" | "MATIC" | "AVAX" | "BTC")[];
|
|
962
991
|
settlementStatus: "pending" | "completed" | "failed" | null;
|
|
963
992
|
environment: "live" | "test";
|
|
964
993
|
apiKeyId: string | null;
|
|
@@ -1026,6 +1055,7 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
1026
1055
|
token: "USDC" | "USDT";
|
|
1027
1056
|
network: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
1028
1057
|
}[];
|
|
1058
|
+
swapAlternatives: ("ETH" | "BNB" | "MATIC" | "AVAX" | "BTC")[];
|
|
1029
1059
|
settlementStatus: "pending" | "completed" | "failed" | null;
|
|
1030
1060
|
environment: "live" | "test";
|
|
1031
1061
|
apiKeyId: string | null;
|
|
@@ -2346,6 +2376,50 @@ declare const PaginatedWebhookDeliveriesSchema: z.ZodObject<{
|
|
|
2346
2376
|
}>;
|
|
2347
2377
|
type PaginatedWebhookDeliveries = z.infer<typeof PaginatedWebhookDeliveriesSchema>;
|
|
2348
2378
|
|
|
2379
|
+
declare const CreateRecipientSchema: z.ZodObject<{
|
|
2380
|
+
address: z.ZodString;
|
|
2381
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2382
|
+
}, "strip", z.ZodTypeAny, {
|
|
2383
|
+
address: string;
|
|
2384
|
+
label?: string | undefined;
|
|
2385
|
+
}, {
|
|
2386
|
+
address: string;
|
|
2387
|
+
label?: string | undefined;
|
|
2388
|
+
}>;
|
|
2389
|
+
type CreateRecipientInput = z.infer<typeof CreateRecipientSchema>;
|
|
2390
|
+
type CreateRecipientRequest = z.input<typeof CreateRecipientSchema>;
|
|
2391
|
+
declare const RecipientSchema: z.ZodObject<{
|
|
2392
|
+
id: z.ZodString;
|
|
2393
|
+
environment: z.ZodEnum<["live", "test"]>;
|
|
2394
|
+
address: z.ZodString;
|
|
2395
|
+
label: z.ZodNullable<z.ZodString>;
|
|
2396
|
+
payout: z.ZodBoolean;
|
|
2397
|
+
createdAt: z.ZodString;
|
|
2398
|
+
}, "strip", z.ZodTypeAny, {
|
|
2399
|
+
address: string;
|
|
2400
|
+
label: string | null;
|
|
2401
|
+
id: string;
|
|
2402
|
+
environment: "live" | "test";
|
|
2403
|
+
createdAt: string;
|
|
2404
|
+
payout: boolean;
|
|
2405
|
+
}, {
|
|
2406
|
+
address: string;
|
|
2407
|
+
label: string | null;
|
|
2408
|
+
id: string;
|
|
2409
|
+
environment: "live" | "test";
|
|
2410
|
+
createdAt: string;
|
|
2411
|
+
payout: boolean;
|
|
2412
|
+
}>;
|
|
2413
|
+
type Recipient = z.infer<typeof RecipientSchema>;
|
|
2414
|
+
declare const SetRecipientPayoutSchema: z.ZodObject<{
|
|
2415
|
+
payout: z.ZodBoolean;
|
|
2416
|
+
}, "strip", z.ZodTypeAny, {
|
|
2417
|
+
payout: boolean;
|
|
2418
|
+
}, {
|
|
2419
|
+
payout: boolean;
|
|
2420
|
+
}>;
|
|
2421
|
+
type SetRecipientPayoutInput = z.infer<typeof SetRecipientPayoutSchema>;
|
|
2422
|
+
|
|
2349
2423
|
declare const TransactionSourceSchema: z.ZodEnum<["moralis_webhook", "reconciliation_job", "sandbox"]>;
|
|
2350
2424
|
type TransactionSource = z.infer<typeof TransactionSourceSchema>;
|
|
2351
2425
|
declare const TimelineEventTypeSchema: z.ZodEnum<["charge.created", "charge.expired", "transaction.detected", "split.distributed", "webhook.dispatched", "webhook.delivered", "webhook.failed"]>;
|
|
@@ -2452,4 +2526,99 @@ declare const CapabilitiesSchema: z.ZodObject<{
|
|
|
2452
2526
|
}>;
|
|
2453
2527
|
type Capabilities = z.infer<typeof CapabilitiesSchema>;
|
|
2454
2528
|
|
|
2455
|
-
|
|
2529
|
+
declare const CreateSwapQuoteSchema: z.ZodObject<{
|
|
2530
|
+
inputToken: z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>;
|
|
2531
|
+
inputNetwork: z.ZodEnum<["base", "optimism", "polygon", "ethereum", "arbitrum", "avalanche", "bnb"]>;
|
|
2532
|
+
takerAddress: z.ZodString;
|
|
2533
|
+
}, "strip", z.ZodTypeAny, {
|
|
2534
|
+
inputToken: "ETH" | "BNB" | "MATIC" | "AVAX" | "BTC";
|
|
2535
|
+
inputNetwork: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
2536
|
+
takerAddress: string;
|
|
2537
|
+
}, {
|
|
2538
|
+
inputToken: "ETH" | "BNB" | "MATIC" | "AVAX" | "BTC";
|
|
2539
|
+
inputNetwork: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
2540
|
+
takerAddress: string;
|
|
2541
|
+
}>;
|
|
2542
|
+
type CreateSwapQuoteInput = z.infer<typeof CreateSwapQuoteSchema>;
|
|
2543
|
+
declare const SwapQuoteSchema: z.ZodObject<{
|
|
2544
|
+
inputToken: z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>;
|
|
2545
|
+
inputNetwork: z.ZodEnum<["base", "optimism", "polygon", "ethereum", "arbitrum", "avalanche", "bnb"]>;
|
|
2546
|
+
inputAmount: z.ZodNumber;
|
|
2547
|
+
outputToken: z.ZodEnum<["USDC", "USDT"]>;
|
|
2548
|
+
outputNetwork: z.ZodEnum<["base", "optimism", "polygon", "ethereum", "arbitrum", "avalanche", "bnb"]>;
|
|
2549
|
+
outputAmount: z.ZodNumber;
|
|
2550
|
+
fees: z.ZodObject<{
|
|
2551
|
+
klappayFee: z.ZodNumber;
|
|
2552
|
+
zeroExFee: z.ZodNullable<z.ZodNumber>;
|
|
2553
|
+
}, "strip", z.ZodTypeAny, {
|
|
2554
|
+
klappayFee: number;
|
|
2555
|
+
zeroExFee: number | null;
|
|
2556
|
+
}, {
|
|
2557
|
+
klappayFee: number;
|
|
2558
|
+
zeroExFee: number | null;
|
|
2559
|
+
}>;
|
|
2560
|
+
expiresAt: z.ZodString;
|
|
2561
|
+
transaction: z.ZodObject<{
|
|
2562
|
+
to: z.ZodString;
|
|
2563
|
+
data: z.ZodString;
|
|
2564
|
+
value: z.ZodString;
|
|
2565
|
+
}, "strip", z.ZodTypeAny, {
|
|
2566
|
+
value: string;
|
|
2567
|
+
data: string;
|
|
2568
|
+
to: string;
|
|
2569
|
+
}, {
|
|
2570
|
+
value: string;
|
|
2571
|
+
data: string;
|
|
2572
|
+
to: string;
|
|
2573
|
+
}>;
|
|
2574
|
+
permit2: z.ZodOptional<z.ZodObject<{
|
|
2575
|
+
eip712: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2576
|
+
}, "strip", z.ZodTypeAny, {
|
|
2577
|
+
eip712: Record<string, unknown>;
|
|
2578
|
+
}, {
|
|
2579
|
+
eip712: Record<string, unknown>;
|
|
2580
|
+
}>>;
|
|
2581
|
+
}, "strip", z.ZodTypeAny, {
|
|
2582
|
+
expiresAt: string;
|
|
2583
|
+
inputToken: "ETH" | "BNB" | "MATIC" | "AVAX" | "BTC";
|
|
2584
|
+
inputNetwork: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
2585
|
+
inputAmount: number;
|
|
2586
|
+
outputToken: "USDC" | "USDT";
|
|
2587
|
+
outputNetwork: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
2588
|
+
outputAmount: number;
|
|
2589
|
+
fees: {
|
|
2590
|
+
klappayFee: number;
|
|
2591
|
+
zeroExFee: number | null;
|
|
2592
|
+
};
|
|
2593
|
+
transaction: {
|
|
2594
|
+
value: string;
|
|
2595
|
+
data: string;
|
|
2596
|
+
to: string;
|
|
2597
|
+
};
|
|
2598
|
+
permit2?: {
|
|
2599
|
+
eip712: Record<string, unknown>;
|
|
2600
|
+
} | undefined;
|
|
2601
|
+
}, {
|
|
2602
|
+
expiresAt: string;
|
|
2603
|
+
inputToken: "ETH" | "BNB" | "MATIC" | "AVAX" | "BTC";
|
|
2604
|
+
inputNetwork: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
2605
|
+
inputAmount: number;
|
|
2606
|
+
outputToken: "USDC" | "USDT";
|
|
2607
|
+
outputNetwork: "base" | "optimism" | "polygon" | "ethereum" | "arbitrum" | "avalanche" | "bnb";
|
|
2608
|
+
outputAmount: number;
|
|
2609
|
+
fees: {
|
|
2610
|
+
klappayFee: number;
|
|
2611
|
+
zeroExFee: number | null;
|
|
2612
|
+
};
|
|
2613
|
+
transaction: {
|
|
2614
|
+
value: string;
|
|
2615
|
+
data: string;
|
|
2616
|
+
to: string;
|
|
2617
|
+
};
|
|
2618
|
+
permit2?: {
|
|
2619
|
+
eip712: Record<string, unknown>;
|
|
2620
|
+
} | undefined;
|
|
2621
|
+
}>;
|
|
2622
|
+
type SwapQuote = z.infer<typeof SwapQuoteSchema>;
|
|
2623
|
+
|
|
2624
|
+
export { ALT_TOKEN_ADDRESSES, ALT_TOKEN_DECIMALS, API_KEY_SCOPES, type AcceptedPayment, AcceptedPaymentSchema, type AltToken, AltTokenSchema, type ApiKeyScope, ApiKeyScopeSchema, CHARGE_ACCEPTED_PAYMENTS_MAX, CHARGE_AMOUNT_MAX, CHARGE_EXPIRES_IN_MAX_SECONDS, CHARGE_EXPIRES_IN_MIN_SECONDS, CHARGE_SPLIT_RECIPIENTS_MAX, CHECKOUT_PRODUCTS_MAX, CONFLICTING_SCOPE_PAIRS, type Capabilities, CapabilitiesSchema, type Charge, ChargeSchema, type ChargeStatus, ChargeStatusSchema, ChargeWebhookEventTypeSchema, type ChargesDateField, ChargesDateFieldSchema, type ChargesMetricField, ChargesMetricFieldSchema, type ChargesQueryField, ChargesQueryFieldSchema, type CheckoutProduct, CheckoutProductSchema, type CreateChargeInput, type CreateChargeRequest, CreateChargeSchema, type CreateRecipientInput, type CreateRecipientRequest, CreateRecipientSchema, type CreateSwapQuoteInput, CreateSwapQuoteSchema, type CreateWebhookInput, type CreateWebhookRequest, CreateWebhookSchema, type DistributionsDateField, DistributionsDateFieldSchema, type DistributionsMetricField, DistributionsMetricFieldSchema, type DistributionsQueryField, DistributionsQueryFieldSchema, EVENT_CATEGORY_MAP, EVM_NETWORKS, type Environment, EnvironmentSchema, type ErrorPayload, ErrorPayloadSchema, type EvmNetwork, type GetChargeQrCodeQuery, type GetChargeQrCodeQueryRequest, GetChargeQrCodeQuerySchema, type Health, HealthSchema, type KlappayCheckoutMetadata, KlappayCheckoutMetadataSchema, type ListChargesInput, type ListChargesRequest, ListChargesSchema, type ListWebhookDeliveriesInput, type ListWebhookDeliveriesRequest, ListWebhookDeliveriesSchema, type ListenPendingDistributionsQuery, ListenPendingDistributionsQuerySchema, MAX_METRICS_QUERY_DATE_RANGE_DAYS, METRICS_QUERY_DEFAULT_ROW_LIMIT, METRICS_QUERY_MAX_FILTERS, METRICS_QUERY_MAX_GROUP_BY, METRICS_QUERY_MAX_METRICS, METRICS_QUERY_MAX_ROW_LIMIT, MetadataWithKlappaySchema, type MetricsAggregation, MetricsAggregationSchema, type MetricsDateGranularity, MetricsDateGranularitySchema, type MetricsFilterOperator, MetricsFilterOperatorSchema, type MetricsQuery, type MetricsQueryRequest, type MetricsQueryResult, type MetricsQueryResultRow, MetricsQueryResultRowSchema, MetricsQueryResultSchema, MetricsQuerySchema, type MetricsResource, MetricsResourceSchema, NETWORK_EXPLORERS, NETWORK_LABELS, type Network, NetworkSchema, OPERATIONAL_NETWORKS, type OperationalNetwork, PAGINATION_LIMIT_DEFAULT, PAGINATION_LIMIT_MAX, PAGINATION_LIMIT_MIN, type PaginatedCharges, PaginatedChargesSchema, type PaginatedPendingDistributions, PaginatedPendingDistributionsSchema, type PaginatedWebhookDeliveries, PaginatedWebhookDeliveriesSchema, type PaginationQuery, type PaginationQueryRequest, PaginationQuerySchema, type PendingDistribution, type PendingDistributionEvent, PendingDistributionEventSchema, PendingDistributionRecipientSchema, PendingDistributionSchema, type Recipient, RecipientSchema, type SandboxTriggerInput, SandboxTriggerSchema, type SetRecipientPayoutInput, SetRecipientPayoutSchema, type SettlementStatus, SettlementStatusSchema, type SplitDistributionStatus, SplitDistributionStatusSchema, type SplitRecipient, type SplitRecipientInput, SplitRecipientInputSchema, SplitRecipientSchema, type SwapQuote, SwapQuoteSchema, TOKEN_ADDRESSES, TOKEN_DECIMALS, type TimelineEvent, TimelineEventSchema, type TimelineEventType, TimelineEventTypeSchema, type Token, TokenSchema, type TransactionSource, TransactionSourceSchema, type TransactionsDateField, TransactionsDateFieldSchema, type TransactionsMetricField, TransactionsMetricFieldSchema, type TransactionsQueryField, TransactionsQueryFieldSchema, type TriggerableChargeEvent, TriggerableChargeEventSchema, type TypedWebhookPayload, WEBHOOK_EVENTS_WILDCARD, WEBHOOK_EVENT_CATEGORIES, type Webhook, type WebhookCategory, WebhookCategorySchema, type WebhookDelivery, WebhookDeliveryEventTypeSchema, WebhookDeliverySchema, type WebhookDeliveryStatus, WebhookDeliveryStatusSchema, type WebhookEventDataMap, type WebhookEventType, WebhookEventTypeSchema, type WebhookHealthEventData, type WebhookListItem, WebhookListItemSchema, type WebhookPayload, WebhookPayloadSchema, WebhookSchema, findConflictingScopes, listAltTokensForNetworks, paginatedSchema };
|