@klappay/types 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -2
- package/dist/chunk-WKIOAEJ3.mjs +137 -0
- package/dist/chunk-WKIOAEJ3.mjs.map +1 -0
- package/dist/{constants-DQGVNS9O.d.mts → constants-021Ybu31.d.mts} +11 -2
- package/dist/{constants-DQGVNS9O.d.ts → constants-021Ybu31.d.ts} +11 -2
- package/dist/constants.d.mts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +51 -20
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +9 -3
- package/dist/index.d.mts +50 -1
- package/dist/index.d.ts +50 -1
- package/dist/index.js +341 -283
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +300 -267
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-KZ3646WX.mjs +0 -109
- package/dist/chunk-KZ3646WX.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export { A as ALT_TOKEN_ADDRESSES, a as ALT_TOKEN_DECIMALS, b as AltToken, c as AltTokenSchema, C as CHAIN_IDS, E as EVM_NETWORKS, d as Environment, e as EnvironmentSchema, f as EvmNetwork, N as NETWORK_EXPLORERS, g as NETWORK_LABELS, h as Network, i as NetworkSchema, O as OPERATIONAL_NETWORKS, j as OperationalNetwork, S as SwapAlternative, k as SwapAlternativeSchema, T as TOKEN_ADDRESSES, l as TOKEN_DECIMALS, m as
|
|
2
|
+
export { A as ALT_TOKEN_ADDRESSES, a as ALT_TOKEN_DECIMALS, b as AltToken, c as AltTokenSchema, C as CHAIN_IDS, E as EVM_NETWORKS, d as Environment, e as EnvironmentSchema, f as EvmNetwork, N as NETWORK_EXPLORERS, g as NETWORK_LABELS, h as Network, i as NetworkSchema, O as OPERATIONAL_NETWORKS, j as OperationalNetwork, S as SwapAlternative, k as SwapAlternativeSchema, T as TOKEN_ADDRESSES, l as TOKEN_DECIMALS, m as TOKEN_DEPLOYMENTS, n as Token, o as TokenDeployment, p as TokenSchema, q as getTokenDeployment, r as isPaymentDeploymentEnabled, s as listSwapAlternatives } from './constants-021Ybu31.js';
|
|
3
3
|
|
|
4
4
|
declare const ErrorPayloadSchema: z.ZodObject<{
|
|
5
5
|
error: z.ZodObject<{
|
|
@@ -359,11 +359,14 @@ type CreateChargeRequest = z.input<typeof CreateChargeSchema>;
|
|
|
359
359
|
declare const ChargeSchema: z.ZodObject<{
|
|
360
360
|
id: z.ZodString;
|
|
361
361
|
amount: z.ZodNumber;
|
|
362
|
+
amountExact: z.ZodOptional<z.ZodString>;
|
|
362
363
|
feePayer: z.ZodEnum<["merchant", "payer"]>;
|
|
363
364
|
feePercent: z.ZodNumber;
|
|
364
365
|
feeAmount: z.ZodNumber;
|
|
365
366
|
merchantAmount: z.ZodNumber;
|
|
366
367
|
amountReceived: z.ZodNullable<z.ZodNumber>;
|
|
368
|
+
amountReceivedExact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
369
|
+
paymentUnavailable: z.ZodOptional<z.ZodBoolean>;
|
|
367
370
|
isOverpaid: z.ZodBoolean;
|
|
368
371
|
currency: z.ZodString;
|
|
369
372
|
acceptedPayments: z.ZodArray<z.ZodObject<{
|
|
@@ -598,6 +601,9 @@ declare const ChargeSchema: z.ZodObject<{
|
|
|
598
601
|
confirmedAt: string | null;
|
|
599
602
|
settledAt: string | null;
|
|
600
603
|
lastActivityAt: string;
|
|
604
|
+
amountExact?: string | undefined;
|
|
605
|
+
amountReceivedExact?: string | null | undefined;
|
|
606
|
+
paymentUnavailable?: boolean | undefined;
|
|
601
607
|
}, {
|
|
602
608
|
status: "pending" | "partially_paid" | "confirmed" | "expired" | "underpaid";
|
|
603
609
|
address: string;
|
|
@@ -674,6 +680,9 @@ declare const ChargeSchema: z.ZodObject<{
|
|
|
674
680
|
confirmedAt: string | null;
|
|
675
681
|
settledAt: string | null;
|
|
676
682
|
lastActivityAt: string;
|
|
683
|
+
amountExact?: string | undefined;
|
|
684
|
+
amountReceivedExact?: string | null | undefined;
|
|
685
|
+
paymentUnavailable?: boolean | undefined;
|
|
677
686
|
}>;
|
|
678
687
|
type Charge = z.infer<typeof ChargeSchema>;
|
|
679
688
|
declare const ListChargesSchema: z.ZodObject<{
|
|
@@ -711,11 +720,14 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
711
720
|
data: z.ZodArray<z.ZodObject<{
|
|
712
721
|
id: z.ZodString;
|
|
713
722
|
amount: z.ZodNumber;
|
|
723
|
+
amountExact: z.ZodOptional<z.ZodString>;
|
|
714
724
|
feePayer: z.ZodEnum<["merchant", "payer"]>;
|
|
715
725
|
feePercent: z.ZodNumber;
|
|
716
726
|
feeAmount: z.ZodNumber;
|
|
717
727
|
merchantAmount: z.ZodNumber;
|
|
718
728
|
amountReceived: z.ZodNullable<z.ZodNumber>;
|
|
729
|
+
amountReceivedExact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
730
|
+
paymentUnavailable: z.ZodOptional<z.ZodBoolean>;
|
|
719
731
|
isOverpaid: z.ZodBoolean;
|
|
720
732
|
currency: z.ZodString;
|
|
721
733
|
acceptedPayments: z.ZodArray<z.ZodObject<{
|
|
@@ -950,6 +962,9 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
950
962
|
confirmedAt: string | null;
|
|
951
963
|
settledAt: string | null;
|
|
952
964
|
lastActivityAt: string;
|
|
965
|
+
amountExact?: string | undefined;
|
|
966
|
+
amountReceivedExact?: string | null | undefined;
|
|
967
|
+
paymentUnavailable?: boolean | undefined;
|
|
953
968
|
}, {
|
|
954
969
|
status: "pending" | "partially_paid" | "confirmed" | "expired" | "underpaid";
|
|
955
970
|
address: string;
|
|
@@ -1026,6 +1041,9 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
1026
1041
|
confirmedAt: string | null;
|
|
1027
1042
|
settledAt: string | null;
|
|
1028
1043
|
lastActivityAt: string;
|
|
1044
|
+
amountExact?: string | undefined;
|
|
1045
|
+
amountReceivedExact?: string | null | undefined;
|
|
1046
|
+
paymentUnavailable?: boolean | undefined;
|
|
1029
1047
|
}>, "many">;
|
|
1030
1048
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
1031
1049
|
hasMore: z.ZodBoolean;
|
|
@@ -1106,6 +1124,9 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
1106
1124
|
confirmedAt: string | null;
|
|
1107
1125
|
settledAt: string | null;
|
|
1108
1126
|
lastActivityAt: string;
|
|
1127
|
+
amountExact?: string | undefined;
|
|
1128
|
+
amountReceivedExact?: string | null | undefined;
|
|
1129
|
+
paymentUnavailable?: boolean | undefined;
|
|
1109
1130
|
}[];
|
|
1110
1131
|
nextCursor: string | null;
|
|
1111
1132
|
hasMore: boolean;
|
|
@@ -1186,6 +1207,9 @@ declare const PaginatedChargesSchema: z.ZodObject<{
|
|
|
1186
1207
|
confirmedAt: string | null;
|
|
1187
1208
|
settledAt: string | null;
|
|
1188
1209
|
lastActivityAt: string;
|
|
1210
|
+
amountExact?: string | undefined;
|
|
1211
|
+
amountReceivedExact?: string | null | undefined;
|
|
1212
|
+
paymentUnavailable?: boolean | undefined;
|
|
1189
1213
|
}[];
|
|
1190
1214
|
nextCursor: string | null;
|
|
1191
1215
|
hasMore: boolean;
|
|
@@ -1224,11 +1248,14 @@ type CheckChargeRequest = z.infer<typeof CheckChargeRequestSchema>;
|
|
|
1224
1248
|
declare const CheckChargeResponseSchema: z.ZodObject<{
|
|
1225
1249
|
id: z.ZodString;
|
|
1226
1250
|
amount: z.ZodNumber;
|
|
1251
|
+
amountExact: z.ZodOptional<z.ZodString>;
|
|
1227
1252
|
feePayer: z.ZodEnum<["merchant", "payer"]>;
|
|
1228
1253
|
feePercent: z.ZodNumber;
|
|
1229
1254
|
feeAmount: z.ZodNumber;
|
|
1230
1255
|
merchantAmount: z.ZodNumber;
|
|
1231
1256
|
amountReceived: z.ZodNullable<z.ZodNumber>;
|
|
1257
|
+
amountReceivedExact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1258
|
+
paymentUnavailable: z.ZodOptional<z.ZodBoolean>;
|
|
1232
1259
|
isOverpaid: z.ZodBoolean;
|
|
1233
1260
|
currency: z.ZodString;
|
|
1234
1261
|
acceptedPayments: z.ZodArray<z.ZodObject<{
|
|
@@ -1488,6 +1515,9 @@ declare const CheckChargeResponseSchema: z.ZodObject<{
|
|
|
1488
1515
|
blocksSeen: number;
|
|
1489
1516
|
blocksRequired: number;
|
|
1490
1517
|
} | null;
|
|
1518
|
+
amountExact?: string | undefined;
|
|
1519
|
+
amountReceivedExact?: string | null | undefined;
|
|
1520
|
+
paymentUnavailable?: boolean | undefined;
|
|
1491
1521
|
}, {
|
|
1492
1522
|
status: "pending" | "partially_paid" | "confirmed" | "expired" | "underpaid";
|
|
1493
1523
|
address: string;
|
|
@@ -1571,6 +1601,9 @@ declare const CheckChargeResponseSchema: z.ZodObject<{
|
|
|
1571
1601
|
blocksSeen: number;
|
|
1572
1602
|
blocksRequired: number;
|
|
1573
1603
|
} | null;
|
|
1604
|
+
amountExact?: string | undefined;
|
|
1605
|
+
amountReceivedExact?: string | null | undefined;
|
|
1606
|
+
paymentUnavailable?: boolean | undefined;
|
|
1574
1607
|
}>;
|
|
1575
1608
|
type CheckChargeResponse = z.infer<typeof CheckChargeResponseSchema>;
|
|
1576
1609
|
|
|
@@ -3079,18 +3112,26 @@ declare const SwapQuoteSchema: z.ZodObject<{
|
|
|
3079
3112
|
inputToken: z.ZodEnum<["ETH", "BNB", "MATIC", "AVAX", "BTC"]>;
|
|
3080
3113
|
inputNetwork: z.ZodEnum<["base", "optimism", "polygon", "ethereum", "arbitrum", "avalanche", "bnb"]>;
|
|
3081
3114
|
inputAmount: z.ZodNumber;
|
|
3115
|
+
inputAmountExact: z.ZodOptional<z.ZodString>;
|
|
3082
3116
|
outputToken: z.ZodEnum<["USDC", "USDT"]>;
|
|
3083
3117
|
outputNetwork: z.ZodEnum<["base", "optimism", "polygon", "ethereum", "arbitrum", "avalanche", "bnb"]>;
|
|
3084
3118
|
outputAmount: z.ZodNumber;
|
|
3119
|
+
outputAmountExact: z.ZodOptional<z.ZodString>;
|
|
3085
3120
|
fees: z.ZodObject<{
|
|
3086
3121
|
klappayFee: z.ZodNumber;
|
|
3122
|
+
klappayFeeExact: z.ZodOptional<z.ZodString>;
|
|
3087
3123
|
zeroExFee: z.ZodNullable<z.ZodNumber>;
|
|
3124
|
+
zeroExFeeExact: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3088
3125
|
}, "strip", z.ZodTypeAny, {
|
|
3089
3126
|
klappayFee: number;
|
|
3090
3127
|
zeroExFee: number | null;
|
|
3128
|
+
klappayFeeExact?: string | undefined;
|
|
3129
|
+
zeroExFeeExact?: string | null | undefined;
|
|
3091
3130
|
}, {
|
|
3092
3131
|
klappayFee: number;
|
|
3093
3132
|
zeroExFee: number | null;
|
|
3133
|
+
klappayFeeExact?: string | undefined;
|
|
3134
|
+
zeroExFeeExact?: string | null | undefined;
|
|
3094
3135
|
}>;
|
|
3095
3136
|
expiresAt: z.ZodString;
|
|
3096
3137
|
transaction: z.ZodObject<{
|
|
@@ -3124,12 +3165,16 @@ declare const SwapQuoteSchema: z.ZodObject<{
|
|
|
3124
3165
|
fees: {
|
|
3125
3166
|
klappayFee: number;
|
|
3126
3167
|
zeroExFee: number | null;
|
|
3168
|
+
klappayFeeExact?: string | undefined;
|
|
3169
|
+
zeroExFeeExact?: string | null | undefined;
|
|
3127
3170
|
};
|
|
3128
3171
|
transaction: {
|
|
3129
3172
|
value: string;
|
|
3130
3173
|
data: string;
|
|
3131
3174
|
to: string;
|
|
3132
3175
|
};
|
|
3176
|
+
inputAmountExact?: string | undefined;
|
|
3177
|
+
outputAmountExact?: string | undefined;
|
|
3133
3178
|
permit2?: {
|
|
3134
3179
|
eip712: Record<string, unknown>;
|
|
3135
3180
|
} | null | undefined;
|
|
@@ -3144,12 +3189,16 @@ declare const SwapQuoteSchema: z.ZodObject<{
|
|
|
3144
3189
|
fees: {
|
|
3145
3190
|
klappayFee: number;
|
|
3146
3191
|
zeroExFee: number | null;
|
|
3192
|
+
klappayFeeExact?: string | undefined;
|
|
3193
|
+
zeroExFeeExact?: string | null | undefined;
|
|
3147
3194
|
};
|
|
3148
3195
|
transaction: {
|
|
3149
3196
|
value: string;
|
|
3150
3197
|
data: string;
|
|
3151
3198
|
to: string;
|
|
3152
3199
|
};
|
|
3200
|
+
inputAmountExact?: string | undefined;
|
|
3201
|
+
outputAmountExact?: string | undefined;
|
|
3153
3202
|
permit2?: {
|
|
3154
3203
|
eip712: Record<string, unknown>;
|
|
3155
3204
|
} | null | undefined;
|