paraspace-api
v0.3.42
Published
A simple api for interacting with paraspace protocol
Downloads
29
Readme
:package: paraspace-api
A simple api for interacting with paraspace protocol
🌟 Features
- 🪐 internal integration of typechain and paraspace-core addresses
- 🤖️ multicall integration
- 🍵 ethers based rpc provider
:sparkles: Usage
npm i paraspace-api
:beers: Example
// In this case, we are connecting to the test network of paraspace in goerli
// NOTE: provider.init() should be done before use
import { Provider, ParaSpaceEthMM as MM, Environment, NetworkName, RPCProviderType } from "paraspace-api"
const rpcs = [
{
endpoint: "https://goerli.infura.io/v3/<your-api-key>",
type: RPCProviderType.ArchiveRPC,
},
{
endpoint: "https://eth-goerli.g.alchemy.com/v2/<your-api-key>",
type: RPCProviderType.ArchiveRPC,
}
// and more ...
]
const provider = new Provider(Environment.DEVELOPMENT, NetworkName.goerli, rpcs)
await provider.init()
const reserves = await provider.connectAndSendTx(
MM.ProtocolDataProvider,
"getAllReservesTokens",
[]
)
const USDC = reserves.find({ symbol } => symbol === "USDC")
console.log(USDC)
:bookmark: see release
for CHANGELOG