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
  • InvokeArguments
  • Argument
  • TxHashAttribute
  • AssetIntentOverrides
  • AssetInput
  • AssetOutput
  • Success Response
  • Error Response
  • Example
  • Request
  • Response

这有帮助吗?

  1. Reference
  2. Neo2 provider API
  3. Write Methods

invokeMulti

Invoke Multi functions the same as Invoke, but accepts inputs to execute multiple invokes in the same transaction.

Input Arguments

Parameter
Description

fee?: string

If a fee is specified then the wallet SHOULD NOT override it, if a fee is not specified the wallet SHOULD allow the user to attach an optional fee

network: string

Network alias to submit this request to.

Used to specify the exact UTXO's to use for attached assets. If this is provided fee and attachedAssets will be ignored

Array of contract invoke inputs

broadcastOverride?: boolean

If this flag is set to True, the wallet provider will return the signed transaction rather than broadcasting to a node.

Optional list of tx attribute hash values to be added

InvokeArguments

Parameter
Description

scriptHash: string

The script hash of the contract that you wish to invoke

operation: string

The operation on the smart contract that you wish to call. This can be fetched from the contract ABI

A list of arguments necessary to perform on the operation you wish to call

attachedAssets?: AttachedAssets[]

Describes the assets to attach with the smart contract, e.g. attaching assets to mint tokens during a token sale

triggerContractVerification: bolean?

Adds the instruction to invoke the contract verifican trigger

Argument

Parameter
Description

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

The type of the argument with you are using

value: any

String representation of the argument which you are using

TxHashAttribute

Parameter
Description

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

The type of the argument with you are using

value: any

String representation of the argument which you are using

txAttrUsage: 'Hash1' | 'Hash2' | 'Hash3' | 'Hash4' | 'Hash5' | 'Hash6' | 'Hash7' | 'Hash8' | 'Hash9' | 'Hash10' | 'Hash11' | 'Hash12' | 'Hash13' | 'Hash14' | 'Hash15'

Attribute usage value

AssetIntentOverrides

Parameter
Description

A list of UTXO inputs to use for this transaction

A list of UTXO outputs to use for this transaction

AssetInput

Parameter
Description

txid: string

Transaction id to be used as input

index: number

Index of the UTXO, can be found from transaction details

AssetOutput

Parameter
Description

asset: string

Asset of the UTXO

address: string

Address to receive the UTXO

value: string

String representation of double or integer value to be used as output

Success Response

In the case where the "broadcastOverride" input argument is not set, or set to false.

Parameter
Description

txid: string

The transaction ID of the invocation

nodeURL: string

The node which the transaction was broadcast to. Returned if transaction is broadcast by wallet provider

In the case where the "broadcastOverride" input argument is set to True.

Parameter
Description

txid: string

The transaction ID of the invocation

signedTx: string

The serialized signed transaction. Only returned if the broadcastOverride input argument was set to True

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

neoline.invokeMulti({
    invokeArgs: [
        {
            scriptHash: "808f0823a811cdb7d80af3509e900cc2f594ceb1",
            operation: "transfer",
            args: [
            {
                    "type": "Address",
                    "value": "AWSEU4BXpjGVdw9ajnFBXh8Rg8cgw9f3Zo"
                },
                {
                    "type": "Address",
                    "value": "AY69kajrRx1Qk29AeLxvkXHYf2h3pQw9yK"
                },
                {
                    "type": "Integer",
                    "value": "100000000"
                }

            ],
            attachedAssets: {
                NEO: '1',
                GAS: '0.0001'
            },
        },
        {
            scriptHash: "808f0823a811cdb7d80af3509e900cc2f594ceb1",
            operation: "transfer",
            args: [
            {
                    "type": "Address",
                    "value": "AWSEU4BXpjGVdw9ajnFBXh8Rg8cgw9f3Zo"
                },
                {
                    "type": "Address",
                    "value": "AY69kajrRx1Qk29AeLxvkXHYf2h3pQw9yK"
                },
                {
                    "type": "Integer",
                    "value": "300000000"
                }
            ],
            attachedAssets: {
                NEO: '2',
                GAS: '0.01'
            },
        }
    ],
    fee: '0.01',
    network: 'TestNet',
    broadcastOverride: false,
    txHashAttributes: [
        {
            type: 'Boolean',
            value: true,
            txAttrUsage: 'Hash1'
        }
    ]
})
.then(({txid, nodeURL}: InvokeOutput) => {
  console.log('Invoke transaction success!');
  console.log('Transaction ID: ' + txid);
  console.log('RPC node URL: ' + nodeURL);
})
.catch((error) => {
  const {type, description, data} = error;
  switch(type) {
    case NO_PROVIDER:
        console.log('No provider available.');
        break;
    case RPC_ERROR:
        console.log('There was an error when broadcasting this transaction to the network.');
        break;
    case CANCELED:
        console.log('The user has canceled this transaction.');
        break;
    default:
        // Not an expected error object.  Just write the error to the console.
        console.error(error);
        break;
  }
});

Response

{
    txid: "8979389ac095c37c43fa6922ae3f1180e33082394b43108b82cb0ca37d900541",
    nodeURL: "https://testnet.api.neoline.io"
};
上一页invoke下一页signMessage

最后更新于7个月前

这有帮助吗?

assetIntentOverrides?: AssetIntentOverrides

invokeArgs?: InvokeArguments[]

txHashAttributes?: TxHashAttribute[]

args: Argument[]

inputs: AssetInput[]

outputs: AssetOutput[]