Skip to content

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

Merged
merged 33 commits into from
May 13, 2025
Merged

Btc deposit #333

merged 33 commits into from
May 13, 2025

Conversation

biwasxyz
Copy link
Contributor

No description provided.

@biwasxyz biwasxyz changed the base branch from main to staging April 17, 2025 08:17
Copy link

cloudflare-workers-and-pages bot commented Apr 28, 2025

Deploying aibtcdev-frontend-staging with  Cloudflare Pages  Cloudflare Pages

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

View logs

@biwasxyz
Copy link
Contributor Author

biwasxyz commented May 7, 2025

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

Copy link
Contributor

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.

Copy link
Contributor

@whoabuddy whoabuddy left a 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(() => {
Copy link
Contributor

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

Copy link
Contributor Author

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`;
Copy link
Contributor

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"
Copy link
Contributor

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

Copy link
Contributor

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!

Copy link
Contributor

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

Copy link
Contributor

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

@biwasxyz biwasxyz changed the title Btc deposit (WIP) Btc deposit May 7, 2025
@biwasxyz
Copy link
Contributor Author

biwasxyz commented May 8, 2025

phewwwww....

@biwasxyz biwasxyz merged commit bc38b5f into staging May 13, 2025
1 check passed
@biwasxyz biwasxyz deleted the btc-deposit branch May 13, 2025 08:33
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.

2 participants