-
Hey guys export async function ccDemoCallPublic(senderKey) {
const txOptions = {
contractAddress: 'ST36TRBFNKPB1TQT13S6PMPFFW32TD7A3NVBXNAW2',
contractName: 'counter',
functionName: 'increment',
functionArgs: [],
senderKey,
validateWithAbi: true,
network: regNetwork,
// sponsored: true,
// postConditions,
anchorMode: AnchorMode.Any,
};
const transaction = await makeContractCall(txOptions);
console.log('transaction',transaction);
return broadcastTransaction(transaction, regNetwork);
} The senderKey came from @stacks/connect-react UserSession's 'appPrivateKey' {
"error": "transaction rejected",
"reason": "NotEnoughFunds",
"reason_data": {
"actual": "0x00000000000000000000000000000000",
"expected": "0x00000000000000000000000000003101"
},
"txid": "c43f1517c320dc297d9d19367fc9dea36a953d79e340edbe3acc3493de10b73c"
} Can anyone help with this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
My fault, I mistook senderKey to appPrivateKey,and due to the community's expert suggestion. I changed my way to use chrome web extension wallet to do contract calls, which is more secured and meaningful. |
Beta Was this translation helpful? Give feedback.
My fault, I mistook senderKey to appPrivateKey,and due to the community's expert suggestion. I changed my way to use chrome web extension wallet to do contract calls, which is more secured and meaningful.
The way will be, us openContractCall, from @stacks/connect package.
if anyone meets "Invalid Buffer provided in SmartBufferOptions " error. Pls take a look at :
hirosystems/connect#150