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

Coin Selection GraphQL API #121

Closed
Voxelot opened this issue Jan 6, 2022 · 1 comment · Fixed by #131
Closed

Coin Selection GraphQL API #121

Voxelot opened this issue Jan 6, 2022 · 1 comment · Fixed by #131
Assignees

Comments

@Voxelot
Copy link
Member

Voxelot commented Jan 6, 2022

The SDK should use a special API to select which utxos to use as inputs, instead of directly picking utxos from the full set. This is important for ensuring consistent behavior across SDK's and the ability to implement efficient dust mitigation strategies such as random-improve.

For inputs, the API will take:

owner: The Address of the utxo owner
spend_query: Vec<(AssetId, Amount)> The total amount of each asset type to spend
max_inputs: u8 The max number of utxos that can be used

Success:
Return a list of utxos <= max_inputs that will satisfy the amounts to be spent.

Errors:

  • If the spend amount is higher than the available balance of the owner.
  • If reaching the spend amount requires the list of utxos to be greater than max_inputs
@AlicanC AlicanC self-assigned this Jan 10, 2022
@Voxelot Voxelot linked a pull request Feb 9, 2022 that will close this issue
6 tasks
@Voxelot
Copy link
Member Author

Voxelot commented Feb 9, 2022

@digorithm this is done, and will be available in the next release. Integration testing could start using the published docker image from master branch.

@Voxelot Voxelot closed this as completed Feb 9, 2022
ControlCplusControlV pushed a commit that referenced this issue Jan 15, 2023
* Clean up comments and code

* Additional comment format

* Minor comment formatting

* Update comment text

* Simplify test storage maps

* Simplify sparse test storage maps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants