Page MenuHomePhabricator

[ecash-wallet] Add fluent API for building and broadcasting txs
DraftPublic

Authored by bytesofman on Wed, Mar 19, 04:27.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

We want a powerful and user-friendly API that exposes commonly used steps in tx processing. For example, getting utxos to send a tx (/checking if we have the utxos we need to send a tx), getting a tx fee, and checking a tx size are all things that are commonly done without broadcasting a tx. We keep methods that do not need to be async as, well, not async. Only `broadcast() is (of necessity) async.

Note we will need to have a websocket that keeps the utxo set in sync, as a dev it is annoying to always have to remember to call await wallet.sync() before sending a tx. However, I think we need to get the tx API worked out first so we know what exactly the websocket should do and manage.

Test Plan

npm test, build node in build and then BUILD_DIR="${PWD}/../../build" npm run integration-tests

Diff Detail

Repository
rABC Bitcoin ABC
Branch
wallet-txs-regtest
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32768
Build 65024: Build Diffecash-wallet-tests
Build 65023: arc lint + arc unit