Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@emurgo/dullahan

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emurgo/dullahan

  • 0.2.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Coin selection algorithm

Algorithm overview

The arhitecture of coin selection is designed to allow adjust coin selection based on the coins selected before (for example: the coin selector gives us a selection of UTxO, then we can adjust the fee based on the selected UTxO and trigger coin selection again).

  • We start coin selection with the biggest UTxO, then, if the change would produce a smaller UTxO than the smallest existing UTxO, we add the smalles UTxO to the selection.
  • To optimize multiasset selection, we try to remove UTxOs from selection until no removal is possible.

Note that the algorithm ensures the smallest UTxO after transaction will be bigger (or at least equal) than the smallest UTxO before.

Implementation:

https://github.com/Emurgo/dullahan/blob/dev/packages/blockchain/variants/ImproveSelection.ts

Test:

https://github.com/Emurgo/dullahan/blob/dev/packages/blockchain/variants/ImproveSelection.test.ts

FAQs

Package last updated on 21 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc