Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for strict-send and strict-receive paths end-point. #444

Merged
merged 1 commit into from
Oct 15, 2019

Conversation

abuiles
Copy link
Contributor

@abuiles abuiles commented Oct 14, 2019

This PR adds support for /paths/strict-send and /paths/strict-receive and deprecates server.paths

Add ➕

server.strictSendPaths

This request allows you to answer questions like "Get me the most EUR possible for my 10 USD".

This functions takes the asset you want to send, the amount and a list of assets or alternatively the destination address.

You can call it passing a list of assets as destination:

server.strictSendPaths(sourceAsset, sourceAmount, [destinationAsset]).call()

Or an Stellar account address:

server.strictSendPaths(sourceAsset, sourceAmount, "GDRREYWHQWJDICNH4SAH4TT2JRBYRPTDYIMLK4UWBDT3X3ZVVYT6I4UQ").call()

server.strictReceivePaths

This request allows you to answer questions like "How much EUR do it to send 10 USD?".

You can call it passing a list of source assets:

server.strictReceivePaths(sourceAssets,destinationAccount,destinationAsset, destinationAmount)

Or a by passing a Stellar source account address:

server.strictReceivePaths(sourceAccount,destinationAccount,destinationAsset, destinationAmount)

When you call this function with a Stellar account address, it will look at the account’s trustlines and use them to determine all payment paths that can satisfy the desired amount.

Deprecated ⚠️

Copy link
Contributor

@morleyzhi morleyzhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@abuiles abuiles marked this pull request as ready for review October 14, 2019 20:09
Copy link
Contributor

@rice2000 rice2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just left a few small copy editing suggestions.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
src/server.ts Outdated Show resolved Hide resolved
src/strict_send_path_call_builder.ts Outdated Show resolved Hide resolved
@abuiles abuiles requested a review from rice2000 October 15, 2019 15:53
Copy link
Contributor

@rice2000 rice2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Add support for `/paths/strict-send`, `/paths/strict-receive` and deprecates `server.paths`
@abuiles abuiles changed the title Add server.strictSendPath. Add Server#strictSendPaths and Server#strictReceivePaths Oct 15, 2019
@abuiles abuiles changed the title Add Server#strictSendPaths and Server#strictReceivePaths Add support for strict-send and strict-receive paths end-point. Oct 15, 2019
@abuiles abuiles merged commit 94fa7c6 into master Oct 15, 2019
@abuiles abuiles deleted the strict-send-paths branch October 15, 2019 16:45
@abuiles abuiles mentioned this pull request Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants