Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
Metamask javascript send money in a specific crypto token

im trying to make a payment button for metamask but i dont know how to choose a specift crypto do send the value.

here is my code:

const ethereumButton = document.querySelector('.enableEthereumButton');
    const sendEthButton = document.querySelector('.sendEthButton');

    let accounts = [];

    //Sending Ethereum to an address
    sendEthButton.addEventListener('click', () => {
      ethereum
        .request({
          method: 'eth_sendTransaction',
          params: [
            {
              from: accounts[0],
              to: 'MYWALLETHERE',
              value: '0x38d7ea4c68000'
            },
          ],
        })
        .then((txHash) => console.log(txHash))
        .catch((error) => console.error);
    });

    ethereumButton.addEventListener('click', () => {
      getAccount();
    });

    async function getAccount() {
      accounts = await ethereum.request({ method: 'eth_requestAccounts' });   
      
    }
    getAccount();   
 <button class="enableEthereumButton btn">Enable Metamask</button>
        <button class="sendEthButton btn">Fazer pagamento</button>

how can i force a crypto like BNB here in Binance smart chain?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!