Get Staking Transaction
Running your first API call
const STAKING_BASE_API_URL = 'https://ethereum-staking.sprd.validationcloud.io/v1/api';
const STAKING_REQUEST_URL = `${STAKING_BASE_API_URL}/ethereum/mainnet/stake_transaction`;
async function createStakeTransaction(token, walletAddress, num) {
const jsonBody = JSON.stringify({
num_validators: num,
wallet_address: walletAddress,
});
const response = await fetch(STAKING_REQUEST_URL, {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: jsonBody,
});
return await response.json();
}Last updated