@coin-voyage/shared 2.2.0-beta.6 → 2.2.0-beta.8
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.
|
@@ -15,7 +15,9 @@ export declare const zPayOrderMetadata: z.ZodObject<{
|
|
|
15
15
|
refund_amount: z.ZodOptional<z.ZodNumber>;
|
|
16
16
|
currency: z.ZodOptional<z.ZodString>;
|
|
17
17
|
}, z.core.$strip>>;
|
|
18
|
-
}, z.core.$catchall<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean
|
|
18
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodAny>, z.ZodObject<{}, z.core.$catchall<z.ZodAny>>]>, z.ZodTransform<string, string | number | boolean | any[] | {
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
}>>>>;
|
|
19
21
|
export declare const zPayOrder: z.ZodObject<{
|
|
20
22
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
21
23
|
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -33,7 +35,9 @@ export declare const zPayOrder: z.ZodObject<{
|
|
|
33
35
|
refund_amount: z.ZodOptional<z.ZodNumber>;
|
|
34
36
|
currency: z.ZodOptional<z.ZodString>;
|
|
35
37
|
}, z.core.$strip>>;
|
|
36
|
-
}, z.core.$catchall<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodTransform<string, string | number | boolean
|
|
38
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodAny>, z.ZodObject<{}, z.core.$catchall<z.ZodAny>>]>, z.ZodTransform<string, string | number | boolean | any[] | {
|
|
39
|
+
[x: string]: any;
|
|
40
|
+
}>>>>>;
|
|
37
41
|
intent: z.ZodObject<{
|
|
38
42
|
asset: z.ZodOptional<z.ZodObject<{
|
|
39
43
|
chain_id: z.ZodNumber;
|
|
@@ -51,4 +55,10 @@ export declare const zPayOrder: z.ZodObject<{
|
|
|
51
55
|
receiving_address: z.ZodOptional<z.ZodString>;
|
|
52
56
|
}, z.core.$strip>;
|
|
53
57
|
}, z.core.$strip>;
|
|
54
|
-
export type PayOrderMetadata = z.infer<typeof zPayOrderMetadata
|
|
58
|
+
export type PayOrderMetadata = z.infer<typeof zPayOrderMetadata> & {
|
|
59
|
+
[key: string]: string | number | boolean;
|
|
60
|
+
};
|
|
61
|
+
export type PayOrderMetadataInput = {
|
|
62
|
+
items?: z.input<typeof zPayOrderMetadata.shape.items>;
|
|
63
|
+
refund?: z.input<typeof zPayOrderMetadata.shape.refund>;
|
|
64
|
+
} & Record<string, string | number | boolean>;
|
|
@@ -4,7 +4,7 @@ import { ChainId } from "../chains";
|
|
|
4
4
|
import { FIAT_CURRENCIES } from "../currencies";
|
|
5
5
|
const knownKeys = ["items", "refund"];
|
|
6
6
|
const customFieldSchema = z
|
|
7
|
-
.union([z.string(), z.number(), z.boolean()])
|
|
7
|
+
.union([z.string(), z.number(), z.boolean(), z.array(z.any()), z.object({}).catchall(z.any())])
|
|
8
8
|
.transform((val) => String(val))
|
|
9
9
|
.refine((val) => val.length <= 500, {
|
|
10
10
|
message: "Each custom field value must be 500 characters or less",
|
package/dist/types/api.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ChainId, ChainType, Currency, CurrencyAmount, CurrencyBase, CurrencyWithAmount, FiatCurrency, PaymentData, PayOrderStatus, QuoteWithCurrency, zPayOrderMetadata } from "../common";
|
|
1
|
+
import { ChainId, ChainType, Currency, CurrencyAmount, CurrencyBase, CurrencyWithAmount, FiatCurrency, PaymentData, PayOrderMetadataInput, PayOrderStatus, QuoteWithCurrency } from "../common";
|
|
3
2
|
export type PayOrderParams = {
|
|
4
3
|
/**
|
|
5
4
|
* Intent of the order.
|
|
@@ -8,7 +7,7 @@ export type PayOrderParams = {
|
|
|
8
7
|
/**
|
|
9
8
|
* Metadata to attach to the payOrder.
|
|
10
9
|
*/
|
|
11
|
-
metadata?:
|
|
10
|
+
metadata?: PayOrderMetadataInput;
|
|
12
11
|
};
|
|
13
12
|
export type PayOrderQuoteParams = {
|
|
14
13
|
wallet_address: string;
|