🔗availableContracts

Description

The availableContracts function is an asynchronous function that retrieves a list of available contracts for a specific blockchain.

Parameters

Response

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:

npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib

Request

Here is an example of how to make a availableContracts request using the Nest SDK:

const { BlockchainInfo } = require('@nest25/evm-chains-lib');

const info = new BlockchainInfo();

async function main() {
    const response = await info.availableContracts('klay')
    console.log(response)
}

main();

Response

{
        code: 1,
        types: [
          { contract: 'ERC20', parameters: [Object] },
          { contract: 'ERC721', parameters: [Object] },
          { contract: 'ERC1155', parameters: [Object] },
          { contract: 'Soulbound', parameters: [Object] }
        ]
      }

Use Cases

  • The listAvailableContracts function can be used to fetch a list of available contracts for a specific blockchain supported by the blockchain gateway. It can be helpful when providing a selection of contract types for users to choose from or when validating the contract type input in other functions.

Last updated