@prosopo/cli 0.1.16 → 0.1.17
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/argv.d.ts +13 -2
- package/dist/argv.d.ts.map +1 -1
- package/dist/argv.js +22 -311
- package/dist/argv.js.map +1 -1
- package/dist/cli.js +35 -25
- package/dist/cli.js.map +1 -1
- package/dist/commands/batchCommit.d.ts +21 -0
- package/dist/commands/batchCommit.d.ts.map +1 -0
- package/dist/commands/batchCommit.js +37 -0
- package/dist/commands/batchCommit.js.map +1 -0
- package/dist/commands/calculateCaptchaSolutions.d.ts +21 -0
- package/dist/commands/calculateCaptchaSolutions.d.ts.map +1 -0
- package/dist/commands/calculateCaptchaSolutions.js +32 -0
- package/dist/commands/calculateCaptchaSolutions.js.map +1 -0
- package/dist/commands/dappAccounts.d.ts +14 -0
- package/dist/commands/dappAccounts.d.ts.map +1 -0
- package/dist/commands/dappAccounts.js +25 -0
- package/dist/commands/dappAccounts.js.map +1 -0
- package/dist/commands/dappDetails.d.ts +16 -0
- package/dist/commands/dappDetails.d.ts.map +1 -0
- package/dist/commands/dappDetails.js +32 -0
- package/dist/commands/dappDetails.js.map +1 -0
- package/dist/commands/dappRegister.d.ts +18 -0
- package/dist/commands/dappRegister.d.ts.map +1 -0
- package/dist/commands/dappRegister.js +45 -0
- package/dist/commands/dappRegister.js.map +1 -0
- package/dist/commands/dappUpdate.d.ts +18 -0
- package/dist/commands/dappUpdate.d.ts.map +1 -0
- package/dist/commands/dappUpdate.js +47 -0
- package/dist/commands/dappUpdate.js.map +1 -0
- package/dist/commands/index.d.ts +15 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +15 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/providerAccounts.d.ts +9 -0
- package/dist/commands/providerAccounts.d.ts.map +1 -0
- package/dist/commands/providerAccounts.js +24 -0
- package/dist/commands/providerAccounts.js.map +1 -0
- package/dist/commands/providerDataset.d.ts +13 -0
- package/dist/commands/providerDataset.d.ts.map +1 -0
- package/dist/commands/providerDataset.js +44 -0
- package/dist/commands/providerDataset.js.map +1 -0
- package/dist/commands/providerDeregister.d.ts +16 -0
- package/dist/commands/providerDeregister.d.ts.map +1 -0
- package/dist/commands/providerDeregister.js +30 -0
- package/dist/commands/providerDeregister.js.map +1 -0
- package/dist/commands/providerDetails.d.ts +16 -0
- package/dist/commands/providerDetails.d.ts.map +1 -0
- package/dist/commands/providerDetails.js +30 -0
- package/dist/commands/providerDetails.js.map +1 -0
- package/dist/commands/providerRegister.d.ts +9 -0
- package/dist/commands/providerRegister.d.ts.map +1 -0
- package/dist/commands/providerRegister.js +60 -0
- package/dist/commands/providerRegister.js.map +1 -0
- package/dist/commands/providerSetDataset.d.ts +14 -0
- package/dist/commands/providerSetDataset.d.ts.map +1 -0
- package/dist/commands/providerSetDataset.js +32 -0
- package/dist/commands/providerSetDataset.js.map +1 -0
- package/dist/commands/providerUpdate.d.ts +18 -0
- package/dist/commands/providerUpdate.d.ts.map +1 -0
- package/dist/commands/providerUpdate.js +51 -0
- package/dist/commands/providerUpdate.js.map +1 -0
- package/dist/commands/validators.d.ts +22 -0
- package/dist/commands/validators.d.ts.map +1 -0
- package/dist/commands/validators.js +51 -0
- package/dist/commands/validators.js.map +1 -0
- package/dist/commands/version.d.ts +12 -0
- package/dist/commands/version.d.ts.map +1 -0
- package/dist/commands/version.js +13 -0
- package/dist/commands/version.js.map +1 -0
- package/dist/env.d.ts +1 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +30 -20
- package/dist/env.js.map +1 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +22 -17
- package/dist/files.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -12
- package/dist/index.js.map +1 -1
- package/dist/process.env.d.ts +1 -8
- package/dist/process.env.d.ts.map +1 -1
- package/dist/process.env.js +18 -38
- package/dist/process.env.js.map +1 -1
- package/dist/prosopo.config.d.ts.map +1 -1
- package/dist/prosopo.config.js +27 -12
- package/dist/prosopo.config.js.map +1 -1
- package/dist/start.d.ts +2 -0
- package/dist/start.d.ts.map +1 -1
- package/dist/start.js +27 -54
- package/dist/start.js.map +1 -1
- package/package.json +24 -11
- package/vite.config.ts +25 -0
package/dist/argv.d.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { KeyringPair } from '@polkadot/keyring/types';
|
|
2
|
+
import { ProsopoConfig } from '@prosopo/types';
|
|
3
|
+
export declare function processArgs(args: any, pair: KeyringPair, config: ProsopoConfig): {
|
|
4
|
+
[x: string]: unknown;
|
|
5
|
+
api: boolean;
|
|
6
|
+
_: (string | number)[];
|
|
7
|
+
$0: string;
|
|
8
|
+
} | Promise<{
|
|
9
|
+
[x: string]: unknown;
|
|
10
|
+
api: boolean;
|
|
11
|
+
_: (string | number)[];
|
|
12
|
+
$0: string;
|
|
13
|
+
}>;
|
|
3
14
|
//# sourceMappingURL=argv.d.ts.map
|
package/dist/argv.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argv.d.ts","sourceRoot":"","sources":["../src/argv.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"argv.d.ts","sourceRoot":"","sources":["../src/argv.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAoB9C,wBAAgB,WAAW,CAAC,IAAI,KAAA,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa;;;;;;;;;;GAoBzE"}
|
package/dist/argv.js
CHANGED
|
@@ -1,315 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.processArgs = void 0;
|
|
17
|
-
const tslib_1 = require("tslib");
|
|
18
|
-
const provider_1 = require("@prosopo/provider");
|
|
19
|
-
const types_1 = require("@prosopo/types");
|
|
20
|
-
const common_1 = require("@prosopo/common");
|
|
21
|
-
const provider_2 = require("@prosopo/provider");
|
|
22
|
-
const process_1 = require("process");
|
|
23
|
-
const provider_3 = require("@prosopo/provider");
|
|
24
|
-
const util_1 = require("@polkadot/util");
|
|
25
|
-
const files_1 = require("./files");
|
|
26
|
-
const contract_1 = require("@prosopo/contract");
|
|
27
|
-
const cron_parser_1 = tslib_1.__importDefault(require("cron-parser"));
|
|
28
|
-
const pm2_1 = tslib_1.__importDefault(require("pm2"));
|
|
29
|
-
const yargs = require('yargs');
|
|
30
|
-
const validateAddress = (argv) => {
|
|
31
|
-
const address = (0, provider_3.encodeStringAddress)(argv.address);
|
|
32
|
-
return { address };
|
|
33
|
-
};
|
|
34
|
-
const validateContract = (argv) => {
|
|
35
|
-
const address = (0, provider_3.encodeStringAddress)(argv.contract);
|
|
36
|
-
return { address };
|
|
37
|
-
};
|
|
38
|
-
const validatePayee = (argv) => {
|
|
39
|
-
try {
|
|
40
|
-
if (!argv.payee)
|
|
41
|
-
return;
|
|
42
|
-
const payeeArg = argv.payee[0].toUpperCase() + argv.payee.slice(1).toLowerCase() || '';
|
|
43
|
-
const payee = types_1.PayeeSchema.parse(payeeArg);
|
|
44
|
-
return { payee };
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
throw new common_1.ProsopoEnvError(error, 'CLI.PARAMETER_ERROR', {}, [argv.payee]);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const validateValue = (argv) => {
|
|
51
|
-
if (typeof argv.value !== 'number') {
|
|
52
|
-
throw new common_1.ProsopoEnvError('CLI.PARAMETER_ERROR', validateValue.name, {}, argv.value);
|
|
53
|
-
}
|
|
54
|
-
const value = argv.value;
|
|
55
|
-
return { value };
|
|
56
|
-
};
|
|
57
|
-
const validateScheduleExpression = (argv) => {
|
|
58
|
-
if (typeof argv.schedule === 'string') {
|
|
59
|
-
const result = cron_parser_1.default.parseString(argv.schedule);
|
|
60
|
-
if (argv.schedule in result.errors) {
|
|
61
|
-
throw new common_1.ProsopoEnvError('CLI.PARAMETER_ERROR', validateScheduleExpression.name, {}, [argv.schedule]);
|
|
62
|
-
}
|
|
63
|
-
return { schedule: argv.schedule };
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
return { schedule: null };
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
function processArgs(args, env) {
|
|
70
|
-
const tasks = new provider_2.Tasks(env);
|
|
71
|
-
const logger = (0, common_1.logger)(env.config.logLevel, 'CLI');
|
|
72
|
-
return yargs
|
|
1
|
+
import { LogLevelSchema, getLogger } from '@prosopo/common';
|
|
2
|
+
import { commandBatchCommit, commandCalculateCaptchaSolutions, commandDappAccounts, commandDappDetails, commandDappRegister, commandDappUpdate, commandProviderAccounts, commandProviderDataset, commandProviderDeregister, commandProviderDetails, commandProviderRegister, commandProviderSetDataset, commandProviderUpdate, commandVersion, } from './commands/index.js';
|
|
3
|
+
import { hideBin } from 'yargs/helpers';
|
|
4
|
+
import yargs from 'yargs';
|
|
5
|
+
export function processArgs(args, pair, config) {
|
|
6
|
+
const logger = getLogger(LogLevelSchema.Values.Info, 'CLI');
|
|
7
|
+
return yargs(hideBin(args))
|
|
73
8
|
.usage('Usage: $0 [global options] <command> [options]')
|
|
74
9
|
.option('api', { demand: false, default: false, type: 'boolean' })
|
|
75
|
-
.command(
|
|
76
|
-
.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}), async (argv) => {
|
|
91
|
-
const providerRegisterArgs = [
|
|
92
|
-
Array.from((0, util_1.hexToU8a)((0, contract_1.stringToHexPadded)(argv.url))),
|
|
93
|
-
argv.fee,
|
|
94
|
-
argv.payee,
|
|
95
|
-
{
|
|
96
|
-
value: 0,
|
|
97
|
-
},
|
|
98
|
-
];
|
|
99
|
-
await (0, contract_1.wrapQuery)(tasks.contract.query.providerRegister, tasks.contract.query)(...providerRegisterArgs);
|
|
100
|
-
const result = await tasks.contract.tx.providerRegister(...providerRegisterArgs);
|
|
101
|
-
logger.info(JSON.stringify(result, null, 2));
|
|
102
|
-
}, [validatePayee])
|
|
103
|
-
.command('provider_update', 'Update a Provider', (yargs) => yargs
|
|
104
|
-
.option('url', {
|
|
105
|
-
type: 'string',
|
|
106
|
-
demand: false,
|
|
107
|
-
desc: 'The provider service origin (URI)',
|
|
108
|
-
})
|
|
109
|
-
.option('fee', {
|
|
110
|
-
type: 'number',
|
|
111
|
-
demand: false,
|
|
112
|
-
desc: 'The fee to pay per solved captcha',
|
|
113
|
-
})
|
|
114
|
-
.option('payee', {
|
|
115
|
-
type: 'string',
|
|
116
|
-
demand: false,
|
|
117
|
-
desc: 'The person who receives the fee (`Provider` or `Dapp`)',
|
|
118
|
-
})
|
|
119
|
-
.option('value', {
|
|
120
|
-
type: 'number',
|
|
121
|
-
demand: false,
|
|
122
|
-
desc: 'The value to stake in the contract',
|
|
123
|
-
}), async (argv) => {
|
|
124
|
-
const provider = (await tasks.contract.query.getProvider(argv.address, {})).value.unwrap().unwrap();
|
|
125
|
-
if (provider && (argv.url || argv.fee || argv.payee || argv.value)) {
|
|
126
|
-
const result = await tasks.contract.tx.providerUpdate(argv.url || provider.url, argv.fee || provider.fee, argv.payee || provider.payee, argv.value || 0);
|
|
127
|
-
logger.info(JSON.stringify(result, null, 2));
|
|
128
|
-
}
|
|
129
|
-
}, [validateAddress, validatePayee])
|
|
130
|
-
.command('provider_deregister', 'Deregister a Provider', (yargs) => yargs.option('address', {
|
|
131
|
-
type: 'string',
|
|
132
|
-
demand: true,
|
|
133
|
-
desc: 'The AccountId of the Provider',
|
|
134
|
-
}), async (argv) => {
|
|
135
|
-
try {
|
|
136
|
-
await tasks.contract.tx.providerDeregister(argv.address);
|
|
137
|
-
logger.info('Provider registered');
|
|
138
|
-
}
|
|
139
|
-
catch (err) {
|
|
140
|
-
logger.error(err);
|
|
141
|
-
}
|
|
142
|
-
}, [validateAddress])
|
|
143
|
-
.command('provider_set_data_set', 'Add a dataset as a Provider', (yargs) => yargs.option('file', {
|
|
144
|
-
type: 'string',
|
|
145
|
-
demand: true,
|
|
146
|
-
desc: 'The file path of a JSON dataset file',
|
|
147
|
-
}), async (argv) => {
|
|
148
|
-
try {
|
|
149
|
-
const jsonFile = (0, files_1.loadJSONFile)(argv.file, logger);
|
|
150
|
-
const result = await tasks.providerSetDatasetFromFile(jsonFile);
|
|
151
|
-
logger.info(JSON.stringify(result, null, 2));
|
|
152
|
-
}
|
|
153
|
-
catch (err) {
|
|
154
|
-
logger.error(err);
|
|
155
|
-
}
|
|
156
|
-
}, [])
|
|
157
|
-
.command('dapp_register', 'Register a Dapp', (yargs) => yargs
|
|
158
|
-
.option('contract', {
|
|
159
|
-
type: 'string',
|
|
160
|
-
demand: true,
|
|
161
|
-
desc: 'The AccountId of the Dapp',
|
|
162
|
-
})
|
|
163
|
-
.option('payee', {
|
|
164
|
-
type: 'string',
|
|
165
|
-
demand: true,
|
|
166
|
-
desc: 'The person who receives the fee (`Provider` or `Dapp`)',
|
|
167
|
-
}), async (argv) => {
|
|
168
|
-
const dappRegisterArgs = [
|
|
169
|
-
argv.contract,
|
|
170
|
-
argv.payee,
|
|
171
|
-
{
|
|
172
|
-
value: 0,
|
|
173
|
-
},
|
|
174
|
-
];
|
|
175
|
-
await (0, contract_1.wrapQuery)(tasks.contract.query.dappRegister, tasks.contract.query)(...dappRegisterArgs);
|
|
176
|
-
const result = await tasks.contract.tx.dappRegister(...dappRegisterArgs);
|
|
177
|
-
logger.info(JSON.stringify(result, null, 2));
|
|
178
|
-
}, [validateContract, validatePayee])
|
|
179
|
-
.command('dapp_update', 'Register a Dapp', (yargs) => yargs
|
|
180
|
-
.option('contract', {
|
|
181
|
-
type: 'string',
|
|
182
|
-
demand: true,
|
|
183
|
-
desc: 'The AccountId of the Dapp',
|
|
184
|
-
})
|
|
185
|
-
.option('payee', {
|
|
186
|
-
type: 'string',
|
|
187
|
-
demand: true,
|
|
188
|
-
desc: 'The person who receives the fee (`Provider` or `Dapp`)',
|
|
189
|
-
}), async (argv) => {
|
|
190
|
-
const stakeThreshold = (await tasks.contract.query.getDappStakeThreshold({})).value.unwrap();
|
|
191
|
-
const dappRegisterArgs = [
|
|
192
|
-
argv.contract,
|
|
193
|
-
argv.payee,
|
|
194
|
-
argv.owner,
|
|
195
|
-
{
|
|
196
|
-
value: stakeThreshold.toNumber(),
|
|
197
|
-
},
|
|
198
|
-
];
|
|
199
|
-
await (0, contract_1.wrapQuery)(tasks.contract.query.dappUpdate, tasks.contract.query)(...dappRegisterArgs);
|
|
200
|
-
const result = await tasks.contract.tx.dappUpdate(...dappRegisterArgs);
|
|
201
|
-
logger.info(JSON.stringify(result, null, 2));
|
|
202
|
-
}, [validateContract, validatePayee])
|
|
203
|
-
.command('provider_accounts', 'List all provider accounts', (yargs) => yargs, async () => {
|
|
204
|
-
try {
|
|
205
|
-
const result = await tasks.contract.contract['providerAccounts']();
|
|
206
|
-
logger.info(JSON.stringify(result, null, 2));
|
|
207
|
-
}
|
|
208
|
-
catch (err) {
|
|
209
|
-
logger.error(err);
|
|
210
|
-
}
|
|
211
|
-
}, [])
|
|
212
|
-
.command('dapp_accounts', 'List all dapp accounts', (yargs) => yargs, async () => {
|
|
213
|
-
try {
|
|
214
|
-
const result = await tasks.contract.contract['dappAccounts']();
|
|
215
|
-
logger.info(JSON.stringify(result, null, 2));
|
|
216
|
-
}
|
|
217
|
-
catch (err) {
|
|
218
|
-
logger.error(err);
|
|
219
|
-
}
|
|
220
|
-
}, [])
|
|
221
|
-
.command('provider_details', 'List details of a single Provider', (yargs) => yargs.option('address', {
|
|
222
|
-
type: 'string',
|
|
223
|
-
demand: true,
|
|
224
|
-
desc: 'The AccountId of the Provider',
|
|
225
|
-
}), async (argv) => {
|
|
226
|
-
try {
|
|
227
|
-
const result = (await tasks.contract.query.getProvider(argv.address, {})).value.unwrap().unwrap();
|
|
228
|
-
logger.info(JSON.stringify(result, null, 2));
|
|
229
|
-
}
|
|
230
|
-
catch (err) {
|
|
231
|
-
logger.error(err);
|
|
232
|
-
}
|
|
233
|
-
}, [validateAddress])
|
|
234
|
-
.command('dapp_details', 'List details of a single Dapp', (yargs) => yargs.option('address', {
|
|
235
|
-
type: 'string',
|
|
236
|
-
demand: true,
|
|
237
|
-
desc: 'The AccountId of the Dapp',
|
|
238
|
-
}), async (argv) => {
|
|
239
|
-
try {
|
|
240
|
-
const result = (await tasks.contract.query.getDapp(argv.address)).value.unwrap().unwrap();
|
|
241
|
-
logger.info(JSON.stringify(result, null, 2));
|
|
242
|
-
}
|
|
243
|
-
catch (err) {
|
|
244
|
-
logger.error(err);
|
|
245
|
-
}
|
|
246
|
-
}, [validateAddress])
|
|
247
|
-
.command('calculate_captcha_solutions', 'Calculate captcha solutions', (yargs) => yargs.option('schedule', {
|
|
248
|
-
type: 'string',
|
|
249
|
-
demand: false,
|
|
250
|
-
desc: 'A Recurring schedule expression',
|
|
251
|
-
}), async (argv) => {
|
|
252
|
-
if (argv.schedule) {
|
|
253
|
-
pm2_1.default.connect((err) => {
|
|
254
|
-
if (err) {
|
|
255
|
-
console.error(err);
|
|
256
|
-
process.exit(2);
|
|
257
|
-
}
|
|
258
|
-
pm2_1.default.start({
|
|
259
|
-
script: `ts-node scheduler.js ${JSON.stringify(argv.schedule)}`,
|
|
260
|
-
name: 'scheduler',
|
|
261
|
-
cwd: (0, process_1.cwd)() + '/dist/src',
|
|
262
|
-
}, (err, apps) => {
|
|
263
|
-
if (err) {
|
|
264
|
-
console.error(err);
|
|
265
|
-
return pm2_1.default.disconnect();
|
|
266
|
-
}
|
|
267
|
-
logger.info(apps);
|
|
268
|
-
process.exit();
|
|
269
|
-
});
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
const result = await tasks.calculateCaptchaSolutions();
|
|
274
|
-
logger.info(`Updated ${result} captcha solutions`);
|
|
275
|
-
}
|
|
276
|
-
}, [validateScheduleExpression])
|
|
277
|
-
.command('batch_commit', 'Batch commit user solutions to contract', (yargs) => yargs.option('schedule', {
|
|
278
|
-
type: 'string',
|
|
279
|
-
demand: false,
|
|
280
|
-
desc: 'A Recurring schedule expression',
|
|
281
|
-
}), async (argv) => {
|
|
282
|
-
if (argv.schedule) {
|
|
283
|
-
pm2_1.default.connect((err) => {
|
|
284
|
-
if (err) {
|
|
285
|
-
console.error(err);
|
|
286
|
-
process.exit(2);
|
|
287
|
-
}
|
|
288
|
-
pm2_1.default.start({
|
|
289
|
-
script: `ts-node scheduler.js ${JSON.stringify(argv.schedule)}`,
|
|
290
|
-
name: 'scheduler',
|
|
291
|
-
cwd: (0, process_1.cwd)() + '/dist/src',
|
|
292
|
-
}, (err, apps) => {
|
|
293
|
-
if (err) {
|
|
294
|
-
console.error(err);
|
|
295
|
-
return pm2_1.default.disconnect();
|
|
296
|
-
}
|
|
297
|
-
logger.info(apps);
|
|
298
|
-
process.exit();
|
|
299
|
-
});
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
if (env.db) {
|
|
304
|
-
const batchCommitter = new provider_1.BatchCommitments(env.config.batchCommit, env.contractInterface, env.db, 2, 0n, env.logger);
|
|
305
|
-
const result = await batchCommitter.runBatch();
|
|
306
|
-
logger.info(`Batch commit complete: ${result}`);
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
logger.error('No database configured');
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}, [validateScheduleExpression]).argv;
|
|
10
|
+
.command(commandProviderRegister(pair, config, { logger }))
|
|
11
|
+
.command(commandProviderUpdate(pair, config, { logger }))
|
|
12
|
+
.command(commandProviderDeregister(pair, config, { logger }))
|
|
13
|
+
.command(commandProviderSetDataset(pair, config, { logger }))
|
|
14
|
+
.command(commandDappRegister(pair, config, { logger }))
|
|
15
|
+
.command(commandDappUpdate(pair, config, { logger }))
|
|
16
|
+
.command(commandProviderAccounts(pair, config, { logger }))
|
|
17
|
+
.command(commandDappAccounts(pair, config, { logger }))
|
|
18
|
+
.command(commandProviderDetails(pair, config, { logger }))
|
|
19
|
+
.command(commandProviderDataset(pair, config, { logger }))
|
|
20
|
+
.command(commandDappDetails(pair, config, { logger }))
|
|
21
|
+
.command(commandCalculateCaptchaSolutions(pair, config, { logger }))
|
|
22
|
+
.command(commandBatchCommit(pair, config, { logger }))
|
|
23
|
+
.command(commandVersion(pair, config, { logger }))
|
|
24
|
+
.parse();
|
|
313
25
|
}
|
|
314
|
-
exports.processArgs = processArgs;
|
|
315
26
|
//# sourceMappingURL=argv.js.map
|
package/dist/argv.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argv.js","sourceRoot":"","sources":["../src/argv.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;AAEjC,gDAAoD;AAEpD,0CAA4C;AAC5C,4CAAsE;AAEtE,gDAAyC;AACzC,qCAA6B;AAC7B,gDAAuD;AACvD,yCAAyC;AAC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,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;SAC5D,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;SACtD,OAAO,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;SACpD,OAAO,CAAC,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;SAC1D,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;SACtD,OAAO,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;SACzD,OAAO,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;SACzD,OAAO,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;SACrD,OAAO,CAAC,gCAAgC,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;SACnE,OAAO,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;SACrD,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;SACjD,KAAK,EAAE,CAAA;AAChB,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
// Copyright 2021-2022 Prosopo (UK) Ltd.
|
|
4
2
|
//
|
|
5
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -13,31 +11,43 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
12
|
// See the License for the specific language governing permissions and
|
|
15
13
|
// limitations under the License.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
import { LogLevelSchema, getLogger, getPair } from '@prosopo/common';
|
|
15
|
+
import { ProviderEnvironment } from '@prosopo/env';
|
|
16
|
+
import { getConfig, getPairType, getSecret, getSs58Format } from './process.env.js';
|
|
17
|
+
import { loadEnv } from '@prosopo/cli';
|
|
18
|
+
import { processArgs } from './argv.js';
|
|
19
|
+
import { start } from './start.js';
|
|
20
|
+
import esMain from 'es-main';
|
|
21
|
+
import process from 'process';
|
|
22
|
+
const log = getLogger(LogLevelSchema.enum.Info, 'cli');
|
|
23
23
|
async function main() {
|
|
24
|
-
|
|
25
|
-
const secret =
|
|
26
|
-
const ss58Format =
|
|
27
|
-
const pairType =
|
|
28
|
-
const config =
|
|
29
|
-
const pair = await
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
loadEnv();
|
|
25
|
+
const secret = getSecret();
|
|
26
|
+
const ss58Format = getSs58Format();
|
|
27
|
+
const pairType = getPairType();
|
|
28
|
+
const config = getConfig();
|
|
29
|
+
const pair = await getPair(pairType, ss58Format, secret);
|
|
30
|
+
log.info(`Pair address: ${pair.address}`);
|
|
31
|
+
log.info(`Contract address: ${process.env.PROTOCOL_CONTRACT_ADDRESS}`);
|
|
32
|
+
const processedArgs = await processArgs(process.argv, pair, config);
|
|
33
|
+
if (processedArgs.api) {
|
|
34
|
+
const env = new ProviderEnvironment(pair, config);
|
|
35
|
+
await env.isReady();
|
|
36
|
+
log.info('Starting API');
|
|
37
|
+
await start(env);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
process.exit(0);
|
|
41
|
+
}
|
|
36
42
|
}
|
|
37
|
-
//
|
|
38
|
-
if (
|
|
39
|
-
main()
|
|
40
|
-
|
|
43
|
+
//if main process
|
|
44
|
+
if (esMain(import.meta)) {
|
|
45
|
+
main()
|
|
46
|
+
.then(() => {
|
|
47
|
+
log.info('Running main process...');
|
|
48
|
+
})
|
|
49
|
+
.catch((error) => {
|
|
50
|
+
log.error(error);
|
|
41
51
|
});
|
|
42
52
|
}
|
|
43
53
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,MAAM,GAAG,GAAG,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACtD,KAAK,UAAU,IAAI;IACf,OAAO,EAAE,CAAA;IAET,MAAM,MAAM,GA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logger } from '@prosopo/common';
|
|
4
|
+
import { ProsopoConfig } from '@prosopo/types';
|
|
5
|
+
declare const _default: (pair: KeyringPair, config: ProsopoConfig, cmdArgs?: {
|
|
6
|
+
logger?: Logger;
|
|
7
|
+
}) => {
|
|
8
|
+
command: string;
|
|
9
|
+
describe: "Batch commit user solutions to contract";
|
|
10
|
+
builder: (yargs: Argv) => Argv<{
|
|
11
|
+
schedule: string | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
handler: (argv: any) => Promise<void>;
|
|
14
|
+
middlewares: ((argv: any) => {
|
|
15
|
+
schedule: string;
|
|
16
|
+
} | {
|
|
17
|
+
schedule: null;
|
|
18
|
+
})[];
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=batchCommit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batchCommit.d.ts","sourceRoot":"","sources":["../../src/commands/batchCommit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAkB,MAAM,EAA8B,MAAM,iBAAiB,CAAA;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;+BAGxB,WAAW,UAAU,aAAa,YAAY;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;;;qBAK9D,IAAI;;;;;;;;;;AAL7B,wBAmCC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BatchCommitmentsTask } from '@prosopo/provider';
|
|
2
|
+
import { LogLevelSchema, ProsopoEnvError, getLogger } from '@prosopo/common';
|
|
3
|
+
import { ProviderEnvironment } from '@prosopo/env';
|
|
4
|
+
import { validateScheduleExpression } from './validators.js';
|
|
5
|
+
export default (pair, config, cmdArgs) => {
|
|
6
|
+
const logger = cmdArgs?.logger || getLogger(LogLevelSchema.Values.Info, 'cli.batch_commit');
|
|
7
|
+
return {
|
|
8
|
+
command: 'batch_commit',
|
|
9
|
+
describe: 'Batch commit user solutions to contract',
|
|
10
|
+
builder: (yargs) => {
|
|
11
|
+
return yargs.option('schedule', {
|
|
12
|
+
type: 'string',
|
|
13
|
+
demand: false,
|
|
14
|
+
desc: 'A Recurring schedule expression',
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
handler: async (argv) => {
|
|
18
|
+
const env = new ProviderEnvironment(pair, config);
|
|
19
|
+
await env.isReady();
|
|
20
|
+
if (argv.schedule) {
|
|
21
|
+
throw new ProsopoEnvError('GENERAL.NOT_IMPLEMENTED');
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
if (env.db) {
|
|
25
|
+
const batchCommitter = new BatchCommitmentsTask(env.config.batchCommit, env.contractInterface, env.db, 0n, env.logger);
|
|
26
|
+
const result = await batchCommitter.run();
|
|
27
|
+
logger.info(`Batch commit complete: ${result}`);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
logger.error('No database configured');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
middlewares: [validateScheduleExpression],
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=batchCommit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batchCommit.js","sourceRoot":"","sources":["../../src/commands/batchCommit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,cAAc,EAAU,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAC5D,eAAe,CAAC,IAAiB,EAAE,MAAqB,EAAE,OAA6B,EAAE,EAAE;IACvF,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAA;IAC3F,OAAO;QACH,OAAO,EAAE,cAAc;QACvB,QAAQ,EAAE,yCAAkD;QAC5D,OAAO,EAAE,CAAC,KAAW,EAAE,EAAE;YACrB,OAAO,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE;gBAC5B,IAAI,EAAE,QAAiB;gBACvB,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,iCAAiC;aACjC,CAAC,CAAA;QACf,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YACpB,MAAM,GAAG,GAAG,IAAI,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;YACjD,MAAM,GAAG,CAAC,OAAO,EAAE,CAAA;YACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACf,MAAM,IAAI,eAAe,CAAC,yBAAyB,CAAC,CAAA;aACvD;iBAAM;gBACH,IAAI,GAAG,CAAC,EAAE,EAAE;oBACR,MAAM,cAAc,GAAG,IAAI,oBAAoB,CAC3C,GAAG,CAAC,MAAM,CAAC,WAAW,EACtB,GAAG,CAAC,iBAAiB,EACrB,GAAG,CAAC,EAAE,EACN,EAAE,EACF,GAAG,CAAC,MAAM,CACb,CAAA;oBACD,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,GAAG,EAAE,CAAA;oBACzC,MAAM,CAAC,IAAI,CAAC,0BAA0B,MAAM,EAAE,CAAC,CAAA;iBAClD;qBAAM;oBACH,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;iBACzC;aACJ;QACL,CAAC;QACD,WAAW,EAAE,CAAC,0BAA0B,CAAC;KAC5C,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
import { KeyringPair } from '@polkadot/keyring/types';
|
|
3
|
+
import { Logger } from '@prosopo/common';
|
|
4
|
+
import { ProsopoConfig } from '@prosopo/types';
|
|
5
|
+
declare const _default: (pair: KeyringPair, config: ProsopoConfig, cmdArgs?: {
|
|
6
|
+
logger?: Logger;
|
|
7
|
+
}) => {
|
|
8
|
+
command: string;
|
|
9
|
+
describe: string;
|
|
10
|
+
builder: (yargs: Argv) => Argv<{
|
|
11
|
+
schedule: string | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
handler: (argv: any) => Promise<void>;
|
|
14
|
+
middlewares: ((argv: any) => {
|
|
15
|
+
schedule: string;
|
|
16
|
+
} | {
|
|
17
|
+
schedule: null;
|
|
18
|
+
})[];
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=calculateCaptchaSolutions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculateCaptchaSolutions.d.ts","sourceRoot":"","sources":["../../src/commands/calculateCaptchaSolutions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAkB,MAAM,EAA8B,MAAM,iBAAiB,CAAA;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;+BAGxB,WAAW,UAAU,aAAa,YAAY;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;;;qBAM9D,IAAI;;;;;;;;;;AAN7B,wBA0BC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CalculateSolutionsTask } from '@prosopo/provider';
|
|
2
|
+
import { LogLevelSchema, ProsopoEnvError, getLogger } from '@prosopo/common';
|
|
3
|
+
import { ProviderEnvironment } from '@prosopo/env';
|
|
4
|
+
import { validateScheduleExpression } from './validators.js';
|
|
5
|
+
export default (pair, config, cmdArgs) => {
|
|
6
|
+
const logger = cmdArgs?.logger || getLogger(LogLevelSchema.Values.Info, 'cli.calculate_captcha_solutions');
|
|
7
|
+
return {
|
|
8
|
+
command: 'calculate_captcha_solutions',
|
|
9
|
+
describe: 'Calculate captcha solutions',
|
|
10
|
+
builder: (yargs) => {
|
|
11
|
+
return yargs.option('schedule', {
|
|
12
|
+
type: 'string',
|
|
13
|
+
demand: false,
|
|
14
|
+
desc: 'A Recurring schedule expression',
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
handler: async (argv) => {
|
|
18
|
+
const env = new ProviderEnvironment(pair, config);
|
|
19
|
+
await env.isReady();
|
|
20
|
+
if (argv.schedule) {
|
|
21
|
+
throw new ProsopoEnvError('GENERAL.NOT_IMPLEMENTED');
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const calculateSolutionsTask = new CalculateSolutionsTask(env);
|
|
25
|
+
const result = await calculateSolutionsTask.run();
|
|
26
|
+
logger.info(`Updated ${result} captcha solutions`);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
middlewares: [validateScheduleExpression],
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=calculateCaptchaSolutions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculateCaptchaSolutions.js","sourceRoot":"","sources":["../../src/commands/calculateCaptchaSolutions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,OAAO,EAAE,cAAc,EAAU,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAC5D,eAAe,CAAC,IAAiB,EAAE,MAAqB,EAAE,OAA6B,EAAE,EAAE;IACvF,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,iCAAiC,CAAC,CAAA;IAE1G,OAAO;QACH,OAAO,EAAE,6BAA6B;QACtC,QAAQ,EAAE,6BAA6B;QACvC,OAAO,EAAE,CAAC,KAAW,EAAE,EAAE;YACrB,OAAO,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE;gBAC5B,IAAI,EAAE,QAAiB;gBACvB,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,iCAAiC;aACjC,CAAC,CAAA;QACf,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YACpB,MAAM,GAAG,GAAG,IAAI,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;YACjD,MAAM,GAAG,CAAC,OAAO,EAAE,CAAA;YACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACf,MAAM,IAAI,eAAe,CAAC,yBAAyB,CAAC,CAAA;aACvD;iBAAM;gBACH,MAAM,sBAAsB,GAAG,IAAI,sBAAsB,CAAC,GAAG,CAAC,CAAA;gBAC9D,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC,GAAG,EAAE,CAAA;gBACjD,MAAM,CAAC,IAAI,CAAC,WAAW,MAAM,oBAAoB,CAAC,CAAA;aACrD;QACL,CAAC;QACD,WAAW,EAAE,CAAC,0BAA0B,CAAC;KAC5C,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { KeyringPair } from '@polkadot/keyring/types';
|
|
2
|
+
import { Logger } from '@prosopo/common';
|
|
3
|
+
import { ProsopoConfig } from '@prosopo/types';
|
|
4
|
+
declare const _default: (pair: KeyringPair, config: ProsopoConfig, cmdArgs?: {
|
|
5
|
+
logger?: Logger;
|
|
6
|
+
}) => {
|
|
7
|
+
command: string;
|
|
8
|
+
describe: string;
|
|
9
|
+
builder: (yargs: any) => any;
|
|
10
|
+
handler: () => Promise<void>;
|
|
11
|
+
middlewares: never[];
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=dappAccounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dappAccounts.d.ts","sourceRoot":"","sources":["../../src/commands/dappAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAkB,MAAM,EAAa,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;+BAGxB,WAAW,UAAU,aAAa,YAAY;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;AAAvF,wBAsBC"}
|