question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The SDK should give better feedback when submitted offers are deleted by the network

See original GitHub issue

Some offers are deleted immediately after being sent to the network (usually when the amount is very small). The offer transactions succeed without errors, and the transactions are on the network, but the offers don’t appear on the orderbook, and it doesn’t appear when you query an account’s offers.

If you inspect the result_xdr from the response of StellarServer.submitTransaction, this monster of a path will be equal to manageOfferDeleted:

StellarSdk.xdr.TransactionResult.fromXDR(result.result_xdr, 'base64').result().value()[0].value().value().success().offer().switch().name

So the task is to find some way to either educate the users how to do find this out (👎) or to surface it in the sdk (👍 ).


Original issue:

Continuing a conversation from stellar/stellar-protocol#195 (and copying from stellar/js-stellar-base#148, I meant to open here initially), extremely small trades (e.g. 0.0000001 XLM) appear to submit successfully, but actually are never placed on the orderbook.

Per this comment it seems that it should be possible to determine when this has happened from the returned XDR, but that seems awfully close to the protocol for a web app to be dealing with.

I believe it would be more appropriate for SDK itself (or Horizon, alternatively) to return an error in this circumstance.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
bartekncommented, Mar 7, 2019

OK, reasons why not to reject submitTransaction in such cases are here: https://github.com/stellar/js-stellar-sdk/pull/243#discussion_r263143220. Let’s look how a discussion in https://github.com/stellar/stellar-protocol/issues/195#issuecomment-470298587 unfolds. Seems like failing the transaction at the protocol level is the best option.

As a sidenote, I think we really need to support XDR->JSON conversion in js-xdr. Checking tx_result using the current js-xdr API is not easy.

1reaction
morleyzhicommented, Mar 6, 2019

It seems that inevitably, clients will have to check transaction responses to be sure of failures, so I added documentation to that effect. I think that’s the best we can do right now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Latest News - Apple Developer
Learn about the latest technologies, events, and policies for developers.
Read more >
15 Best Mobile In-App Feedback Tools in 2023 - Qualaroo
In-app feedback tools are used to provide a shortcut to submit feedback to app users. Here are the 15 best mobile In-app feedback...
Read more >
Developer Program Policy: November 16, 2022 announcement
We're updating the following policies. All new and existing apps will receive a grace period of at least 30 days from November 16, ......
Read more >
LUIS frequently asked questions - Azure | Microsoft Learn
Yes, Speech to text is provided as an integration with LUIS. ... If an application hasn't been used in 90 days, it will...
Read more >
AWS SDK for JavaScript v3
The AWS SDK for JavaScript v3 is a rewrite of v2 with some great new features. ... Install from Source; Giving feedback and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found