Transfer Node Delegate Stake
Add and increase delegate stake
Explorer
Select the submit the following extrinsic and choose network in the explorer.
Choose transferDelegateStake(fromSubnetId, toSubnetId, sharesToBeSwitched)
.
Choose the subnet ID transferring from.
Choose the subnet node ID transferring from.
Choose the subnet ID to transfer to.
Choose the subnet node ID to transfer to.
The shares to transfer from the fromSubnetId.
Substrate Libraries
# convert balance to shares using the ``convert_to_shares`` function
keypair = Keypair.create_from_uri('//Alice') # replace with your mnemonic phrase
call = substrate.compose_call(
call_module='Network',
call_function='transfer_node_delegate_stake',
call_params={
'from_subnet_id': from_subnet_id,
'from_subnet_node_id': from_subnet_node_id,
'to_subnet_id': to_subnet_id,
'to_subnet_node_id': to_subnet_node_id,
'shares_to_be_switched': shares_to_be_switched,
}
)
extrinsic = substrate.create_signed_extrinsic(call=call, keypair=keypair)
receipt = substrate.submit_extrinsic(extrinsic, wait_for_inclusion=True)
// convert balance to shares using the ``convert_to_shares`` function
const api = await ApiPromise.create();
// Construct the keyring after the API (crypto has an async init)
const keyring = new Keyring({ type: 'sr25519' });
// Replace //Alice with your mnemonic phrase
const keypair = keyring.addFromUri('//Alice');
const fromSubnetId = 1;
const toSubnetId = 2;
const sharesToBeSwitched = 100;
const extrinsic = api.tx.network.transferNodeDelegateStake(
fromSubnetId,
fromSubnetNodeId,
toSubnetId,
toSubnetNodeId,
sharesToBeSwitched
);
const hash = await extrinsic.signAndSend(keypair);