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

feat(service|btc)!: adapt org mempool updates in btc-assets-api #148

Merged
merged 7 commits into from
Apr 30, 2024

Conversation

ShookLyngs
Copy link
Collaborator

@ShookLyngs ShookLyngs commented Apr 29, 2024

Changes

  • Add BtcAssetsApi.getBtcRecommendedFeeRates() as the btc-assets-api service provides the API directly
  • Add after_txid filter in BtcAssetsApi. getBtcTransactions() API to allow query starts after a btc txid
  • Remove DataSource.getRecommendedFeeRates() and DataSource.getAverageFeeRate() API
  • Set fastestFee as the default fee rate in TxBuilder (it was halfHourFee)
  • Remove mempool.js from the service lib's dependencies
  • Replace deprecated test info in the service tests
  • Rename service tests to improve readability

Parent PR

Most of the updates in this pull request are based on the org mempool api updates in btc-assets-api:

Related issues

TODOs

@ShookLyngs ShookLyngs self-assigned this Apr 29, 2024
@ShookLyngs ShookLyngs marked this pull request as ready for review April 30, 2024 04:01
@ShookLyngs ShookLyngs force-pushed the feat/assets-mempool-api branch from 87b4a3a to 4f97df2 Compare April 30, 2024 04:17
}

// Get the recommended average fee rate.
async getAverageFeeRate(): Promise<number> {
const fees = await this.getRecommendedFeeRates();
const fees = await this.service.getBtcRecommendedFeeRates();
return fees.halfHourFee;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we just need getRecommendedFeeRates, getAverageFeeRate looks like it just goes to one of the fields. Are there compatibility considerations here?

Copy link
Collaborator Author

@ShookLyngs ShookLyngs Apr 30, 2024

Choose a reason for hiding this comment

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

Yes, personally I would like to remove both DataSource.getRecommendedFeeRates and DataSource.getAverageFeeRate, but I didn't do it due to compatibility concerns. The PR #98 was stuck for the same reason. I think if JoyID is not using them directly, we can remove them with a BREAKING CHANGE mark in the PR.

Update: after discussion with ahonn and yuche, I think it's okay to remove these APIs with a BREAKING CHANGE mark. The reason for removing them: the BtcAssetsApi provides the fees API directly, and the DataSource does nothing but re-route it.

…om DataSource, and use fastestFee by default in TxBuilder
@ShookLyngs ShookLyngs requested a review from ahonn April 30, 2024 07:29
@ShookLyngs ShookLyngs changed the title feat(service|btc): adapt org mempool updates in btc-assets-api feat(service|btc)!: adapt org mempool updates in btc-assets-api Apr 30, 2024
@ShookLyngs ShookLyngs merged commit 53ac8ed into develop Apr 30, 2024
1 check passed
@Flouse Flouse deleted the feat/assets-mempool-api branch April 30, 2024 10:46
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.

Re-enable btc/service tests in test.yaml Refactor the default feeRate of rgbpp-sdk/btc
3 participants