Kiln docs
Search…
⌃K

Ethereum (ETH): Stake ETH with Kiln Connect

Stake ETH programmatically with Kiln Connect SDK.

Stake

Stake a multiple of 32 ETH in a single transaction. You can also decide to use your own validation keys and not use Kiln by default.
// optional, only for specific setups
const options = {
// if not specified, generate keys with Kiln API
deposit_data?: {
pubkey: string;
withdrawalCrendentials: string;
signature: string;
depositDataRoot: string;
}[];
};
/* async craftStakeTx(accountId: string, walletPubkey: string, amountInEth: number, options: EthereumStakeOptions): Promise<EthereumTx> */
const tx = await k.eth.craftStakeTx(account.id, WALLET_PUBKEY, 320, options);

Unstake

Unstaking on Ethereum is not supported by the protocol yet.

Sign

Sign Ethereum transactions by specifying the integration name and the crafted transaction.
/* async sign(integration: string, transaction: EthereumTx): Promise<EthereumTx> */
const signed = await k.eth.sign('vault-1', tx);

Broadcast

Broadcast and get the status of a broadcasted transaction. If you specified a custom RPC url for Ethereum in the SDK configuration, it will be used instead of the default one.
/* async broadcast(signedTx: SignedEthereumTx): Promise<string | undefined> */
const hash = await k.eth.broadcast(signed);
/* async getTxStatus(transactionHash: string): Promise<EthTxStatus> */
const status = await k.eth.getTxStatus(hash);