wapi-client 0.14.1 → 0.14.10
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/client.browser.cjs +1 -1
- package/dist/client.browser.js +1 -1
- package/dist/client.cjs +1 -1
- package/dist/client.js +1 -1
- package/dist/fns/create-contract/create-contract.browser.cjs +4 -5
- package/dist/fns/create-contract/create-contract.browser.js +4 -5
- package/dist/fns/create-contract/create-contract.cjs +4 -5
- package/dist/fns/create-contract/create-contract.js +4 -5
- package/dist/fns/create-deposit/create-deposit.browser.cjs +3 -3
- package/dist/fns/create-deposit/create-deposit.browser.js +3 -5
- package/dist/fns/create-deposit/create-deposit.cjs +3 -3
- package/dist/fns/create-deposit/create-deposit.js +3 -5
- package/dist/fns/create-exchange/create-exchange.browser.cjs +6 -6
- package/dist/fns/create-exchange/create-exchange.browser.js +7 -7
- package/dist/fns/create-exchange/create-exchange.cjs +6 -6
- package/dist/fns/create-exchange/create-exchange.js +7 -7
- package/dist/fns/create-token/create-token.browser.cjs +1 -2
- package/dist/fns/create-token/create-token.browser.js +1 -2
- package/dist/fns/create-token/create-token.cjs +1 -2
- package/dist/fns/create-token/create-token.js +1 -2
- package/dist/fns/create-transfer/create-transfer.browser.cjs +6 -6
- package/dist/fns/create-transfer/create-transfer.browser.js +6 -8
- package/dist/fns/create-transfer/create-transfer.cjs +6 -6
- package/dist/fns/create-transfer/create-transfer.js +6 -8
- package/dist/fns/create-withdrawal/create-withdrawal.browser.cjs +3 -3
- package/dist/fns/create-withdrawal/create-withdrawal.browser.js +3 -5
- package/dist/fns/create-withdrawal/create-withdrawal.cjs +3 -3
- package/dist/fns/create-withdrawal/create-withdrawal.js +3 -5
- package/dist/fns/export-balance-history/export-balance-history.browser.cjs +1 -2
- package/dist/fns/export-balance-history/export-balance-history.browser.js +1 -2
- package/dist/fns/export-balance-history/export-balance-history.cjs +1 -2
- package/dist/fns/export-balance-history/export-balance-history.js +1 -2
- package/dist/fns/get-balance/get-balance.browser.cjs +2 -2
- package/dist/fns/get-balance/get-balance.browser.js +3 -3
- package/dist/fns/get-balance/get-balance.cjs +2 -2
- package/dist/fns/get-balance/get-balance.js +3 -3
- package/dist/fns/get-balance-history/get-balance-history.browser.cjs +2 -3
- package/dist/fns/get-balance-history/get-balance-history.browser.js +2 -3
- package/dist/fns/get-balance-history/get-balance-history.cjs +2 -3
- package/dist/fns/get-balance-history/get-balance-history.js +2 -3
- package/dist/fns/get-token/get-token.browser.cjs +15 -9
- package/dist/fns/get-token/get-token.browser.js +16 -10
- package/dist/fns/get-token/get-token.cjs +15 -9
- package/dist/fns/get-token/get-token.js +16 -10
- package/dist/fns/get-token/get-token.schema.zod.browser.cjs +2 -1
- package/dist/fns/get-token/get-token.schema.zod.browser.js +2 -1
- package/dist/fns/get-token/get-token.schema.zod.cjs +2 -1
- package/dist/fns/get-token/get-token.schema.zod.js +2 -1
- package/dist/fns/get-transfer/get-transfer.browser.cjs +1 -2
- package/dist/fns/get-transfer/get-transfer.browser.js +1 -2
- package/dist/fns/get-transfer/get-transfer.cjs +1 -2
- package/dist/fns/get-transfer/get-transfer.js +1 -2
- package/dist/fns/get-transfer-group/get-transfer-group.browser.cjs +1 -2
- package/dist/fns/get-transfer-group/get-transfer-group.browser.js +1 -2
- package/dist/fns/get-transfer-group/get-transfer-group.cjs +1 -2
- package/dist/fns/get-transfer-group/get-transfer-group.js +1 -2
- package/dist/fns/get-wallet/get-wallet.browser.cjs +1 -2
- package/dist/fns/get-wallet/get-wallet.browser.js +1 -2
- package/dist/fns/get-wallet/get-wallet.cjs +1 -2
- package/dist/fns/get-wallet/get-wallet.js +1 -2
- package/dist/fns/reverse-transfer/reverse-transfer.browser.cjs +1 -2
- package/dist/fns/reverse-transfer/reverse-transfer.browser.js +1 -2
- package/dist/fns/reverse-transfer/reverse-transfer.cjs +1 -2
- package/dist/fns/reverse-transfer/reverse-transfer.js +1 -2
- package/dist/fns/reverse-transfer-group/reverse-transfer-group.browser.cjs +1 -2
- package/dist/fns/reverse-transfer-group/reverse-transfer-group.browser.js +1 -2
- package/dist/fns/reverse-transfer-group/reverse-transfer-group.cjs +1 -2
- package/dist/fns/reverse-transfer-group/reverse-transfer-group.js +1 -2
- package/dist/fns/update-token/update-token.browser.cjs +1 -2
- package/dist/fns/update-token/update-token.browser.js +1 -2
- package/dist/fns/update-token/update-token.cjs +1 -2
- package/dist/fns/update-token/update-token.js +1 -2
- package/dist/fns/update-transfer/update-transfer.browser.cjs +1 -2
- package/dist/fns/update-transfer/update-transfer.browser.js +1 -2
- package/dist/fns/update-transfer/update-transfer.cjs +1 -2
- package/dist/fns/update-transfer/update-transfer.js +1 -2
- package/dist/fns/update-transfer-group/update-transfer-group.browser.cjs +1 -2
- package/dist/fns/update-transfer-group/update-transfer-group.browser.js +1 -2
- package/dist/fns/update-transfer-group/update-transfer-group.cjs +1 -2
- package/dist/fns/update-transfer-group/update-transfer-group.js +1 -2
- package/dist/fns/update-wallet/update-wallet.browser.cjs +1 -2
- package/dist/fns/update-wallet/update-wallet.browser.js +1 -2
- package/dist/fns/update-wallet/update-wallet.cjs +1 -2
- package/dist/fns/update-wallet/update-wallet.js +1 -2
- package/dist/lib/env.browser.cjs +1 -1
- package/dist/lib/env.browser.js +1 -1
- package/dist/lib/env.cjs +1 -1
- package/dist/lib/env.js +1 -1
- package/dist/lib/errors.browser.cjs +5 -0
- package/dist/lib/errors.browser.js +5 -0
- package/dist/lib/errors.cjs +5 -0
- package/dist/lib/errors.js +5 -0
- package/dist/lib/utils.browser.cjs +0 -27
- package/dist/lib/utils.browser.js +0 -27
- package/dist/lib/utils.cjs +0 -30
- package/dist/lib/utils.js +0 -27
- package/dist/txs/consts.browser.cjs +10 -2
- package/dist/txs/consts.browser.js +10 -2
- package/dist/txs/consts.cjs +10 -2
- package/dist/txs/consts.js +10 -2
- package/dist/txs/create-access-token/create-access-token.schema.zod.browser.cjs +33 -1
- package/dist/txs/create-access-token/create-access-token.schema.zod.browser.js +33 -1
- package/dist/txs/create-access-token/create-access-token.schema.zod.cjs +33 -1
- package/dist/txs/create-access-token/create-access-token.schema.zod.js +33 -1
- package/dist/txs/find-apikey-many/find-apikey-many.schema.zod.browser.cjs +21 -4
- package/dist/txs/find-apikey-many/find-apikey-many.schema.zod.browser.js +24 -4
- package/dist/txs/find-apikey-many/find-apikey-many.schema.zod.cjs +21 -4
- package/dist/txs/find-apikey-many/find-apikey-many.schema.zod.js +24 -4
- package/dist/txs/get-balance-history/get-balance-history.schema.zod.browser.cjs +2 -1
- package/dist/txs/get-balance-history/get-balance-history.schema.zod.browser.js +2 -1
- package/dist/txs/get-balance-history/get-balance-history.schema.zod.cjs +2 -1
- package/dist/txs/get-balance-history/get-balance-history.schema.zod.js +2 -1
- package/dist/types/wapi-client.d.ts +6092 -854
- package/dist/wapi-client-web.iife.js +8 -8
- package/dist/wapi-client.browser.cjs +7 -0
- package/dist/wapi-client.browser.js +7 -0
- package/dist/wapi-client.cjs +8 -0
- package/dist/wapi-client.iife.js +8 -8
- package/dist/wapi-client.js +7 -0
- package/package.json +1 -1
|
@@ -35,8 +35,6 @@ import { InputError } from "../../lib/errors.browser.js";
|
|
|
35
35
|
import {
|
|
36
36
|
checkCopyObject,
|
|
37
37
|
convertToNumber,
|
|
38
|
-
getForeign,
|
|
39
|
-
getIdentifierFilter,
|
|
40
38
|
getTxIdSync,
|
|
41
39
|
modifyObject
|
|
42
40
|
} from "../../lib/utils.browser.js";
|
|
@@ -74,9 +72,9 @@ function createWithdrawal(options, input, fnOptions) {
|
|
|
74
72
|
}
|
|
75
73
|
const withdrawal = __spreadValues(__spreadProps(__spreadValues({}, partialWithdrawal), {
|
|
76
74
|
amount: convertToNumber(partialWithdrawal.amount),
|
|
77
|
-
transfer_group:
|
|
78
|
-
token
|
|
79
|
-
from_wallet:
|
|
75
|
+
transfer_group: inputCopy.transfer_group,
|
|
76
|
+
token,
|
|
77
|
+
from_wallet: wallet,
|
|
80
78
|
type: "withdrawal"
|
|
81
79
|
}), metadata ? { metadata } : {});
|
|
82
80
|
if (!withdrawal.identifier) {
|
|
@@ -88,9 +88,9 @@ function createWithdrawal(options, input, fnOptions) {
|
|
|
88
88
|
}
|
|
89
89
|
const withdrawal = __spreadValues(__spreadProps(__spreadValues({}, partialWithdrawal), {
|
|
90
90
|
amount: (0, import_utils.convertToNumber)(partialWithdrawal.amount),
|
|
91
|
-
transfer_group:
|
|
92
|
-
token
|
|
93
|
-
from_wallet:
|
|
91
|
+
transfer_group: inputCopy.transfer_group,
|
|
92
|
+
token,
|
|
93
|
+
from_wallet: wallet,
|
|
94
94
|
type: "withdrawal"
|
|
95
95
|
}), metadata ? { metadata } : {});
|
|
96
96
|
if (!withdrawal.identifier) {
|
|
@@ -35,8 +35,6 @@ import { InputError } from "../../lib/errors.js";
|
|
|
35
35
|
import {
|
|
36
36
|
checkCopyObject,
|
|
37
37
|
convertToNumber,
|
|
38
|
-
getForeign,
|
|
39
|
-
getIdentifierFilter,
|
|
40
38
|
getTxIdSync,
|
|
41
39
|
modifyObject
|
|
42
40
|
} from "../../lib/utils.js";
|
|
@@ -74,9 +72,9 @@ function createWithdrawal(options, input, fnOptions) {
|
|
|
74
72
|
}
|
|
75
73
|
const withdrawal = __spreadValues(__spreadProps(__spreadValues({}, partialWithdrawal), {
|
|
76
74
|
amount: convertToNumber(partialWithdrawal.amount),
|
|
77
|
-
transfer_group:
|
|
78
|
-
token
|
|
79
|
-
from_wallet:
|
|
75
|
+
transfer_group: inputCopy.transfer_group,
|
|
76
|
+
token,
|
|
77
|
+
from_wallet: wallet,
|
|
80
78
|
type: "withdrawal"
|
|
81
79
|
}), metadata ? { metadata } : {});
|
|
82
80
|
if (!withdrawal.identifier) {
|
|
@@ -23,7 +23,6 @@ __export(export_balance_history_exports, {
|
|
|
23
23
|
exportBalanceHistory: () => exportBalanceHistory
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(export_balance_history_exports);
|
|
26
|
-
var import_utils = require("../../lib/utils.browser.cjs");
|
|
27
26
|
var import_errors = require("../../lib/errors.browser.cjs");
|
|
28
27
|
var import_validation = require("../../lib/validation.browser.cjs");
|
|
29
28
|
var import_export_balance_history_schema_zod = require("./export-balance-history.schema.zod.browser.cjs");
|
|
@@ -31,7 +30,7 @@ var zodValidator = (0, import_validation.getValidator)(import_export_balance_his
|
|
|
31
30
|
function exportBalanceHistory(options, input, fnOptions) {
|
|
32
31
|
const { client } = options;
|
|
33
32
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
34
|
-
const token = inputCopy.token ||
|
|
33
|
+
const token = inputCopy.token || client.getConfig("token");
|
|
35
34
|
if (token === void 0) {
|
|
36
35
|
throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input });
|
|
37
36
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// src/fns/export-balance-history/export-balance-history.ts
|
|
2
|
-
import { getForeign } from "../../lib/utils.browser.js";
|
|
3
2
|
import { InputError } from "../../lib/errors.browser.js";
|
|
4
3
|
import { getValidator } from "../../lib/validation.browser.js";
|
|
5
4
|
import { exportBalanceHistoryFnInputSchema } from "./export-balance-history.schema.zod.browser.js";
|
|
@@ -7,7 +6,7 @@ var zodValidator = getValidator(exportBalanceHistoryFnInputSchema);
|
|
|
7
6
|
function exportBalanceHistory(options, input, fnOptions) {
|
|
8
7
|
const { client } = options;
|
|
9
8
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
10
|
-
const token = inputCopy.token ||
|
|
9
|
+
const token = inputCopy.token || client.getConfig("token");
|
|
11
10
|
if (token === void 0) {
|
|
12
11
|
throw new InputError("INPUT_NEEDS_TOKEN", { input });
|
|
13
12
|
}
|
|
@@ -23,7 +23,6 @@ __export(export_balance_history_exports, {
|
|
|
23
23
|
exportBalanceHistory: () => exportBalanceHistory
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(export_balance_history_exports);
|
|
26
|
-
var import_utils = require("../../lib/utils.cjs");
|
|
27
26
|
var import_errors = require("../../lib/errors.cjs");
|
|
28
27
|
var import_validation = require("../../lib/validation.cjs");
|
|
29
28
|
var import_export_balance_history_schema_zod = require("./export-balance-history.schema.zod.cjs");
|
|
@@ -31,7 +30,7 @@ var zodValidator = (0, import_validation.getValidator)(import_export_balance_his
|
|
|
31
30
|
function exportBalanceHistory(options, input, fnOptions) {
|
|
32
31
|
const { client } = options;
|
|
33
32
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
34
|
-
const token = inputCopy.token ||
|
|
33
|
+
const token = inputCopy.token || client.getConfig("token");
|
|
35
34
|
if (token === void 0) {
|
|
36
35
|
throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input });
|
|
37
36
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// src/fns/export-balance-history/export-balance-history.ts
|
|
2
|
-
import { getForeign } from "../../lib/utils.js";
|
|
3
2
|
import { InputError } from "../../lib/errors.js";
|
|
4
3
|
import { getValidator } from "../../lib/validation.js";
|
|
5
4
|
import { exportBalanceHistoryFnInputSchema } from "./export-balance-history.schema.zod.js";
|
|
@@ -7,7 +6,7 @@ var zodValidator = getValidator(exportBalanceHistoryFnInputSchema);
|
|
|
7
6
|
function exportBalanceHistory(options, input, fnOptions) {
|
|
8
7
|
const { client } = options;
|
|
9
8
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
10
|
-
const token = inputCopy.token ||
|
|
9
|
+
const token = inputCopy.token || client.getConfig("token");
|
|
11
10
|
if (token === void 0) {
|
|
12
11
|
throw new InputError("INPUT_NEEDS_TOKEN", { input });
|
|
13
12
|
}
|
|
@@ -48,8 +48,8 @@ function getBalance(options, input, fnOptions) {
|
|
|
48
48
|
}
|
|
49
49
|
return client.api.getBalance({
|
|
50
50
|
balance: {
|
|
51
|
-
wallet:
|
|
52
|
-
token
|
|
51
|
+
wallet: inputCopy.wallet,
|
|
52
|
+
token,
|
|
53
53
|
datetime: inputCopy.datetime
|
|
54
54
|
},
|
|
55
55
|
options: inputCopy.options
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/fns/get-balance/get-balance.ts
|
|
2
2
|
import { InputError } from "../../lib/errors.browser.js";
|
|
3
|
-
import { checkCopyObject,
|
|
3
|
+
import { checkCopyObject, isFutureDate } from "../../lib/utils.browser.js";
|
|
4
4
|
import { getValidator } from "../../lib/validation.browser.js";
|
|
5
5
|
import { getBalanceFnInputSchema } from "./get-balance.schema.zod.browser.js";
|
|
6
6
|
var zodValidator = getValidator(getBalanceFnInputSchema);
|
|
@@ -24,8 +24,8 @@ function getBalance(options, input, fnOptions) {
|
|
|
24
24
|
}
|
|
25
25
|
return client.api.getBalance({
|
|
26
26
|
balance: {
|
|
27
|
-
wallet:
|
|
28
|
-
token
|
|
27
|
+
wallet: inputCopy.wallet,
|
|
28
|
+
token,
|
|
29
29
|
datetime: inputCopy.datetime
|
|
30
30
|
},
|
|
31
31
|
options: inputCopy.options
|
|
@@ -48,8 +48,8 @@ function getBalance(options, input, fnOptions) {
|
|
|
48
48
|
}
|
|
49
49
|
return client.api.getBalance({
|
|
50
50
|
balance: {
|
|
51
|
-
wallet:
|
|
52
|
-
token
|
|
51
|
+
wallet: inputCopy.wallet,
|
|
52
|
+
token,
|
|
53
53
|
datetime: inputCopy.datetime
|
|
54
54
|
},
|
|
55
55
|
options: inputCopy.options
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/fns/get-balance/get-balance.ts
|
|
2
2
|
import { InputError } from "../../lib/errors.js";
|
|
3
|
-
import { checkCopyObject,
|
|
3
|
+
import { checkCopyObject, isFutureDate } from "../../lib/utils.js";
|
|
4
4
|
import { getValidator } from "../../lib/validation.js";
|
|
5
5
|
import { getBalanceFnInputSchema } from "./get-balance.schema.zod.js";
|
|
6
6
|
var zodValidator = getValidator(getBalanceFnInputSchema);
|
|
@@ -24,8 +24,8 @@ function getBalance(options, input, fnOptions) {
|
|
|
24
24
|
}
|
|
25
25
|
return client.api.getBalance({
|
|
26
26
|
balance: {
|
|
27
|
-
wallet:
|
|
28
|
-
token
|
|
27
|
+
wallet: inputCopy.wallet,
|
|
28
|
+
token,
|
|
29
29
|
datetime: inputCopy.datetime
|
|
30
30
|
},
|
|
31
31
|
options: inputCopy.options
|
|
@@ -24,7 +24,6 @@ __export(get_balance_history_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(get_balance_history_exports);
|
|
26
26
|
var import_errors = require("../../lib/errors.browser.cjs");
|
|
27
|
-
var import_utils = require("../../lib/utils.browser.cjs");
|
|
28
27
|
var import_validation = require("../../lib/validation.browser.cjs");
|
|
29
28
|
var import_get_balance_history_schema_zod = require("./get-balance-history.schema.zod.browser.cjs");
|
|
30
29
|
var zodValidator = (0, import_validation.getValidator)(import_get_balance_history_schema_zod.getBalanceHistoryFnInputSchema);
|
|
@@ -37,8 +36,8 @@ function getBalanceHistory(options, input, fnOptions) {
|
|
|
37
36
|
}
|
|
38
37
|
return client.api.getBalanceHistory({
|
|
39
38
|
balance: {
|
|
40
|
-
wallet:
|
|
41
|
-
token
|
|
39
|
+
wallet: inputCopy.wallet,
|
|
40
|
+
token,
|
|
42
41
|
datetime: inputCopy.datetime
|
|
43
42
|
},
|
|
44
43
|
options: inputCopy.options
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// src/fns/get-balance-history/get-balance-history.ts
|
|
2
2
|
import { InputError } from "../../lib/errors.browser.js";
|
|
3
|
-
import { getForeign } from "../../lib/utils.browser.js";
|
|
4
3
|
import { getValidator } from "../../lib/validation.browser.js";
|
|
5
4
|
import { getBalanceHistoryFnInputSchema } from "./get-balance-history.schema.zod.browser.js";
|
|
6
5
|
var zodValidator = getValidator(getBalanceHistoryFnInputSchema);
|
|
@@ -13,8 +12,8 @@ function getBalanceHistory(options, input, fnOptions) {
|
|
|
13
12
|
}
|
|
14
13
|
return client.api.getBalanceHistory({
|
|
15
14
|
balance: {
|
|
16
|
-
wallet:
|
|
17
|
-
token
|
|
15
|
+
wallet: inputCopy.wallet,
|
|
16
|
+
token,
|
|
18
17
|
datetime: inputCopy.datetime
|
|
19
18
|
},
|
|
20
19
|
options: inputCopy.options
|
|
@@ -24,7 +24,6 @@ __export(get_balance_history_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(get_balance_history_exports);
|
|
26
26
|
var import_errors = require("../../lib/errors.cjs");
|
|
27
|
-
var import_utils = require("../../lib/utils.cjs");
|
|
28
27
|
var import_validation = require("../../lib/validation.cjs");
|
|
29
28
|
var import_get_balance_history_schema_zod = require("./get-balance-history.schema.zod.cjs");
|
|
30
29
|
var zodValidator = (0, import_validation.getValidator)(import_get_balance_history_schema_zod.getBalanceHistoryFnInputSchema);
|
|
@@ -37,8 +36,8 @@ function getBalanceHistory(options, input, fnOptions) {
|
|
|
37
36
|
}
|
|
38
37
|
return client.api.getBalanceHistory({
|
|
39
38
|
balance: {
|
|
40
|
-
wallet:
|
|
41
|
-
token
|
|
39
|
+
wallet: inputCopy.wallet,
|
|
40
|
+
token,
|
|
42
41
|
datetime: inputCopy.datetime
|
|
43
42
|
},
|
|
44
43
|
options: inputCopy.options
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// src/fns/get-balance-history/get-balance-history.ts
|
|
2
2
|
import { InputError } from "../../lib/errors.js";
|
|
3
|
-
import { getForeign } from "../../lib/utils.js";
|
|
4
3
|
import { getValidator } from "../../lib/validation.js";
|
|
5
4
|
import { getBalanceHistoryFnInputSchema } from "./get-balance-history.schema.zod.js";
|
|
6
5
|
var zodValidator = getValidator(getBalanceHistoryFnInputSchema);
|
|
@@ -13,8 +12,8 @@ function getBalanceHistory(options, input, fnOptions) {
|
|
|
13
12
|
}
|
|
14
13
|
return client.api.getBalanceHistory({
|
|
15
14
|
balance: {
|
|
16
|
-
wallet:
|
|
17
|
-
token
|
|
15
|
+
wallet: inputCopy.wallet,
|
|
16
|
+
token,
|
|
18
17
|
datetime: inputCopy.datetime
|
|
19
18
|
},
|
|
20
19
|
options: inputCopy.options
|
|
@@ -24,24 +24,30 @@ __export(get_token_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(get_token_exports);
|
|
26
26
|
var import_errors = require("../../lib/errors.browser.cjs");
|
|
27
|
-
var import_utils = require("../../lib/utils.browser.cjs");
|
|
28
27
|
var import_validation = require("../../lib/validation.browser.cjs");
|
|
29
28
|
var import_get_token_schema_zod = require("./get-token.schema.zod.browser.cjs");
|
|
30
29
|
var zodValidator = (0, import_validation.getValidator)(import_get_token_schema_zod.getTokenFnInputSchema);
|
|
31
30
|
function getToken(options, input = {}, fnOptions) {
|
|
32
31
|
const { client } = options;
|
|
33
|
-
|
|
34
|
-
input,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
if (!input.token && !input.foreign && !client.getConfig("token")) {
|
|
33
|
+
throw new import_errors.ValidationError({ input }, `token is required if no default set`);
|
|
34
|
+
}
|
|
35
|
+
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
36
|
+
if (inputCopy.foreign) {
|
|
37
|
+
console.log(".foreign is deprecated, use .token");
|
|
38
|
+
}
|
|
39
|
+
if ("token" in input && input.token === void 0) {
|
|
40
|
+
throw new import_errors.ValidationError({ input }, `undefined provided for token`);
|
|
41
|
+
}
|
|
42
|
+
if ("foreign" in input && input.foreign === void 0) {
|
|
43
|
+
throw new import_errors.ValidationError({ input }, `undefined provided for foreign`);
|
|
44
|
+
}
|
|
45
|
+
const token = inputCopy.token || inputCopy.foreign || client.getConfig("token");
|
|
40
46
|
if (token === void 0) {
|
|
41
47
|
throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input });
|
|
42
48
|
}
|
|
43
49
|
return client.api.getToken({
|
|
44
|
-
token
|
|
50
|
+
token,
|
|
45
51
|
options: inputCopy.options
|
|
46
52
|
});
|
|
47
53
|
}
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
// src/fns/get-token/get-token.ts
|
|
2
|
-
import { InputError } from "../../lib/errors.browser.js";
|
|
3
|
-
import { checkCopyObject, getForeign } from "../../lib/utils.browser.js";
|
|
2
|
+
import { InputError, ValidationError } from "../../lib/errors.browser.js";
|
|
4
3
|
import { getValidator } from "../../lib/validation.browser.js";
|
|
5
4
|
import { getTokenFnInputSchema } from "./get-token.schema.zod.browser.js";
|
|
6
5
|
var zodValidator = getValidator(getTokenFnInputSchema);
|
|
7
6
|
function getToken(options, input = {}, fnOptions) {
|
|
8
7
|
const { client } = options;
|
|
9
|
-
|
|
10
|
-
input,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
if (!input.token && !input.foreign && !client.getConfig("token")) {
|
|
9
|
+
throw new ValidationError({ input }, `token is required if no default set`);
|
|
10
|
+
}
|
|
11
|
+
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
12
|
+
if (inputCopy.foreign) {
|
|
13
|
+
console.log(".foreign is deprecated, use .token");
|
|
14
|
+
}
|
|
15
|
+
if ("token" in input && input.token === void 0) {
|
|
16
|
+
throw new ValidationError({ input }, `undefined provided for token`);
|
|
17
|
+
}
|
|
18
|
+
if ("foreign" in input && input.foreign === void 0) {
|
|
19
|
+
throw new ValidationError({ input }, `undefined provided for foreign`);
|
|
20
|
+
}
|
|
21
|
+
const token = inputCopy.token || inputCopy.foreign || client.getConfig("token");
|
|
16
22
|
if (token === void 0) {
|
|
17
23
|
throw new InputError("INPUT_NEEDS_TOKEN", { input });
|
|
18
24
|
}
|
|
19
25
|
return client.api.getToken({
|
|
20
|
-
token
|
|
26
|
+
token,
|
|
21
27
|
options: inputCopy.options
|
|
22
28
|
});
|
|
23
29
|
}
|
|
@@ -24,24 +24,30 @@ __export(get_token_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(get_token_exports);
|
|
26
26
|
var import_errors = require("../../lib/errors.cjs");
|
|
27
|
-
var import_utils = require("../../lib/utils.cjs");
|
|
28
27
|
var import_validation = require("../../lib/validation.cjs");
|
|
29
28
|
var import_get_token_schema_zod = require("./get-token.schema.zod.cjs");
|
|
30
29
|
var zodValidator = (0, import_validation.getValidator)(import_get_token_schema_zod.getTokenFnInputSchema);
|
|
31
30
|
function getToken(options, input = {}, fnOptions) {
|
|
32
31
|
const { client } = options;
|
|
33
|
-
|
|
34
|
-
input,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
if (!input.token && !input.foreign && !client.getConfig("token")) {
|
|
33
|
+
throw new import_errors.ValidationError({ input }, `token is required if no default set`);
|
|
34
|
+
}
|
|
35
|
+
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
36
|
+
if (inputCopy.foreign) {
|
|
37
|
+
console.log(".foreign is deprecated, use .token");
|
|
38
|
+
}
|
|
39
|
+
if ("token" in input && input.token === void 0) {
|
|
40
|
+
throw new import_errors.ValidationError({ input }, `undefined provided for token`);
|
|
41
|
+
}
|
|
42
|
+
if ("foreign" in input && input.foreign === void 0) {
|
|
43
|
+
throw new import_errors.ValidationError({ input }, `undefined provided for foreign`);
|
|
44
|
+
}
|
|
45
|
+
const token = inputCopy.token || inputCopy.foreign || client.getConfig("token");
|
|
40
46
|
if (token === void 0) {
|
|
41
47
|
throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input });
|
|
42
48
|
}
|
|
43
49
|
return client.api.getToken({
|
|
44
|
-
token
|
|
50
|
+
token,
|
|
45
51
|
options: inputCopy.options
|
|
46
52
|
});
|
|
47
53
|
}
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
// src/fns/get-token/get-token.ts
|
|
2
|
-
import { InputError } from "../../lib/errors.js";
|
|
3
|
-
import { checkCopyObject, getForeign } from "../../lib/utils.js";
|
|
2
|
+
import { InputError, ValidationError } from "../../lib/errors.js";
|
|
4
3
|
import { getValidator } from "../../lib/validation.js";
|
|
5
4
|
import { getTokenFnInputSchema } from "./get-token.schema.zod.js";
|
|
6
5
|
var zodValidator = getValidator(getTokenFnInputSchema);
|
|
7
6
|
function getToken(options, input = {}, fnOptions) {
|
|
8
7
|
const { client } = options;
|
|
9
|
-
|
|
10
|
-
input,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
if (!input.token && !input.foreign && !client.getConfig("token")) {
|
|
9
|
+
throw new ValidationError({ input }, `token is required if no default set`);
|
|
10
|
+
}
|
|
11
|
+
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
12
|
+
if (inputCopy.foreign) {
|
|
13
|
+
console.log(".foreign is deprecated, use .token");
|
|
14
|
+
}
|
|
15
|
+
if ("token" in input && input.token === void 0) {
|
|
16
|
+
throw new ValidationError({ input }, `undefined provided for token`);
|
|
17
|
+
}
|
|
18
|
+
if ("foreign" in input && input.foreign === void 0) {
|
|
19
|
+
throw new ValidationError({ input }, `undefined provided for foreign`);
|
|
20
|
+
}
|
|
21
|
+
const token = inputCopy.token || inputCopy.foreign || client.getConfig("token");
|
|
16
22
|
if (token === void 0) {
|
|
17
23
|
throw new InputError("INPUT_NEEDS_TOKEN", { input });
|
|
18
24
|
}
|
|
19
25
|
return client.api.getToken({
|
|
20
|
-
token
|
|
26
|
+
token,
|
|
21
27
|
options: inputCopy.options
|
|
22
28
|
});
|
|
23
29
|
}
|
|
@@ -34,7 +34,8 @@ var getTokenFnOptionsSchema = import_get_token_schema_zod.getTokenTxInputOptions
|
|
|
34
34
|
"Optional flags for input"
|
|
35
35
|
);
|
|
36
36
|
var getTokenInputSchema = import_zod.z.object({
|
|
37
|
-
foreign: import_consts.allowedStringIntSchema.describe("Foreign of the token")
|
|
37
|
+
foreign: import_consts.allowedStringIntSchema.describe("Foreign of the token"),
|
|
38
|
+
token: import_consts.allowedStringIntSchema.describe("Foreign of the token")
|
|
38
39
|
}).partial();
|
|
39
40
|
var getTokenFnInputSchema = getTokenInputSchema.extend({
|
|
40
41
|
options: getTokenFnOptionsSchema.optional()
|
|
@@ -9,7 +9,8 @@ var getTokenFnOptionsSchema = getTokenTxInputOptionsSchema.describe(
|
|
|
9
9
|
"Optional flags for input"
|
|
10
10
|
);
|
|
11
11
|
var getTokenInputSchema = z.object({
|
|
12
|
-
foreign: allowedStringIntSchema.describe("Foreign of the token")
|
|
12
|
+
foreign: allowedStringIntSchema.describe("Foreign of the token"),
|
|
13
|
+
token: allowedStringIntSchema.describe("Foreign of the token")
|
|
13
14
|
}).partial();
|
|
14
15
|
var getTokenFnInputSchema = getTokenInputSchema.extend({
|
|
15
16
|
options: getTokenFnOptionsSchema.optional()
|
|
@@ -34,7 +34,8 @@ var getTokenFnOptionsSchema = import_get_token_schema_zod.getTokenTxInputOptions
|
|
|
34
34
|
"Optional flags for input"
|
|
35
35
|
);
|
|
36
36
|
var getTokenInputSchema = import_zod.z.object({
|
|
37
|
-
foreign: import_consts.allowedStringIntSchema.describe("Foreign of the token")
|
|
37
|
+
foreign: import_consts.allowedStringIntSchema.describe("Foreign of the token"),
|
|
38
|
+
token: import_consts.allowedStringIntSchema.describe("Foreign of the token")
|
|
38
39
|
}).partial();
|
|
39
40
|
var getTokenFnInputSchema = getTokenInputSchema.extend({
|
|
40
41
|
options: getTokenFnOptionsSchema.optional()
|
|
@@ -9,7 +9,8 @@ var getTokenFnOptionsSchema = getTokenTxInputOptionsSchema.describe(
|
|
|
9
9
|
"Optional flags for input"
|
|
10
10
|
);
|
|
11
11
|
var getTokenInputSchema = z.object({
|
|
12
|
-
foreign: allowedStringIntSchema.describe("Foreign of the token")
|
|
12
|
+
foreign: allowedStringIntSchema.describe("Foreign of the token"),
|
|
13
|
+
token: allowedStringIntSchema.describe("Foreign of the token")
|
|
13
14
|
}).partial();
|
|
14
15
|
var getTokenFnInputSchema = getTokenInputSchema.extend({
|
|
15
16
|
options: getTokenFnOptionsSchema.optional()
|
|
@@ -23,7 +23,6 @@ __export(get_transfer_exports, {
|
|
|
23
23
|
getTransfer: () => getTransfer
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(get_transfer_exports);
|
|
26
|
-
var import_utils = require("../../lib/utils.browser.cjs");
|
|
27
26
|
var import_validation = require("../../lib/validation.browser.cjs");
|
|
28
27
|
var import_get_transfer_schema_zod = require("./get-transfer.schema.zod.browser.cjs");
|
|
29
28
|
var zodValidator = (0, import_validation.getValidator)(import_get_transfer_schema_zod.getTransferFnInputSchema);
|
|
@@ -31,7 +30,7 @@ function getTransfer(options, input, fnOptions) {
|
|
|
31
30
|
const { client } = options;
|
|
32
31
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
33
32
|
return client.api.getTransfer({
|
|
34
|
-
transfer:
|
|
33
|
+
transfer: inputCopy.transfer,
|
|
35
34
|
options: inputCopy.options
|
|
36
35
|
});
|
|
37
36
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// src/fns/get-transfer/get-transfer.ts
|
|
2
|
-
import { getIdentifierFilter } from "../../lib/utils.browser.js";
|
|
3
2
|
import { getValidator } from "../../lib/validation.browser.js";
|
|
4
3
|
import { getTransferFnInputSchema } from "./get-transfer.schema.zod.browser.js";
|
|
5
4
|
var zodValidator = getValidator(getTransferFnInputSchema);
|
|
@@ -7,7 +6,7 @@ function getTransfer(options, input, fnOptions) {
|
|
|
7
6
|
const { client } = options;
|
|
8
7
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
9
8
|
return client.api.getTransfer({
|
|
10
|
-
transfer:
|
|
9
|
+
transfer: inputCopy.transfer,
|
|
11
10
|
options: inputCopy.options
|
|
12
11
|
});
|
|
13
12
|
}
|
|
@@ -23,7 +23,6 @@ __export(get_transfer_exports, {
|
|
|
23
23
|
getTransfer: () => getTransfer
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(get_transfer_exports);
|
|
26
|
-
var import_utils = require("../../lib/utils.cjs");
|
|
27
26
|
var import_validation = require("../../lib/validation.cjs");
|
|
28
27
|
var import_get_transfer_schema_zod = require("./get-transfer.schema.zod.cjs");
|
|
29
28
|
var zodValidator = (0, import_validation.getValidator)(import_get_transfer_schema_zod.getTransferFnInputSchema);
|
|
@@ -31,7 +30,7 @@ function getTransfer(options, input, fnOptions) {
|
|
|
31
30
|
const { client } = options;
|
|
32
31
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
33
32
|
return client.api.getTransfer({
|
|
34
|
-
transfer:
|
|
33
|
+
transfer: inputCopy.transfer,
|
|
35
34
|
options: inputCopy.options
|
|
36
35
|
});
|
|
37
36
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// src/fns/get-transfer/get-transfer.ts
|
|
2
|
-
import { getIdentifierFilter } from "../../lib/utils.js";
|
|
3
2
|
import { getValidator } from "../../lib/validation.js";
|
|
4
3
|
import { getTransferFnInputSchema } from "./get-transfer.schema.zod.js";
|
|
5
4
|
var zodValidator = getValidator(getTransferFnInputSchema);
|
|
@@ -7,7 +6,7 @@ function getTransfer(options, input, fnOptions) {
|
|
|
7
6
|
const { client } = options;
|
|
8
7
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
9
8
|
return client.api.getTransfer({
|
|
10
|
-
transfer:
|
|
9
|
+
transfer: inputCopy.transfer,
|
|
11
10
|
options: inputCopy.options
|
|
12
11
|
});
|
|
13
12
|
}
|
|
@@ -23,7 +23,6 @@ __export(get_transfer_group_exports, {
|
|
|
23
23
|
getTransferGroup: () => getTransferGroup
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(get_transfer_group_exports);
|
|
26
|
-
var import_utils = require("../../lib/utils.browser.cjs");
|
|
27
26
|
var import_validation = require("../../lib/validation.browser.cjs");
|
|
28
27
|
var import_get_transfer_group_schema_zod = require("./get-transfer-group.schema.zod.browser.cjs");
|
|
29
28
|
var zodValidator = (0, import_validation.getValidator)(import_get_transfer_group_schema_zod.getTransferGroupFnInputSchema);
|
|
@@ -31,7 +30,7 @@ function getTransferGroup(options, input, fnOptions) {
|
|
|
31
30
|
const { client } = options;
|
|
32
31
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
33
32
|
return client.api.getTransferGroup({
|
|
34
|
-
transfer_group:
|
|
33
|
+
transfer_group: inputCopy.transfer_group,
|
|
35
34
|
options: inputCopy.options
|
|
36
35
|
});
|
|
37
36
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// src/fns/get-transfer-group/get-transfer-group.ts
|
|
2
|
-
import { getIdentifierFilter } from "../../lib/utils.browser.js";
|
|
3
2
|
import { getValidator } from "../../lib/validation.browser.js";
|
|
4
3
|
import { getTransferGroupFnInputSchema } from "./get-transfer-group.schema.zod.browser.js";
|
|
5
4
|
var zodValidator = getValidator(getTransferGroupFnInputSchema);
|
|
@@ -7,7 +6,7 @@ function getTransferGroup(options, input, fnOptions) {
|
|
|
7
6
|
const { client } = options;
|
|
8
7
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
9
8
|
return client.api.getTransferGroup({
|
|
10
|
-
transfer_group:
|
|
9
|
+
transfer_group: inputCopy.transfer_group,
|
|
11
10
|
options: inputCopy.options
|
|
12
11
|
});
|
|
13
12
|
}
|
|
@@ -23,7 +23,6 @@ __export(get_transfer_group_exports, {
|
|
|
23
23
|
getTransferGroup: () => getTransferGroup
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(get_transfer_group_exports);
|
|
26
|
-
var import_utils = require("../../lib/utils.cjs");
|
|
27
26
|
var import_validation = require("../../lib/validation.cjs");
|
|
28
27
|
var import_get_transfer_group_schema_zod = require("./get-transfer-group.schema.zod.cjs");
|
|
29
28
|
var zodValidator = (0, import_validation.getValidator)(import_get_transfer_group_schema_zod.getTransferGroupFnInputSchema);
|
|
@@ -31,7 +30,7 @@ function getTransferGroup(options, input, fnOptions) {
|
|
|
31
30
|
const { client } = options;
|
|
32
31
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
33
32
|
return client.api.getTransferGroup({
|
|
34
|
-
transfer_group:
|
|
33
|
+
transfer_group: inputCopy.transfer_group,
|
|
35
34
|
options: inputCopy.options
|
|
36
35
|
});
|
|
37
36
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// src/fns/get-transfer-group/get-transfer-group.ts
|
|
2
|
-
import { getIdentifierFilter } from "../../lib/utils.js";
|
|
3
2
|
import { getValidator } from "../../lib/validation.js";
|
|
4
3
|
import { getTransferGroupFnInputSchema } from "./get-transfer-group.schema.zod.js";
|
|
5
4
|
var zodValidator = getValidator(getTransferGroupFnInputSchema);
|
|
@@ -7,7 +6,7 @@ function getTransferGroup(options, input, fnOptions) {
|
|
|
7
6
|
const { client } = options;
|
|
8
7
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
9
8
|
return client.api.getTransferGroup({
|
|
10
|
-
transfer_group:
|
|
9
|
+
transfer_group: inputCopy.transfer_group,
|
|
11
10
|
options: inputCopy.options
|
|
12
11
|
});
|
|
13
12
|
}
|
|
@@ -23,7 +23,6 @@ __export(get_wallet_exports, {
|
|
|
23
23
|
getWallet: () => getWallet
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(get_wallet_exports);
|
|
26
|
-
var import_utils = require("../../lib/utils.browser.cjs");
|
|
27
26
|
var import_validation = require("../../lib/validation.browser.cjs");
|
|
28
27
|
var import_get_wallet_schema_zod = require("./get-wallet.schema.zod.browser.cjs");
|
|
29
28
|
var zodValidator = (0, import_validation.getValidator)(import_get_wallet_schema_zod.getWalletFnInputSchema);
|
|
@@ -31,7 +30,7 @@ function getWallet(options, input, fnOptions) {
|
|
|
31
30
|
const { client } = options;
|
|
32
31
|
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
33
32
|
return client.api.getWallet({
|
|
34
|
-
wallet:
|
|
33
|
+
wallet: inputCopy.wallet,
|
|
35
34
|
options: inputCopy.options
|
|
36
35
|
});
|
|
37
36
|
}
|