Getting Started
Last updated
Last updated
Prerequisite: You should have installed Node.js (version 18.10.0 or higher).
Install the npm package to get started with the Bastion SDK.
First, go to the Bastion Dashboard and create an API key.
We DO NOT charge for testnet transactions. For Mainnet transactions, if you want the gas to be sponsored by a Paymaster, then you need to top up your account on the Bastion dashboard and make sure that you have enough balance there for all the transactions to go through.
In the above code, replace the Config variables as required.
All the Config fields EXCEPT apiKey are optional. You can leave them empty if you pass a web3 provider with a signer (such as when using Metamask, Particle Auth, or web3 auth).
Note:- If you're using the SDK in a NodeJS backend environment and are not passing a web3Provider, then you NEED to pass a Private Key in the CONFIG.
You can find more info about creating the web3 provider and the various configurations in the Tutorials section.