1.0.2 • Published 1 year ago
mferbuilderdao-sdk v1.0.2
mferbuilderdao-sdk
the
mferbuilderdao-sdk
is a TypeScript library that provides type safe interactions and data fetching for the mferbuilderDAO contracts.
this is an mferbuilderDAO-scoped fork of the builder-sdk by neokry.
just getting started
add the package with your package manager of choice | npm registry page
yarn add mferbuilderdao-sdk
# or
npm install mferbuilderdao-sdk
quick example
import { ethers } from 'ethers'
import { MferBuilderDAO } from 'mferbuilderdao-sdk'
// grab your Ethers provider of choice!
const provider = ethers.getDefaultProvider('mainnet')
// connect to the mferbuilderDAO SDK
const { auction, token } = MferBuilderDAO.connect({
signerOrProvider: provider,
})
// access to the DAO's Auction and Token contracts
const auctionContract = auction()
const tokenContract = token()
// grab that data, mfer! all contract functions & events are available
const auctionData = await auctionContract.auction()
const tokenURI = await tokenContract.tokenURI(auctionData.tokenId)
more examples
there are more in-depth examples in the examples
folder:
with-react
with-node
develop locally using the examples
install dependencies
yarn
with React
setup the local environment and run the React app
yarn dev:react
with Node
setup the local Node environment
yarn dev:node
navigate to the with-node
example directory
cd examples/with-node
run the script!
yarn dev
development workflow
you can edit the files in package
directory then run the following command at the root of the project to have the changes reflect in the examples
yarn build