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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract BitcoinEsploraApiProvider #210

Merged
merged 1 commit into from
Sep 18, 2019

Conversation

matthewjablack
Copy link
Contributor

@matthewjablack matthewjablack commented Sep 12, 2019

Description

This PR abstract elements of BitcoinEsploraApiProvider, so that it can be better used alongside BitcoinRpcProvider

One example of this is getUnspentTransactions

Here is a typical response from BitcoinRpcProvider

[ { txid: '36ae54d1aec4027f6d37b1f78ea4d1eed56d3a6894b29e9ecd52ba5337e58986',
    vout: 0,
    address: 'bcrt1qn6qvwfuypdglmsz0zvssperewad7j9e3f3mn86zvysl9e3ddjrts3mgctu',
    label: '',
    scriptPubKey: '00209e80c727840b51fdc04f132100e479775be917314c7733e84c243e5cc5ad90d7',
    amount: 0.00196033,
    confirmations: 3,
    spendable: false,
    solvable: false,
    safe: true,
    satoshis: 196033 } ]

New EsploraApiProvider response

{ txid: '8ac344f5d0b464b19cbbe91b2fb588b52e949d06e41fed3eef46d393c22f9e3b',
    vout: 0,
    status:
     { confirmed: true,
       block_height: 1577116,
       block_hash: '000000000000004c211ce88c7006bc676d8cb515abf075f8cbd64237a327d318',
       block_time: 1567802898 },
    value: 5152772,
    address: 'mtkU1Fdn1FKYSHDXbm4NJji13UbVUmhz8d',
    satoshis: 5152772,
    amount: 0.05152772,
    confirmations: 1101 } ]

Example

Submission Checklist 馃摑

  • Add confirmations to BitcoinEsploraApiProvider for getUnspentTransactions

@monokh monokh self-requested a review September 13, 2019 08:28
Copy link
Collaborator

@monokh monokh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one

@matthewjablack matthewjablack merged commit c6fa79c into dev Sep 18, 2019
@matthewjablack matthewjablack deleted the abstract-esplora-api-provider branch September 18, 2019 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants