Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammed-almujil committed Mar 26, 2023
1 parent 4bf810d commit 2366978
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

0 comments on commit 2366978

Please sign in to comment.