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

Refactor the default feeRate of rgbpp-sdk/btc #92

Closed
Flouse opened this issue Apr 2, 2024 · 3 comments · Fixed by #148
Closed

Refactor the default feeRate of rgbpp-sdk/btc #92

Flouse opened this issue Apr 2, 2024 · 3 comments · Fixed by #148
Assignees
Labels

Comments

@Flouse
Copy link
Contributor

Flouse commented Apr 2, 2024

Tune the default fee_rate of a btc transaction to the fastestFee of curl -sSL "https://mempool.space/api/v1/fees/recommended".

Related Code

https://github.com/ckb-cell/rgbpp-sdk/blob/44b8eda57b5a51a0a7b9a0ebd181b19d5e8db2c6/packages/btc/src/query/source.ts#L153-L161

https://github.com/ckb-cell/rgbpp-sdk/blob/44b8eda57b5a51a0a7b9a0ebd181b19d5e8db2c6/examples/rgbpp/local/transfer-btc.ts#L34-L35

@ShookLyngs
Copy link
Collaborator

ShookLyngs commented Apr 2, 2024

Two questions:

  1. Do you wish all APIs to use the fastestFee?
  2. Do you prefer an option (e.g. feeType, recommendedFeeType) to adjust the fee rate?

@Flouse
Copy link
Contributor Author

Flouse commented Apr 2, 2024

  • Do you wish all APIs to use the fastestFee?
  1. Yes, use mempool.space API's fastestFee by default if the param feeRate is not specified.
  • Do you prefer an option (e.g. feeType, recommendedFeeType) to adjust the fee rate?
  1. LGTM. Do you mean supports feeRate: number | recommendedFeeType | undefined?

@ShookLyngs
Copy link
Collaborator

ShookLyngs commented Apr 2, 2024

  1. LGTM. Do you mean supports feeType: number | recommendedFeeType?

I was thinking maybe we can add a prop in the APIs (feeType or recommendedFeeType):

sendBtc({
  ...
  feeRate: 1, // optional, default to undefined
  feeType: 'halfHourFee', // optional, if "feeRate == undefined", use FeesRecommended[feeRate] as the fee rate
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants