user6324: I am looking for a method to create the policy.vkey and policy.skey.
unfortunately my search has been unsuccessful so far.
I have searched the library https://github.com/Berry-Pool/cardanocli-js/blob/main/API.md but found nothing.
I want to create a NFT with the library "cardanocli-js".
Thanks for the help
want to create an NFT and I get the following error in my code

const mintScript = {
  "type": "all",
  "scripts": [
    {
      "type": "before",
      "slot": expireSlot
    },
    {
      "keyHash": cardanocliJs.addressKeyHash(wallet.name),
      "type": "sig",
    }
  ]
}

const policy = cardanocliJs.transactionPolicyid(mintScript);
const BERRYCOIN = policy + ".TestNFT";
const ASSET_NAME = 'Test-BildNFT';

console.log(policy);

const metadata = {
  "721": {
      [policy]: {
          [ASSET_NAME]: {
              "name": ASSET_NAME,
              "id": 1,
              "artist": 'Dave',
              "size": "big",
              "mediaType": "image/jpeg",
              "collection": "CollectionTest",
              "image": 'ipfs://QmYBfPDQ7reFcFvYESuipFL8R4FaqGZdMieCaUTHnZTB73',
              "description": 'Test Picture NFT',
          }
      }
  }
}

const tx = {
  txIn: wallet.balance().utxo,
  txOut: [
    {
      address: wallet.paymentAddr,
      value: { ...wallet.balance().value, [BERRYCOIN]: 1 },
    },
  ],
  mint: [
    { action: "mint", quantity: 1, asset: BERRYCOIN, script: mintScript },
  ],
  witnessCount: 2,
  metadata: metadata,
};

const raw = createTransaction(tx);
const signed = signTransaction(wallet, raw);
console.log(cardanocliJs.transactionView({ txFile: signed }));
const txHash = cardanocliJs.transactionSubmit(signed);
console.log(txHash);

const createTransaction = (tx) => {
  let raw = cardanocliJs.transactionBuildRaw(tx);
  let fee = cardanocliJs.transactionCalculateMinFee({
    ...tx,
    txBody: raw,
  });
  tx.txOut[0].value.lovelace -= fee;
  return cardanocliJs.transactionBuildRaw({ ...tx, fee });
};

const signTransaction = (wallet, tx, script) => {
  return cardanocliJs.transactionSign({
    signingKeys: [wallet.payment.skey, wallet.payment.skey],
    txBody: tx,
  });
};
Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (ScriptWitnessNotValidatingUTXOW (fromList [ScriptHash "857ebbcadda9fd10568262fdaf64d20935681752968390cf9a830952"])))])
node:child_process:903
    throw err;
    ^

Error: Command failed: cardano-cli transaction submit --testnet-magic 1097911063 --tx-file ./tmp/tx_orkb4h9js.signed
Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (ScriptWitnessNotValidatingUTXOW (fromList [ScriptHash "857ebbcadda9fd10568262fdaf64d20935681752968390cf9a830952"])))])


user382: A policy key is just a payment key (or stake key, depending on where the policy is listed in the address). So in the example of using cardanocli-js, you would use the addressKeyGen method. https://github.com/Berry-Pool/cardanocli-js/blob/main/API.md#CardanocliJs+addressKeyGen

6324: <p>I am looking for a method to create the policy.vkey and policy.skey.
unfortunately my search has been unsuccessful so far.
I have searched the library <a href="https://github.com/Berry-Pool/cardanocli-js/blob/main/API.md" rel="nofollow noreferrer">https://github.com/Berry-Pool/cardanocli-js/blob/main/API.md</a> but found nothing.</p>
<p>I want to create a NFT with the library &quot;cardanocli-js&quot;.</p>
<p>Thanks for the help</p>
<p>want to create an NFT and I get the following error in my code</p>
<pre>
const mintScript = {
  "type": "all",
  "scripts": [
    {
      "type": "before",
      "slot": expireSlot
    },
    {
      "keyHash": cardanocliJs.addressKeyHash(wallet.name),
      "type": "sig",
    }
  ]
}

const policy = cardanocliJs.transactionPolicyid(mintScript);
const BERRYCOIN = policy + ".TestNFT";
const ASSET_NAME = 'Test-BildNFT';

console.log(policy);

const metadata = {
  "721": {
      [policy]: {
          [ASSET_NAME]: {
              "name": ASSET_NAME,
              "id": 1,
              "artist": 'Dave',
              "size": "big",
              "mediaType": "image/jpeg",
              "collection": "CollectionTest",
              "image": 'ipfs://QmYBfPDQ7reFcFvYESuipFL8R4FaqGZdMieCaUTHnZTB73',
              "description": 'Test Picture NFT',
          }
      }
  }
}

const tx = {
  txIn: wallet.balance().utxo,
  txOut: [
    {
      address: wallet.paymentAddr,
      value: { ...wallet.balance().value, [BERRYCOIN]: 1 },
    },
  ],
  mint: [
    { action: "mint", quantity: 1, asset: BERRYCOIN, script: mintScript },
  ],
  witnessCount: 2,
  metadata: metadata,
};

const raw = createTransaction(tx);
const signed = signTransaction(wallet, raw);
console.log(cardanocliJs.transactionView({ txFile: signed }));
const txHash = cardanocliJs.transactionSubmit(signed);
console.log(txHash);

const createTransaction = (tx) => {
  let raw = cardanocliJs.transactionBuildRaw(tx);
  let fee = cardanocliJs.transactionCalculateMinFee({
    ...tx,
    txBody: raw,
  });
  tx.txOut[0].value.lovelace -= fee;
  return cardanocliJs.transactionBuildRaw({ ...tx, fee });
};

const signTransaction = (wallet, tx, script) => {
  return cardanocliJs.transactionSign({
    signingKeys: [wallet.payment.skey, wallet.payment.skey],
    txBody: tx,
  });
};</pre>
<pre>Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (ScriptWitnessNotValidatingUTXOW (fromList [ScriptHash "857ebbcadda9fd10568262fdaf64d20935681752968390cf9a830952"])))])
node:child_process:903
    throw err;
    ^

Error: Command failed: cardano-cli transaction submit --testnet-magic 1097911063 --tx-file ./tmp/tx_orkb4h9js.signed
Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (ScriptWitnessNotValidatingUTXOW (fromList [ScriptHash "857ebbcadda9fd10568262fdaf64d20935681752968390cf9a830952"])))])
</pre>
 382: <p>A policy key is just a payment key (or stake key, depending on where the policy is listed in the address). So in the example of using cardanocli-js, you would use the <code>addressKeyGen</code> method. <a href="https://github.com/Berry-Pool/cardanocli-js/blob/main/API.md#CardanocliJs+addressKeyGen" rel="nofollow noreferrer">https://github.com/Berry-Pool/cardanocli-js/blob/main/API.md#CardanocliJs+addressKeyGen</a></p>
