The client to use for the transaction. AvalancheWalletCoreClient
The parameters for the transaction. PrepareSetAutoRenewedValidatorConfigTxnParameters
The unsigned transaction. PrepareSetAutoRenewedValidatorConfigTxnReturnType
import { prepareSetAutoRenewedValidatorConfigTxn } from "@avalanche-sdk/client/methods/wallet/pChain/prepareSetAutoRenewedValidatorConfigTxn";
import { createAvalancheWalletClient } from "@avalanche-sdk/client/clients/createAvalancheWalletClient";
import { privateKeyToAvalancheAccount } from "@avalanche-sdk/client/accounts";
import { avalanche } from "@avalanche-sdk/client/chains";
const account = privateKeyToAvalancheAccount("0x1234567890123456789012345678901234567890");
const walletClient = createAvalancheWalletClient({
account,
chain: avalanche,
});
const pChainSetAutoRenewedValidatorConfigTxnRequest =
await prepareSetAutoRenewedValidatorConfigTxn(walletClient, {
validatorTxId: "11111111111111111111111111111111LpoYY",
auth: [0],
period: 1209600n,
autoCompoundRewardPercentage: 30,
});
console.log(pChainSetAutoRenewedValidatorConfigTxnRequest);
Prepares a set auto-renewed validator config transaction for the P-chain.