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): add getInscription API and enhance types #901

Merged
merged 7 commits into from
May 31, 2024

Conversation

AmAzing129
Copy link
Collaborator

@AmAzing129 AmAzing129 commented May 22, 2024

💡 Background and solution

问题背景:类似于 NFTCard,提供 OrdinalsCard 用于展示铭文

设计思路:UI 层可以使用 NFTCard,而图片信息需要去获取,也就是类似 getNFTMetadata 的逻辑。不过特殊之处在于:

  • 有的钱包内置了接口去读取铭文,比如 Unisat,而如 Xverse 等则需要自行获取(情况与 getBalance 相同)
  • 获取铭文信息,只在 Bitcoin 层,并不涉及更通用的封装

因此不单独透出组件,而是提供统一的 API 读取铭文信息,开发者可以更加灵活地使用,同时依然可以使用 ant-design-web3 提供的 UI 组件。参见 demos/get-inscriptions.tsx

注:官方并不提供统一 Open API ordinals/ord#2672 因此使用 Hiro 的开源 API

🔗 Related issue link

#800

Copy link

vercel bot commented May 22, 2024

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

Name Status Preview Comments Updated (UTC)
ant-design-web3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 7:09am

Copy link

changeset-bot bot commented May 22, 2024

🦋 Changeset detected

Latest commit: 7be40ff

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

This PR includes changesets to release 5 packages
Name Type
@ant-design/web3 Patch
@ant-design/web3-bitcoin Minor
@example/eth-web3js Patch
@example/ethers-v5 Patch
@example/ethers 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

github-actions bot commented May 22, 2024

Preview is ready

Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (8a6d1c7) to head (7be40ff).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #901   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          712       712           
  Lines        21525     21588   +63     
  Branches      1216      1225    +9     
=========================================
+ Hits         21525     21588   +63     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

packages/bitcoin/src/adapter/useBitcoinWallet.ts Outdated Show resolved Hide resolved
packages/bitcoin/src/helpers.tsx Outdated Show resolved Hide resolved
@jeasonstudio
Copy link
Collaborator

https://preview-901-ant-design-web3.surge.sh/components/bitcoin
这页文档下面需要加一个 NFTCard + Bitcoin Adapter 的例子

@AmAzing129 AmAzing129 merged commit fd01924 into main May 31, 2024
12 checks passed
@AmAzing129 AmAzing129 deleted the feat/bitcoin-inscription branch May 31, 2024 07:19
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.

None yet

6 participants