wapi-client 0.12.0-beta.0 → 0.12.0-beta.2
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/ws-client.cjs +1 -1
- package/dist/api/ws-client.js +1 -1
- package/dist/client.cjs +1 -1
- package/dist/client.js +1 -1
- package/dist/db/consts.browser.cjs +8 -1
- package/dist/db/consts.browser.js +8 -1
- package/dist/db/consts.cjs +8 -1
- package/dist/db/consts.d.ts +1 -1
- package/dist/db/consts.js +8 -1
- package/dist/fns/consts.browser.cjs +5 -0
- package/dist/fns/consts.browser.js +5 -0
- package/dist/fns/consts.cjs +6 -0
- package/dist/fns/consts.d.ts +1 -0
- package/dist/fns/consts.js +5 -0
- package/dist/fns/create-deposit/create-deposit.browser.cjs +1 -0
- package/dist/fns/create-deposit/create-deposit.browser.js +2 -0
- package/dist/fns/create-deposit/create-deposit.cjs +1 -0
- package/dist/fns/create-deposit/create-deposit.js +2 -0
- package/dist/fns/create-deposit/create-deposit.schema.zod.browser.cjs +1 -1
- package/dist/fns/create-deposit/create-deposit.schema.zod.browser.js +5 -2
- package/dist/fns/create-deposit/create-deposit.schema.zod.cjs +1 -1
- package/dist/fns/create-deposit/create-deposit.schema.zod.d.ts +6 -6
- package/dist/fns/create-deposit/create-deposit.schema.zod.js +5 -2
- package/dist/fns/create-transfer/create-transfer.browser.cjs +1 -1
- package/dist/fns/create-transfer/create-transfer.browser.js +2 -1
- package/dist/fns/create-transfer/create-transfer.cjs +1 -1
- package/dist/fns/create-transfer/create-transfer.js +2 -1
- package/dist/fns/create-transfer/create-transfer.schema.zod.browser.cjs +1 -1
- package/dist/fns/create-transfer/create-transfer.schema.zod.browser.js +5 -2
- package/dist/fns/create-transfer/create-transfer.schema.zod.cjs +1 -1
- package/dist/fns/create-transfer/create-transfer.schema.zod.d.ts +30 -30
- package/dist/fns/create-transfer/create-transfer.schema.zod.js +5 -2
- package/dist/fns/create-transfer-group/create-transfer-group.schema.zod.d.ts +48 -48
- package/dist/fns/create-transfers/create-transfers.schema.zod.d.ts +15 -15
- package/dist/fns/create-withdrawal/create-withdrawal.browser.cjs +1 -0
- package/dist/fns/create-withdrawal/create-withdrawal.browser.js +2 -0
- package/dist/fns/create-withdrawal/create-withdrawal.cjs +1 -0
- package/dist/fns/create-withdrawal/create-withdrawal.js +2 -0
- package/dist/fns/create-withdrawal/create-withdrawal.schema.zod.browser.cjs +1 -1
- package/dist/fns/create-withdrawal/create-withdrawal.schema.zod.browser.js +5 -2
- package/dist/fns/create-withdrawal/create-withdrawal.schema.zod.cjs +1 -1
- package/dist/fns/create-withdrawal/create-withdrawal.schema.zod.d.ts +6 -6
- package/dist/fns/create-withdrawal/create-withdrawal.schema.zod.js +5 -2
- package/dist/fns/healthcheck/healthcheck.schema.zod.d.ts +3 -0
- package/dist/fns/import-data/import-data.schema.zod.d.ts +186 -186
- package/dist/fns/index.d.ts +93 -93
- package/dist/lib/utils.browser.cjs +7 -0
- package/dist/lib/utils.browser.js +7 -0
- package/dist/lib/utils.cjs +8 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.js +7 -0
- package/dist/txs/consts.browser.cjs +2 -2
- package/dist/txs/consts.browser.js +2 -2
- package/dist/txs/consts.cjs +2 -2
- package/dist/txs/consts.js +2 -2
- package/dist/txs/healthcheck/healthcheck.schema.zod.browser.cjs +2 -1
- package/dist/txs/healthcheck/healthcheck.schema.zod.browser.js +2 -1
- package/dist/txs/healthcheck/healthcheck.schema.zod.cjs +2 -1
- package/dist/txs/healthcheck/healthcheck.schema.zod.d.ts +3 -0
- package/dist/txs/healthcheck/healthcheck.schema.zod.js +2 -1
- package/dist/txs/index.d.ts +1 -1
- package/dist/txs/reset-database/reset-database.schema.zod.d.ts +2 -2
- package/dist/types/index.d.ts +396 -388
- package/dist/wapi-client-web.iife.js +1 -1
- package/dist/wapi-client.iife.js +1 -1
- package/package.json +1 -1
package/dist/api/ws-client.cjs
CHANGED
|
@@ -76,7 +76,7 @@ var import_base_client = require('./base-client.cjs');
|
|
|
76
76
|
var import_connection = require('./connection/connection.enums.cjs');
|
|
77
77
|
var import__ = require('../index.cjs');
|
|
78
78
|
var _a;
|
|
79
|
-
var CLIENT_VERSION = (_a = '0.12.0-beta.
|
|
79
|
+
var CLIENT_VERSION = (_a = '0.12.0-beta.2') != null ? _a : "";
|
|
80
80
|
function createWsClient(opts, config) {
|
|
81
81
|
const initialConnection = createConnection(opts, {
|
|
82
82
|
timeout: config == null ? void 0 : config.connectingTimeout
|
package/dist/api/ws-client.js
CHANGED
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
} from "./connection/connection.enums";
|
|
49
49
|
import { WapiClientType } from "../index";
|
|
50
50
|
var _a;
|
|
51
|
-
var CLIENT_VERSION = (_a = '0.12.0-beta.
|
|
51
|
+
var CLIENT_VERSION = (_a = '0.12.0-beta.2') != null ? _a : "";
|
|
52
52
|
function createWsClient(opts, config) {
|
|
53
53
|
const initialConnection = createConnection(opts, {
|
|
54
54
|
timeout: config == null ? void 0 : config.connectingTimeout
|
package/dist/client.cjs
CHANGED
|
@@ -63,7 +63,7 @@ var import_api = require('./api/index.cjs');
|
|
|
63
63
|
var import_errors = require('./lib/errors.cjs');
|
|
64
64
|
var import_fns = require('./fns/index.cjs');
|
|
65
65
|
var _a;
|
|
66
|
-
var CLIENT_VERSION = (_a = '0.12.0-beta.
|
|
66
|
+
var CLIENT_VERSION = (_a = '0.12.0-beta.2') != null ? _a : "";
|
|
67
67
|
var Client = class {
|
|
68
68
|
/**
|
|
69
69
|
* @internal
|
package/dist/client.js
CHANGED
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
import { ConfigError } from "./lib/errors";
|
|
45
45
|
import { ClientFunctions } from "./fns";
|
|
46
46
|
var _a;
|
|
47
|
-
var CLIENT_VERSION = (_a = '0.12.0-beta.
|
|
47
|
+
var CLIENT_VERSION = (_a = '0.12.0-beta.2') != null ? _a : "";
|
|
48
48
|
var Client = class {
|
|
49
49
|
/**
|
|
50
50
|
* @internal
|
|
@@ -4077,7 +4077,14 @@ var MetadataSchema = z.record(
|
|
|
4077
4077
|
z.boolean(),
|
|
4078
4078
|
z.number(),
|
|
4079
4079
|
z.null(),
|
|
4080
|
-
z.lazy(() => MetadataSchema)
|
|
4080
|
+
z.lazy(() => MetadataSchema),
|
|
4081
|
+
z.union([
|
|
4082
|
+
z.string(),
|
|
4083
|
+
z.boolean(),
|
|
4084
|
+
z.number(),
|
|
4085
|
+
z.null(),
|
|
4086
|
+
z.lazy(() => MetadataSchema)
|
|
4087
|
+
]).array()
|
|
4081
4088
|
])
|
|
4082
4089
|
).nullable().describe("Custom key/value object");
|
|
4083
4090
|
var DatetimeSchema = z.union([
|
|
@@ -4005,7 +4005,14 @@ var MetadataSchema = z.record(
|
|
|
4005
4005
|
z.boolean(),
|
|
4006
4006
|
z.number(),
|
|
4007
4007
|
z.null(),
|
|
4008
|
-
z.lazy(() => MetadataSchema)
|
|
4008
|
+
z.lazy(() => MetadataSchema),
|
|
4009
|
+
z.union([
|
|
4010
|
+
z.string(),
|
|
4011
|
+
z.boolean(),
|
|
4012
|
+
z.number(),
|
|
4013
|
+
z.null(),
|
|
4014
|
+
z.lazy(() => MetadataSchema)
|
|
4015
|
+
]).array()
|
|
4009
4016
|
])
|
|
4010
4017
|
).nullable().describe("Custom key/value object");
|
|
4011
4018
|
var DatetimeSchema = z.union([
|
package/dist/db/consts.cjs
CHANGED
|
@@ -107,7 +107,14 @@ var MetadataSchema = import_zod.default.record(
|
|
|
107
107
|
import_zod.default.boolean(),
|
|
108
108
|
import_zod.default.number(),
|
|
109
109
|
import_zod.default.null(),
|
|
110
|
-
import_zod.default.lazy(() => MetadataSchema)
|
|
110
|
+
import_zod.default.lazy(() => MetadataSchema),
|
|
111
|
+
import_zod.default.union([
|
|
112
|
+
import_zod.default.string(),
|
|
113
|
+
import_zod.default.boolean(),
|
|
114
|
+
import_zod.default.number(),
|
|
115
|
+
import_zod.default.null(),
|
|
116
|
+
import_zod.default.lazy(() => MetadataSchema)
|
|
117
|
+
]).array()
|
|
111
118
|
])
|
|
112
119
|
).nullable().describe("Custom key/value object");
|
|
113
120
|
var DatetimeSchema = import_zod.default.union([
|
package/dist/db/consts.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
export type Metadata = {
|
|
3
|
-
[key: string]: string | boolean | number | null | Metadata;
|
|
3
|
+
[key: string]: string | boolean | number | null | Metadata | (string | boolean | number | null | Metadata)[];
|
|
4
4
|
} | null;
|
|
5
5
|
export declare const MetadataSchema: z.ZodType<Metadata>;
|
|
6
6
|
export declare const DatetimeSchema: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>;
|
package/dist/db/consts.js
CHANGED
|
@@ -25,7 +25,14 @@ var MetadataSchema = z.record(
|
|
|
25
25
|
z.boolean(),
|
|
26
26
|
z.number(),
|
|
27
27
|
z.null(),
|
|
28
|
-
z.lazy(() => MetadataSchema)
|
|
28
|
+
z.lazy(() => MetadataSchema),
|
|
29
|
+
z.union([
|
|
30
|
+
z.string(),
|
|
31
|
+
z.boolean(),
|
|
32
|
+
z.number(),
|
|
33
|
+
z.null(),
|
|
34
|
+
z.lazy(() => MetadataSchema)
|
|
35
|
+
]).array()
|
|
29
36
|
])
|
|
30
37
|
).nullable().describe("Custom key/value object");
|
|
31
38
|
var DatetimeSchema = z.union([
|
|
@@ -58,6 +58,7 @@ var consts_exports = {};
|
|
|
58
58
|
__export(consts_exports, {
|
|
59
59
|
allowedStringIntSchema: () => allowedStringIntSchema,
|
|
60
60
|
allowedStringNumberSchema: () => allowedStringNumberSchema,
|
|
61
|
+
allowedStringPositiveNumericSchema: () => allowedStringPositiveNumericSchema,
|
|
61
62
|
iFnFindOptionsExtraSchema: () => iFnFindOptionsExtraSchema,
|
|
62
63
|
iFnFindOptionsSchema: () => iFnFindOptionsSchema
|
|
63
64
|
});
|
|
@@ -4026,5 +4027,9 @@ var iFnFindOptionsExtraSchema = z.object({
|
|
|
4026
4027
|
order_by: z.string().describe("Ordering options in string format")
|
|
4027
4028
|
}).describe("extra find options for client functions");
|
|
4028
4029
|
var iFnFindOptionsSchema = import_consts2.iTxLimitingOptions.merge(import_consts.iTxOrderingOptions).merge(iFnFindOptionsExtraSchema).describe("extended find options for client functions");
|
|
4030
|
+
var allowedStringPositiveNumericSchema = z.union([
|
|
4031
|
+
z.number().positive(),
|
|
4032
|
+
z.string().regex(/^((0\.\d+)|([1-9]\d*(\.\d+){0,1}))$/, "invalid number")
|
|
4033
|
+
]);
|
|
4029
4034
|
var allowedStringIntSchema = z.union([z.string(), z.number().int()]);
|
|
4030
4035
|
var allowedStringNumberSchema = z.union([z.string(), z.number()]);
|
|
@@ -4003,11 +4003,16 @@ var iFnFindOptionsExtraSchema = z.object({
|
|
|
4003
4003
|
order_by: z.string().describe("Ordering options in string format")
|
|
4004
4004
|
}).describe("extra find options for client functions");
|
|
4005
4005
|
var iFnFindOptionsSchema = iTxLimitingOptions.merge(iTxOrderingOptions).merge(iFnFindOptionsExtraSchema).describe("extended find options for client functions");
|
|
4006
|
+
var allowedStringPositiveNumericSchema = z.union([
|
|
4007
|
+
z.number().positive(),
|
|
4008
|
+
z.string().regex(/^((0\.\d+)|([1-9]\d*(\.\d+){0,1}))$/, "invalid number")
|
|
4009
|
+
]);
|
|
4006
4010
|
var allowedStringIntSchema = z.union([z.string(), z.number().int()]);
|
|
4007
4011
|
var allowedStringNumberSchema = z.union([z.string(), z.number()]);
|
|
4008
4012
|
export {
|
|
4009
4013
|
allowedStringIntSchema,
|
|
4010
4014
|
allowedStringNumberSchema,
|
|
4015
|
+
allowedStringPositiveNumericSchema,
|
|
4011
4016
|
iFnFindOptionsExtraSchema,
|
|
4012
4017
|
iFnFindOptionsSchema
|
|
4013
4018
|
};
|
package/dist/fns/consts.cjs
CHANGED
|
@@ -31,6 +31,7 @@ var consts_exports = {};
|
|
|
31
31
|
__export(consts_exports, {
|
|
32
32
|
allowedStringIntSchema: () => allowedStringIntSchema,
|
|
33
33
|
allowedStringNumberSchema: () => allowedStringNumberSchema,
|
|
34
|
+
allowedStringPositiveNumericSchema: () => allowedStringPositiveNumericSchema,
|
|
34
35
|
iFnFindOptionsExtraSchema: () => iFnFindOptionsExtraSchema,
|
|
35
36
|
iFnFindOptionsSchema: () => iFnFindOptionsSchema
|
|
36
37
|
});
|
|
@@ -42,12 +43,17 @@ var iFnFindOptionsExtraSchema = import_zod.default.object({
|
|
|
42
43
|
order_by: import_zod.default.string().describe("Ordering options in string format")
|
|
43
44
|
}).describe("extra find options for client functions");
|
|
44
45
|
var iFnFindOptionsSchema = import_consts2.iTxLimitingOptions.merge(import_consts.iTxOrderingOptions).merge(iFnFindOptionsExtraSchema).describe("extended find options for client functions");
|
|
46
|
+
var allowedStringPositiveNumericSchema = import_zod.default.union([
|
|
47
|
+
import_zod.default.number().positive(),
|
|
48
|
+
import_zod.default.string().regex(/^((0\.\d+)|([1-9]\d*(\.\d+){0,1}))$/, "invalid number")
|
|
49
|
+
]);
|
|
45
50
|
var allowedStringIntSchema = import_zod.default.union([import_zod.default.string(), import_zod.default.number().int()]);
|
|
46
51
|
var allowedStringNumberSchema = import_zod.default.union([import_zod.default.string(), import_zod.default.number()]);
|
|
47
52
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
53
|
0 && (module.exports = {
|
|
49
54
|
allowedStringIntSchema,
|
|
50
55
|
allowedStringNumberSchema,
|
|
56
|
+
allowedStringPositiveNumericSchema,
|
|
51
57
|
iFnFindOptionsExtraSchema,
|
|
52
58
|
iFnFindOptionsSchema
|
|
53
59
|
});
|
package/dist/fns/consts.d.ts
CHANGED
|
@@ -44,5 +44,6 @@ export declare const iFnFindOptionsSchema: z.ZodObject<z.objectUtil.extendShape<
|
|
|
44
44
|
offset?: number | undefined;
|
|
45
45
|
limit?: number | undefined;
|
|
46
46
|
}>;
|
|
47
|
+
export declare const allowedStringPositiveNumericSchema: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
47
48
|
export declare const allowedStringIntSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
48
49
|
export declare const allowedStringNumberSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
package/dist/fns/consts.js
CHANGED
|
@@ -6,11 +6,16 @@ var iFnFindOptionsExtraSchema = z.object({
|
|
|
6
6
|
order_by: z.string().describe("Ordering options in string format")
|
|
7
7
|
}).describe("extra find options for client functions");
|
|
8
8
|
var iFnFindOptionsSchema = iTxLimitingOptions.merge(iTxOrderingOptions).merge(iFnFindOptionsExtraSchema).describe("extended find options for client functions");
|
|
9
|
+
var allowedStringPositiveNumericSchema = z.union([
|
|
10
|
+
z.number().positive(),
|
|
11
|
+
z.string().regex(/^((0\.\d+)|([1-9]\d*(\.\d+){0,1}))$/, "invalid number")
|
|
12
|
+
]);
|
|
9
13
|
var allowedStringIntSchema = z.union([z.string(), z.number().int()]);
|
|
10
14
|
var allowedStringNumberSchema = z.union([z.string(), z.number()]);
|
|
11
15
|
export {
|
|
12
16
|
allowedStringIntSchema,
|
|
13
17
|
allowedStringNumberSchema,
|
|
18
|
+
allowedStringPositiveNumericSchema,
|
|
14
19
|
iFnFindOptionsExtraSchema,
|
|
15
20
|
iFnFindOptionsSchema
|
|
16
21
|
};
|
|
@@ -82,6 +82,7 @@ function createDeposit(options, input, fnOptions) {
|
|
|
82
82
|
"options"
|
|
83
83
|
]);
|
|
84
84
|
const deposit = __spreadValues(__spreadProps(__spreadValues({}, partialDeposit), {
|
|
85
|
+
amount: (0, import_utils.convertToNumber)(partialDeposit.amount),
|
|
85
86
|
transfer_group: (0, import_utils.getIdentifierFilter)(inputCopy.transfer_group),
|
|
86
87
|
token: (0, import_utils.getForeign)(token),
|
|
87
88
|
to_wallet: (0, import_utils.getForeign)(wallet),
|
|
@@ -33,6 +33,7 @@ var __objRest = (source, exclude) => {
|
|
|
33
33
|
// src/fns/create-deposit/create-deposit.ts
|
|
34
34
|
import {
|
|
35
35
|
checkCopyObject,
|
|
36
|
+
convertToNumber,
|
|
36
37
|
getForeign,
|
|
37
38
|
getIdentifierFilter,
|
|
38
39
|
getTxIdSync,
|
|
@@ -67,6 +68,7 @@ function createDeposit(options, input, fnOptions) {
|
|
|
67
68
|
"options"
|
|
68
69
|
]);
|
|
69
70
|
const deposit = __spreadValues(__spreadProps(__spreadValues({}, partialDeposit), {
|
|
71
|
+
amount: convertToNumber(partialDeposit.amount),
|
|
70
72
|
transfer_group: getIdentifierFilter(inputCopy.transfer_group),
|
|
71
73
|
token: getForeign(token),
|
|
72
74
|
to_wallet: getForeign(wallet),
|
|
@@ -82,6 +82,7 @@ function createDeposit(options, input, fnOptions) {
|
|
|
82
82
|
"options"
|
|
83
83
|
]);
|
|
84
84
|
const deposit = __spreadValues(__spreadProps(__spreadValues({}, partialDeposit), {
|
|
85
|
+
amount: (0, import_utils.convertToNumber)(partialDeposit.amount),
|
|
85
86
|
transfer_group: (0, import_utils.getIdentifierFilter)(inputCopy.transfer_group),
|
|
86
87
|
token: (0, import_utils.getForeign)(token),
|
|
87
88
|
to_wallet: (0, import_utils.getForeign)(wallet),
|
|
@@ -33,6 +33,7 @@ var __objRest = (source, exclude) => {
|
|
|
33
33
|
// src/fns/create-deposit/create-deposit.ts
|
|
34
34
|
import {
|
|
35
35
|
checkCopyObject,
|
|
36
|
+
convertToNumber,
|
|
36
37
|
getForeign,
|
|
37
38
|
getIdentifierFilter,
|
|
38
39
|
getTxIdSync,
|
|
@@ -67,6 +68,7 @@ function createDeposit(options, input, fnOptions) {
|
|
|
67
68
|
"options"
|
|
68
69
|
]);
|
|
69
70
|
const deposit = __spreadValues(__spreadProps(__spreadValues({}, partialDeposit), {
|
|
71
|
+
amount: convertToNumber(partialDeposit.amount),
|
|
70
72
|
transfer_group: getIdentifierFilter(inputCopy.transfer_group),
|
|
71
73
|
token: getForeign(token),
|
|
72
74
|
to_wallet: getForeign(wallet),
|
|
@@ -4035,7 +4035,7 @@ var createDepositInputSchema = z.object({
|
|
|
4035
4035
|
identifier: import_transfer_schema.transferTableSchema.shape.identifier,
|
|
4036
4036
|
token: import_consts2.allowedStringIntSchema.describe("Id of the token to deposit as"),
|
|
4037
4037
|
wallet: import_consts2.allowedStringIntSchema.describe("Id of the wallet to deposit to"),
|
|
4038
|
-
amount:
|
|
4038
|
+
amount: import_consts2.allowedStringPositiveNumericSchema.describe("amount to deposit"),
|
|
4039
4039
|
metadata: import_transfer_schema.transferTableSchema.shape.metadata,
|
|
4040
4040
|
status: import_transfer_schema.transferTableStatusInputSchema,
|
|
4041
4041
|
transfer_group: import_consts2.allowedStringIntSchema.describe(
|
|
@@ -4001,7 +4001,10 @@ import {
|
|
|
4001
4001
|
} from "../../db/transfer/transfer.schema.zod.browser.js";
|
|
4002
4002
|
import { iTxGeneralOptions } from "../../txs/consts.browser.js";
|
|
4003
4003
|
import { createDepositTxOutputSchema } from "../../txs/create-deposit/create-deposit.schema.zod.browser.js";
|
|
4004
|
-
import {
|
|
4004
|
+
import {
|
|
4005
|
+
allowedStringIntSchema,
|
|
4006
|
+
allowedStringPositiveNumericSchema
|
|
4007
|
+
} from "../consts.browser.js";
|
|
4005
4008
|
var createDepositFnOptionsSchema = iTxGeneralOptions.extend({
|
|
4006
4009
|
return_balance: z.boolean().describe("return balance after deposit"),
|
|
4007
4010
|
create_wallet_if_not_exists: z.boolean().describe(
|
|
@@ -4012,7 +4015,7 @@ var createDepositInputSchema = z.object({
|
|
|
4012
4015
|
identifier: transferTableSchema.shape.identifier,
|
|
4013
4016
|
token: allowedStringIntSchema.describe("Id of the token to deposit as"),
|
|
4014
4017
|
wallet: allowedStringIntSchema.describe("Id of the wallet to deposit to"),
|
|
4015
|
-
amount:
|
|
4018
|
+
amount: allowedStringPositiveNumericSchema.describe("amount to deposit"),
|
|
4016
4019
|
metadata: transferTableSchema.shape.metadata,
|
|
4017
4020
|
status: transferTableStatusInputSchema,
|
|
4018
4021
|
transfer_group: allowedStringIntSchema.describe(
|
|
@@ -41,7 +41,7 @@ var createDepositInputSchema = import_zod.z.object({
|
|
|
41
41
|
identifier: import_transfer_schema.transferTableSchema.shape.identifier,
|
|
42
42
|
token: import_consts2.allowedStringIntSchema.describe("Id of the token to deposit as"),
|
|
43
43
|
wallet: import_consts2.allowedStringIntSchema.describe("Id of the wallet to deposit to"),
|
|
44
|
-
amount:
|
|
44
|
+
amount: import_consts2.allowedStringPositiveNumericSchema.describe("amount to deposit"),
|
|
45
45
|
metadata: import_transfer_schema.transferTableSchema.shape.metadata,
|
|
46
46
|
status: import_transfer_schema.transferTableStatusInputSchema,
|
|
47
47
|
transfer_group: import_consts2.allowedStringIntSchema.describe(
|
|
@@ -21,11 +21,11 @@ export declare const createDepositInputSchema: z.ZodObject<{
|
|
|
21
21
|
metadata: z.ZodOptional<z.ZodOptional<z.ZodType<import("../../db/consts").Metadata, z.ZodTypeDef, import("../../db/consts").Metadata>>>;
|
|
22
22
|
token: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
23
23
|
created_at: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>>;
|
|
24
|
-
amount: z.ZodNumber
|
|
24
|
+
amount: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
25
25
|
wallet: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
26
26
|
transfer_group: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
27
27
|
}, "strip", z.ZodTypeAny, {
|
|
28
|
-
amount: number;
|
|
28
|
+
amount: string | number;
|
|
29
29
|
wallet: string | number;
|
|
30
30
|
status?: "pending" | "finished" | undefined;
|
|
31
31
|
identifier?: string | undefined;
|
|
@@ -34,7 +34,7 @@ export declare const createDepositInputSchema: z.ZodObject<{
|
|
|
34
34
|
created_at?: string | undefined;
|
|
35
35
|
transfer_group?: string | number | undefined;
|
|
36
36
|
}, {
|
|
37
|
-
amount: number;
|
|
37
|
+
amount: string | number;
|
|
38
38
|
wallet: string | number;
|
|
39
39
|
status?: "pending" | "finished" | undefined;
|
|
40
40
|
identifier?: string | undefined;
|
|
@@ -49,7 +49,7 @@ export declare const createDepositFnInputSchema: z.ZodObject<z.objectUtil.extend
|
|
|
49
49
|
metadata: z.ZodOptional<z.ZodOptional<z.ZodType<import("../../db/consts").Metadata, z.ZodTypeDef, import("../../db/consts").Metadata>>>;
|
|
50
50
|
token: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
51
51
|
created_at: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodString]>>;
|
|
52
|
-
amount: z.ZodNumber
|
|
52
|
+
amount: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
53
53
|
wallet: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
54
54
|
transfer_group: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
55
55
|
}, {
|
|
@@ -70,7 +70,7 @@ export declare const createDepositFnInputSchema: z.ZodObject<z.objectUtil.extend
|
|
|
70
70
|
return_balance?: boolean | undefined;
|
|
71
71
|
}>>;
|
|
72
72
|
}>, "strict", z.ZodTypeAny, {
|
|
73
|
-
amount: number;
|
|
73
|
+
amount: string | number;
|
|
74
74
|
wallet: string | number;
|
|
75
75
|
options?: {
|
|
76
76
|
tracking_id?: string | undefined;
|
|
@@ -85,7 +85,7 @@ export declare const createDepositFnInputSchema: z.ZodObject<z.objectUtil.extend
|
|
|
85
85
|
created_at?: string | undefined;
|
|
86
86
|
transfer_group?: string | number | undefined;
|
|
87
87
|
}, {
|
|
88
|
-
amount: number;
|
|
88
|
+
amount: string | number;
|
|
89
89
|
wallet: string | number;
|
|
90
90
|
options?: {
|
|
91
91
|
tracking_id?: string | undefined;
|
|
@@ -6,7 +6,10 @@ import {
|
|
|
6
6
|
} from "../../db/transfer/transfer.schema.zod";
|
|
7
7
|
import { iTxGeneralOptions } from "../../txs/consts";
|
|
8
8
|
import { createDepositTxOutputSchema } from "../../txs/create-deposit/create-deposit.schema.zod";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
allowedStringIntSchema,
|
|
11
|
+
allowedStringPositiveNumericSchema
|
|
12
|
+
} from "../consts";
|
|
10
13
|
var createDepositFnOptionsSchema = iTxGeneralOptions.extend({
|
|
11
14
|
return_balance: z.boolean().describe("return balance after deposit"),
|
|
12
15
|
create_wallet_if_not_exists: z.boolean().describe(
|
|
@@ -17,7 +20,7 @@ var createDepositInputSchema = z.object({
|
|
|
17
20
|
identifier: transferTableSchema.shape.identifier,
|
|
18
21
|
token: allowedStringIntSchema.describe("Id of the token to deposit as"),
|
|
19
22
|
wallet: allowedStringIntSchema.describe("Id of the wallet to deposit to"),
|
|
20
|
-
amount:
|
|
23
|
+
amount: allowedStringPositiveNumericSchema.describe("amount to deposit"),
|
|
21
24
|
metadata: transferTableSchema.shape.metadata,
|
|
22
25
|
status: transferTableStatusInputSchema,
|
|
23
26
|
transfer_group: allowedStringIntSchema.describe(
|
|
@@ -75,7 +75,7 @@ function transferFnInputToTransferData(input, token) {
|
|
|
75
75
|
const transfer = {
|
|
76
76
|
identifier: input.identifier,
|
|
77
77
|
token: (0, import_utils.getForeign)(input.token || token),
|
|
78
|
-
amount: input.amount,
|
|
78
|
+
amount: (0, import_utils.convertToNumber)(input.amount),
|
|
79
79
|
metadata: input.metadata,
|
|
80
80
|
status: input.status,
|
|
81
81
|
type: input.type,
|
|
@@ -21,6 +21,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
21
21
|
// src/fns/create-transfer/create-transfer.ts
|
|
22
22
|
import {
|
|
23
23
|
checkCopyObject,
|
|
24
|
+
convertToNumber,
|
|
24
25
|
getForeign,
|
|
25
26
|
getIdentifierFilter,
|
|
26
27
|
getTxIdSync
|
|
@@ -58,7 +59,7 @@ function transferFnInputToTransferData(input, token) {
|
|
|
58
59
|
const transfer = {
|
|
59
60
|
identifier: input.identifier,
|
|
60
61
|
token: getForeign(input.token || token),
|
|
61
|
-
amount: input.amount,
|
|
62
|
+
amount: convertToNumber(input.amount),
|
|
62
63
|
metadata: input.metadata,
|
|
63
64
|
status: input.status,
|
|
64
65
|
type: input.type,
|
|
@@ -75,7 +75,7 @@ function transferFnInputToTransferData(input, token) {
|
|
|
75
75
|
const transfer = {
|
|
76
76
|
identifier: input.identifier,
|
|
77
77
|
token: (0, import_utils.getForeign)(input.token || token),
|
|
78
|
-
amount: input.amount,
|
|
78
|
+
amount: (0, import_utils.convertToNumber)(input.amount),
|
|
79
79
|
metadata: input.metadata,
|
|
80
80
|
status: input.status,
|
|
81
81
|
type: input.type,
|
|
@@ -21,6 +21,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
21
21
|
// src/fns/create-transfer/create-transfer.ts
|
|
22
22
|
import {
|
|
23
23
|
checkCopyObject,
|
|
24
|
+
convertToNumber,
|
|
24
25
|
getForeign,
|
|
25
26
|
getIdentifierFilter,
|
|
26
27
|
getTxIdSync
|
|
@@ -58,7 +59,7 @@ function transferFnInputToTransferData(input, token) {
|
|
|
58
59
|
const transfer = {
|
|
59
60
|
identifier: input.identifier,
|
|
60
61
|
token: getForeign(input.token || token),
|
|
61
|
-
amount: input.amount,
|
|
62
|
+
amount: convertToNumber(input.amount),
|
|
62
63
|
metadata: input.metadata,
|
|
63
64
|
status: input.status,
|
|
64
65
|
type: input.type,
|
|
@@ -4039,7 +4039,7 @@ var createTransferBaseInputSchema = z.object({
|
|
|
4039
4039
|
"Foreign of the wallet to deposit to"
|
|
4040
4040
|
),
|
|
4041
4041
|
latest_control_hash: import_transfer_schema.transferTableSchema.shape.control_hash,
|
|
4042
|
-
amount:
|
|
4042
|
+
amount: import_consts.allowedStringPositiveNumericSchema.describe("amount to withdraw"),
|
|
4043
4043
|
metadata: import_transfer_schema.transferTableSchema.shape.metadata,
|
|
4044
4044
|
status: import_transfer_schema.transferTableStatusInputSchema.describe("status of the transfer"),
|
|
4045
4045
|
transfer_group: import_consts.allowedStringIntSchema.describe(
|
|
@@ -4003,7 +4003,10 @@ import {
|
|
|
4003
4003
|
createTransferTxInputOptionsSchema,
|
|
4004
4004
|
createTransferTxOutputSchema
|
|
4005
4005
|
} from "../../txs/create-transfer/create-transfer.schema.zod.browser.js";
|
|
4006
|
-
import {
|
|
4006
|
+
import {
|
|
4007
|
+
allowedStringIntSchema,
|
|
4008
|
+
allowedStringPositiveNumericSchema
|
|
4009
|
+
} from "../consts.browser.js";
|
|
4007
4010
|
var createTransferFnOptionsSchema = createTransferTxInputOptionsSchema.describe("Optional flags for input");
|
|
4008
4011
|
var createTransferBaseInputSchema = z.object({
|
|
4009
4012
|
identifier: transferTableSchema.shape.identifier,
|
|
@@ -4015,7 +4018,7 @@ var createTransferBaseInputSchema = z.object({
|
|
|
4015
4018
|
"Foreign of the wallet to deposit to"
|
|
4016
4019
|
),
|
|
4017
4020
|
latest_control_hash: transferTableSchema.shape.control_hash,
|
|
4018
|
-
amount:
|
|
4021
|
+
amount: allowedStringPositiveNumericSchema.describe("amount to withdraw"),
|
|
4019
4022
|
metadata: transferTableSchema.shape.metadata,
|
|
4020
4023
|
status: transferTableStatusInputSchema.describe("status of the transfer"),
|
|
4021
4024
|
transfer_group: allowedStringIntSchema.describe(
|
|
@@ -45,7 +45,7 @@ var createTransferBaseInputSchema = import_zod.z.object({
|
|
|
45
45
|
"Foreign of the wallet to deposit to"
|
|
46
46
|
),
|
|
47
47
|
latest_control_hash: import_transfer_schema.transferTableSchema.shape.control_hash,
|
|
48
|
-
amount:
|
|
48
|
+
amount: import_consts.allowedStringPositiveNumericSchema.describe("amount to withdraw"),
|
|
49
49
|
metadata: import_transfer_schema.transferTableSchema.shape.metadata,
|
|
50
50
|
status: import_transfer_schema.transferTableStatusInputSchema.describe("status of the transfer"),
|
|
51
51
|
transfer_group: import_consts.allowedStringIntSchema.describe(
|