Jump to content

Error when attempting to get the order book between two currencies


Recommended Posts

I am attempting to use the xrpl.js library to get the order book between two currencies. Using the xrpl websocket transaction example (no tx example in the xrpl.js library reference)

https://xrpl.org/book_offers.html

XRPL.js book_offers reference.

https://js.xrpl.org/interfaces/BookOffersRequest.html

When running the following code I get the error response

"Uncaught (in promise) RippledError: Missing field 'account'."

But according to both references "account" is not a required property.

 

  (async () => {
        
        await client.connect() ;
        
        let tx  = {
            "id": 4,
            "command": "book_offers",
            "taker": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
            "taker_gets": {
              "currency": "XRP"
            },
            "taker_pays": {
              "currency": "USD",
              "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
            },
            "limit": 10
          }


        // Autofill the tx to see how flags actually look compared to the interface usage.
        let autofilledTx = await client.autofill(tx);
        let result = await client.submitAndWait(autofilledTx).catch(e => console.log(e)) ;

        console.log(result);
        client.disconnect();

  })();

       

 

Edited by drFushFlan
Link to comment
Share on other sites

  • drFushFlan changed the title to Error when attempting to get the order book between two currencies
  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.