@otim/utils 0.0.3 → 0.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/dist/api/index.js +31 -0
- package/dist/api/index.js.map +2 -2
- package/dist/api/index.mjs +31 -0
- package/dist/api/index.mjs.map +2 -2
- package/dist/api/schemas/payments.d.mts +42 -0
- package/dist/api/schemas/payments.d.ts +42 -0
- package/dist/api/schemas/payments.d.ts.map +1 -1
- package/dist/api/services/payments.d.mts +2 -1
- package/dist/api/services/payments.d.ts +2 -1
- package/dist/api/services/payments.d.ts.map +1 -1
- package/dist/helpers/index.js +8 -6
- package/dist/helpers/index.js.map +2 -2
- package/dist/helpers/index.mjs +8 -6
- package/dist/helpers/index.mjs.map +2 -2
- package/dist/helpers/zod.d.mts +2 -2
- package/dist/helpers/zod.d.ts +2 -2
- package/dist/helpers/zod.d.ts.map +1 -1
- package/dist/server/index.js +32 -0
- package/dist/server/index.js.map +2 -2
- package/dist/server/index.mjs +32 -0
- package/dist/server/index.mjs.map +2 -2
- package/dist/server/routes/bridge.d.mts +62 -0
- package/dist/server/routes/bridge.d.ts +62 -0
- package/dist/server/routes/bridge.d.ts.map +1 -1
- package/dist/server/routes/payments.d.mts +2 -1
- package/dist/server/routes/payments.d.ts +2 -1
- package/dist/server/routes/payments.d.ts.map +1 -1
- package/package.json +9 -5
|
@@ -114,6 +114,7 @@ export declare const paymentRequestBuildResponseSchema: z.ZodObject<{
|
|
|
114
114
|
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
115
115
|
maxExecutions: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
116
116
|
action: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
117
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
117
118
|
arguments: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
118
119
|
}, z.core.$strip>>;
|
|
119
120
|
instructions: z.ZodArray<z.ZodObject<{
|
|
@@ -122,12 +123,14 @@ export declare const paymentRequestBuildResponseSchema: z.ZodObject<{
|
|
|
122
123
|
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
123
124
|
maxExecutions: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
124
125
|
action: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
126
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
125
127
|
arguments: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
126
128
|
}, z.core.$strip>>;
|
|
127
129
|
}, z.core.$strip>;
|
|
128
130
|
export type PaymentRequestBuildResponse = z.infer<typeof paymentRequestBuildResponseSchema>;
|
|
129
131
|
export declare const newInstructionRequestSchema: z.ZodObject<{
|
|
130
132
|
nickname: z.ZodOptional<z.ZodString>;
|
|
133
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
131
134
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
132
135
|
chainId: z.ZodNumber;
|
|
133
136
|
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
@@ -145,6 +148,7 @@ export declare const paymentRequestNewRequestSchema: z.ZodObject<{
|
|
|
145
148
|
signedAuthorization: z.ZodString;
|
|
146
149
|
completionInstructions: z.ZodArray<z.ZodObject<{
|
|
147
150
|
nickname: z.ZodOptional<z.ZodString>;
|
|
151
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
148
152
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
149
153
|
chainId: z.ZodNumber;
|
|
150
154
|
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
@@ -159,6 +163,7 @@ export declare const paymentRequestNewRequestSchema: z.ZodObject<{
|
|
|
159
163
|
}, z.core.$strip>>;
|
|
160
164
|
instructions: z.ZodArray<z.ZodObject<{
|
|
161
165
|
nickname: z.ZodOptional<z.ZodString>;
|
|
166
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
162
167
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
163
168
|
chainId: z.ZodNumber;
|
|
164
169
|
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
@@ -196,4 +201,41 @@ export type PaymentRequestDetailsResponse = z.infer<typeof paymentRequestDetails
|
|
|
196
201
|
export interface PaymentsListRequest extends PaginatedRequest {
|
|
197
202
|
tab: "active" | "completed";
|
|
198
203
|
}
|
|
204
|
+
export declare const buildSettlementRequestSchema: z.ZodObject<{
|
|
205
|
+
acceptedTokens: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
206
|
+
settlementChain: z.ZodNumber;
|
|
207
|
+
settlementToken: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
208
|
+
settlementAmount: z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>;
|
|
209
|
+
recipientAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
210
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
211
|
+
payerAddress: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
212
|
+
dueDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
213
|
+
maxRuns: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
214
|
+
}, z.core.$strip>;
|
|
215
|
+
export type BuildSettlementRequest = z.infer<typeof buildSettlementRequestSchema>;
|
|
216
|
+
export declare const buildSettlementResponseSchema: z.ZodObject<{
|
|
217
|
+
requestId: z.ZodString;
|
|
218
|
+
subOrgId: z.ZodString;
|
|
219
|
+
walletId: z.ZodString;
|
|
220
|
+
ephemeralWalletAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
221
|
+
completionInstructions: z.ZodArray<z.ZodObject<{
|
|
222
|
+
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
223
|
+
chainId: z.ZodNumber;
|
|
224
|
+
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
225
|
+
maxExecutions: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
226
|
+
action: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
227
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
228
|
+
arguments: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
229
|
+
}, z.core.$strip>>;
|
|
230
|
+
instructions: z.ZodArray<z.ZodObject<{
|
|
231
|
+
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
232
|
+
chainId: z.ZodNumber;
|
|
233
|
+
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
234
|
+
maxExecutions: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
235
|
+
action: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
236
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
237
|
+
arguments: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
238
|
+
}, z.core.$strip>>;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
export type BuildSettlementResponse = z.infer<typeof buildSettlementResponseSchema>;
|
|
199
241
|
//# sourceMappingURL=payments.d.ts.map
|
|
@@ -114,6 +114,7 @@ export declare const paymentRequestBuildResponseSchema: z.ZodObject<{
|
|
|
114
114
|
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
115
115
|
maxExecutions: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
116
116
|
action: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
117
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
117
118
|
arguments: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
118
119
|
}, z.core.$strip>>;
|
|
119
120
|
instructions: z.ZodArray<z.ZodObject<{
|
|
@@ -122,12 +123,14 @@ export declare const paymentRequestBuildResponseSchema: z.ZodObject<{
|
|
|
122
123
|
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
123
124
|
maxExecutions: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
124
125
|
action: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
126
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
125
127
|
arguments: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
126
128
|
}, z.core.$strip>>;
|
|
127
129
|
}, z.core.$strip>;
|
|
128
130
|
export type PaymentRequestBuildResponse = z.infer<typeof paymentRequestBuildResponseSchema>;
|
|
129
131
|
export declare const newInstructionRequestSchema: z.ZodObject<{
|
|
130
132
|
nickname: z.ZodOptional<z.ZodString>;
|
|
133
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
131
134
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
132
135
|
chainId: z.ZodNumber;
|
|
133
136
|
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
@@ -145,6 +148,7 @@ export declare const paymentRequestNewRequestSchema: z.ZodObject<{
|
|
|
145
148
|
signedAuthorization: z.ZodString;
|
|
146
149
|
completionInstructions: z.ZodArray<z.ZodObject<{
|
|
147
150
|
nickname: z.ZodOptional<z.ZodString>;
|
|
151
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
148
152
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
149
153
|
chainId: z.ZodNumber;
|
|
150
154
|
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
@@ -159,6 +163,7 @@ export declare const paymentRequestNewRequestSchema: z.ZodObject<{
|
|
|
159
163
|
}, z.core.$strip>>;
|
|
160
164
|
instructions: z.ZodArray<z.ZodObject<{
|
|
161
165
|
nickname: z.ZodOptional<z.ZodString>;
|
|
166
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
162
167
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
163
168
|
chainId: z.ZodNumber;
|
|
164
169
|
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
@@ -196,4 +201,41 @@ export type PaymentRequestDetailsResponse = z.infer<typeof paymentRequestDetails
|
|
|
196
201
|
export interface PaymentsListRequest extends PaginatedRequest {
|
|
197
202
|
tab: "active" | "completed";
|
|
198
203
|
}
|
|
204
|
+
export declare const buildSettlementRequestSchema: z.ZodObject<{
|
|
205
|
+
acceptedTokens: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
206
|
+
settlementChain: z.ZodNumber;
|
|
207
|
+
settlementToken: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
208
|
+
settlementAmount: z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>;
|
|
209
|
+
recipientAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
210
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
211
|
+
payerAddress: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
212
|
+
dueDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
213
|
+
maxRuns: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
214
|
+
}, z.core.$strip>;
|
|
215
|
+
export type BuildSettlementRequest = z.infer<typeof buildSettlementRequestSchema>;
|
|
216
|
+
export declare const buildSettlementResponseSchema: z.ZodObject<{
|
|
217
|
+
requestId: z.ZodString;
|
|
218
|
+
subOrgId: z.ZodString;
|
|
219
|
+
walletId: z.ZodString;
|
|
220
|
+
ephemeralWalletAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
221
|
+
completionInstructions: z.ZodArray<z.ZodObject<{
|
|
222
|
+
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
223
|
+
chainId: z.ZodNumber;
|
|
224
|
+
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
225
|
+
maxExecutions: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
226
|
+
action: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
227
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
228
|
+
arguments: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
229
|
+
}, z.core.$strip>>;
|
|
230
|
+
instructions: z.ZodArray<z.ZodObject<{
|
|
231
|
+
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
232
|
+
chainId: z.ZodNumber;
|
|
233
|
+
salt: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
234
|
+
maxExecutions: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
235
|
+
action: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
236
|
+
actionName: z.ZodOptional<z.ZodString>;
|
|
237
|
+
arguments: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
238
|
+
}, z.core.$strip>>;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
export type BuildSettlementResponse = z.infer<typeof buildSettlementResponseSchema>;
|
|
199
241
|
//# sourceMappingURL=payments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../../src/api/schemas/payments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,8BAA8B;;;EAAyB,CAAC;AAErE,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;iBAO1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;EAMrC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;iBAc/B,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;kBAAgC,CAAC;AAC9E,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;iBAM1C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;iBAa3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;iBAK5B,CAAC;
|
|
1
|
+
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../../src/api/schemas/payments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MA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6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC;CAC7B;AAED,eAAO,MAAM,4BAA4B;;;;;;;;;;iBAUvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;iBAOxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PaginatedServiceResponse, ServiceResponse } from "../core";
|
|
2
|
-
import type { GetPaymentRequestsRequest, GetPaymentRequestsResponse, PaymentRequestBuildRequest, PaymentRequestBuildResponse, PaymentRequestDetailsRequest, PaymentRequestDetailsResponse, PaymentRequestNewRequest, PaymentsListRequest } from "../schemas";
|
|
2
|
+
import type { BuildSettlementRequest, BuildSettlementResponse, GetPaymentRequestsRequest, GetPaymentRequestsResponse, PaymentRequestBuildRequest, PaymentRequestBuildResponse, PaymentRequestDetailsRequest, PaymentRequestDetailsResponse, PaymentRequestNewRequest, PaymentsListRequest } from "../schemas";
|
|
3
3
|
import type { Payments } from "@otim/utils/schemas";
|
|
4
4
|
import { BaseService } from "./base";
|
|
5
5
|
export declare class PaymentsService extends BaseService {
|
|
@@ -9,5 +9,6 @@ export declare class PaymentsService extends BaseService {
|
|
|
9
9
|
newPaymentRequest(requestBody: PaymentRequestNewRequest): Promise<ServiceResponse<unknown>>;
|
|
10
10
|
getPaymentRequestDetails(requestBody: PaymentRequestDetailsRequest): Promise<ServiceResponse<PaymentRequestDetailsResponse>>;
|
|
11
11
|
getPaymentRequests(request: GetPaymentRequestsRequest): Promise<PaginatedServiceResponse<GetPaymentRequestsResponse>>;
|
|
12
|
+
buildSettlementOrchestration(requestBody: BuildSettlementRequest): Promise<ServiceResponse<BuildSettlementResponse>>;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=payments.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PaginatedServiceResponse, ServiceResponse } from "../core";
|
|
2
|
-
import type { GetPaymentRequestsRequest, GetPaymentRequestsResponse, PaymentRequestBuildRequest, PaymentRequestBuildResponse, PaymentRequestDetailsRequest, PaymentRequestDetailsResponse, PaymentRequestNewRequest, PaymentsListRequest } from "../schemas";
|
|
2
|
+
import type { BuildSettlementRequest, BuildSettlementResponse, GetPaymentRequestsRequest, GetPaymentRequestsResponse, PaymentRequestBuildRequest, PaymentRequestBuildResponse, PaymentRequestDetailsRequest, PaymentRequestDetailsResponse, PaymentRequestNewRequest, PaymentsListRequest } from "../schemas";
|
|
3
3
|
import type { Payments } from "@otim/utils/schemas";
|
|
4
4
|
import { BaseService } from "./base";
|
|
5
5
|
export declare class PaymentsService extends BaseService {
|
|
@@ -9,5 +9,6 @@ export declare class PaymentsService extends BaseService {
|
|
|
9
9
|
newPaymentRequest(requestBody: PaymentRequestNewRequest): Promise<ServiceResponse<unknown>>;
|
|
10
10
|
getPaymentRequestDetails(requestBody: PaymentRequestDetailsRequest): Promise<ServiceResponse<PaymentRequestDetailsResponse>>;
|
|
11
11
|
getPaymentRequests(request: GetPaymentRequestsRequest): Promise<PaginatedServiceResponse<GetPaymentRequestsResponse>>;
|
|
12
|
+
buildSettlementOrchestration(requestBody: BuildSettlementRequest): Promise<ServiceResponse<BuildSettlementResponse>>;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=payments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../../src/api/services/payments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,SAAS,CAA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wBAAwB,CAAC,0BAA0B,CAAC,CAAC;IAYnD,4BAA4B,CACvC,WAAW,EAAE,sBAAsB,GAClC,OAAO,CAAC,eAAe,CAAC,uBAAuB,CAAC,CAAC;CAQrD"}
|
package/dist/helpers/index.js
CHANGED
|
@@ -1330,13 +1330,15 @@ var formHexStringSchema = () => import_zod6.z.preprocess(
|
|
|
1330
1330
|
(val) => val === void 0 || val === null || val === "" ? DEFAULT_ADDRESS : val,
|
|
1331
1331
|
hexStringSchema
|
|
1332
1332
|
);
|
|
1333
|
+
var isInternalZodError = (error) => {
|
|
1334
|
+
return error.includes("expected string, received") || error.includes("Invalid input") || error.includes("Expected string");
|
|
1335
|
+
};
|
|
1333
1336
|
var getDisplayableZodError = (errors, fieldValue) => {
|
|
1334
|
-
if (!errors || errors.length === 0) return void 0;
|
|
1335
|
-
const stringValue = typeof fieldValue === "string" ? fieldValue : "";
|
|
1336
|
-
if (!stringValue
|
|
1337
|
-
const
|
|
1338
|
-
|
|
1339
|
-
);
|
|
1337
|
+
if (!errors || Array.isArray(errors) && errors.length === 0) return void 0;
|
|
1338
|
+
const stringValue = typeof fieldValue === "string" ? fieldValue.trim() : "";
|
|
1339
|
+
if (!stringValue) return void 0;
|
|
1340
|
+
const errorArray = Array.isArray(errors) ? errors : [errors];
|
|
1341
|
+
const filteredErrors = errorArray.filter((error) => !isInternalZodError(error));
|
|
1340
1342
|
return filteredErrors.length > 0 ? filteredErrors.join(", ") : void 0;
|
|
1341
1343
|
};
|
|
1342
1344
|
//# sourceMappingURL=index.js.map
|