wapi-client 0.16.0 → 0.17.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/client.browser.cjs +109 -0
- package/dist/client.browser.js +109 -0
- package/dist/client.cjs +109 -0
- package/dist/client.js +109 -0
- package/dist/fns/create-apikey/create-apikey.browser.cjs +51 -0
- package/dist/fns/create-apikey/create-apikey.browser.js +32 -0
- package/dist/fns/create-apikey/create-apikey.cjs +55 -0
- package/dist/fns/create-apikey/create-apikey.enums.browser.cjs +18 -0
- package/dist/fns/create-apikey/create-apikey.enums.browser.js +0 -0
- package/dist/fns/create-apikey/create-apikey.enums.cjs +18 -0
- package/dist/fns/create-apikey/create-apikey.enums.js +0 -0
- package/dist/fns/create-apikey/create-apikey.js +32 -0
- package/dist/fns/create-apikey/create-apikey.schema.zod.browser.cjs +49 -0
- package/dist/fns/create-apikey/create-apikey.schema.zod.browser.js +32 -0
- package/dist/fns/create-apikey/create-apikey.schema.zod.cjs +57 -0
- package/dist/fns/create-apikey/create-apikey.schema.zod.js +32 -0
- package/dist/fns/find-apikeys/find-apikeys.browser.cjs +49 -0
- package/dist/fns/find-apikeys/find-apikeys.browser.js +33 -0
- package/dist/fns/find-apikeys/find-apikeys.cjs +53 -0
- package/dist/fns/find-apikeys/find-apikeys.enums.browser.cjs +18 -0
- package/dist/fns/find-apikeys/find-apikeys.enums.browser.js +0 -0
- package/dist/fns/find-apikeys/find-apikeys.enums.cjs +18 -0
- package/dist/fns/find-apikeys/find-apikeys.enums.js +0 -0
- package/dist/fns/find-apikeys/find-apikeys.js +33 -0
- package/dist/fns/find-apikeys/find-apikeys.schema.zod.browser.cjs +64 -0
- package/dist/fns/find-apikeys/find-apikeys.schema.zod.browser.js +52 -0
- package/dist/fns/find-apikeys/find-apikeys.schema.zod.cjs +72 -0
- package/dist/fns/find-apikeys/find-apikeys.schema.zod.js +52 -0
- package/dist/fns/fn-types.browser.cjs +2 -0
- package/dist/fns/fn-types.browser.js +2 -0
- package/dist/fns/fn-types.cjs +4 -0
- package/dist/fns/fn-types.js +2 -0
- package/dist/fns/update-apikey/update-apikey.browser.cjs +41 -0
- package/dist/fns/update-apikey/update-apikey.browser.js +20 -0
- package/dist/fns/update-apikey/update-apikey.cjs +45 -0
- package/dist/fns/update-apikey/update-apikey.enums.browser.cjs +18 -0
- package/dist/fns/update-apikey/update-apikey.enums.browser.js +0 -0
- package/dist/fns/update-apikey/update-apikey.enums.cjs +18 -0
- package/dist/fns/update-apikey/update-apikey.enums.js +0 -0
- package/dist/fns/update-apikey/update-apikey.js +20 -0
- package/dist/fns/update-apikey/update-apikey.schema.zod.browser.cjs +48 -0
- package/dist/fns/update-apikey/update-apikey.schema.zod.browser.js +30 -0
- package/dist/fns/update-apikey/update-apikey.schema.zod.cjs +56 -0
- package/dist/fns/update-apikey/update-apikey.schema.zod.js +30 -0
- 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 +15 -0
- package/dist/lib/errors.browser.js +15 -0
- package/dist/lib/errors.cjs +15 -0
- package/dist/lib/errors.js +15 -0
- package/dist/lib/validator.browser.cjs +15 -6
- package/dist/lib/validator.browser.js +18 -0
- package/dist/lib/validator.cjs +15 -6
- package/dist/lib/validator.js +18 -0
- package/dist/txs/consts.browser.cjs +4 -1
- package/dist/txs/consts.browser.js +4 -1
- package/dist/txs/consts.cjs +4 -1
- package/dist/txs/consts.js +4 -1
- package/dist/txs/create-apikey/create-apikey.schema.zod.browser.cjs +6 -4
- package/dist/txs/create-apikey/create-apikey.schema.zod.browser.js +7 -5
- package/dist/txs/create-apikey/create-apikey.schema.zod.cjs +6 -4
- package/dist/txs/create-apikey/create-apikey.schema.zod.js +7 -5
- package/dist/txs/find-apikey-many/find-apikey-many.schema.zod.browser.cjs +2 -2
- package/dist/txs/find-apikey-many/find-apikey-many.schema.zod.browser.js +2 -2
- package/dist/txs/find-apikey-many/find-apikey-many.schema.zod.cjs +2 -2
- package/dist/txs/find-apikey-many/find-apikey-many.schema.zod.js +2 -2
- package/dist/txs/get-balance/get-balance.schema.zod.browser.cjs +1 -1
- package/dist/txs/get-balance/get-balance.schema.zod.browser.js +1 -1
- package/dist/txs/get-balance/get-balance.schema.zod.cjs +1 -1
- package/dist/txs/get-balance/get-balance.schema.zod.js +1 -1
- package/dist/txs/get-balance-history/get-balance-history.schema.zod.browser.cjs +1 -0
- package/dist/txs/get-balance-history/get-balance-history.schema.zod.browser.js +1 -0
- package/dist/txs/get-balance-history/get-balance-history.schema.zod.cjs +1 -0
- package/dist/txs/get-balance-history/get-balance-history.schema.zod.js +1 -0
- package/dist/types/wapi-client.d.ts +2700 -1870
- package/dist/wapi-client-web.iife.js +6 -6
- package/dist/wapi-client.iife.js +6 -6
- package/package.json +1 -1
package/dist/client.browser.cjs
CHANGED
|
@@ -65,6 +65,7 @@ var import_errors = require("./lib/errors.browser.cjs");
|
|
|
65
65
|
var import_env = require("./lib/env.browser.cjs");
|
|
66
66
|
var import_aggregate_transfers = require("./fns/aggregate-transfers/aggregate-transfers.browser.cjs");
|
|
67
67
|
var import_create_access_token = require("./fns/create-access-token/create-access-token.browser.cjs");
|
|
68
|
+
var import_create_apikey = require("./fns/create-apikey/create-apikey.browser.cjs");
|
|
68
69
|
var import_create_contract = require("./fns/create-contract/create-contract.browser.cjs");
|
|
69
70
|
var import_create_deposit = require("./fns/create-deposit/create-deposit.browser.cjs");
|
|
70
71
|
var import_create_exchange = require("./fns/create-exchange/create-exchange.browser.cjs");
|
|
@@ -80,6 +81,7 @@ var import_export_tokens = require("./fns/export-tokens/export-tokens.browser.cj
|
|
|
80
81
|
var import_export_transfer_groups = require("./fns/export-transfer-groups/export-transfer-groups.browser.cjs");
|
|
81
82
|
var import_export_transfers = require("./fns/export-transfers/export-transfers.browser.cjs");
|
|
82
83
|
var import_export_wallets = require("./fns/export-wallets/export-wallets.browser.cjs");
|
|
84
|
+
var import_find_apikeys = require("./fns/find-apikeys/find-apikeys.browser.cjs");
|
|
83
85
|
var import_find_balances = require("./fns/find-balances/find-balances.browser.cjs");
|
|
84
86
|
var import_find_tokens = require("./fns/find-tokens/find-tokens.browser.cjs");
|
|
85
87
|
var import_find_transfer_groups = require("./fns/find-transfer-groups/find-transfer-groups.browser.cjs");
|
|
@@ -101,6 +103,7 @@ var import_reverse_transfer_group = require("./fns/reverse-transfer-group/revers
|
|
|
101
103
|
var import_reverse_transfers = require("./fns/reverse-transfers/reverse-transfers.browser.cjs");
|
|
102
104
|
var import_set_flags = require("./fns/set-flags/set-flags.browser.cjs");
|
|
103
105
|
var import_update_token = require("./fns/update-token/update-token.browser.cjs");
|
|
106
|
+
var import_update_apikey = require("./fns/update-apikey/update-apikey.browser.cjs");
|
|
104
107
|
var import_update_transfer = require("./fns/update-transfer/update-transfer.browser.cjs");
|
|
105
108
|
var import_update_transfer_group = require("./fns/update-transfer-group/update-transfer-group.browser.cjs");
|
|
106
109
|
var import_update_transfer_groups = require("./fns/update-transfer-groups/update-transfer-groups.browser.cjs");
|
|
@@ -359,6 +362,39 @@ var Client = class {
|
|
|
359
362
|
createAccessToken(input, options) {
|
|
360
363
|
return (0, import_create_access_token.createAccessToken)({ client: this }, input != null ? input : {}, options);
|
|
361
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
*
|
|
367
|
+
* Create a new API key for accessing WAPI
|
|
368
|
+
*
|
|
369
|
+
*
|
|
370
|
+
* ```javascript
|
|
371
|
+
*
|
|
372
|
+
* const response = await wapiClient.createApikey({
|
|
373
|
+
* apikey: {
|
|
374
|
+
* type: 'admin',
|
|
375
|
+
* description: 'My admin API key',
|
|
376
|
+
* validUntil: '2025-12-31T23:59:59Z',
|
|
377
|
+
* metadata: {
|
|
378
|
+
* purpose: 'backend-service',
|
|
379
|
+
* },
|
|
380
|
+
* },
|
|
381
|
+
* });
|
|
382
|
+
*
|
|
383
|
+
* // Or create a limited API key with specific function access
|
|
384
|
+
* const limitedResponse = await wapiClient.createApikey({
|
|
385
|
+
* apikey: {
|
|
386
|
+
* type: 'limited',
|
|
387
|
+
* description: 'Read-only API key',
|
|
388
|
+
* functions: ['getBalance', 'getWallet', 'findTransfers'],
|
|
389
|
+
* },
|
|
390
|
+
* });
|
|
391
|
+
*
|
|
392
|
+
* ```
|
|
393
|
+
*
|
|
394
|
+
*/
|
|
395
|
+
createApikey(input, options) {
|
|
396
|
+
return (0, import_create_apikey.createApikey)({ client: this }, input, options);
|
|
397
|
+
}
|
|
362
398
|
/**
|
|
363
399
|
*
|
|
364
400
|
* Create a contract like transferGroup
|
|
@@ -1101,6 +1137,41 @@ var Client = class {
|
|
|
1101
1137
|
exportWallets(input, options) {
|
|
1102
1138
|
return (0, import_export_wallets.exportWallets)({ client: this }, input, options);
|
|
1103
1139
|
}
|
|
1140
|
+
/**
|
|
1141
|
+
*
|
|
1142
|
+
* Search for API keys using either a simple filter or queryBuilder
|
|
1143
|
+
*
|
|
1144
|
+
*
|
|
1145
|
+
* ```javascript
|
|
1146
|
+
*
|
|
1147
|
+
* const result = await wapiClient
|
|
1148
|
+
* .findApikeys()
|
|
1149
|
+
* .where({
|
|
1150
|
+
* type: 'admin',
|
|
1151
|
+
* })
|
|
1152
|
+
* .orWhere({
|
|
1153
|
+
* status: 'active',
|
|
1154
|
+
* })
|
|
1155
|
+
* .limit(10)
|
|
1156
|
+
* .offset(0)
|
|
1157
|
+
* .orderBy('created_at', 'desc')
|
|
1158
|
+
* .options({
|
|
1159
|
+
* tracking_id: 'hello',
|
|
1160
|
+
* return_metadata_total: true,
|
|
1161
|
+
* });
|
|
1162
|
+
*
|
|
1163
|
+
* // Or with simple filter
|
|
1164
|
+
* const adminKeys = await wapiClient.findApikeys({
|
|
1165
|
+
* type: 'admin',
|
|
1166
|
+
* status: 'active',
|
|
1167
|
+
* });
|
|
1168
|
+
*
|
|
1169
|
+
* ```
|
|
1170
|
+
*
|
|
1171
|
+
*/
|
|
1172
|
+
findApikeys(input, options) {
|
|
1173
|
+
return (0, import_find_apikeys.findApikeys)({ client: this }, input, options);
|
|
1174
|
+
}
|
|
1104
1175
|
/**
|
|
1105
1176
|
*
|
|
1106
1177
|
* Search for Balances using either a simple filter or queryBuilder
|
|
@@ -1967,6 +2038,44 @@ var Client = class {
|
|
|
1967
2038
|
updateToken(input, options) {
|
|
1968
2039
|
return (0, import_update_token.updateToken)({ client: this }, input, options);
|
|
1969
2040
|
}
|
|
2041
|
+
/**
|
|
2042
|
+
*
|
|
2043
|
+
* Update an API key
|
|
2044
|
+
*
|
|
2045
|
+
*
|
|
2046
|
+
* ```javascript
|
|
2047
|
+
*
|
|
2048
|
+
* const result = await wapiClient.updateApikey(
|
|
2049
|
+
* {
|
|
2050
|
+
* apikey: 'my-apikey-id',
|
|
2051
|
+
* metadata: {
|
|
2052
|
+
* updated: true,
|
|
2053
|
+
* },
|
|
2054
|
+
* },
|
|
2055
|
+
* {
|
|
2056
|
+
* return_when_not_updated: true,
|
|
2057
|
+
* tracking_id: 'mylogId',
|
|
2058
|
+
* },
|
|
2059
|
+
* );
|
|
2060
|
+
*
|
|
2061
|
+
* // Delete an API key
|
|
2062
|
+
* const deleteResult = await wapiClient.updateApikey({
|
|
2063
|
+
* apikey: 'my-apikey-id',
|
|
2064
|
+
* status: 'deleted',
|
|
2065
|
+
* });
|
|
2066
|
+
*
|
|
2067
|
+
* // Regenerate apisecret
|
|
2068
|
+
* const regenerateResult = await wapiClient.updateApikey({
|
|
2069
|
+
* apikey: 'my-apikey-id',
|
|
2070
|
+
* apisecret: true,
|
|
2071
|
+
* });
|
|
2072
|
+
*
|
|
2073
|
+
* ```
|
|
2074
|
+
*
|
|
2075
|
+
*/
|
|
2076
|
+
updateApikey(input, options) {
|
|
2077
|
+
return (0, import_update_apikey.updateApikey)({ client: this }, input, options);
|
|
2078
|
+
}
|
|
1970
2079
|
/**
|
|
1971
2080
|
*
|
|
1972
2081
|
* Update a Transfer
|
package/dist/client.browser.js
CHANGED
|
@@ -45,6 +45,7 @@ import { ConfigError } from "./lib/errors.browser.js";
|
|
|
45
45
|
import { CLIENT_VERSION } from "./lib/env.browser.js";
|
|
46
46
|
import { aggregateTransfers } from "./fns/aggregate-transfers/aggregate-transfers.browser.js";
|
|
47
47
|
import { createAccessToken } from "./fns/create-access-token/create-access-token.browser.js";
|
|
48
|
+
import { createApikey } from "./fns/create-apikey/create-apikey.browser.js";
|
|
48
49
|
import { createContract } from "./fns/create-contract/create-contract.browser.js";
|
|
49
50
|
import { createDeposit } from "./fns/create-deposit/create-deposit.browser.js";
|
|
50
51
|
import { createExchange } from "./fns/create-exchange/create-exchange.browser.js";
|
|
@@ -60,6 +61,7 @@ import { exportTokens } from "./fns/export-tokens/export-tokens.browser.js";
|
|
|
60
61
|
import { exportTransferGroups } from "./fns/export-transfer-groups/export-transfer-groups.browser.js";
|
|
61
62
|
import { exportTransfers } from "./fns/export-transfers/export-transfers.browser.js";
|
|
62
63
|
import { exportWallets } from "./fns/export-wallets/export-wallets.browser.js";
|
|
64
|
+
import { findApikeys } from "./fns/find-apikeys/find-apikeys.browser.js";
|
|
63
65
|
import { findBalances } from "./fns/find-balances/find-balances.browser.js";
|
|
64
66
|
import { findTokens } from "./fns/find-tokens/find-tokens.browser.js";
|
|
65
67
|
import { findTransferGroups } from "./fns/find-transfer-groups/find-transfer-groups.browser.js";
|
|
@@ -81,6 +83,7 @@ import { reverseTransferGroup } from "./fns/reverse-transfer-group/reverse-trans
|
|
|
81
83
|
import { reverseTransfers } from "./fns/reverse-transfers/reverse-transfers.browser.js";
|
|
82
84
|
import { setFlags } from "./fns/set-flags/set-flags.browser.js";
|
|
83
85
|
import { updateToken } from "./fns/update-token/update-token.browser.js";
|
|
86
|
+
import { updateApikey } from "./fns/update-apikey/update-apikey.browser.js";
|
|
84
87
|
import { updateTransfer } from "./fns/update-transfer/update-transfer.browser.js";
|
|
85
88
|
import { updateTransferGroup } from "./fns/update-transfer-group/update-transfer-group.browser.js";
|
|
86
89
|
import { updateTransferGroups } from "./fns/update-transfer-groups/update-transfer-groups.browser.js";
|
|
@@ -339,6 +342,39 @@ var Client = class {
|
|
|
339
342
|
createAccessToken(input, options) {
|
|
340
343
|
return createAccessToken({ client: this }, input != null ? input : {}, options);
|
|
341
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
*
|
|
347
|
+
* Create a new API key for accessing WAPI
|
|
348
|
+
*
|
|
349
|
+
*
|
|
350
|
+
* ```javascript
|
|
351
|
+
*
|
|
352
|
+
* const response = await wapiClient.createApikey({
|
|
353
|
+
* apikey: {
|
|
354
|
+
* type: 'admin',
|
|
355
|
+
* description: 'My admin API key',
|
|
356
|
+
* validUntil: '2025-12-31T23:59:59Z',
|
|
357
|
+
* metadata: {
|
|
358
|
+
* purpose: 'backend-service',
|
|
359
|
+
* },
|
|
360
|
+
* },
|
|
361
|
+
* });
|
|
362
|
+
*
|
|
363
|
+
* // Or create a limited API key with specific function access
|
|
364
|
+
* const limitedResponse = await wapiClient.createApikey({
|
|
365
|
+
* apikey: {
|
|
366
|
+
* type: 'limited',
|
|
367
|
+
* description: 'Read-only API key',
|
|
368
|
+
* functions: ['getBalance', 'getWallet', 'findTransfers'],
|
|
369
|
+
* },
|
|
370
|
+
* });
|
|
371
|
+
*
|
|
372
|
+
* ```
|
|
373
|
+
*
|
|
374
|
+
*/
|
|
375
|
+
createApikey(input, options) {
|
|
376
|
+
return createApikey({ client: this }, input, options);
|
|
377
|
+
}
|
|
342
378
|
/**
|
|
343
379
|
*
|
|
344
380
|
* Create a contract like transferGroup
|
|
@@ -1081,6 +1117,41 @@ var Client = class {
|
|
|
1081
1117
|
exportWallets(input, options) {
|
|
1082
1118
|
return exportWallets({ client: this }, input, options);
|
|
1083
1119
|
}
|
|
1120
|
+
/**
|
|
1121
|
+
*
|
|
1122
|
+
* Search for API keys using either a simple filter or queryBuilder
|
|
1123
|
+
*
|
|
1124
|
+
*
|
|
1125
|
+
* ```javascript
|
|
1126
|
+
*
|
|
1127
|
+
* const result = await wapiClient
|
|
1128
|
+
* .findApikeys()
|
|
1129
|
+
* .where({
|
|
1130
|
+
* type: 'admin',
|
|
1131
|
+
* })
|
|
1132
|
+
* .orWhere({
|
|
1133
|
+
* status: 'active',
|
|
1134
|
+
* })
|
|
1135
|
+
* .limit(10)
|
|
1136
|
+
* .offset(0)
|
|
1137
|
+
* .orderBy('created_at', 'desc')
|
|
1138
|
+
* .options({
|
|
1139
|
+
* tracking_id: 'hello',
|
|
1140
|
+
* return_metadata_total: true,
|
|
1141
|
+
* });
|
|
1142
|
+
*
|
|
1143
|
+
* // Or with simple filter
|
|
1144
|
+
* const adminKeys = await wapiClient.findApikeys({
|
|
1145
|
+
* type: 'admin',
|
|
1146
|
+
* status: 'active',
|
|
1147
|
+
* });
|
|
1148
|
+
*
|
|
1149
|
+
* ```
|
|
1150
|
+
*
|
|
1151
|
+
*/
|
|
1152
|
+
findApikeys(input, options) {
|
|
1153
|
+
return findApikeys({ client: this }, input, options);
|
|
1154
|
+
}
|
|
1084
1155
|
/**
|
|
1085
1156
|
*
|
|
1086
1157
|
* Search for Balances using either a simple filter or queryBuilder
|
|
@@ -1947,6 +2018,44 @@ var Client = class {
|
|
|
1947
2018
|
updateToken(input, options) {
|
|
1948
2019
|
return updateToken({ client: this }, input, options);
|
|
1949
2020
|
}
|
|
2021
|
+
/**
|
|
2022
|
+
*
|
|
2023
|
+
* Update an API key
|
|
2024
|
+
*
|
|
2025
|
+
*
|
|
2026
|
+
* ```javascript
|
|
2027
|
+
*
|
|
2028
|
+
* const result = await wapiClient.updateApikey(
|
|
2029
|
+
* {
|
|
2030
|
+
* apikey: 'my-apikey-id',
|
|
2031
|
+
* metadata: {
|
|
2032
|
+
* updated: true,
|
|
2033
|
+
* },
|
|
2034
|
+
* },
|
|
2035
|
+
* {
|
|
2036
|
+
* return_when_not_updated: true,
|
|
2037
|
+
* tracking_id: 'mylogId',
|
|
2038
|
+
* },
|
|
2039
|
+
* );
|
|
2040
|
+
*
|
|
2041
|
+
* // Delete an API key
|
|
2042
|
+
* const deleteResult = await wapiClient.updateApikey({
|
|
2043
|
+
* apikey: 'my-apikey-id',
|
|
2044
|
+
* status: 'deleted',
|
|
2045
|
+
* });
|
|
2046
|
+
*
|
|
2047
|
+
* // Regenerate apisecret
|
|
2048
|
+
* const regenerateResult = await wapiClient.updateApikey({
|
|
2049
|
+
* apikey: 'my-apikey-id',
|
|
2050
|
+
* apisecret: true,
|
|
2051
|
+
* });
|
|
2052
|
+
*
|
|
2053
|
+
* ```
|
|
2054
|
+
*
|
|
2055
|
+
*/
|
|
2056
|
+
updateApikey(input, options) {
|
|
2057
|
+
return updateApikey({ client: this }, input, options);
|
|
2058
|
+
}
|
|
1950
2059
|
/**
|
|
1951
2060
|
*
|
|
1952
2061
|
* Update a Transfer
|
package/dist/client.cjs
CHANGED
|
@@ -65,6 +65,7 @@ var import_errors = require("./lib/errors.cjs");
|
|
|
65
65
|
var import_env = require("./lib/env.cjs");
|
|
66
66
|
var import_aggregate_transfers = require("./fns/aggregate-transfers/aggregate-transfers.cjs");
|
|
67
67
|
var import_create_access_token = require("./fns/create-access-token/create-access-token.cjs");
|
|
68
|
+
var import_create_apikey = require("./fns/create-apikey/create-apikey.cjs");
|
|
68
69
|
var import_create_contract = require("./fns/create-contract/create-contract.cjs");
|
|
69
70
|
var import_create_deposit = require("./fns/create-deposit/create-deposit.cjs");
|
|
70
71
|
var import_create_exchange = require("./fns/create-exchange/create-exchange.cjs");
|
|
@@ -80,6 +81,7 @@ var import_export_tokens = require("./fns/export-tokens/export-tokens.cjs");
|
|
|
80
81
|
var import_export_transfer_groups = require("./fns/export-transfer-groups/export-transfer-groups.cjs");
|
|
81
82
|
var import_export_transfers = require("./fns/export-transfers/export-transfers.cjs");
|
|
82
83
|
var import_export_wallets = require("./fns/export-wallets/export-wallets.cjs");
|
|
84
|
+
var import_find_apikeys = require("./fns/find-apikeys/find-apikeys.cjs");
|
|
83
85
|
var import_find_balances = require("./fns/find-balances/find-balances.cjs");
|
|
84
86
|
var import_find_tokens = require("./fns/find-tokens/find-tokens.cjs");
|
|
85
87
|
var import_find_transfer_groups = require("./fns/find-transfer-groups/find-transfer-groups.cjs");
|
|
@@ -101,6 +103,7 @@ var import_reverse_transfer_group = require("./fns/reverse-transfer-group/rever
|
|
|
101
103
|
var import_reverse_transfers = require("./fns/reverse-transfers/reverse-transfers.cjs");
|
|
102
104
|
var import_set_flags = require("./fns/set-flags/set-flags.cjs");
|
|
103
105
|
var import_update_token = require("./fns/update-token/update-token.cjs");
|
|
106
|
+
var import_update_apikey = require("./fns/update-apikey/update-apikey.cjs");
|
|
104
107
|
var import_update_transfer = require("./fns/update-transfer/update-transfer.cjs");
|
|
105
108
|
var import_update_transfer_group = require("./fns/update-transfer-group/update-transfer-group.cjs");
|
|
106
109
|
var import_update_transfer_groups = require("./fns/update-transfer-groups/update-transfer-groups.cjs");
|
|
@@ -359,6 +362,39 @@ var Client = class {
|
|
|
359
362
|
createAccessToken(input, options) {
|
|
360
363
|
return (0, import_create_access_token.createAccessToken)({ client: this }, input != null ? input : {}, options);
|
|
361
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
*
|
|
367
|
+
* Create a new API key for accessing WAPI
|
|
368
|
+
*
|
|
369
|
+
*
|
|
370
|
+
* ```javascript
|
|
371
|
+
*
|
|
372
|
+
* const response = await wapiClient.createApikey({
|
|
373
|
+
* apikey: {
|
|
374
|
+
* type: 'admin',
|
|
375
|
+
* description: 'My admin API key',
|
|
376
|
+
* validUntil: '2025-12-31T23:59:59Z',
|
|
377
|
+
* metadata: {
|
|
378
|
+
* purpose: 'backend-service',
|
|
379
|
+
* },
|
|
380
|
+
* },
|
|
381
|
+
* });
|
|
382
|
+
*
|
|
383
|
+
* // Or create a limited API key with specific function access
|
|
384
|
+
* const limitedResponse = await wapiClient.createApikey({
|
|
385
|
+
* apikey: {
|
|
386
|
+
* type: 'limited',
|
|
387
|
+
* description: 'Read-only API key',
|
|
388
|
+
* functions: ['getBalance', 'getWallet', 'findTransfers'],
|
|
389
|
+
* },
|
|
390
|
+
* });
|
|
391
|
+
*
|
|
392
|
+
* ```
|
|
393
|
+
*
|
|
394
|
+
*/
|
|
395
|
+
createApikey(input, options) {
|
|
396
|
+
return (0, import_create_apikey.createApikey)({ client: this }, input, options);
|
|
397
|
+
}
|
|
362
398
|
/**
|
|
363
399
|
*
|
|
364
400
|
* Create a contract like transferGroup
|
|
@@ -1101,6 +1137,41 @@ var Client = class {
|
|
|
1101
1137
|
exportWallets(input, options) {
|
|
1102
1138
|
return (0, import_export_wallets.exportWallets)({ client: this }, input, options);
|
|
1103
1139
|
}
|
|
1140
|
+
/**
|
|
1141
|
+
*
|
|
1142
|
+
* Search for API keys using either a simple filter or queryBuilder
|
|
1143
|
+
*
|
|
1144
|
+
*
|
|
1145
|
+
* ```javascript
|
|
1146
|
+
*
|
|
1147
|
+
* const result = await wapiClient
|
|
1148
|
+
* .findApikeys()
|
|
1149
|
+
* .where({
|
|
1150
|
+
* type: 'admin',
|
|
1151
|
+
* })
|
|
1152
|
+
* .orWhere({
|
|
1153
|
+
* status: 'active',
|
|
1154
|
+
* })
|
|
1155
|
+
* .limit(10)
|
|
1156
|
+
* .offset(0)
|
|
1157
|
+
* .orderBy('created_at', 'desc')
|
|
1158
|
+
* .options({
|
|
1159
|
+
* tracking_id: 'hello',
|
|
1160
|
+
* return_metadata_total: true,
|
|
1161
|
+
* });
|
|
1162
|
+
*
|
|
1163
|
+
* // Or with simple filter
|
|
1164
|
+
* const adminKeys = await wapiClient.findApikeys({
|
|
1165
|
+
* type: 'admin',
|
|
1166
|
+
* status: 'active',
|
|
1167
|
+
* });
|
|
1168
|
+
*
|
|
1169
|
+
* ```
|
|
1170
|
+
*
|
|
1171
|
+
*/
|
|
1172
|
+
findApikeys(input, options) {
|
|
1173
|
+
return (0, import_find_apikeys.findApikeys)({ client: this }, input, options);
|
|
1174
|
+
}
|
|
1104
1175
|
/**
|
|
1105
1176
|
*
|
|
1106
1177
|
* Search for Balances using either a simple filter or queryBuilder
|
|
@@ -1967,6 +2038,44 @@ var Client = class {
|
|
|
1967
2038
|
updateToken(input, options) {
|
|
1968
2039
|
return (0, import_update_token.updateToken)({ client: this }, input, options);
|
|
1969
2040
|
}
|
|
2041
|
+
/**
|
|
2042
|
+
*
|
|
2043
|
+
* Update an API key
|
|
2044
|
+
*
|
|
2045
|
+
*
|
|
2046
|
+
* ```javascript
|
|
2047
|
+
*
|
|
2048
|
+
* const result = await wapiClient.updateApikey(
|
|
2049
|
+
* {
|
|
2050
|
+
* apikey: 'my-apikey-id',
|
|
2051
|
+
* metadata: {
|
|
2052
|
+
* updated: true,
|
|
2053
|
+
* },
|
|
2054
|
+
* },
|
|
2055
|
+
* {
|
|
2056
|
+
* return_when_not_updated: true,
|
|
2057
|
+
* tracking_id: 'mylogId',
|
|
2058
|
+
* },
|
|
2059
|
+
* );
|
|
2060
|
+
*
|
|
2061
|
+
* // Delete an API key
|
|
2062
|
+
* const deleteResult = await wapiClient.updateApikey({
|
|
2063
|
+
* apikey: 'my-apikey-id',
|
|
2064
|
+
* status: 'deleted',
|
|
2065
|
+
* });
|
|
2066
|
+
*
|
|
2067
|
+
* // Regenerate apisecret
|
|
2068
|
+
* const regenerateResult = await wapiClient.updateApikey({
|
|
2069
|
+
* apikey: 'my-apikey-id',
|
|
2070
|
+
* apisecret: true,
|
|
2071
|
+
* });
|
|
2072
|
+
*
|
|
2073
|
+
* ```
|
|
2074
|
+
*
|
|
2075
|
+
*/
|
|
2076
|
+
updateApikey(input, options) {
|
|
2077
|
+
return (0, import_update_apikey.updateApikey)({ client: this }, input, options);
|
|
2078
|
+
}
|
|
1970
2079
|
/**
|
|
1971
2080
|
*
|
|
1972
2081
|
* Update a Transfer
|
package/dist/client.js
CHANGED
|
@@ -45,6 +45,7 @@ import { ConfigError } from "./lib/errors.js";
|
|
|
45
45
|
import { CLIENT_VERSION } from "./lib/env.js";
|
|
46
46
|
import { aggregateTransfers } from "./fns/aggregate-transfers/aggregate-transfers.js";
|
|
47
47
|
import { createAccessToken } from "./fns/create-access-token/create-access-token.js";
|
|
48
|
+
import { createApikey } from "./fns/create-apikey/create-apikey.js";
|
|
48
49
|
import { createContract } from "./fns/create-contract/create-contract.js";
|
|
49
50
|
import { createDeposit } from "./fns/create-deposit/create-deposit.js";
|
|
50
51
|
import { createExchange } from "./fns/create-exchange/create-exchange.js";
|
|
@@ -60,6 +61,7 @@ import { exportTokens } from "./fns/export-tokens/export-tokens.js";
|
|
|
60
61
|
import { exportTransferGroups } from "./fns/export-transfer-groups/export-transfer-groups.js";
|
|
61
62
|
import { exportTransfers } from "./fns/export-transfers/export-transfers.js";
|
|
62
63
|
import { exportWallets } from "./fns/export-wallets/export-wallets.js";
|
|
64
|
+
import { findApikeys } from "./fns/find-apikeys/find-apikeys.js";
|
|
63
65
|
import { findBalances } from "./fns/find-balances/find-balances.js";
|
|
64
66
|
import { findTokens } from "./fns/find-tokens/find-tokens.js";
|
|
65
67
|
import { findTransferGroups } from "./fns/find-transfer-groups/find-transfer-groups.js";
|
|
@@ -81,6 +83,7 @@ import { reverseTransferGroup } from "./fns/reverse-transfer-group/reverse-trans
|
|
|
81
83
|
import { reverseTransfers } from "./fns/reverse-transfers/reverse-transfers.js";
|
|
82
84
|
import { setFlags } from "./fns/set-flags/set-flags.js";
|
|
83
85
|
import { updateToken } from "./fns/update-token/update-token.js";
|
|
86
|
+
import { updateApikey } from "./fns/update-apikey/update-apikey.js";
|
|
84
87
|
import { updateTransfer } from "./fns/update-transfer/update-transfer.js";
|
|
85
88
|
import { updateTransferGroup } from "./fns/update-transfer-group/update-transfer-group.js";
|
|
86
89
|
import { updateTransferGroups } from "./fns/update-transfer-groups/update-transfer-groups.js";
|
|
@@ -339,6 +342,39 @@ var Client = class {
|
|
|
339
342
|
createAccessToken(input, options) {
|
|
340
343
|
return createAccessToken({ client: this }, input != null ? input : {}, options);
|
|
341
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
*
|
|
347
|
+
* Create a new API key for accessing WAPI
|
|
348
|
+
*
|
|
349
|
+
*
|
|
350
|
+
* ```javascript
|
|
351
|
+
*
|
|
352
|
+
* const response = await wapiClient.createApikey({
|
|
353
|
+
* apikey: {
|
|
354
|
+
* type: 'admin',
|
|
355
|
+
* description: 'My admin API key',
|
|
356
|
+
* validUntil: '2025-12-31T23:59:59Z',
|
|
357
|
+
* metadata: {
|
|
358
|
+
* purpose: 'backend-service',
|
|
359
|
+
* },
|
|
360
|
+
* },
|
|
361
|
+
* });
|
|
362
|
+
*
|
|
363
|
+
* // Or create a limited API key with specific function access
|
|
364
|
+
* const limitedResponse = await wapiClient.createApikey({
|
|
365
|
+
* apikey: {
|
|
366
|
+
* type: 'limited',
|
|
367
|
+
* description: 'Read-only API key',
|
|
368
|
+
* functions: ['getBalance', 'getWallet', 'findTransfers'],
|
|
369
|
+
* },
|
|
370
|
+
* });
|
|
371
|
+
*
|
|
372
|
+
* ```
|
|
373
|
+
*
|
|
374
|
+
*/
|
|
375
|
+
createApikey(input, options) {
|
|
376
|
+
return createApikey({ client: this }, input, options);
|
|
377
|
+
}
|
|
342
378
|
/**
|
|
343
379
|
*
|
|
344
380
|
* Create a contract like transferGroup
|
|
@@ -1081,6 +1117,41 @@ var Client = class {
|
|
|
1081
1117
|
exportWallets(input, options) {
|
|
1082
1118
|
return exportWallets({ client: this }, input, options);
|
|
1083
1119
|
}
|
|
1120
|
+
/**
|
|
1121
|
+
*
|
|
1122
|
+
* Search for API keys using either a simple filter or queryBuilder
|
|
1123
|
+
*
|
|
1124
|
+
*
|
|
1125
|
+
* ```javascript
|
|
1126
|
+
*
|
|
1127
|
+
* const result = await wapiClient
|
|
1128
|
+
* .findApikeys()
|
|
1129
|
+
* .where({
|
|
1130
|
+
* type: 'admin',
|
|
1131
|
+
* })
|
|
1132
|
+
* .orWhere({
|
|
1133
|
+
* status: 'active',
|
|
1134
|
+
* })
|
|
1135
|
+
* .limit(10)
|
|
1136
|
+
* .offset(0)
|
|
1137
|
+
* .orderBy('created_at', 'desc')
|
|
1138
|
+
* .options({
|
|
1139
|
+
* tracking_id: 'hello',
|
|
1140
|
+
* return_metadata_total: true,
|
|
1141
|
+
* });
|
|
1142
|
+
*
|
|
1143
|
+
* // Or with simple filter
|
|
1144
|
+
* const adminKeys = await wapiClient.findApikeys({
|
|
1145
|
+
* type: 'admin',
|
|
1146
|
+
* status: 'active',
|
|
1147
|
+
* });
|
|
1148
|
+
*
|
|
1149
|
+
* ```
|
|
1150
|
+
*
|
|
1151
|
+
*/
|
|
1152
|
+
findApikeys(input, options) {
|
|
1153
|
+
return findApikeys({ client: this }, input, options);
|
|
1154
|
+
}
|
|
1084
1155
|
/**
|
|
1085
1156
|
*
|
|
1086
1157
|
* Search for Balances using either a simple filter or queryBuilder
|
|
@@ -1947,6 +2018,44 @@ var Client = class {
|
|
|
1947
2018
|
updateToken(input, options) {
|
|
1948
2019
|
return updateToken({ client: this }, input, options);
|
|
1949
2020
|
}
|
|
2021
|
+
/**
|
|
2022
|
+
*
|
|
2023
|
+
* Update an API key
|
|
2024
|
+
*
|
|
2025
|
+
*
|
|
2026
|
+
* ```javascript
|
|
2027
|
+
*
|
|
2028
|
+
* const result = await wapiClient.updateApikey(
|
|
2029
|
+
* {
|
|
2030
|
+
* apikey: 'my-apikey-id',
|
|
2031
|
+
* metadata: {
|
|
2032
|
+
* updated: true,
|
|
2033
|
+
* },
|
|
2034
|
+
* },
|
|
2035
|
+
* {
|
|
2036
|
+
* return_when_not_updated: true,
|
|
2037
|
+
* tracking_id: 'mylogId',
|
|
2038
|
+
* },
|
|
2039
|
+
* );
|
|
2040
|
+
*
|
|
2041
|
+
* // Delete an API key
|
|
2042
|
+
* const deleteResult = await wapiClient.updateApikey({
|
|
2043
|
+
* apikey: 'my-apikey-id',
|
|
2044
|
+
* status: 'deleted',
|
|
2045
|
+
* });
|
|
2046
|
+
*
|
|
2047
|
+
* // Regenerate apisecret
|
|
2048
|
+
* const regenerateResult = await wapiClient.updateApikey({
|
|
2049
|
+
* apikey: 'my-apikey-id',
|
|
2050
|
+
* apisecret: true,
|
|
2051
|
+
* });
|
|
2052
|
+
*
|
|
2053
|
+
* ```
|
|
2054
|
+
*
|
|
2055
|
+
*/
|
|
2056
|
+
updateApikey(input, options) {
|
|
2057
|
+
return updateApikey({ client: this }, input, options);
|
|
2058
|
+
}
|
|
1950
2059
|
/**
|
|
1951
2060
|
*
|
|
1952
2061
|
* Update a Transfer
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __objRest = (source, exclude) => {
|
|
9
|
+
var target = {};
|
|
10
|
+
for (var prop in source)
|
|
11
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
12
|
+
target[prop] = source[prop];
|
|
13
|
+
if (source != null && __getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
15
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
16
|
+
target[prop] = source[prop];
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
23
|
+
};
|
|
24
|
+
var __copyProps = (to, from, except, desc) => {
|
|
25
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
+
for (let key of __getOwnPropNames(from))
|
|
27
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
28
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
29
|
+
}
|
|
30
|
+
return to;
|
|
31
|
+
};
|
|
32
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
|
+
|
|
34
|
+
// src/fns/create-apikey/create-apikey.ts
|
|
35
|
+
var create_apikey_exports = {};
|
|
36
|
+
__export(create_apikey_exports, {
|
|
37
|
+
createApikey: () => createApikey
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(create_apikey_exports);
|
|
40
|
+
var import_validation = require("../../lib/validation.browser.cjs");
|
|
41
|
+
var import_create_apikey_schema_zod = require("./create-apikey.schema.zod.browser.cjs");
|
|
42
|
+
var zodValidator = (0, import_validation.getValidator)(import_create_apikey_schema_zod.createApikeyFnInputSchema);
|
|
43
|
+
function createApikey(options, input, fnOptions) {
|
|
44
|
+
const { client } = options;
|
|
45
|
+
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
46
|
+
const _a = inputCopy, { options: clientOptions } = _a, apikey = __objRest(_a, ["options"]);
|
|
47
|
+
return client.api.createApikey({
|
|
48
|
+
apikey,
|
|
49
|
+
options: clientOptions
|
|
50
|
+
});
|
|
51
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
2
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var __objRest = (source, exclude) => {
|
|
5
|
+
var target = {};
|
|
6
|
+
for (var prop in source)
|
|
7
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8
|
+
target[prop] = source[prop];
|
|
9
|
+
if (source != null && __getOwnPropSymbols)
|
|
10
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
11
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
12
|
+
target[prop] = source[prop];
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// src/fns/create-apikey/create-apikey.ts
|
|
18
|
+
import { getValidator } from "../../lib/validation.browser.js";
|
|
19
|
+
import { createApikeyFnInputSchema } from "./create-apikey.schema.zod.browser.js";
|
|
20
|
+
var zodValidator = getValidator(createApikeyFnInputSchema);
|
|
21
|
+
function createApikey(options, input, fnOptions) {
|
|
22
|
+
const { client } = options;
|
|
23
|
+
const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
|
|
24
|
+
const _a = inputCopy, { options: clientOptions } = _a, apikey = __objRest(_a, ["options"]);
|
|
25
|
+
return client.api.createApikey({
|
|
26
|
+
apikey,
|
|
27
|
+
options: clientOptions
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
createApikey
|
|
32
|
+
};
|