Having an issue trying to mint an NFT with my own policy. It's throwing the error below:
Missing key witness for: 1e101f14d07f203b01f8.....
I am not sure what to do here and any assistance would be appreciated. Long time developer, short time developing on Cardano.
Here is my code:
const nativeScript: NativeScript = {
type: 'all',
scripts:
[
{
type: 'sig',
keyHash: '1e101f14d07f203b01f89d1562831374f....'
},
{
type: 'before',
slot: '317614504'
}
]
};
const forgingScript = ForgeScript.fromNativeScript(nativeScript);
const { wallet, connected } = useWallet();
const [txHash, setTxHash] = useState<string | null>(null);
const [loading, setLoading] = useState<boolean>(false);
const wallet_for_mint = new AppWallet({
networkId: 1,
fetcher: blockchainProvider,
submitter: blockchainProvider,
key: {
type: "mnemonic",
words: [
'tenant',
....
],
},
});
const assetMetadata1: AssetMetadata = {
name: "ASSETNAME",
type: "TYPE1",
item: "FLAG",
image: "ipfs://Qmb18wvCu.....",
};
const asset1: Mint = {
assetName: "TESTASSET",
assetQuantity: "1",
metadata: assetMetadata1,
label: "721",
recipient:
"addr.........e",
};
const txMint = new Transaction({ initiator: wallet_for_mint });
txMint.mintAsset(forgingScript, asset1);
const unsignedTxMint = await txMint.build();
const signedTxMint = await wallet_for_mint.signTx(unsignedTxMint);
const txHash = await wallet_for_mint.submitTx(signedTxMint);