Skip to content

Commit 15472e4

Browse files
authored
feat: file helper cmd (#211)
- add `get-config` cmd
1 parent 94da115 commit 15472e4

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

cli-typescript/src/cmds/general.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import { setTokenUriSuffixAction } from '../utils/cmdActions/setTokenUriSuffixAc
4141
import { ownerMintAction } from '../utils/cmdActions/ownerMintAction';
4242
import { checkSignerBalanceAction } from '../utils/cmdActions/checkSignerBalanceAction';
4343
import getWalletInfoAction from '../utils/cmdActions/getWalletInfoAction';
44+
import getProjectConfigAction from '../utils/cmdActions/getProjectConfigAction';
4445

4546
export const newProjectCmd = new Command('new')
4647
.command('new <symbol>')
@@ -203,3 +204,9 @@ export const getWalletInfoCmd = new Command('get-wallet-info')
203204
.command('get-wallet-info <symbol>')
204205
.description('Get the wallet info for a collection')
205206
.action(getWalletInfoAction);
207+
208+
export const getConfigCmd = new Command('get-config')
209+
.command('get-config <symbol>')
210+
.alias('gc')
211+
.description('Retrieve the project configuration for a specific collection.')
212+
.action(getProjectConfigAction);

cli-typescript/src/cmds/mainMenu.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
freezeThawContractCmd,
66
checkSignerBalanceCmd,
77
getWalletInfoCmd,
8+
getConfigCmd,
89
initContractCmd,
910
listProjectsCmd,
1011
manageAuthorizedMintersCmd,
@@ -65,6 +66,7 @@ export const mainMenu = async () => {
6566
program.addCommand(ownerMintCmd);
6667
program.addCommand(checkSignerBalanceCmd);
6768
program.addCommand(getWalletInfoCmd);
69+
program.addCommand(getConfigCmd);
6870

6971
// network sub-commands
7072
program.addCommand(eth);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { showText } from '../display';
2+
import { init } from '../evmUtils';
3+
4+
const getProjectConfigAction = async (symbol: string) => {
5+
symbol = symbol.toLowerCase();
6+
7+
const { store } = init(symbol);
8+
9+
showText(`${symbol} information retrieved successfully.`);
10+
console.log(JSON.stringify(store.data, null, 2));
11+
};
12+
13+
export default getProjectConfigAction;

0 commit comments

Comments
 (0)