-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Benjamin Smith <[email protected]>
- Loading branch information
1 parent
aefd9d5
commit f25a205
Showing
2 changed files
with
88 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
## Examples | ||
|
||
You can run any of the following example scripts using the command: | ||
|
||
```bash | ||
npx ts-node examples/*.ts | ||
``` | ||
|
||
Here are some of the available examples: | ||
|
||
1. **Basic:** | ||
- [Send ETH](./send-eth.ts) | ||
2. **WETH Operations:** | ||
- [Deposit (Wrap-ETH)](./weth/wrap.ts) | ||
- [Withdraw (Unwrap-ETH)](./weth/unwrap.ts) | ||
3. **NFT Operations:** | ||
- [Transfer ERC721](./nft/erc721/transfer.ts) | ||
4. **Advanced:** | ||
- [Buy NFT on OpenSea](./opensea.ts) | ||
|
||
## Example: Buy NFT by Collection Slug | ||
|
||
To buy an NFT using a collection slug, follow these steps: | ||
|
||
```sh | ||
# Install dependencies | ||
yarn | ||
|
||
# Set up credentials | ||
cp .env.example .env # Paste your NEAR credentials into the .env file | ||
|
||
# Run the OpenSea example script | ||
npx ts-node examples/opensea.ts | ||
``` | ||
|
||
You will be prompted to provide a `collectionSlug`. | ||
|
||
### What is a Collection Slug? | ||
|
||
A collection slug identifies a specific collection on OpenSea. To find a collection slug: | ||
|
||
1. Visit [testnet.opensea](https://testnets.opensea.io/). | ||
2. Browse and find a collection you like. | ||
3. 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`. |