create-blocklet 0.9.17 → 0.9.18
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/package.json +1 -1
- package/templates/did-connect-dapp/api/hooks/pre-start.js +3 -26
- package/templates/did-connect-dapp/package.json +1 -1
- package/templates/did-wallet-dapp/package.json +1 -1
- package/templates/react-aigne-dapp/package.json +1 -1
- package/templates/react-dapp/package.json +1 -1
- package/templates/react-dapp-ts/package.json +1 -1
- package/templates/react-gun-dapp/package.json +1 -1
- package/templates/react-static/package.json +1 -1
- package/templates/solidjs-dapp/package.json +1 -1
- package/templates/solidjs-static/package.json +1 -1
- package/templates/svelte-dapp/package.json +1 -1
- package/templates/svelte-static/package.json +1 -1
- package/templates/todo-list-example/package.json +1 -1
- package/templates/vue-dapp/package.json +1 -1
- package/templates/vue-static/package.json +1 -1
- package/templates/vue-ts-static/package.json +1 -1
- package/templates/vue2-dapp/package.json +1 -1
- package/templates/vue2-static/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,33 +1,10 @@
|
|
|
1
1
|
require('@blocklet/sdk/lib/error-handler');
|
|
2
2
|
require('dotenv-flow').config();
|
|
3
3
|
|
|
4
|
-
const Client = require('@ocap/client');
|
|
5
|
-
|
|
6
|
-
const env = require('../libs/env');
|
|
7
4
|
const logger = require('../libs/logger');
|
|
8
|
-
const { wallet } = require('../libs/auth');
|
|
9
5
|
const { name } = require('../../package.json');
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const client = new Client(env.chainHost);
|
|
16
|
-
const { state } = await client.getAccountState({ address: wallet.toAddress() }, { ignoreFields: ['context'] });
|
|
17
|
-
if (!state) {
|
|
18
|
-
const hash = await client.declare({ moniker: name, wallet });
|
|
19
|
-
logger.log(`app account declared on chain ${env.chainHost}`, hash);
|
|
20
|
-
} else {
|
|
21
|
-
logger.log(`app account already declared on chain ${env.chainHost}`);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
(async () => {
|
|
26
|
-
try {
|
|
27
|
-
await ensureAccountDeclared();
|
|
28
|
-
process.exit(0);
|
|
29
|
-
} catch (err) {
|
|
30
|
-
logger.error(`${name} pre-start error`, err.message);
|
|
31
|
-
process.exit(1);
|
|
32
|
-
}
|
|
7
|
+
(() => {
|
|
8
|
+
logger.error(`${name} pre-start`);
|
|
9
|
+
process.exit(0);
|
|
33
10
|
})();
|