NFT Operations
Methods for working with reputation NFTs.mintReputationNFT
Mints a reputation NFT for a user.Parameters
| Name | Type | Description |
|---|---|---|
| userAddress | Address | Address of the user |
Returns
Hex - Transaction hash of the minting.
Example
Requirements
- User must be registered
- User must not already have an NFT
hasReputationNFT
Checks if a user has minted their reputation NFT.Parameters
| Name | Type | Description |
|---|---|---|
| userAddress | Address | Address of the user |
Returns
boolean - True if the user has an NFT, false otherwise.
Example
getTokenIdByUser
Gets the token ID for a user’s reputation NFT.Parameters
| Name | Type | Description |
|---|---|---|
| userAddress | Address | Address of the user |
Returns
bigint - Token ID of the user’s NFT.
Example
getNFTTokenURI
Gets the token URI for an NFT.Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | bigint | Token ID |
Returns
string - Token URI.
Example
getReputationNFTData
Gets the metadata for a user’s reputation NFT.Parameters
| Name | Type | Description |
|---|---|---|
| userAddress | Address | Address of the user |
Returns
ReputationNFTData object containing NFT details.Example
getNFTTotalSupply
Gets the total supply of reputation NFTs.Returns
bigint - Total supply of NFTs.
Example
generateBadgeSVG
Generates an SVG badge for display.Parameters
| Name | Type | Description |
|---|---|---|
| tier | number | Badge tier |
| referrals | number | Number of referrals |
| earnings | bigint | Total earnings in wei |
| rank | number | User’s rank |
Returns
string - Data URI of the SVG badge.