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

chore: separate blockchain api to a package #4065

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

enesozturk
Copy link
Contributor

@enesozturk enesozturk commented Mar 24, 2025

Description

Separates our Blockchain API into a package to be able to use it in different apps.

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

changeset-bot bot commented Mar 24, 2025

⚠️ No Changeset found

Latest commit: 9aa3b3c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented Mar 24, 2025

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

Name Status Preview Comments Updated (UTC)
appkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 25, 2025 8:00am
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 25, 2025 8:00am
12 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-ep ⬜️ Ignored (Inspect) Mar 25, 2025 8:00am
appkit-basic-ep-example ⬜️ Ignored (Inspect) Mar 25, 2025 8:00am
appkit-basic-example ⬜️ Ignored (Inspect) Mar 25, 2025 8:00am
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) Mar 25, 2025 8:00am
appkit-basic-up-example ⬜️ Ignored (Inspect) Mar 25, 2025 8:00am
appkit-ethers5-bera ⬜️ Ignored (Inspect) Mar 25, 2025 8:00am
appkit-nansen-demo ⬜️ Ignored (Inspect) Mar 25, 2025 8:00am
appkit-vue-solana ⬜️ Ignored (Inspect) Mar 25, 2025 8:00am
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Mar 25, 2025 8:00am
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Visit Preview Mar 25, 2025 8:00am
next-wagmi-solana-bitcoin-example ⬜️ Ignored (Inspect) Mar 25, 2025 8:00am
vue-wagmi-example ⬜️ Ignored (Inspect) Mar 25, 2025 8:00am

Copy link
Contributor

github-actions bot commented Mar 24, 2025

Warnings
⚠️ File apps/laboratory/tests/email-after-farcaster.spec.ts contains a KEY or SECRET
⚠️ File apps/laboratory/tests/email.spec.ts contains a KEY or SECRET
⚠️ File apps/laboratory/tests/shared/pages/ModalPage.ts contains a KEY or SECRET
⚠️ File apps/laboratory/tests/shared/pages/WalletPage.ts contains a KEY or SECRET
⚠️ File packages/appkit/src/client/appkit-base-client.ts contains a KEY or SECRET
⚠️ File packages/blockchain-api/tests/FetchUtil.test.ts contains a KEY or SECRET
⚠️ File packages/controllers/package.json contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/AccountController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/ApiController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/SendController.ts contains a KEY or SECRET
⚠️ File packages/experimental/package.json contains a KEY or SECRET
⚠️ File packages/experimental/src/smart-session/controllers/SmartSessionsController.ts contains a KEY or SECRET
⚠️ File packages/wallet-button/package.json contains a KEY or SECRET
⚠️ File packages/wallet-button/src/controllers/ApiController.ts contains a KEY or SECRET
⚠️ File packages/blockchain-api/package.json contains a KEY or SECRET
⚠️ File packages/blockchain-api/src/utils/FetchUtil.ts contains a KEY or SECRET
⚠️ File packages/blockchain-api/package.json contains a KEY or SECRET
⚠️ File packages/blockchain-api/src/utils/FetchUtil.ts contains a KEY or SECRET

Generated by 🚫 dangerJS against 9aa3b3c

Copy link
Contributor

github-actions bot commented Mar 24, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 74.68% 24502 / 32806
🔵 Statements 74.68% 24502 / 32806
🔵 Functions 65.59% 2065 / 3148
🔵 Branches 82.14% 4573 / 5567
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/src/client/appkit-base-client.ts 71.41% 86.46% 75.39% 71.41% 163-164, 166-167, 172-173, 241-242, 303, 307-308, 318-324, 351-370, 373-411, 414-419, 435-439, 452-463, 466-485, 488-494, 497-507, 510-522, 525-527, 530-532, 535-537, 540-542, 545-551, 554-557, 573-585, 591-624, 627-637, 691-692, 698, 709-723, 729-736, 749-753, 793-794, 799-801, 835-839, 845-846, 858, 881-886, 952, 973-974, 980, 982-998, 1003, 1041-1042, 1055-1066, 1098-1105, 1150-1154, 1183-1186, 1190, 1206-1216, 1238-1239, 1268-1269, 1276-1277, 1281-1282, 1449-1450, 1470-1471, 1474-1475, 1490-1493, 1496-1497, 1517-1518, 1521-1522, 1542-1543, 1556, 1560, 1565-1584, 1587-1596, 1611-1612, 1655-1658, 1661-1662, 1750-1751, 1754-1757, 1760-1761, 1764-1765, 1768-1769, 1772-1773, 1776-1780, 1845-1856, 1865-1887, 1567-1588
packages/blockchain-api/exports/index.ts 100% 100% 100% 100%
packages/blockchain-api/src/api/BlockchainApiClient.ts 29.26% 70.58% 37.03% 29.26% 116-117, 122, 124-128, 139-142, 165-179, 187-204, 212-220, 228-243, 273-286, 294-314, 322-337, 347-359, 367-371, 381-391, 399-403, 411-422, 430-446, 456-468, 476-496, 504-513, 523-537
packages/blockchain-api/src/utils/FetchUtil.ts 60.67% 73.68% 66.66% 60.67% 16-17, 48-50, 57-58, 65-66, 78-79, 82-92, 95-105, 120-121, 125-126
packages/blockchain-api/src/utils/constants.ts 100% 100% 100% 100%
packages/common/src/utils/TypeUtil.ts 100% 100% 100% 100%
packages/controllers/exports/index.ts 100% 100% 100% 100%
packages/controllers/exports/utils.ts 100% 100% 100% 100%
packages/controllers/src/controllers/AccountController.ts 91.19% 95.31% 69.38% 91.19% 63-64, 71-75, 108, 158, 224-227, 249, 83, 192, 206-226
packages/controllers/src/controllers/ApiController.ts 94.66% 90.24% 88.37% 94.66% 90-91, 152, 165, 338-346, 360, 364
packages/controllers/src/controllers/BlockchainApiController.ts 32.33% 76.47% 19.14% 32.33% 62-68, 80-84, 96-97, 101-102, 116-137, 141-148, 152-161, 165-172, 180-181, 187-194, 198-218, 222-233, 247-262, 266-273, 277-286, 290-297, 301-313, 317-336, 340-347, 351-368, 372-382, 386-394
packages/controllers/src/controllers/EventsController.ts 100% 91.3% 85.71% 100%
packages/controllers/src/controllers/SendController.ts 51.11% 72.54% 58.53% 51.11% 64, 114-116, 118, 143-166, 209-223, 231-232, 243-244, 256-311, 330, 332-347, 349-366, 370-394, 134-363
packages/experimental/src/smart-session/controllers/SmartSessionsController.ts 62.29% 61.53% 57.14% 62.29% 52-56, 58-81, 89-90, 97-98, 154-155, 163-166, 170-171, 174-176, 184-185, 193, 199-238
packages/wallet-button/src/controllers/ApiController.ts 85.29% 80% 100% 85.29% 55-59
Generated in workflow #10409 for commit 9aa3b3c by the Vitest Coverage Report Action

Comment on lines +5 to +11
export { FetchUtil } from '../src/utils/FetchUtil.js'

// Export constants
export { BLOCKCHAIN_API_URL, CACHE_EXPIRY } from '../src/utils/constants.js'

// Export types
export type {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know if we can split exports here ? I remember having an issue where @reown/appkit-ui was exporting all components in one go so we had to split it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think no need as we only export BlockchainApiClient, FetchUtils, and few constants, rest are types. And this package shouldn't be exporting something else actually

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