wapi-client 0.8.13 → 0.9.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/api/base-client.browser.cjs +21 -14
- package/dist/api/base-client.browser.js +22 -20
- package/dist/api/base-client.cjs +21 -14
- package/dist/api/base-client.d.ts +8 -0
- package/dist/api/base-client.js +22 -20
- package/dist/api/jsonrpc/jsonrpc.enums.d.ts +5 -4
- package/dist/api/ws-client.browser.cjs +3 -11
- package/dist/api/ws-client.browser.js +4 -16
- package/dist/api/ws-client.cjs +4 -12
- package/dist/api/ws-client.js +5 -17
- package/dist/client.browser.cjs +29 -5
- package/dist/client.browser.js +30 -6
- package/dist/client.cjs +30 -6
- package/dist/client.d.ts +26 -0
- package/dist/client.js +31 -7
- package/dist/fns/create-deposit/create-deposit.browser.cjs +1 -4
- package/dist/fns/create-deposit/create-deposit.browser.js +2 -5
- package/dist/fns/create-deposit/create-deposit.cjs +1 -4
- package/dist/fns/create-deposit/create-deposit.js +2 -5
- package/dist/fns/create-withdrawal/create-withdrawal.browser.cjs +1 -4
- package/dist/fns/create-withdrawal/create-withdrawal.browser.js +2 -5
- package/dist/fns/create-withdrawal/create-withdrawal.cjs +1 -4
- package/dist/fns/create-withdrawal/create-withdrawal.js +2 -5
- package/dist/fns/find-transfers/find-transfers.browser.cjs +8 -20
- package/dist/fns/find-transfers/find-transfers.browser.js +9 -21
- package/dist/fns/find-transfers/find-transfers.cjs +8 -20
- package/dist/fns/find-transfers/find-transfers.js +9 -21
- package/dist/fns/get-balance/get-balance.browser.cjs +2 -8
- package/dist/fns/get-balance/get-balance.browser.js +3 -9
- package/dist/fns/get-balance/get-balance.cjs +2 -8
- package/dist/fns/get-balance/get-balance.js +3 -9
- package/dist/fns/get-balance-history/get-balance-history.browser.cjs +1 -4
- package/dist/fns/get-balance-history/get-balance-history.browser.js +2 -5
- package/dist/fns/get-balance-history/get-balance-history.cjs +1 -4
- package/dist/fns/get-balance-history/get-balance-history.js +2 -5
- package/dist/fns/get-token/get-token.browser.cjs +1 -4
- package/dist/fns/get-token/get-token.browser.js +2 -5
- package/dist/fns/get-token/get-token.cjs +1 -4
- package/dist/fns/get-token/get-token.js +2 -5
- package/dist/fns/healthcheck/healthcheck.browser.cjs +56 -0
- package/dist/fns/healthcheck/healthcheck.browser.js +38 -0
- package/dist/fns/healthcheck/healthcheck.cjs +60 -0
- package/dist/fns/healthcheck/healthcheck.d.ts +9 -0
- package/dist/fns/healthcheck/healthcheck.enums.browser.cjs +17 -0
- package/dist/fns/healthcheck/healthcheck.enums.browser.js +0 -0
- package/dist/fns/healthcheck/healthcheck.enums.cjs +17 -0
- package/dist/fns/healthcheck/healthcheck.enums.d.ts +20 -0
- package/dist/fns/healthcheck/healthcheck.enums.js +0 -0
- package/dist/fns/healthcheck/healthcheck.guards.browser.cjs +36 -0
- package/dist/fns/healthcheck/healthcheck.guards.browser.js +16 -0
- package/dist/fns/healthcheck/healthcheck.guards.cjs +41 -0
- package/dist/fns/healthcheck/healthcheck.guards.d.ts +4 -0
- package/dist/fns/healthcheck/healthcheck.guards.js +16 -0
- package/dist/fns/healthcheck/healthcheck.js +38 -0
- package/dist/fns/healthcheck/healthcheck.schema.input.json +25 -0
- package/dist/fns/healthcheck/healthcheck.schema.output.json +8 -0
- package/dist/fns/import-data/import-data.cjs +2 -5
- package/dist/fns/import-data/import-data.js +3 -6
- package/dist/fns/import-data/import-data.node.browser.cjs +2 -5
- package/dist/fns/import-data/import-data.node.browser.js +3 -6
- package/dist/fns/import-data/import-data.node.cjs +2 -5
- package/dist/fns/import-data/import-data.node.js +3 -6
- package/dist/fns/index.browser.cjs +9 -0
- package/dist/fns/index.browser.js +9 -0
- package/dist/fns/index.cjs +12 -0
- package/dist/fns/index.d.ts +7 -1
- package/dist/fns/index.js +9 -0
- package/dist/fns/set-flags/set-flags.browser.cjs +3 -3
- package/dist/fns/set-flags/set-flags.browser.js +3 -3
- package/dist/fns/set-flags/set-flags.cjs +3 -3
- package/dist/fns/set-flags/set-flags.js +3 -3
- package/dist/index.browser.cjs +13 -1
- package/dist/index.browser.js +25 -1
- package/dist/index.cjs +25 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +25 -1
- package/dist/lib/errors.browser.cjs +642 -214
- package/dist/lib/errors.browser.js +645 -214
- package/dist/lib/errors.cjs +652 -218
- package/dist/lib/errors.d.ts +1411 -342
- package/dist/lib/errors.js +645 -214
- package/dist/lib/query-builder.browser.cjs +2 -2
- package/dist/lib/query-builder.browser.js +2 -2
- package/dist/lib/query-builder.cjs +2 -2
- package/dist/lib/query-builder.js +2 -2
- package/dist/lib/stream-promise.browser.cjs +3 -4
- package/dist/lib/stream-promise.browser.js +4 -5
- package/dist/lib/stream-promise.cjs +3 -4
- package/dist/lib/stream-promise.js +4 -5
- package/dist/lib/utils.browser.cjs +9 -13
- package/dist/lib/utils.browser.js +9 -13
- package/dist/lib/utils.cjs +9 -13
- package/dist/lib/utils.js +9 -13
- package/dist/lib/validator.browser.cjs +46 -4
- package/dist/lib/validator.browser.js +46 -4
- package/dist/lib/validator.cjs +46 -4
- package/dist/lib/validator.d.ts +5 -1
- package/dist/lib/validator.js +46 -4
- package/dist/txs/healthcheck/healthcheck.enums.browser.cjs +17 -0
- package/dist/txs/healthcheck/healthcheck.enums.browser.js +0 -0
- package/dist/txs/healthcheck/healthcheck.enums.cjs +17 -0
- package/dist/txs/healthcheck/healthcheck.enums.d.ts +22 -0
- package/dist/txs/healthcheck/healthcheck.enums.js +0 -0
- package/dist/txs/healthcheck/healthcheck.schema.input.json +23 -0
- package/dist/txs/healthcheck/healthcheck.schema.output.json +32 -0
- package/dist/txs/index.browser.cjs +7 -0
- package/dist/txs/index.browser.js +7 -0
- package/dist/txs/index.cjs +9 -0
- package/dist/txs/index.d.ts +5 -0
- package/dist/txs/index.js +7 -0
- package/dist/types/index.d.ts +2425 -1239
- package/dist/wapi-client-web.iife.js +4 -4
- package/dist/wapi-client.iife.js +4 -4
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -66,7 +66,7 @@ var import_errors = require('./lib/errors.cjs');
|
|
|
66
66
|
var import_fns = require('./fns/index.cjs');
|
|
67
67
|
var import_import_data = require('./fns/import-data/import-data.guards.cjs');
|
|
68
68
|
var _a;
|
|
69
|
-
var CLIENT_VERSION = (_a = '0.
|
|
69
|
+
var CLIENT_VERSION = (_a = '0.9.1') != null ? _a : "";
|
|
70
70
|
var Client = class {
|
|
71
71
|
/**
|
|
72
72
|
* @internal
|
|
@@ -1112,6 +1112,33 @@ var Client = class {
|
|
|
1112
1112
|
getWallet(input, options) {
|
|
1113
1113
|
return import_fns.ClientFunctions.getWallet({ client: this }, input, options);
|
|
1114
1114
|
}
|
|
1115
|
+
/**
|
|
1116
|
+
*
|
|
1117
|
+
* Get health information about service
|
|
1118
|
+
*
|
|
1119
|
+
* ```javascript
|
|
1120
|
+
*
|
|
1121
|
+
* const result = await wapiClient.healthcheck({
|
|
1122
|
+
* }, {
|
|
1123
|
+
* tracking_id: 'mylogId',
|
|
1124
|
+
* });
|
|
1125
|
+
* expect(result).toEqual({
|
|
1126
|
+
* status: 'green',
|
|
1127
|
+
* database_size: '3240MB',
|
|
1128
|
+
* indexes_size: '1234MB',
|
|
1129
|
+
* connection_count: 1,
|
|
1130
|
+
* });
|
|
1131
|
+
*
|
|
1132
|
+
* ```
|
|
1133
|
+
*
|
|
1134
|
+
* @param {HealthcheckFnInput} input
|
|
1135
|
+
* @param {HealthcheckFnOptions} [options]
|
|
1136
|
+
* @returns {StreamPromise<HealthcheckFnOutput>}
|
|
1137
|
+
*
|
|
1138
|
+
*/
|
|
1139
|
+
healthcheck(input, options) {
|
|
1140
|
+
return import_fns.ClientFunctions.healthcheck({ client: this }, input != null ? input : {}, options);
|
|
1141
|
+
}
|
|
1115
1142
|
importData(input, options) {
|
|
1116
1143
|
if (input === void 0 && options === void 0) {
|
|
1117
1144
|
return import_fns.ClientFunctions.importData({ client: this });
|
|
@@ -1123,11 +1150,8 @@ var Client = class {
|
|
|
1123
1150
|
return import_fns.ClientFunctions.importData({ client: this }, input, options);
|
|
1124
1151
|
}
|
|
1125
1152
|
throw new import_errors.ValidationError({
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
input,
|
|
1129
|
-
options
|
|
1130
|
-
}
|
|
1153
|
+
input,
|
|
1154
|
+
options
|
|
1131
1155
|
});
|
|
1132
1156
|
}
|
|
1133
1157
|
/**
|
package/dist/client.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ import { GetTokenFnInput, GetTokenFnOptions, GetTokenFnOutput } from './fns/get-
|
|
|
33
33
|
import { GetTransferGroupFnInput, GetTransferGroupFnOptions, GetTransferGroupFnOutput } from './fns/get-transfer-group/get-transfer-group.enums';
|
|
34
34
|
import { GetTransferFnInput, GetTransferFnOptions, GetTransferFnOutput } from './fns/get-transfer/get-transfer.enums';
|
|
35
35
|
import { GetWalletFnInput, GetWalletFnOptions, GetWalletFnOutput } from './fns/get-wallet/get-wallet.enums';
|
|
36
|
+
import { HealthcheckFnInput, HealthcheckFnOptions, HealthcheckFnOutput } from './fns/healthcheck/healthcheck.enums';
|
|
36
37
|
import { ImportDataFnOptions, ImportDataFnOutput, ImportDataFnStreamChunk, ImportDataFnInput } from './fns/import-data/import-data.enums';
|
|
37
38
|
import { ReverseTransferGroupFnInput, ReverseTransferGroupFnOptions, ReverseTransferGroupFnOutput } from './fns/reverse-transfer-group/reverse-transfer-group.enums';
|
|
38
39
|
import { ReverseTransferFnInput, ReverseTransferFnOptions, ReverseTransferFnOutput } from './fns/reverse-transfer/reverse-transfer.enums';
|
|
@@ -1272,6 +1273,31 @@ export declare class Client {
|
|
|
1272
1273
|
*
|
|
1273
1274
|
*/
|
|
1274
1275
|
getWallet(input: GetWalletFnInput, options?: GetWalletFnOptions): StreamPromise<GetWalletFnOutput>;
|
|
1276
|
+
/**
|
|
1277
|
+
*
|
|
1278
|
+
* Get health information about service
|
|
1279
|
+
*
|
|
1280
|
+
* ```javascript
|
|
1281
|
+
*
|
|
1282
|
+
* const result = await wapiClient.healthcheck({
|
|
1283
|
+
* }, {
|
|
1284
|
+
* tracking_id: 'mylogId',
|
|
1285
|
+
* });
|
|
1286
|
+
* expect(result).toEqual({
|
|
1287
|
+
* status: 'green',
|
|
1288
|
+
* database_size: '3240MB',
|
|
1289
|
+
* indexes_size: '1234MB',
|
|
1290
|
+
* connection_count: 1,
|
|
1291
|
+
* });
|
|
1292
|
+
*
|
|
1293
|
+
* ```
|
|
1294
|
+
*
|
|
1295
|
+
* @param {HealthcheckFnInput} input
|
|
1296
|
+
* @param {HealthcheckFnOptions} [options]
|
|
1297
|
+
* @returns {StreamPromise<HealthcheckFnOutput>}
|
|
1298
|
+
*
|
|
1299
|
+
*/
|
|
1300
|
+
healthcheck(input?: HealthcheckFnInput, options?: HealthcheckFnOptions): StreamPromise<HealthcheckFnOutput>;
|
|
1275
1301
|
/**
|
|
1276
1302
|
*
|
|
1277
1303
|
*
|
package/dist/client.js
CHANGED
|
@@ -43,14 +43,14 @@ import {
|
|
|
43
43
|
createHttpClient,
|
|
44
44
|
createWsClient
|
|
45
45
|
} from "./api";
|
|
46
|
-
import {
|
|
46
|
+
import { ValidationError } from "./lib/errors";
|
|
47
47
|
import { ClientFunctions } from "./fns";
|
|
48
48
|
import {
|
|
49
49
|
isImportDataFnOptions,
|
|
50
50
|
isImportDataFnInput
|
|
51
51
|
} from "./fns/import-data/import-data.guards";
|
|
52
52
|
var _a;
|
|
53
|
-
var CLIENT_VERSION = (_a = '0.
|
|
53
|
+
var CLIENT_VERSION = (_a = '0.9.1') != null ? _a : "";
|
|
54
54
|
var Client = class {
|
|
55
55
|
/**
|
|
56
56
|
* @internal
|
|
@@ -1096,6 +1096,33 @@ var Client = class {
|
|
|
1096
1096
|
getWallet(input, options) {
|
|
1097
1097
|
return ClientFunctions.getWallet({ client: this }, input, options);
|
|
1098
1098
|
}
|
|
1099
|
+
/**
|
|
1100
|
+
*
|
|
1101
|
+
* Get health information about service
|
|
1102
|
+
*
|
|
1103
|
+
* ```javascript
|
|
1104
|
+
*
|
|
1105
|
+
* const result = await wapiClient.healthcheck({
|
|
1106
|
+
* }, {
|
|
1107
|
+
* tracking_id: 'mylogId',
|
|
1108
|
+
* });
|
|
1109
|
+
* expect(result).toEqual({
|
|
1110
|
+
* status: 'green',
|
|
1111
|
+
* database_size: '3240MB',
|
|
1112
|
+
* indexes_size: '1234MB',
|
|
1113
|
+
* connection_count: 1,
|
|
1114
|
+
* });
|
|
1115
|
+
*
|
|
1116
|
+
* ```
|
|
1117
|
+
*
|
|
1118
|
+
* @param {HealthcheckFnInput} input
|
|
1119
|
+
* @param {HealthcheckFnOptions} [options]
|
|
1120
|
+
* @returns {StreamPromise<HealthcheckFnOutput>}
|
|
1121
|
+
*
|
|
1122
|
+
*/
|
|
1123
|
+
healthcheck(input, options) {
|
|
1124
|
+
return ClientFunctions.healthcheck({ client: this }, input != null ? input : {}, options);
|
|
1125
|
+
}
|
|
1099
1126
|
importData(input, options) {
|
|
1100
1127
|
if (input === void 0 && options === void 0) {
|
|
1101
1128
|
return ClientFunctions.importData({ client: this });
|
|
@@ -1107,11 +1134,8 @@ var Client = class {
|
|
|
1107
1134
|
return ClientFunctions.importData({ client: this }, input, options);
|
|
1108
1135
|
}
|
|
1109
1136
|
throw new ValidationError({
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
input,
|
|
1113
|
-
options
|
|
1114
|
-
}
|
|
1137
|
+
input,
|
|
1138
|
+
options
|
|
1115
1139
|
});
|
|
1116
1140
|
}
|
|
1117
1141
|
/**
|
|
@@ -61,10 +61,7 @@ function createDeposit(options, input, fnOptions) {
|
|
|
61
61
|
}
|
|
62
62
|
const token = inputCopy.token || client.getConfig("token");
|
|
63
63
|
if (token === void 0) {
|
|
64
|
-
throw new import_errors.InputError({
|
|
65
|
-
message: import_errors.ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
66
|
-
data: input
|
|
67
|
-
});
|
|
64
|
+
throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input });
|
|
68
65
|
}
|
|
69
66
|
const validatedOptions = inputCopy.options;
|
|
70
67
|
delete inputCopy.options;
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
modifyObject,
|
|
29
29
|
validateClientFnInput
|
|
30
30
|
} from "../../lib/utils.browser.js";
|
|
31
|
-
import {
|
|
31
|
+
import { InputError } from "../../lib/errors.browser.js";
|
|
32
32
|
var validate = getValidator(SchemaNames.CreateDepositFnInput);
|
|
33
33
|
function createDeposit(options, input, fnOptions) {
|
|
34
34
|
const { client } = options;
|
|
@@ -47,10 +47,7 @@ function createDeposit(options, input, fnOptions) {
|
|
|
47
47
|
}
|
|
48
48
|
const token = inputCopy.token || client.getConfig("token");
|
|
49
49
|
if (token === void 0) {
|
|
50
|
-
throw new InputError({
|
|
51
|
-
message: ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
52
|
-
data: input
|
|
53
|
-
});
|
|
50
|
+
throw new InputError("INPUT_NEEDS_TOKEN", { input });
|
|
54
51
|
}
|
|
55
52
|
const validatedOptions = inputCopy.options;
|
|
56
53
|
delete inputCopy.options;
|
|
@@ -61,10 +61,7 @@ function createDeposit(options, input, fnOptions) {
|
|
|
61
61
|
}
|
|
62
62
|
const token = inputCopy.token || client.getConfig("token");
|
|
63
63
|
if (token === void 0) {
|
|
64
|
-
throw new import_errors.InputError({
|
|
65
|
-
message: import_errors.ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
66
|
-
data: input
|
|
67
|
-
});
|
|
64
|
+
throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input });
|
|
68
65
|
}
|
|
69
66
|
const validatedOptions = inputCopy.options;
|
|
70
67
|
delete inputCopy.options;
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
modifyObject,
|
|
29
29
|
validateClientFnInput
|
|
30
30
|
} from "../../lib/utils";
|
|
31
|
-
import {
|
|
31
|
+
import { InputError } from "../../lib/errors";
|
|
32
32
|
var validate = getValidator(SchemaNames.CreateDepositFnInput);
|
|
33
33
|
function createDeposit(options, input, fnOptions) {
|
|
34
34
|
const { client } = options;
|
|
@@ -47,10 +47,7 @@ function createDeposit(options, input, fnOptions) {
|
|
|
47
47
|
}
|
|
48
48
|
const token = inputCopy.token || client.getConfig("token");
|
|
49
49
|
if (token === void 0) {
|
|
50
|
-
throw new InputError({
|
|
51
|
-
message: ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
52
|
-
data: input
|
|
53
|
-
});
|
|
50
|
+
throw new InputError("INPUT_NEEDS_TOKEN", { input });
|
|
54
51
|
}
|
|
55
52
|
const validatedOptions = inputCopy.options;
|
|
56
53
|
delete inputCopy.options;
|
|
@@ -67,10 +67,7 @@ function createWithdrawal(options, input, fnOptions) {
|
|
|
67
67
|
}
|
|
68
68
|
const token = inputCopy.token || client.getConfig("token");
|
|
69
69
|
if (token === void 0) {
|
|
70
|
-
throw new import_errors.InputError({
|
|
71
|
-
message: import_errors.ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
72
|
-
data: input
|
|
73
|
-
});
|
|
70
|
+
throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input });
|
|
74
71
|
}
|
|
75
72
|
const withdrawal = __spreadProps(__spreadValues({}, inputCopy), {
|
|
76
73
|
identifier: inputCopy.identifier,
|
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
|
|
21
21
|
// src/fns/create-withdrawal/create-withdrawal.ts
|
|
22
|
-
import {
|
|
22
|
+
import { InputError } from "../../lib/errors.browser.js";
|
|
23
23
|
import { getValidator, SchemaNames } from "../../lib/validator.browser.js";
|
|
24
24
|
import {
|
|
25
25
|
checkCopyObject,
|
|
@@ -53,10 +53,7 @@ function createWithdrawal(options, input, fnOptions) {
|
|
|
53
53
|
}
|
|
54
54
|
const token = inputCopy.token || client.getConfig("token");
|
|
55
55
|
if (token === void 0) {
|
|
56
|
-
throw new InputError({
|
|
57
|
-
message: ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
58
|
-
data: input
|
|
59
|
-
});
|
|
56
|
+
throw new InputError("INPUT_NEEDS_TOKEN", { input });
|
|
60
57
|
}
|
|
61
58
|
const withdrawal = __spreadProps(__spreadValues({}, inputCopy), {
|
|
62
59
|
identifier: inputCopy.identifier,
|
|
@@ -67,10 +67,7 @@ function createWithdrawal(options, input, fnOptions) {
|
|
|
67
67
|
}
|
|
68
68
|
const token = inputCopy.token || client.getConfig("token");
|
|
69
69
|
if (token === void 0) {
|
|
70
|
-
throw new import_errors.InputError({
|
|
71
|
-
message: import_errors.ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
72
|
-
data: input
|
|
73
|
-
});
|
|
70
|
+
throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input });
|
|
74
71
|
}
|
|
75
72
|
const withdrawal = __spreadProps(__spreadValues({}, inputCopy), {
|
|
76
73
|
identifier: inputCopy.identifier,
|
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
|
|
21
21
|
// src/fns/create-withdrawal/create-withdrawal.ts
|
|
22
|
-
import {
|
|
22
|
+
import { InputError } from "../../lib/errors";
|
|
23
23
|
import { getValidator, SchemaNames } from "../../lib/validator";
|
|
24
24
|
import {
|
|
25
25
|
checkCopyObject,
|
|
@@ -53,10 +53,7 @@ function createWithdrawal(options, input, fnOptions) {
|
|
|
53
53
|
}
|
|
54
54
|
const token = inputCopy.token || client.getConfig("token");
|
|
55
55
|
if (token === void 0) {
|
|
56
|
-
throw new InputError({
|
|
57
|
-
message: ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
58
|
-
data: input
|
|
59
|
-
});
|
|
56
|
+
throw new InputError("INPUT_NEEDS_TOKEN", { input });
|
|
60
57
|
}
|
|
61
58
|
const withdrawal = __spreadProps(__spreadValues({}, inputCopy), {
|
|
62
59
|
identifier: inputCopy.identifier,
|
|
@@ -93,19 +93,13 @@ function findTransfers(options, input, fnOptions) {
|
|
|
93
93
|
delete inputCopy.options.order_by;
|
|
94
94
|
if (inputCopy.options.return_running_balance) {
|
|
95
95
|
if (inputCopy.options.return_running_balance_for_wallet) {
|
|
96
|
-
throw new import_errors.InputError({
|
|
97
|
-
|
|
98
|
-
data: {
|
|
99
|
-
options: inputCopy.options
|
|
100
|
-
}
|
|
96
|
+
throw new import_errors.InputError("CONFLICTING_OPTIONS_FOR_BALANCE", {
|
|
97
|
+
options: inputCopy.options
|
|
101
98
|
});
|
|
102
99
|
}
|
|
103
100
|
if (!filter.wallet) {
|
|
104
|
-
throw new import_errors.InputError({
|
|
105
|
-
|
|
106
|
-
data: {
|
|
107
|
-
input: inputCopy
|
|
108
|
-
}
|
|
101
|
+
throw new import_errors.InputError("RUNNING_BALANCE_WITHOUT_WALLET", {
|
|
102
|
+
input: inputCopy
|
|
109
103
|
});
|
|
110
104
|
}
|
|
111
105
|
inputCopy.options.return_running_balance_for_wallet = inputCopy.wallet;
|
|
@@ -114,19 +108,13 @@ function findTransfers(options, input, fnOptions) {
|
|
|
114
108
|
delete inputCopy.options.return_running_balance_for_wallet;
|
|
115
109
|
if (inputCopy.options.return_signed_amount) {
|
|
116
110
|
if (inputCopy.options.return_signed_amount_for_wallet) {
|
|
117
|
-
throw new import_errors.InputError({
|
|
118
|
-
|
|
119
|
-
data: {
|
|
120
|
-
options: inputCopy.options
|
|
121
|
-
}
|
|
111
|
+
throw new import_errors.InputError("CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT", {
|
|
112
|
+
options: inputCopy.options
|
|
122
113
|
});
|
|
123
114
|
}
|
|
124
115
|
if (!filter.wallet) {
|
|
125
|
-
throw new import_errors.InputError({
|
|
126
|
-
|
|
127
|
-
data: {
|
|
128
|
-
input: inputCopy
|
|
129
|
-
}
|
|
116
|
+
throw new import_errors.InputError("SIGNED_AMOUNT_WITHOUT_WALLET", {
|
|
117
|
+
input: inputCopy
|
|
130
118
|
});
|
|
131
119
|
}
|
|
132
120
|
inputCopy.options.return_signed_amount_for_wallet = inputCopy.wallet;
|
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
|
|
18
18
|
// src/fns/find-transfers/find-transfers.ts
|
|
19
19
|
import { QueryBuilder } from "../../lib/query-builder.browser.js";
|
|
20
|
-
import {
|
|
20
|
+
import { InputError } from "../../lib/errors.browser.js";
|
|
21
21
|
import {
|
|
22
22
|
getForeign,
|
|
23
23
|
getIdentifierFilter,
|
|
@@ -77,19 +77,13 @@ function findTransfers(options, input, fnOptions) {
|
|
|
77
77
|
delete inputCopy.options.order_by;
|
|
78
78
|
if (inputCopy.options.return_running_balance) {
|
|
79
79
|
if (inputCopy.options.return_running_balance_for_wallet) {
|
|
80
|
-
throw new InputError({
|
|
81
|
-
|
|
82
|
-
data: {
|
|
83
|
-
options: inputCopy.options
|
|
84
|
-
}
|
|
80
|
+
throw new InputError("CONFLICTING_OPTIONS_FOR_BALANCE", {
|
|
81
|
+
options: inputCopy.options
|
|
85
82
|
});
|
|
86
83
|
}
|
|
87
84
|
if (!filter.wallet) {
|
|
88
|
-
throw new InputError({
|
|
89
|
-
|
|
90
|
-
data: {
|
|
91
|
-
input: inputCopy
|
|
92
|
-
}
|
|
85
|
+
throw new InputError("RUNNING_BALANCE_WITHOUT_WALLET", {
|
|
86
|
+
input: inputCopy
|
|
93
87
|
});
|
|
94
88
|
}
|
|
95
89
|
inputCopy.options.return_running_balance_for_wallet = inputCopy.wallet;
|
|
@@ -98,19 +92,13 @@ function findTransfers(options, input, fnOptions) {
|
|
|
98
92
|
delete inputCopy.options.return_running_balance_for_wallet;
|
|
99
93
|
if (inputCopy.options.return_signed_amount) {
|
|
100
94
|
if (inputCopy.options.return_signed_amount_for_wallet) {
|
|
101
|
-
throw new InputError({
|
|
102
|
-
|
|
103
|
-
data: {
|
|
104
|
-
options: inputCopy.options
|
|
105
|
-
}
|
|
95
|
+
throw new InputError("CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT", {
|
|
96
|
+
options: inputCopy.options
|
|
106
97
|
});
|
|
107
98
|
}
|
|
108
99
|
if (!filter.wallet) {
|
|
109
|
-
throw new InputError({
|
|
110
|
-
|
|
111
|
-
data: {
|
|
112
|
-
input: inputCopy
|
|
113
|
-
}
|
|
100
|
+
throw new InputError("SIGNED_AMOUNT_WITHOUT_WALLET", {
|
|
101
|
+
input: inputCopy
|
|
114
102
|
});
|
|
115
103
|
}
|
|
116
104
|
inputCopy.options.return_signed_amount_for_wallet = inputCopy.wallet;
|
|
@@ -93,19 +93,13 @@ function findTransfers(options, input, fnOptions) {
|
|
|
93
93
|
delete inputCopy.options.order_by;
|
|
94
94
|
if (inputCopy.options.return_running_balance) {
|
|
95
95
|
if (inputCopy.options.return_running_balance_for_wallet) {
|
|
96
|
-
throw new import_errors.InputError({
|
|
97
|
-
|
|
98
|
-
data: {
|
|
99
|
-
options: inputCopy.options
|
|
100
|
-
}
|
|
96
|
+
throw new import_errors.InputError("CONFLICTING_OPTIONS_FOR_BALANCE", {
|
|
97
|
+
options: inputCopy.options
|
|
101
98
|
});
|
|
102
99
|
}
|
|
103
100
|
if (!filter.wallet) {
|
|
104
|
-
throw new import_errors.InputError({
|
|
105
|
-
|
|
106
|
-
data: {
|
|
107
|
-
input: inputCopy
|
|
108
|
-
}
|
|
101
|
+
throw new import_errors.InputError("RUNNING_BALANCE_WITHOUT_WALLET", {
|
|
102
|
+
input: inputCopy
|
|
109
103
|
});
|
|
110
104
|
}
|
|
111
105
|
inputCopy.options.return_running_balance_for_wallet = inputCopy.wallet;
|
|
@@ -114,19 +108,13 @@ function findTransfers(options, input, fnOptions) {
|
|
|
114
108
|
delete inputCopy.options.return_running_balance_for_wallet;
|
|
115
109
|
if (inputCopy.options.return_signed_amount) {
|
|
116
110
|
if (inputCopy.options.return_signed_amount_for_wallet) {
|
|
117
|
-
throw new import_errors.InputError({
|
|
118
|
-
|
|
119
|
-
data: {
|
|
120
|
-
options: inputCopy.options
|
|
121
|
-
}
|
|
111
|
+
throw new import_errors.InputError("CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT", {
|
|
112
|
+
options: inputCopy.options
|
|
122
113
|
});
|
|
123
114
|
}
|
|
124
115
|
if (!filter.wallet) {
|
|
125
|
-
throw new import_errors.InputError({
|
|
126
|
-
|
|
127
|
-
data: {
|
|
128
|
-
input: inputCopy
|
|
129
|
-
}
|
|
116
|
+
throw new import_errors.InputError("SIGNED_AMOUNT_WITHOUT_WALLET", {
|
|
117
|
+
input: inputCopy
|
|
130
118
|
});
|
|
131
119
|
}
|
|
132
120
|
inputCopy.options.return_signed_amount_for_wallet = inputCopy.wallet;
|
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
|
|
18
18
|
// src/fns/find-transfers/find-transfers.ts
|
|
19
19
|
import { QueryBuilder } from "../../lib/query-builder";
|
|
20
|
-
import {
|
|
20
|
+
import { InputError } from "../../lib/errors";
|
|
21
21
|
import {
|
|
22
22
|
getForeign,
|
|
23
23
|
getIdentifierFilter,
|
|
@@ -77,19 +77,13 @@ function findTransfers(options, input, fnOptions) {
|
|
|
77
77
|
delete inputCopy.options.order_by;
|
|
78
78
|
if (inputCopy.options.return_running_balance) {
|
|
79
79
|
if (inputCopy.options.return_running_balance_for_wallet) {
|
|
80
|
-
throw new InputError({
|
|
81
|
-
|
|
82
|
-
data: {
|
|
83
|
-
options: inputCopy.options
|
|
84
|
-
}
|
|
80
|
+
throw new InputError("CONFLICTING_OPTIONS_FOR_BALANCE", {
|
|
81
|
+
options: inputCopy.options
|
|
85
82
|
});
|
|
86
83
|
}
|
|
87
84
|
if (!filter.wallet) {
|
|
88
|
-
throw new InputError({
|
|
89
|
-
|
|
90
|
-
data: {
|
|
91
|
-
input: inputCopy
|
|
92
|
-
}
|
|
85
|
+
throw new InputError("RUNNING_BALANCE_WITHOUT_WALLET", {
|
|
86
|
+
input: inputCopy
|
|
93
87
|
});
|
|
94
88
|
}
|
|
95
89
|
inputCopy.options.return_running_balance_for_wallet = inputCopy.wallet;
|
|
@@ -98,19 +92,13 @@ function findTransfers(options, input, fnOptions) {
|
|
|
98
92
|
delete inputCopy.options.return_running_balance_for_wallet;
|
|
99
93
|
if (inputCopy.options.return_signed_amount) {
|
|
100
94
|
if (inputCopy.options.return_signed_amount_for_wallet) {
|
|
101
|
-
throw new InputError({
|
|
102
|
-
|
|
103
|
-
data: {
|
|
104
|
-
options: inputCopy.options
|
|
105
|
-
}
|
|
95
|
+
throw new InputError("CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT", {
|
|
96
|
+
options: inputCopy.options
|
|
106
97
|
});
|
|
107
98
|
}
|
|
108
99
|
if (!filter.wallet) {
|
|
109
|
-
throw new InputError({
|
|
110
|
-
|
|
111
|
-
data: {
|
|
112
|
-
input: inputCopy
|
|
113
|
-
}
|
|
100
|
+
throw new InputError("SIGNED_AMOUNT_WITHOUT_WALLET", {
|
|
101
|
+
input: inputCopy
|
|
114
102
|
});
|
|
115
103
|
}
|
|
116
104
|
inputCopy.options.return_signed_amount_for_wallet = inputCopy.wallet;
|
|
@@ -43,17 +43,11 @@ function getBalance(options, input, fnOptions) {
|
|
|
43
43
|
throw error;
|
|
44
44
|
}
|
|
45
45
|
if (inputCopy.datetime && (0, import_utils.isFutureDate)(inputCopy.datetime)) {
|
|
46
|
-
throw new import_errors.InputError({
|
|
47
|
-
message: import_errors.ERROR_MESSAGES.BAL_FUTURE_DATETIME,
|
|
48
|
-
data: inputCopy
|
|
49
|
-
});
|
|
46
|
+
throw new import_errors.InputError("BAL_FUTURE_DATETIME", { input: inputCopy });
|
|
50
47
|
}
|
|
51
48
|
const token = inputCopy.token || client.getConfig("token");
|
|
52
49
|
if (token === void 0) {
|
|
53
|
-
throw new import_errors.InputError({
|
|
54
|
-
message: import_errors.ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
55
|
-
data: input
|
|
56
|
-
});
|
|
50
|
+
throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input: inputCopy });
|
|
57
51
|
}
|
|
58
52
|
return client.api.getBalance({
|
|
59
53
|
balance: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/fns/get-balance/get-balance.ts
|
|
2
|
-
import {
|
|
2
|
+
import { InputError } from "../../lib/errors.browser.js";
|
|
3
3
|
import { getValidator, SchemaNames } from "../../lib/validator.browser.js";
|
|
4
4
|
import {
|
|
5
5
|
checkCopyObject,
|
|
@@ -24,17 +24,11 @@ function getBalance(options, input, fnOptions) {
|
|
|
24
24
|
throw error;
|
|
25
25
|
}
|
|
26
26
|
if (inputCopy.datetime && isFutureDate(inputCopy.datetime)) {
|
|
27
|
-
throw new InputError({
|
|
28
|
-
message: ERROR_MESSAGES.BAL_FUTURE_DATETIME,
|
|
29
|
-
data: inputCopy
|
|
30
|
-
});
|
|
27
|
+
throw new InputError("BAL_FUTURE_DATETIME", { input: inputCopy });
|
|
31
28
|
}
|
|
32
29
|
const token = inputCopy.token || client.getConfig("token");
|
|
33
30
|
if (token === void 0) {
|
|
34
|
-
throw new InputError({
|
|
35
|
-
message: ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
36
|
-
data: input
|
|
37
|
-
});
|
|
31
|
+
throw new InputError("INPUT_NEEDS_TOKEN", { input: inputCopy });
|
|
38
32
|
}
|
|
39
33
|
return client.api.getBalance({
|
|
40
34
|
balance: {
|
|
@@ -43,17 +43,11 @@ function getBalance(options, input, fnOptions) {
|
|
|
43
43
|
throw error;
|
|
44
44
|
}
|
|
45
45
|
if (inputCopy.datetime && (0, import_utils.isFutureDate)(inputCopy.datetime)) {
|
|
46
|
-
throw new import_errors.InputError({
|
|
47
|
-
message: import_errors.ERROR_MESSAGES.BAL_FUTURE_DATETIME,
|
|
48
|
-
data: inputCopy
|
|
49
|
-
});
|
|
46
|
+
throw new import_errors.InputError("BAL_FUTURE_DATETIME", { input: inputCopy });
|
|
50
47
|
}
|
|
51
48
|
const token = inputCopy.token || client.getConfig("token");
|
|
52
49
|
if (token === void 0) {
|
|
53
|
-
throw new import_errors.InputError({
|
|
54
|
-
message: import_errors.ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
55
|
-
data: input
|
|
56
|
-
});
|
|
50
|
+
throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input: inputCopy });
|
|
57
51
|
}
|
|
58
52
|
return client.api.getBalance({
|
|
59
53
|
balance: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/fns/get-balance/get-balance.ts
|
|
2
|
-
import {
|
|
2
|
+
import { InputError } from "../../lib/errors";
|
|
3
3
|
import { getValidator, SchemaNames } from "../../lib/validator";
|
|
4
4
|
import {
|
|
5
5
|
checkCopyObject,
|
|
@@ -24,17 +24,11 @@ function getBalance(options, input, fnOptions) {
|
|
|
24
24
|
throw error;
|
|
25
25
|
}
|
|
26
26
|
if (inputCopy.datetime && isFutureDate(inputCopy.datetime)) {
|
|
27
|
-
throw new InputError({
|
|
28
|
-
message: ERROR_MESSAGES.BAL_FUTURE_DATETIME,
|
|
29
|
-
data: inputCopy
|
|
30
|
-
});
|
|
27
|
+
throw new InputError("BAL_FUTURE_DATETIME", { input: inputCopy });
|
|
31
28
|
}
|
|
32
29
|
const token = inputCopy.token || client.getConfig("token");
|
|
33
30
|
if (token === void 0) {
|
|
34
|
-
throw new InputError({
|
|
35
|
-
message: ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
36
|
-
data: input
|
|
37
|
-
});
|
|
31
|
+
throw new InputError("INPUT_NEEDS_TOKEN", { input: inputCopy });
|
|
38
32
|
}
|
|
39
33
|
return client.api.getBalance({
|
|
40
34
|
balance: {
|
|
@@ -39,10 +39,7 @@ function getBalanceHistory(options, input, fnOptions) {
|
|
|
39
39
|
}
|
|
40
40
|
const token = inputCopy.token || client.getConfig("token");
|
|
41
41
|
if (token === void 0) {
|
|
42
|
-
throw new import_errors.InputError({
|
|
43
|
-
message: import_errors.ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
44
|
-
data: input
|
|
45
|
-
});
|
|
42
|
+
throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input });
|
|
46
43
|
}
|
|
47
44
|
return client.api.getBalanceHistory({
|
|
48
45
|
balance: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/fns/get-balance-history/get-balance-history.ts
|
|
2
|
-
import {
|
|
2
|
+
import { InputError } from "../../lib/errors.browser.js";
|
|
3
3
|
import { getForeign, validateClientFnInput } from "../../lib/utils.browser.js";
|
|
4
4
|
import { getValidator, SchemaNames } from "../../lib/validator.browser.js";
|
|
5
5
|
var validate = getValidator(SchemaNames.GetBalanceHistoryFnInput);
|
|
@@ -15,10 +15,7 @@ function getBalanceHistory(options, input, fnOptions) {
|
|
|
15
15
|
}
|
|
16
16
|
const token = inputCopy.token || client.getConfig("token");
|
|
17
17
|
if (token === void 0) {
|
|
18
|
-
throw new InputError({
|
|
19
|
-
message: ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
20
|
-
data: input
|
|
21
|
-
});
|
|
18
|
+
throw new InputError("INPUT_NEEDS_TOKEN", { input });
|
|
22
19
|
}
|
|
23
20
|
return client.api.getBalanceHistory({
|
|
24
21
|
balance: {
|
|
@@ -39,10 +39,7 @@ function getBalanceHistory(options, input, fnOptions) {
|
|
|
39
39
|
}
|
|
40
40
|
const token = inputCopy.token || client.getConfig("token");
|
|
41
41
|
if (token === void 0) {
|
|
42
|
-
throw new import_errors.InputError({
|
|
43
|
-
message: import_errors.ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
|
|
44
|
-
data: input
|
|
45
|
-
});
|
|
42
|
+
throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input });
|
|
46
43
|
}
|
|
47
44
|
return client.api.getBalanceHistory({
|
|
48
45
|
balance: {
|