Set Representative
Step-by-Step: Delegate to a Representative
1
Full Code Example
// Convert the public key string into a valid Keeta account
const representativeAccount = Client.lib.Account
.fromPublicKeyString(data.representativeAddress)
.assertAccount(); // Ensure it's a proper account type
// Initialize a block builder
const builder = userClient.initBuilder();
// Add a "set representative" operation
builder.setRep(representativeAccount);
// Publish the operation to the network
await userClient.publishBuilder(builder);
Last updated