-
Notifications
You must be signed in to change notification settings - Fork 5
Btc deposit #333
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
Btc deposit #333
Conversation
Deploying aibtcdev-frontend-staging with
|
Latest commit: |
77ead73
|
Status: | ✅ Deploy successful! |
Preview URL: | https://97536502.aibtcdev-frontend-staging.pages.dev |
Branch Preview URL: | https://btc-deposit.aibtcdev-frontend-staging.pages.dev |
Okay, I’ve finally fixed all the any types, but it needs a review from @whoabuddy before merging. I also haven’t tested it with the Leather wallet yet, so it still needs to be tested using Leather. All the code is included. P.S It does not work on testnet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to have something in the cache for this, would fit nice with the cached lookup + bustCache pattern since they can change but most people will stick to one per address. There are Hiro API endpoints too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked over the code and don't see any blockers. Currently unable to test as its deployed to testnet which isn't supported. Will need to run locally to test between wallet providers but reading through the code:
- happy to merge this now as a starting point, looks good now that builds are passing
- includes some new packages, utilities, and pretty large components (can refactor later)
- we should look over how to better integrate Xverse/Leather for RPC methods in general
>(null); | ||
|
||
// Set the wallet provider based on the session when initialized | ||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a standard way to check for provider or a custom implementation?
RPC methods are described in a Stacks Improvement Proposal here for how to detect wallet providers:
stacksgov/sips#166
I think there are related docs for sats connect too that should help.
https://docs.xverse.app/sats-connect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one's custom implementation. I looked into rafa's implementation and used it here
queryFn: async () => { | ||
if (!btcAddress) return null; | ||
|
||
const blockstreamUrl = `https://blockstream.info/api/address/${btcAddress}/utxo`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting we're introducing blockstream.info for balances
try { | ||
console.log("Fetching fee estimates directly from mempool.space"); | ||
const response = await fetch( | ||
"https://mempool.space/api/v1/fees/recommended" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note we're introducing mempool.space for fee estimation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this file looks good but suspect we'll be able to separate and pull out some utility pieces later as the code is super long!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, giant component, but goal is to make it work then make it pretty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, def some generic helpers like background color and other display items, but can refactor later
phewwwww.... |
No description provided.