🇺🇲
Broearn Wallet Documentation
  • 🧬OVERVIEW
    • 💡What is Broearn Wallet?
    • 🛡️Security
    • 📋Available Networks
      • Parallel Universe Chain
      • Bitcoin
      • Ethereum
      • BNB Chain
      • Tron
      • Solana
      • OKX Chain
      • Optimism
      • Fantom
      • Ethereum Classic
      • Polygon
      • Avalanche
  • 🛸PUT
    • Extension & in Broearn app
      • Events
        • Disconnect
        • Accounts Changed
    • Detecting the Provider
  • Establishing a Connection
  • PROVIDER METHODS
    • Connect
    • Disconnect
    • SignMessage
    • SignTransaction
    • SignAllTransactions
    • SignAndSendTransaction
  • 🔹ETHEREUM & EVM
    • Getting Started with Ethereum and EVM
    • Detecting the Provider
    • Establishing a Connection
    • Sending a Transaction
    • Signing a Message
    • Provider API Reference
      • Properties
        • eth_chainId
        • eth_networkVersion
        • eth_selectedAddress
        • _events
        • _eventsCount
      • Events
        • Connect
        • Accounts Changed
        • Disconnect
        • Chain Changed
      • Methods
        • isConnected
        • request
  • Demo Applications
  • 📜ERRORS
  • ADVANCED
    • Auth
      • Web Javascript demo
      • Web Java
      • Web Golang
      • Web PHP
  • COMMUNITY AND SUPPORT
    • 🐦Twitter
    • ✈️Telegram
    • 🎮Discord
Powered by GitBook
On this page
  1. ETHEREUM & EVM

Sending a Transaction

Once a web application is connected to Broearn Wallet, it can prompt the user for permission to send transactions on their behalf.

To send a transaction, you will need to have a valid transaction object. It should look a little like this:

{
  from: "0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5",
  to: "0xb233696514F192Da7F0f0Fb1332f18c68cfB6c23",
  gasLimit: "21000",
  maxFeePerGas: "300",
  maxPriorityFeePerGas: "10",
  nonce: "0",
  value: "10000000000"
}

However, this transaction object needs to be signed using the sender's private key. This ensures that only the person that holds the private key can send transactions from the public address.

To prompt Broearn Wallet to send a transaction to the network, refer to the following code snippet

const result = await provider.request({
        method: 'eth_sendTransaction',
        params: [
          {
            from: accounts[0],
            to: '0xb233696514F192Da7F0f0Fb1332f18c68cfB6c23',
            value: '0x0',
            gasLimit: '0x5028',
            gasPrice: '0x2540be400',
            type: '0x0',
          },
        ],
});
PreviousEstablishing a ConnectionNextSigning a Message

Last updated 1 year ago

This is the building blocks of what you will need to send a transaction. However, if you were to copy/paste this, it would likely fail. There are several pieces of a transaction that are best provided in a dynamic manner. Take a look at our in our sandbox for reference.

🔹
sendTransaction function