Page MenuHomePhabricator

[Cashtab] Add method for getting agora partial fuel input
ClosedPublic

Authored by bytesofman on Oct 18 2024, 11:02.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABCa9bb41fd8141: [Cashtab] Add method for getting agora partial fuel input
Summary

Depends on D16926

ecash-agora supports constructing Accept and Cancel txs with a method of the AgoraOffer object that is returned by the chronik indexer. User of the lib may calculate the fee of an accept or cancel tx using a dummy input, then build the tx by passing a "fuel input" that covers this fee.

Add a function that finds a single fuel input that will cover the fee. This is the lowest-fee way to accept or cancel an agora tx.

It is possible (but unlikely) that a user has enough XEC to accept or cancel a partial agora offer but must use more than one utxo. For now we do not support this, as it is more complicated to support (need to re-estimate fee with an additional input) and is an edge case that exists for users with small utxos and low amounts of XEC. The solution we want to encourage is buying more XEC.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable