📌approve
Description
The approve
function allows the owner of an ERC721 token to grant approval to another address or contract to transfer the token on their behalf.
Parameters
Parameter | Type | Description |
---|---|---|
| string | The blockchain network to use, e.g., Ethereum, Binance Smart Chain |
| string | The address of the ERC721 contract containing the token |
| string | The ID of the token to approve for transfer |
| string | The address of the account or contract to grant transfer approval |
| string | The private key of the token owner's account |
Response
Field | Type | Description |
---|---|---|
| number | 1 for success, 0 for failure |
| object | The transaction receipt of the approve transaction |
Example Request and Response
Prerequisites
Before making requests with NEST® SDK, you must have it installed.
You can install NEST® SDK using either npm
or yarn
. Use the following commands to install NEST® SDK:
Request
Here is an example of how to make a approve
request using the NEST® SDK:
Response
Use Cases
Crypto wallets: They can use this function to grant approval to other addresses or contracts to transfer their ERC721 tokens on their behalf.
DApp developers: Developers can use this function to enable users to grant approval to their smart contracts to transfer their ERC721 tokens.
Last updated