ERC721
ERC721 resource provides operations for interacting with NFT (Non-Fungible Token) contracts.
Overview
ERC721 is the standard for NFTs on Ethereum. Each token has a unique ID and represents a distinct asset.
Operations
Get Balance
Get the number of NFTs owned by an address.
Required Credentials: Ethereum RPC
Parameters:
- Contract Address (required): The ERC721 NFT contract address
- Owner Address (required): Address to check balance for
Example:
{
"contractAddress": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
"ownerAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}
Output:
{
"balance": "5"
}
Owner Of
Get the owner of a specific token ID.
Required Credentials: Ethereum RPC
Parameters:
- Contract Address (required): The ERC721 NFT contract address
- Token ID (required): The token ID to query
Example:
{
"contractAddress": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
"tokenId": "1234"
}
Output:
{
"owner": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}
Transfer From
Transfer an NFT to another address.
Required Credentials: Ethereum RPC, Ethereum Account
Parameters:
- Contract Address (required): The ERC721 NFT contract address
- From (required): Current owner address
- To (required): Recipient address
- Token ID (required): The token ID to transfer
Example:
{
"contractAddress": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
"from": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"to": "0x1111111254fb6c44bAC0beD2854e76F90643097d",
"tokenId": "1234"
}
Output:
{
"hash": "0x1234567890abcdef...",
"from": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"to": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
}
Safe Transfer From
Safely transfer an NFT with receiver validation.
Required Credentials: Ethereum RPC, Ethereum Account
Parameters:
- Contract Address (required): The ERC721 NFT contract address
- From (required): Current owner address
- To (required): Recipient address
- Token ID (required): The token ID to transfer
Example:
{
"contractAddress": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
"from": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"to": "0x1111111254fb6c44bAC0beD2854e76F90643097d",
"tokenId": "1234"
}
Output:
{
"hash": "0x1234567890abcdef...",
"from": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"to": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
}
Approve
Approve another address to transfer a specific NFT.
Required Credentials: Ethereum RPC, Ethereum Account
Parameters:
- Contract Address (required): The ERC721 NFT contract address
- Spender (required): Address to approve
- Token ID (required): The token ID to approve
Example:
{
"contractAddress": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
"spender": "0x1111111254fb6c44bAC0beD2854e76F90643097d",
"tokenId": "1234"
}
Output:
{
"hash": "0x1234567890abcdef...",
"from": "0xYourAddress...",
"to": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
}
Set Approval For All
Approve an operator to manage all NFTs.
Required Credentials: Ethereum RPC, Ethereum Account
Parameters:
- Contract Address (required): The ERC721 NFT contract address
- Operator (required): Address to approve
- Approved (required): true to approve, false to revoke
Example:
{
"contractAddress": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
"operator": "0x1111111254fb6c44bAC0beD2854e76F90643097d",
"approved": true
}
Output:
{
"hash": "0x1234567890abcdef...",
"from": "0xYourAddress...",
"to": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
}
Get Approved
Get the approved address for a token.
Required Credentials: Ethereum RPC
Parameters:
- Contract Address (required): The ERC721 NFT contract address
- Token ID (required): The token ID to query
Example:
{
"contractAddress": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
"tokenId": "1234"
}
Output:
{
"approved": "0x1111111254fb6c44bAC0beD2854e76F90643097d"
}
Is Approved For All
Check if an operator is approved for all tokens.
Required Credentials: Ethereum RPC
Parameters:
- Contract Address (required): The ERC721 NFT contract address
- Owner (required): Owner address
- Operator (required): Operator address
Example:
{
"contractAddress": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
"owner": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"operator": "0x1111111254fb6c44bAC0beD2854e76F90643097d"
}
Output:
{
"isApprovedForAll": true
}
Token URI
Get the metadata URI for a token.
Required Credentials: Ethereum RPC
Parameters:
- Contract Address (required): The ERC721 NFT contract address
- Token ID (required): The token ID to query
Example Output:
{
"tokenURI": "ipfs://QmXxxx.../1"
}
Common Use Cases
Monitor NFT Ownership
[Ethereum Trigger: Event] → [Owner Of] → [Check Owner] → [Action]
Automated NFT Transfer
[Trigger] → [Safe Transfer From] → [Wait For Transaction] → [Notification]
Check NFT Metadata
[Trigger] → [Token URI] → [Fetch Metadata] → [Display]
Tips
- Safe Transfer: Prefer Safe Transfer From to prevent NFTs being sent to contracts that can't handle them
- Token IDs: Usually sequential but can be any uint256 value
- Metadata: Token URI typically points to JSON metadata (often on IPFS)
- Approval: Set Approval For All is commonly used for marketplace interactions