You can run any of the following example scripts using the command:
npx tsx examples/*.ts
Here are some of the available examples:
- Basic:
- WETH Operations:
- NFT Operations:
- Advanced:
To buy an NFT using a collection slug, follow these steps:
# Install dependencies
yarn
# Set up credentials
cp .env.example .env # Paste your NEAR credentials into the .env file
# Run the OpenSea example script
npx tsx examples/opensea.ts
You will be prompted to provide a collectionSlug
.
A collection slug identifies a specific collection on OpenSea. To find a collection slug:
- Visit testnet.opensea.
- Browse and find a collection you like.
- Copy the slug from the URL:
https://testnets.opensea.io/collection/[slug]
.
For example, if the URL is https://testnets.opensea.io/collection/the-monkey-chainz
, the collection slug is the-monkey-chainz
.