I'm trying to send a ballot operation with Taquito and Beacon SDK. Here's my code:
const currentProposal: string = (await Tezos.rpc.getCurrentProposal())?.toString() || "";
const branch: string = await Tezos.rpc.getBlockHash();
const period: number = (await Tezos.rpc.getCurrentPeriod()).voting_period.index;
const op = {
"branch": branch,
"contents": [
{
"kind": TezosOperationType.BALLOT,
"source": userAddress,
"period": period,
"proposal": currentProposal,
"ballot": ballotValue
}
]
};
/*
Values I got:
branch: 'BLrLfk6Z3vXx3EzNjkFz4dQEzNKZ1AZTUv5ecw4AADvPjWFHkTS',
contents: [
{
kind: 'ballot',
source: 'tz1...',
period: 79,
ballot: 'yay',
proposal: 'PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg',
},
*/
const hash = await wallet.sendOperations([
op
]);
I'm getting the following error, it seems coming from beacon-sdk:
[PARAMETERS_INVALID_ERROR]:Some of the parameters you provided are invalid and the request could not be completed. Please check your inputs and try again.
The pkh I use as source is not a delegate, so I'm expecting an error. More likely something like "no keys for the source contract tz1..." as with tezos-client submit ballot
, not a format error.
The target is to have to confirm the operation with connected Temple wallet. When I try it with a simple transaction operation, it's ok, so my wallet is well initialized.
Is my operation not correctly formated ? Are Taquito or Beacon SDK suitable with ballot operation ? Or maybe Beacon SDK checks if phk is a delegate and returns this error if not ?
I want to be sure of that before taking time necessary to create a private network to test delegates and votes.