Implement Mint by Keys for Badge Hub Dashboard > Execute
This commit is contained in:
parent
cfbec6baeb
commit
f9f0946b41
@ -175,20 +175,24 @@ const BadgeHubExecutePage: NextPage = () => {
|
|||||||
name: 'owner',
|
name: 'owner',
|
||||||
title: 'Owner',
|
title: 'Owner',
|
||||||
subtitle: 'The owner of the badge',
|
subtitle: 'The owner of the badge',
|
||||||
|
defaultValue: wallet.address,
|
||||||
})
|
})
|
||||||
|
|
||||||
const pubkeyState = useInputState({
|
const pubkeyState = useInputState({
|
||||||
id: 'pubkey',
|
id: 'pubkey',
|
||||||
name: 'pubkey',
|
name: 'pubkey',
|
||||||
title: 'Pubkey',
|
title: 'Pubkey',
|
||||||
subtitle: 'The public key for the badge',
|
subtitle: 'The whitelisted public key authorized to mint a badge',
|
||||||
})
|
})
|
||||||
|
|
||||||
const privateKeyState = useInputState({
|
const privateKeyState = useInputState({
|
||||||
id: 'privateKey',
|
id: 'privateKey',
|
||||||
name: 'privateKey',
|
name: 'privateKey',
|
||||||
title: 'Private Key',
|
title: 'Private Key',
|
||||||
subtitle: 'The private key generated during badge creation',
|
subtitle:
|
||||||
|
type === 'mint_by_keys'
|
||||||
|
? 'The corresponding private key for the whitelisted public key'
|
||||||
|
: 'The private key that was generated during badge creation',
|
||||||
})
|
})
|
||||||
|
|
||||||
const nftState = useInputState({
|
const nftState = useInputState({
|
||||||
@ -218,8 +222,9 @@ const BadgeHubExecutePage: NextPage = () => {
|
|||||||
])
|
])
|
||||||
const showLimitField = isEitherType(type, ['purge_keys', 'purge_owners'])
|
const showLimitField = isEitherType(type, ['purge_keys', 'purge_owners'])
|
||||||
const showNFTField = type === 'set_nft'
|
const showNFTField = type === 'set_nft'
|
||||||
const showOwnerField = type === 'mint_by_key'
|
const showOwnerField = isEitherType(type, ['mint_by_key', 'mint_by_keys', 'mint_by_minter'])
|
||||||
const showPrivateKeyField = type === 'mint_by_key'
|
const showPubkeyField = isEitherType(type, ['mint_by_keys'])
|
||||||
|
const showPrivateKeyField = isEitherType(type, ['mint_by_key', 'mint_by_keys'])
|
||||||
|
|
||||||
const messages = useMemo(() => contract?.use(contractState.value), [contract, wallet.address, contractState.value])
|
const messages = useMemo(() => contract?.use(contractState.value), [contract, wallet.address, contractState.value])
|
||||||
const payload: DispatchExecuteArgs = {
|
const payload: DispatchExecuteArgs = {
|
||||||
@ -694,6 +699,7 @@ const BadgeHubExecutePage: NextPage = () => {
|
|||||||
</Alert>
|
</Alert>
|
||||||
</Conditional>
|
</Conditional>
|
||||||
{showLimitField && <NumberInput {...limitState} />}
|
{showLimitField && <NumberInput {...limitState} />}
|
||||||
|
{showPubkeyField && <TextInput className="mt-2" {...pubkeyState} />}
|
||||||
{showPrivateKeyField && <TextInput className="mt-2" {...privateKeyState} />}
|
{showPrivateKeyField && <TextInput className="mt-2" {...privateKeyState} />}
|
||||||
{showNFTField && <AddressInput {...nftState} />}
|
{showNFTField && <AddressInput {...nftState} />}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user