ConsensusCreate

UpdateValidatorTransaction

Returns a serialized `update_validator` transaction. You need to provide the address of a basic account (the sender wallet) to pay the transaction fee. Since JSON doesn't have a primitive for Option (it just has the null primitive), we can't have a double Option. So we use the following work-around for the signal data: null = No change in the signal data field. "" = Change the signal data field to None. "0x29a4b..." = Change the signal data field to Some(0x29a4b...).

const res = await fetch("http://127.0.0.1:8648", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
  jsonrpc: "2.0",
  method: "createUpdateValidatorTransaction",
  params: ["senderWallet", "validatorWallet", "newSigningSecretKey", "newVotingSecretKey", "newRewardAddress", "newSignalData", 0, 0],
  id: 1
})
});
const data = await res.json();

Parameters

PropType / Default
senderWallet
string
validatorWallet
string
newSigningSecretKey
string
newVotingSecretKey
string
newRewardAddress
string
newSignalData
string
fee
number
validityStartHeight
number

Returns

PropType / Default
returnValue
string

On this page