SatoshiPortal / cyphernode

Modular Bitcoin full-node microservices API server architecture and utilities toolkit to build scalable, secure and featureful apps and services without trusted third parties
MIT License
363 stars 68 forks source link

Feature/get ununsedaddress and txns by label #150

Closed gabidi closed 4 years ago

gabidi commented 4 years ago

This PR aim to add to new endpoints to cyphernode

  1. GET /get_txns_by_watchlabel/<label> Given a pub32 watch <label>, this will return the Txns that have been observed (recorded in Cyphernode's DB) for addresses belonging to the pub32 pointed by the label, payload interface:
    interface WatchPub32Txn {
    label: string;
    address: Address;
    txid: TxnId;
    confirmations: number;
    blockheight: number;
    v_out: number;
    amount: number;
    }
  2. GET get_unused_addresses_by_watchlabel/<label>/ Given a pub32 watch <label>, this will return unused addresses, IE Pub32 derived addresses that have no observed transactions in Cyphernode's DB for the Pub32 pointed to by the supplied label.
    interface WatchPub32UnusedAddress {
    pub32_watch_id: string;
    pub32_label: string;
    pub32: string;
    address_pub32_index: number;
    address: Address;
    }

    Bonus:

  3. GET gettxnslist/<count>/<skip> Adds support for RPC call listtransactions for spender wallets https://bitcoin-rpc.github.io/en/doc/0.17.99/rpc/wallet/listtransactions/

--

Functionality has already been integrated into SDK and tests pass v0.0.8

TODO

  1. ~Test regnet~ [Pass]
  2. ~Test Testnet~ [Pass]
Kexkey commented 4 years ago

Should we call it getspendingtxlist instead, to make it clear the returned result doesn't include watched transactions that are not related to the spending wallet?

Kexkey commented 4 years ago

@gabidi I'd like gettxnslist to be more clear it returns only transactions related to the spending wallet... (not the xpubs, the watching, wasabi, etc.) Do you have a suggestion? Something like getspendingtxlist could make it ... @schulterklopfer what do you think?

schulterklopfer commented 4 years ago

@gabidi I'd like gettxnslist to be more clear it returns only transactions related to the spending wallet... (not the xpubs, the watching, wasabi, etc.) Do you have a suggestion? Something like getspendingtxlist could make it ... @schulterklopfer what do you think?

Sure we can rename it to getspendingtxlist. We should collect the requirements now with a somewhat clean API and redesign it properly in v1. But if you rename it, be sure to not remove the old endpoint and just mark it as obsolete or sth, in case someone (Bullbitcoin) is using it ;-)