@@ -108,23 +108,41 @@ async function listCommand(args: any[], option: ListOption) {
108108 const cckey = await CCKey . create ( { dbPath : option . parent . keysPath } ) ;
109109 const accountType = parseAccountType ( option . parent . accountType ) ;
110110 const networkId = option . parent . networkId ;
111- await listKeys ( cckey , accountType , networkId ) ;
111+ await listKeys ( {
112+ cckey,
113+ accountType,
114+ networkId
115+ } ) ;
112116}
113117
114118async function createCommand ( args : any [ ] , option : CreateOption ) {
115119 const cckey = await CCKey . create ( { dbPath : option . parent . keysPath } ) ;
116120 const accountType = parseAccountType ( option . parent . accountType ) ;
117121 const passphrase = await parsePassphrase ( option . passphrase ) ;
118122 const networkId = option . parent . networkId ;
119- await createKey ( cckey , accountType , passphrase , networkId ) ;
123+ await createKey (
124+ {
125+ cckey,
126+ accountType,
127+ networkId
128+ } ,
129+ passphrase
130+ ) ;
120131}
121132
122133async function deleteCommand ( args : any [ ] , option : DeleteOption ) {
123134 const cckey = await CCKey . create ( { dbPath : option . parent . keysPath } ) ;
124135 const accountType = parseAccountType ( option . parent . accountType ) ;
125136 const address = parseAddress ( option . address ) ;
126137 const networkId = option . parent . networkId ;
127- await deleteKey ( cckey , accountType , address , networkId ) ;
138+ await deleteKey (
139+ {
140+ cckey,
141+ accountType,
142+ networkId
143+ } ,
144+ address
145+ ) ;
128146}
129147
130148async function importCommand ( [ path ] : any [ ] , option : ImportOption ) {
@@ -134,11 +152,13 @@ async function importCommand([path]: any[], option: ImportOption) {
134152 const contents = fs . readFileSync ( path , { encoding : "utf8" } ) ;
135153 const networkId = option . parent . networkId ;
136154 await importKey (
137- cckey ,
138- accountType ,
155+ {
156+ cckey,
157+ accountType,
158+ networkId
159+ } ,
139160 JSON . parse ( contents ) ,
140- passphrase ,
141- networkId
161+ passphrase
142162 ) ;
143163}
144164
@@ -147,7 +167,15 @@ async function importRawCommand([privateKey]: any[], option: ImportOption) {
147167 const accountType = parseAccountType ( option . parent . accountType ) ;
148168 const passphrase = await parsePassphrase ( option . passphrase ) ;
149169 const networkId = option . parent . networkId ;
150- await importRawKey ( cckey , accountType , privateKey , passphrase , networkId ) ;
170+ await importRawKey (
171+ {
172+ cckey,
173+ accountType,
174+ networkId
175+ } ,
176+ privateKey ,
177+ passphrase
178+ ) ;
151179}
152180
153181async function exportCommand ( args : any [ ] , option : ExportOption ) {
@@ -157,11 +185,13 @@ async function exportCommand(args: any[], option: ExportOption) {
157185 const passphrase = await parsePassphrase ( option . passphrase ) ;
158186 const networkId = option . parent . networkId ;
159187 const secret = await exportKey (
160- cckey ,
161- accountType ,
188+ {
189+ cckey,
190+ accountType,
191+ networkId
192+ } ,
162193 address ,
163- passphrase ,
164- networkId
194+ passphrase
165195 ) ;
166196 const res = option . pretty
167197 ? JSON . stringify ( secret , null , 2 )
0 commit comments