npm i @byzanlink-tech/aa-sdk --save
And that's it! You are now ready to dive into Account Abstraction. Now let’s learn how to instantiate the SDK.
To integrate Byzanlink Smart Account SDK, you will need the . If you also want to use the Gas Manager, you'll need a
import { ByzanlinkAASdk } from '@byzanlink-tech/aa-sdk';
async function main() {
// Initializating sdk
const byzanlinkAASdk = new ByzanlinkAASdk(
{ privateKey: process.env.PRIVATE_KEY }, // Get the private key using any wallet provider
{
chainId: Number(process.env.CHAIN_ID), // Ex: 80002
policyId: process.env.GAS_MANAGER_POLICY_ID, // Optional - Get the Policy ID from Byzanlink dashboard
apiKey: process.env.BYZANLINK_API_KEY // Get API key from Byzanlink dashboard
})
// Get Byzanlink Wallet address
const address: string = await byzanlinkAASdk.getCounterFactualAddress();
console.log(`ByzanLink Wallet address: ${address}`);
// Get Balance
const balance: string = await byzanlinkAASdk.getNativeBalance();
console.log(`Byzanlink Wallet native balance: ${balance}`);
}
main()
.catch(console.error)
.finally(() => process.exit());
In the next page we’ll take a look at the various methods the SDK offers.