I have an entry point on my smart contract that takes no parameter and is just called with an amount to fund the contract. when I call wallet.sendTransaction without passing parameters and schema, the Transaction is initiated and goes through but attempting to convert the returned Hash fails
const payload = {
amount: CcdAmount.fromMicroCcd(BigInt(microAmount)),
address: ContractAddress.create(receiverAddress, 0),
receiveName: ReceiveName.create(
ContractName.fromString(CCD_CONTRACT),
EntrypointName.fromString(entryPoint)
),
maxContractExecutionEnergy: Energy.create(res.usedEnergy.value + 100n),
}
const hash = await wallet.sendTransaction(
AccountAddress.toBase58(sender),
AccountTransactionType.Update,
payload
}
)
console.log(hash) // hash correctly returned
const transactionHash = TransactionHash.toHexString(hash) // fails here
when trying to do this TransactionHash.toHexString(hash)
it fails with an error
Uncaught (in promise) TypeError: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined
at from (chunk-RABGB6UD.js?v=5d3d8681:265:15)
at Buffer.from (chunk-RABGB6UD.js?v=5d3d8681:295:14)
at Object.toHexString4
But when calling another entry point that takes parameters it works without any issue
const hash = await wallet.sendTransaction(
AccountAddress.toBase58(sender),
AccountTransactionType.Update,
payload,
data,
{
type: 'parameter',
value: rawSchema[entryPoint],
}
)
console.log(hash)
const transactionHash = TransactionHash.toHexString(hash) // works without any issue