Bot SDK - EVM
Calculate prices and prepare buy/sell transactions via the Moonshot SDK. Currently supports Base and Abstract chains
The trading instructions for buy and sell (but not mint) are directly available on-chain via the Moonshot Smart Contract.
Overview
The Moonshot SDK for EVM provides the following functions for Base and Abstract chains:
Minting of a token
Prepare and submit transactions
Upload all assets
Buy an initial amount of the tokens you minted
Get price of the token / position on bonding curve
Calculate collateral/token in and out
Generate buy and sell transactions (both exact in and out)
Set the slippage amount
Installation
Install the package using npm or yarn
Copy
npm i @wen-moon-ser/moonshot-sdk-evm
# or
yarn add @wen-moon-ser/moonshot-sdk-evmExample in Wen Moon repo : https://github.com/wen-moon-ser/moonshot-sdk-evm/blob/main/README.md
Initializing Moonshot
To initialize the Moonshot SDK, you need to create an instance of the Moonshot class. Before instantiating the Moonshot class, define your rpcUrl and signer.
Public endpoints for rpcUrl on Base
Mainnet : https://base.gateway.tenderly.co/
Public endpoints for rpcUrl on Abstract
Mainnet : https://api.mainnet.abs.xyz/
Testnet : https://api.testnet.abs.xyz/
Parameters of the Moonshot class
environment : You can initialize the environment for either mainnet or devnet
For Mainnet, use Environment.MAINNET
For Devnet, use Environemnt.TESTNET
signer : generated through your private key and rpcUrl
network : For selecting which chain you want to connect on
For Base, leave this parameter as empty (as in the example below)
For Abstract, use Network.ASBTRACT
Buy Example
Sell Example
Mint Example
Image size restrictions - 2 MB for the icon and 5 MB for the banner
Recommended aspect ratio - 1 : 1 for the icon and 3:1 for the banner
tokenAmount - Lets you buy an initial amount of tokens that you just minted
Last updated