Skip to content

Commit 0db9042

Browse files
committed
add useDahGallery docs
1 parent 7bf262c commit 0db9042

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ No API is needed, the blockchain is the API!
2323

2424
This package will work with the following dependencies in your app, if they are already included.
2525

26-
- [axios 1.x](https://github.com/axios/axios)
26+
- [axios 1.8.2](https://github.com/axios/axios)
2727
- [ethers.js 6.x](https://github.com/ethers-io/ethers.js/)
2828
- [pinia 2.x or 3.x](https://github.com/vuejs/pinia)
2929
- [vue 3.x](https://github.com/vuejs/core)
@@ -179,6 +179,46 @@ const {
179179
- **`getTokenOwner`**: An async function to get the current token holder wallet address. This is only a utility/convenience function that is not required. This function is not ready to fire until isLoading is true. Watch isLoading and do not fire getTokenMetaData until isLoading has been set to false at least once. Most likely, you should just use the useEvmNft composable to get this function, unless you have already called this composable, because this composable will return the first page of NFTs regardless.
180180
- **`getTokenMetaData`**: An async function to get meta data for an array of Token Ids. This is only a utility/convenience function that is not required. If chain ID is not null, then we get the meta data without needing to access the blockchain at all because we use Dig-A-Hash predictable storage paths based on that chain ID. This function is not ready to fire until isLoading is true. Watch isLoading and do not fire getTokenMetaData until isLoading has been set to false at least once. Most likely, you should just use the useEvmNft composable to get this function, unless you have already called this composable, because this composable will return the first page of NFTs regardless.
181181

182+
## useDahGallery Composable
183+
184+
This composable is exactly like the useEvmMetaDataGallery but this composable requires two new props to the config because there is absolutely no on-chain validation at all using this composable. This is the fastest, and most reliable method.
185+
186+
## Usage
187+
188+
```javascript
189+
import {
190+
useEvmMetaDataGallery,
191+
blockchains,
192+
dahDemoV1Abi as abi,
193+
} from 'vue-evm-nft';
194+
195+
const {
196+
page,
197+
numberOfPages,
198+
nfts,
199+
isLoading,
200+
isAscending,
201+
toggleSortOrder,
202+
} = useEvmMetaDataGallery({
203+
contractPublicKey,
204+
contractAddress,
205+
abi,
206+
chainId: blockchains.fantom.chainId,
207+
rpc: blockchains.fantom.publicRpc,
208+
itemsPerPage,
209+
nftStoreItemCollectionName,
210+
isAscendingSort: false,
211+
isGetAllNftQuery: false,
212+
startTokenId: 0 // new
213+
supply: 500 // new
214+
});
215+
```
216+
217+
#### Configuration Object (config: DahGalleryOptions)
218+
- **`All items from useEvmMetaDataGallery config`**: All items from the useEvmMetaDataGallery config object are used here the same way. Two new options must be specified below.
219+
- **`startTokenId`**: A number indicating the starting token id for the collection, usually 0 or 1.
220+
- **`supply`**: A number specifying the total supply count of all NFTs on contract.
221+
182222
## useEvmNft Composable
183223
The useEvmNft composable is the core composable used internally by both useEvmNftGallery, and useEvmMetaDataGallery.
184224

0 commit comments

Comments
 (0)