I had created a mint
that works from the console with sui client cli. I am trying to call the smart contract from a react app. Here is the code in react js:
const { mutate: signAndExecuteTransactionBlock } = useSignAndExecuteTransactionBlock();
const txb = new TransactionBlock();
const gasBudgetAmount = Number(MIST_PER_SUI)*2;
txb.setGasBudget(gasBudgetAmount);
const [coin] = txb.splitCoins(txb.gas, [txb.pure(1)]);
txb.moveCall({
target: `${contractInfo.PACKAGE_ID}::protocol::mint`,
arguments: [
txb.pure(channelName),
txb.pure("unstoppable channel"),
txb.pure("https://assets-global.website-files.com/65cc508da73d6666440ac030/65cf601634658984e214a47c_CharMian_pfp_07_VisionGuy%20(1).png"),
txb.object(contractInfo.CHANNEL_LIST),
txb.object(contractInfo.RESERVE_CHANNEL_LIST),
coin
],
});
signAndExecuteTransactionBlock(
{
transactionBlock: txb,
chain: 'sui:devnet',
},
{
onSuccess: (result) => {
console.log('executed transaction block', result);
}
}
)
This is the function signature of the mint
function:
public entry fun mint(
name: String,
description: String,
url: String,
channel_list: &mut ChannelList,
reserved_channel_list: &mut ReservedChannelList,
fee: &mut Coin<SUI>,
ctx: &mut TxContext
) {
Connecting to Suiet wallet and calling the smart contract I am getting this error in the wallet:
MoveAbort(MoveLocation { module: ModuleId { address:
8622d71a2522a4f2cde8481b3072d1730d1668f0bc79d2def4579ec362381d30, name:
Identifier("protocol") }, function: 2, instruction: 49, function_name:
Some("mint") }, 0) in command 1 | (RpcError:-5000) (code: -5000)
Connecting to Sui wallet and calling the smart contract I am getting this error in the wall for the same code:
Error: Invalid user signature: Signature is not valid: General cryptographic
error: Groth16 proof verify failed
What does the errors indicate and How to resolve this?