Getting Started
Prerequisite: You should have installed Node.js (version 18.10.0 or higher).
Install the npm package to get started with the Bastion SDK.
Step 0 - Create an API key
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.
Step 1 - Import the Bastion SDK into your app
Step 2 - Instantiate the Bastion SDK with an ether.js web3 provider
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.
Last updated