Read contract

Endpoint that allows you to read contract functions

Read a contract

POST https://api-wallet.venly.io/api/contracts/read

Request Body

NameTypeDescription

inputs.type

string

Type of the input parameter (ex. uint256)

inputs.value

string

Value of the input parameter. This needs to be passed as a string value

inputs

array

Array of inputs needed to call the function

functionName

string

Contract function to call

secretType*

string

On which blockchain the tx will be executed

walletAddress

string

Wallet address, available if required

outputs*

String

Array of expected outputs

outputs.type*

String

Type of output

{
    "success": true,
    "result": [
        {
            "type": "uint256",
            "value": 1
        }
    ]
}

This function is only available for EVM-based chains: Ethereum , Polygon , Avalanche and Binance Smart Chain

Examples

Get Balance of

This example will get the balance of a certain NFT for a specific wallet

POST: https://api-wallet.venly.io/api/contracts/read

Request Body

{
    "secretType": "MATIC",
    "walletAddress": "0x0000000000000000000000000000000000000000",
    "contractAddress": "0xE80F3baA739c18fd4eBf97716529a4b85BE464Dd",
    "functionName": "balanceOf",
    "inputs": [
        {
            "type": "address",
            "value": "0x427d0addaa77d8bb871dbea3458dea4b5198730c"
        },
        {
            "type": "uint256",
            "value": "202"
        }
    ],
    "outputs": [
        {
            "type": "uint256"
        }
    ]
}

Response

{
    "success": true,
    "result": [
        {
            "type": "uint256",
            "value": 1
        }
    ]
}

Get Mint Number

This example will get the mint number for a specific NFT.

POST : https://api.arkane.network/api/contracts/read

Request Body

{
    "secretType": "MATIC",
    "walletAddress": "0x0000000000000000000000000000000000000000",
    "contractAddress": "0xf86013ac3a23d26efb3337b4d63de6e6ec2a9861",
    "functionName": "mintNumber",
    "inputs": [
        {
            "type": "uint256",
            "value": "51"
        }
    ],
    "outputs": [
        {
            "type": "uint256"
        }
    ]
}

Response

{
    "success": true,
    "result": [
        {
            "type": "uint256",
            "value": 2
        }
    ]
}

Get Contract URI

This example will fetch the contract URI, which contains the metadata, for a specific contract.

POST : https://api.arkane.network/api/contracts/read

Request Body

{
    "secretType": "MATIC",
    "walletAddress": "0x0000000000000000000000000000000000000000",
    "contractAddress": "0x8c53de6a889cf0a3151168c3e84263c982d09a2f",
    "functionName": "contractURI",
    "outputs": [
        {
            "type": "string"
        }
    ]
}

Response

{
    "success": true,
    "result": [
        {
            "type": "string",
            "value": "https://metadata.arkane.network/api/apps/0ed3a778-4f11-4cdf-b3cc-45f3225a9065/contracts/76/metadata"
        }
    ]
}

Last updated