-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bf810d
commit 2366978
Showing
1 changed file
with
22 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,29 +8,46 @@ Get on-chain NFT mints/transfers/burns including their metadata. Supported metad | |
## Dev | ||
Clone the repo | ||
``` | ||
git clone [email protected]:mohammed-almujil/on-chain-nft.git | ||
cd on-chain-nft | ||
git clone [email protected]:mohammed-almujil/on-chain-nfts.git | ||
cd on-chain-nfts | ||
``` | ||
Install dependencies | ||
``` | ||
npm install | ||
npm install -g ts-node | ||
``` | ||
Set ETH provider URL in test.ts | ||
|
||
### **Ethereum** | ||
|
||
ETH NFTs | ||
``` | ||
const onChainNFT = require('./index') | ||
onChainNFT.setEthProvider(PROVIDER_URL); | ||
//All NFTs | ||
const all = await onChainNFT.getEthNFTs({ blockNumber: blockNumber }); | ||
//ERC-721 NFTs only | ||
const erc721 = await onChainNFT.getERC721({ blockNumber: blockNumber }); | ||
//ERC-1155 only | ||
const erc1155 = await onChainNFT.getERC1155({ blockNumber: blockNumber }); | ||
``` | ||
|
||
Optionally set IPFS hostnames. The code will try the hostnames one by one in case of failure. More here https://ipfs.github.io/public-gateway-checker/ | ||
``` | ||
onChainNFT.setIpfsHostnames(['gateway.pinata.cloud','cloudflare-ipfs.com']); | ||
``` | ||
|
||
Optionally set Arweave hostnames. The code will try the hostnames one by one in case of failure. | ||
``` | ||
onChainNFT.setIpfsHostnames(['gateway.pinata.cloud','cloudflare-ipfs.com']); | ||
onChainNFT.setArweaveHostnames(['arweave.net']); | ||
``` | ||
### **Tests** | ||
|
||
Run tests locally | ||
Run tests locally, make sure PROVIDER_URL ENV variable is set then run | ||
``` | ||
ts-node test.ts | ||
``` |