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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch BTC transaction from txId #189

Conversation

abdulhaseeb4239
Copy link
Contributor

🔘 PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Enhancement
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

📜 Background

We need functions to fetch individual BTC and Ordinal transaction from txId. We fetch the transaction from transaction status screens to show the transaction detail after the tx is broadcasted successfully.

Issue Link: https://linear.app/xverseapp/issue/ENG-2480/add-fetch-btc-and-ordinal-transaction-functions
Context Link (if applicable): https://linear.app/xverseapp/issue/ENG-2427/update-transaction-status-screens

🔄 Changes

added two functions in api/btc.ts. to fetch BTC and Ordinal transaction from txId.

  • Yes, Incompatible API changes
  • No, Adds functionality (backwards compatible)
  • No, Bug fixes (backwards compatible)

Changes:

  • added functions in api/btc.ts
  • no breaking change

Impact:

  • adds functionality to fetch individual BTC and Ordinal transactions
  • https://github.com/secretkeylabs/xverse/pull/1125 This PR from the mobile app repo depends on this change
  • To test this from the mobile app, we need to broadcast simple BTC and Ordinal transaction and see the transaction from Transaction Status scren after the broadcast is successful

✅ Review checklist

Please ensure the following are true before merging:

  • Code Style is consistent with the project guidelines.
  • Code is readable and well-commented.
  • No unnecessary or debugging code has been added.
  • Security considerations have been taken into account.
  • The change has been manually tested and works as expected.
  • Breaking changes and their impacts have been considered and documented.
  • Code does not introduce new technical debt or issues.

@linear
Copy link

linear bot commented Jul 24, 2023

ENG-2480 Add fetch BTC and Ordinal transaction functions

add functions to fetch single BTC and ordinal transaction from txId using mempool.space API

@@ -146,6 +146,10 @@ export default class BitcoinEsploraApiProvider extends ApiInstance implements Bi
return this.httpGet<esplora.Transaction[]>(`/address/${address}/txs`);
}

async getBtcTransaction(txid: string): Promise<esplora.Transaction> {
Copy link
Member

Choose a reason for hiding this comment

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

should be simplified to be getTransaction

api/btc.ts Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

Test this PR with npm i @secretkeylabs/xverse-core@1.4.2-08606a8

@teebszet teebszet merged commit e642514 into develop Aug 1, 2023
3 checks passed
@teebszet teebszet deleted the abdulhaseeb/eng-2480-add-fetch-btc-and-ordinal-transaction-functions branch August 1, 2023 08:49
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

3 participants