NeoLine
English
English
  • Welcome to NeoLine
  • 🌵Download NeoLine Wallet
    • Mobile
      • Download iOS Version
      • Download Android Version
    • Google Chrome Extension
      • Download Google Chrome Extension
  • 🧩Create and Manage Neo X Wallet
    • Create Neo X (EVM) Wallet
    • Import Neo X (EVM) wallet
    • How to Bridge GAS Using the NeoLine Chrome Extension?
    • How to add and switch networks?
    • About NeoLine Activity
  • 🙂N3 Wallet
    • Neo N3 Wallet User Guide
      • Neo N3 Wallet | Mobile
      • Neo N3 Wallet | NeoLine Chrome Extension
    • Neo N3 Migration Guide
      • Neo N3 Migration Guide | Mobile
      • Neo N3 Migration Guide | NeoLine Chrome Extension
  • 🔒Hardware Wallet
    • Ledger Hardware Wallet
  • 🌈Getting Started
    • How to Securely and Correctly Backup Your Wallet?
    • One Pass Setting for NeoLine Extension Wallet
    • How to Use the Address Book?
    • How to Speed Up or Cancel a Pending Transaction?
    • How to Delete Unused Wallet Accounts in the NeoLine Wallet?
    • Manage Assets
      • How to Add/Manage Assets?
      • How to Add NFTs
      • How to Use NeoLine Wallet for Transfer and Receive
      • How to Transfer to Other Wallets/Exchanges
    • FAQ
  • Reference
    • Neo3 provider API
      • Read Methods
        • getProvider
        • getBalance
        • getStorage
        • invokeRead
        • invokeReadMulti
        • verifyMessage
        • verifyMessageV2
        • getBlock
        • getTransaction
        • getApplicationLog
        • pickAddress
        • AddressToScriptHash
        • ScriptHashToAddress
      • Write Methods
        • send
        • invoke
        • invokeMultiple
        • signMessage
        • signMessageV2
        • signMessageWithoutSalt
        • signMessageWithoutSaltV2
        • signTransaction
        • switchWalletNetwork
        • switchWalletAccount
      • Common Methods
        • getNetworks
        • getAccount
        • getPublicKey
      • Common Events
        • READY
        • ACCOUNT_CHANGED
        • CONNECTED
        • DISCONNECTED
        • NETWORK_CHANGED
        • BLOCK_HEIGHT_CHANGED
        • TRANSACTION_CONFIRMED
      • Event Methods
        • addEventListener
        • removeEventListener
      • Errors
        • Errors
    • Neo2 provider API
      • Read Methods
        • getProvider
        • getNetworks
        • getAccount
        • getPublicKey
        • getBalance
        • getStorage
        • invokeRead
        • verifyMessage
        • getBlock
        • getTransaction
        • getApplicationLog
      • Write Methods
        • send
        • invoke
        • invokeMulti
        • signMessage
        • deploy
        • switchWalletNetwork
        • switchWalletAccount
      • Events
        • READY
        • ACCOUNT_CHANGED
        • CONNECTED
        • DISCONNECTED
        • NETWORK_CHANGED
        • BLOCK_HEIGHT_CHANGED
        • TRANSACTION_CONFIRMED
      • Event Methods
        • addEventListener
        • removeEventListener
      • Errors
        • Errors
    • Ethereum provider API
    • JSON-RPC API
      • eth_requestAccounts
      • eth_accounts
      • eth_chainId
      • personal_sign
      • eth_signTypedData_v4
      • eth_sendTransaction
      • wallet_addEthereumChain
      • wallet_switchEthereumChain
      • wallet_watchAsset
  • 💬Contact Us
    • Contact Us
由 GitBook 提供支持
在本页
  • Input Arguments
  • Success Response
  • Argument
  • Error Response
  • Example
  • Request
  • Response

这有帮助吗?

  1. Reference
  2. Neo3 provider API
  3. Read Methods

invokeReadMulti

Execute a contract invocation in read-only mode.

Input Arguments

Parameter
Description

scriptHash: string

Script hash of the smart contract to invoke a read on

operation: string

Operation on the smart contract to call

Any input arguments for the operation

Success Response

The wallet will return the direct response from the RPC node.

Parameter
Description

script: string

The script which was run

state: string

Status of the executeion

gas_consumed: string

Estimated amount of GAS to be used to execute the invocation. (Up to 10 free per transaction)

An array of response arguments

Argument

Parameter
Description

type: 'String' | 'Boolean' | 'Hash160' | 'Hash256' | 'Integer' | 'ByteArray' | 'Array' | 'Address'

The type of the argument with you are using

value: string

String representation of the argument which you are using

Error Response

Parameter
Description

type: string

The type of error which has occured

description: string

A description of the error which has occured

data: string

Any raw data associated with the error

Example

Request

neolineN3.invokeReadMulti({
    invokeReadArgs: [
        {
            scriptHash: "d2a4cff31913016155e38e474a2c06d08be276cf",
            operation: "balanceOf",
            args: [
                {
                    type: "Address",
                    value: "NaUjKgf5vMuFt7Ffgfffcpc41uH3adx1jq",
                }
            ]
        },
        {
            scriptHash: "d2a4cff31913016155e38e474a2c06d08be276cf",
            operation: "balanceOf",
            args: [
                {
                    type: "Address",
                    value: "NaUjKgf5vMuFt7Ffgfffcpc41uH3adx1jq",
                }
            ]
        }
    ],
    signers: [
        {
            account: "2cab903ff032ac693f8514581665be534beac39f",
            scopes: 1
        }
    ]
}).then(result => {
    console.log('Read invocation result: ' + JSON.stringify(result));
})
.catch((error) => {
  const {type, description, data} = error;
  switch(type) {
    case 'NO_PROVIDER':
        console.log('No provider available.');
        break;
    case 'CONNECTION_REFUSED':
        console.log('Connection dApp not connected. Please call the "connect" function.');
        break;
    case 'RPC_ERROR':
        console.log('There was an error when broadcasting this transaction to the network.');
        break;
    default:
        // Not an expected error object.  Just write the error to the console.
        console.error(error);
        break;
  }
});

Response

[
    {
        "script": "DBRHsV1d1v6Pnc51X7CYvP4eBbMIAxHAHwwJYmFsYW5jZU9mDBTPduKL0AYsSkeO41VhARMZ88+k0kFifVtS",
        "state": "HALT",
        "stack": [
            {
                "type": "Integer",
                "value": "5293314113"
            }
        ]
    },
    {
        "script": "DBRHsV1d1v6Pnc51X7CYvP4eBbMIAxHAHwwJYmFsYW5jZU9mDBTPduKL0AYsSkeO41VhARMZ88+k0kFifVtS",
        "state": "HALT",
        "stack": [
            {
                "type": "Integer",
                "value": "5293314113"
            }
        ]
    }
]
上一页invokeRead下一页verifyMessage

最后更新于6个月前

这有帮助吗?

invokeReadArgs: Argument[]

stack: Argument[]