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

215
Views
Unable to send Ripple (Cryptocurrency Coin - XRP) to Wallet

I am trying to use the below code to send ripple (Cryptocurrency Coin)- XRP to another address, but i am getting the below error :

"Uncaught (in promise) Error: Faucet URL is not defined or inferrable."

Included the below JS reference in HTML file,

script src="https://unpkg.com/xrpl@2.0.0/build/xrpl-latest-min.js" script type="application/javascript" src="send-xrp.js"

What am i missing???

send-xrp.js ===========

    // Dependencies for Node.js.
    // In browsers, use a <script> tag instead.
    if (typeof module !== "undefined") {
      // Use var here because const/let are block-scoped to the if statement.
      var xrpl = require('xrpl')
    }
    
    // Example credentials
    const wallet = xrpl.Wallet.fromSeed("I ENTERED MY SECRET KEY HERE")
    console.log(wallet.address) 
    
    // Connect -------------------------------------------------------------------
    async function main() {
      console.log("Connecting to Testnet... I CHANGED BELOW TO PRODUCTION NETWORK")
      const client = new xrpl.Client('wss://xrplcluster.com')
      await client.connect()
    
      // Get credentials from the Testnet Faucet -----------------------------------
      console.log("Getting a wallet from the Testnet faucet...")
      const {wallet, balance} = await client.fundWallet()
    
      // Prepare transaction -------------------------------------------------------
      const prepared = await client.autofill({
        "TransactionType": "Payment",
        "Account": wallet.address,
        "Amount": xrpl.xrpToDrops("35"),
        "Destination": "ENTERED MY DESTINATION KEY HERE"
      })
      const max_ledger = prepared.LastLedgerSequence
      console.log("Prepared transaction instructions:", prepared)
      console.log("Transaction cost:", xrpl.dropsToXrp(prepared.Fee), "XRP")
      console.log("Transaction expires after ledger:", max_ledger)
    
      // Sign prepared instructions ------------------------------------------------
      const signed = wallet.sign(prepared)
      console.log("Identifying hash:", signed.hash)
      console.log("Signed blob:", signed.tx_blob)
    
      // Submit signed blob --------------------------------------------------------
      const tx = await client.submitAndWait(signed.tx_blob)
    
      // Wait for validation -------------------------------------------------------
      // submitAndWait() handles this automatically, but it can take 4-7s.
    
      // Check transaction results -------------------------------------------------
      console.log("Transaction result:", tx.result.meta.TransactionResult)
      console.log("Balance changes:", JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2))
    
      // End of main()
      client.disconnect()
    }
    
    main()
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The "Secret Key" or privateKey is for signing which is a different animal than the seed. Also, it appears you are connecting to the Mainnet not the Testnet try:

const wallet = xrpl.Wallet.fromSeed(seed)
const client = new xrpl.Client(`wss://s.altnet.rippletest.net:51233`)
about 4 years ago · Juan Pablo Isaza Report
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!