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

267
Views
How to change currency by making web payment with Metamask?

i am trying to integrate Metamask for payments in my websites. I have done it so far, unfortunately, I don't know how to change the cryptocurrency to be USDT on Binance chain. In the code I have defined the chainId for Binance chain, but don't know how to create the contractData.

I will appreciate any help!

payNow: async (ethereum, from) => {
    var amount = $('#inp_amount').val();
    try {
        await ethereum.request({
            method: 'wallet_switchEthereumChain',
            params: [{ chainId: '0x38' }],
        });
        
        // contractData = 'USDT + AMOUNT';
        
        ethereum
        .request({
            method: 'eth_sendTransaction',
            params: [{
                from: from,
                to: "{{ $user->eth_address }}",
                gas: '0x76c0', // 30400
                gasPrice: '0x9184e72a000', // 10000000000000
                data: contractData,
                chainId: '0x38',

            }],
        })
        .then((txHash) => {
            if (txHash) {
                console.log(txHash);
                storeTransaction();
            } else {
                console.log("Something went wrong. Please try again");
            }
        })
        .catch((error) => {
            // for testing
            // storeTransaction();
            console.log(error);
        });
    }
    catch (switchError) {
        console.log(error);
    }
},
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!