Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
import { Network } from "@injectivelabs/networks"; import { toChainFormat } from "@injectivelabs/utils"; import { MsgBroadcasterWithPk } from "@injectivelabs/sdk-ts/core/tx"; import { MsgBeginRedelegate } from "@injectivelabs/sdk-ts/core/modules"; const denom = "inj"; const privateKey = "0x..."; const amount = toChainFormat(5); const injectiveAddress = "inj1..."; const sourceValidatorAddress = "inj1..."; const destinationValidatorAddress = "inj1..."; const msg = MsgBeginRedelegate.fromJSON({ injectiveAddress, dstValidatorAddress: destinationValidatorAddress, srcValidatorAddress: sourceValidatorAddress, amount: { denom, amount, }, }); const txHash = await new MsgBroadcasterWithPk({ privateKey, network: Network.Testnet, }).broadcast({ msgs: msg, }); console.log(txHash);
import { Network } from "@injectivelabs/networks"; import { toChainFormat } from "@injectivelabs/utils"; import { MsgDelegate } from "@injectivelabs/sdk-ts/core/modules"; import { MsgBroadcasterWithPk } from "@injectivelabs/sdk-ts/core/tx"; const denom = "inj"; const privateKey = "0x..."; const injectiveAddress = "inj1..."; const validatorAddress = "inj1..."; const amount = toChainFormat(5).toFixed(); const msg = MsgDelegate.fromJSON({ injectiveAddress, validatorAddress, amount: { denom, amount, }, }); const txHash = await new MsgBroadcasterWithPk({ privateKey, network: Network.Testnet, }).broadcast({ msgs: msg, }); console.log(txHash);
import { Network } from "@injectivelabs/networks"; import { toChainFormat } from "@injectivelabs/utils"; import { MsgBroadcasterWithPk } from "@injectivelabs/sdk-ts/core/tx"; import { MsgCancelUnbondingDelegation } from "@injectivelabs/sdk-ts/core/modules"; const denom = "inj"; const delegatorAddress = "inj1..."; const privateKey = "0x..."; const amount = toChainFormat(5).toFixed(); const validatorAddress = "inj1..."; const creationHeight = "123456"; // the height at which the unbonding was initiated const msg = MsgCancelUnbondingDelegation.fromJSON({ delegatorAddress, validatorAddress, amount: { denom, amount, }, creationHeight, }); const txHash = await new MsgBroadcasterWithPk({ privateKey, network: Network.Testnet, }).broadcast({ msgs: msg, }); console.log(txHash);