bun i @kilnfi/sdk@latestconst k = new Kiln({
testnet: true,
apiToken: 'kiln_xxx',
});
const vault: Integration = {
provider: 'fireblocks',
fireblocksApiKey: 'YOUR_API_USER_KEY', // your fireblocks API user key
fireblocksSecretKey: apiSecret, // your fireblocks private key (generated with your CSR file and your API user)
vaultId: 7 // your fireblocks vault id
};
...
const tx = await k.near.craftStakeTx(
'account_id',
'wallet',
'pool_id',
0.1,
);
const txSigned = await k.near.sign(vault, tx);const k = new Kiln({
baseUrl: 'https://api.testnet.kiln.fi',
apiToken: 'kiln_xxx',
});
const vault: Integration = {
provider: 'fireblocks',
fireblocksApiKey: 'YOUR_API_USER_KEY', // your fireblocks API user key
fireblocksSecretKey: apiSecret, // your fireblocks private key (generated with your CSR file and your API user)
vaultId: 7 // your fireblocks vault id
};
const tx = await k.client.POST(
'/v1/near/transaction/stake',
{
body: {
account_id: 'account_id',
wallet: 'wallet',
pool_id: 'pool_id',
amount_yocto: '1000000000000000000000000',
}
}
);
const signResponse = await k.fireblocks.signNearTx(vault, tx.data.data, "NEAR_TEST");
const broadcastedTx = await k.client.POST("/v1/near/transaction/broadcast", {
body: {
signed_tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
}
});