@@ -22,7 +22,10 @@ import {
2222 buildTokenData ,
2323 determineFiniteMaxSupply ,
2424} from '@/plugins/token/utils/token-data-builders' ;
25- import { resolveOptionalKey } from '@/plugins/token/utils/token-resolve-optional-key' ;
25+ import {
26+ resolveOptionalKey ,
27+ toPublicKey ,
28+ } from '@/plugins/token/utils/token-resolve-optional-key' ;
2629import { ZustandTokenStateHelper } from '@/plugins/token/zustand-state-helper' ;
2730
2831export const TOKEN_CREATE_NFT_COMMAND_NAME = 'token_create-nft' ;
@@ -64,10 +67,11 @@ export class TokenCreateNftCommand extends BaseTransactionCommand<
6467 api . keyResolver ,
6568 'token:admin' ,
6669 ) ;
67- const supply = await api . keyResolver . resolveSigningKey (
70+ const supply = await resolveOptionalKey (
6871 validArgs . supplyKey ,
6972 keyManager ,
70- [ 'token:supply' ] ,
73+ api . keyResolver ,
74+ 'token:supply' ,
7175 ) ;
7276
7377 let finalMaxSupply : bigint | undefined ;
@@ -84,7 +88,7 @@ export class TokenCreateNftCommand extends BaseTransactionCommand<
8488 logger . debug ( '=== NFT PARAMS DEBUG ===' ) ;
8589 logger . debug ( `Treasury ID: ${ treasury . keyRefId } ` ) ;
8690 logger . debug ( `Admin Key (keyRefId): ${ admin ?. keyRefId } ` ) ;
87- logger . debug ( `Supply Key (keyRefId): ${ supply . keyRefId } ` ) ;
91+ logger . debug ( `Supply Key (keyRefId): ${ supply ? .keyRefId } ` ) ;
8892 logger . debug ( `Use Custom Treasury: ${ String ( Boolean ( treasury ) ) } ` ) ;
8993 logger . debug ( '=========================' ) ;
9094
@@ -123,7 +127,7 @@ export class TokenCreateNftCommand extends BaseTransactionCommand<
123127 adminPublicKey : normalisedParams . admin
124128 ? PublicKey . fromString ( normalisedParams . admin . publicKey )
125129 : undefined ,
126- supplyPublicKey : PublicKey . fromString ( normalisedParams . supply . publicKey ) ,
130+ supplyPublicKey : toPublicKey ( normalisedParams . supply ) ,
127131 memo : normalisedParams . memo ,
128132 } ) ;
129133 return { transaction } ;
@@ -187,7 +191,7 @@ export class TokenCreateNftCommand extends BaseTransactionCommand<
187191 tokenType : normalisedParams . tokenType ,
188192 supplyType : normalisedParams . supplyType ,
189193 adminPublicKey : normalisedParams . admin ?. publicKey ,
190- supplyPublicKey : normalisedParams . supply . publicKey ,
194+ supplyPublicKey : normalisedParams . supply ? .publicKey ,
191195 network : normalisedParams . network ,
192196 } ) ;
193197
@@ -216,7 +220,7 @@ export class TokenCreateNftCommand extends BaseTransactionCommand<
216220 adminAccountId : undefined ,
217221 adminPublicKey : normalisedParams . admin ?. publicKey ,
218222 supplyAccountId : undefined ,
219- supplyPublicKey : normalisedParams . supply . publicKey ,
223+ supplyPublicKey : normalisedParams . supply ? .publicKey ,
220224 alias : normalisedParams . alias ,
221225 network : normalisedParams . network ,
222226 } ;
0 commit comments