Undelegate
The undelegate
method allows Antelope account owners to undelegate (unstake) CPU or NET resources from their account. It returns an Action instance that details the undelegation. The action can then be signed and executed on-chain using the SessionKit
Transact method.
Usage
The undelegate
method is available on any Account instance. Here is a basic example of how to use it:
const action = testAccount.undelegate({
cpu: "1.0000 A",
net: "0.5000 A",
})
// Initiates an undelegate action with the specified CPU and NET quantities.
The receiver
option can also be specified to return the undelegated resources to another account:
const action = testAccount.undelegate({
cpu: "1.0000 A",
net: "0.5000 A",
receiver: "wharfkit1112",
})
Arguments
cpu
: The quantity of CPU resources to undelegate, specified as a string (e.g.,1.0000 A
).net
: The quantity of NET resources to undelegate, specified as a string (e.g.,0.5000 A
).
Options
receiver
: The Antelope account to which the undelegated tokens should be returned. If not provided, it defaults to the account initiating theundelegate
action.
Return Value
The undelegate
method returns an Action instance. This action can then be passed to the SessionKit
Transact method for execution.