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: bitcoin adapter get balance #3401

Merged
merged 10 commits into from
Dec 10, 2024
Merged

feat: bitcoin adapter get balance #3401

merged 10 commits into from
Dec 10, 2024

Conversation

zoruka
Copy link
Contributor

@zoruka zoruka commented Dec 5, 2024

Description

Add BitcoinAdapter.getBalance implementation based on BitcoinApi.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

vercel bot commented Dec 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
appkit-builder ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 10:33pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 10:33pm
appkit-vue-solana ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 10:33pm
appkit-wagmi-cdn-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 10:33pm
vue-wagmi-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 10:33pm

Copy link

changeset-bot bot commented Dec 10, 2024

🦋 Changeset detected

Latest commit: 40bf245

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-wallet-button Patch
@reown/appkit-utils Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit Patch
@reown/appkit-common Patch
@reown/appkit-core Patch
@reown/appkit-cli Patch
@reown/appkit-ui Patch
@apps/builder Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-cdn Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-wallet Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Dec 10, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 52.84% 14460 / 27364
🔵 Statements 52.84% 14460 / 27364
🔵 Functions 39.87% 1034 / 2593
🔵 Branches 75.19% 1789 / 2379
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/adapters/bitcoin/src/adapter.ts 24.44% 100% 8.69% 24.44% 37-51, 54-73, 75-89, 91-124, 127-134, 137-151, 154-163, 167-168, 171-177, 208-212, 215-219, 222-226, 229-233, 236-240, 244-245, 249-250, 254-255, 259-260, 263-267, 271-296, 299-301
packages/adapters/bitcoin/src/utils/BitcoinApi.ts 100% 100% 100% 100%
packages/adapters/bitcoin/tests/mocks/mockUTXO.ts 100% 100% 100% 100%
packages/appkit-utils/src/CaipNetworkUtil.ts 87.67% 80.95% 88.88% 87.67% 75-92, 123, 203-204
Generated in workflow #8031 for commit 40bf245 by the Vitest Coverage Report Action

@zoruka zoruka marked this pull request as ready for review December 10, 2024 21:43
): Promise<AdapterBlueprint.GetBalanceResult> {
const network = params.caipNetwork

if (network?.chainNamespace === 'bip122') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it validates type safety of caipNetwork that may be undefined and plus checks if is bip122 to guarantee it not breaking

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