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 提供支持
在本页
  • Params
  • Example
  • Request
  • Result

这有帮助吗?

  1. Reference
  2. JSON-RPC API

eth_sendTransaction

Creates a new wallet confirmation to make an Ethereum transaction from the user's account. This method requires that the user has granted permission to interact with their account first, so make sure to call eth_requestAccounts first.

Params

1. Transaction

The transaction object to sign and send.

The parameters to customize a transaction. If a to address is not provided, it will be assumed that the transaction is a contract creation transaction, and the data field of the transaction will be used as the contract initialization code. gasPrice cannot be used together with maxPriorityFeePerGas and maxFeePerGas.

interface TransactionParameters {
  from: string; // Match pattern: ^0x[0-9a-fA-F]{40}$
  to?: string; // Match pattern: ^0x[0-9a-fA-F]{40}$
  gas?: string; // Match pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
  value?: string; // // Match pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
  data?: string; // Match pattern: ^0x[0-9a-f]*$
  // The gas price the sender is willing to pay to miners in wei. Used in pre-1559 transactions.
  gasPrice?: string; // Match pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
  // Maximum fee per gas the sender is willing to pay to miners in wei. Used in 1559 transactions.
  maxPriorityFeePerGas?: string; // Match pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
  // The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei. Used in 1559 transactions.
  maxFeePerGas?: string; // Match pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
}

Example

Request

await window.NEOLineNeoX.request({
  method: 'eth_sendTransaction',
  params: [
    {
      from: '0xE45e9AdC2B51514849ea5B38dF37d1a65e6D52f5',
      to: '0x7Cd07BCbcCF30d71E768F5228b56d5B7Cc07f674',
      value: '0x3b9aca00', // 1_000_000_000
    },
  ],
});

Result

"0x204563226de98e20e4e98ec40c334dd1a2d6f03388ed7a5d9a7523518c3b277b"
上一页eth_signTypedData_v4下一页wallet_addEthereumChain

最后更新于9个月前

这有帮助吗?