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: Add support for Tron #1258

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

feat: Add support for Tron #1258

wants to merge 15 commits into from

Conversation

Likang0122
Copy link
Collaborator

[中文版模板 / Chinese template]

💡 Background and solution

Add support for Tron

🔗 Related issue link

#1051

Copy link

vercel bot commented Nov 21, 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 Dec 19, 2024 5:56am

Copy link

changeset-bot bot commented Nov 21, 2024

🦋 Changeset detected

Latest commit: 267c262

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

This PR includes changesets to release 1 package
Name Type
@ant-design/web3-tron Major

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 Nov 21, 2024

Preview Failed

@@ -0,0 +1,38 @@
import React, { useState } from 'react';
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个文件夹下两个组件的大小写不一致,统一为大驼峰吧

@@ -0,0 +1 @@
# @ant-design/web3-tron
Copy link
Collaborator

Choose a reason for hiding this comment

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

readme 简单写一个

Copy link
Collaborator

Choose a reason for hiding this comment

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

@@ -0,0 +1,67 @@
{
"name": "@ant-design/web3-tron",
"version": "1.0.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个改为 0.0.1,新增一个 changlog,然后发布的时候就会发布为 1.0.0 版本

export * from './provider';
export * from './wallets/types';
export * from './wallets/okxTronWallet';
export { useWallet } from '@tronweb3/tronwallet-adapter-react-hooks';
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个里面都有些什么 hooks?如果是我们依赖了 @tronweb3/tronwallet-adapter-react-hooks 这个,但是又需要暴露给用户用,是不是把 @tronweb3/tronwallet-adapter-react-hooks 中的内容全部通过 @ant-design/web3-tron/hooks 暴露出去?

可以讨论一下。

@@ -0,0 +1,14 @@
import { ConnectButton, Connector } from '@ant-design/web3';
import { okxTronWallet, tronWallets, TronWeb3ConfigProvider } from '@ant-design/web3-tron';
Copy link
Collaborator

Choose a reason for hiding this comment

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

tronWallets 是复数?

<code src='./demos/message.tsx'></code>

## Sign Transaction

Copy link
Collaborator

Choose a reason for hiding this comment

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

文档 API 补充一下

@github-actions github-actions bot added the major label Nov 26, 2024
Copy link

github-actions bot commented Nov 26, 2024

🚨 @Likang0122, 本次 PR 的更改包含 major 变更,请确认是否符合预期。


🚨 @Likang0122, this PR contains major changes, please confirm if it is as expected.

+'@ant-design/web3-tron': major

@@ -77,6 +77,7 @@ export * from './components/bitcoin-circle-colorful';
export * from './components/bitcoin-circle-filled';
export * from './components/bitcoin-colorful';
export * from './components/bitcoin-filled';
export * from './components/bitget-wallet-colorful';
Copy link
Collaborator

Choose a reason for hiding this comment

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

感觉 icon 单独抽一个 pr 比较好,会让这个 pr review 起来更加轻松,变更文件更少。之前也都是这么做的。

@@ -0,0 +1 @@
# @ant-design/web3-tron
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment on lines 1 to 8
// import type { Wallet, WalletMetadata } from '@ant-design/web3-common';

// export interface WalletFactory {
// create: () => Wallet;
// }

// export type WalletFactoryBuilder = (metadata: WalletMetadata) => WalletFactory;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// import type { Wallet, WalletMetadata } from '@ant-design/web3-common';
// export interface WalletFactory {
// create: () => Wallet;
// }
// export type WalletFactoryBuilder = (metadata: WalletMetadata) => WalletFactory;

Copy link
Collaborator

Choose a reason for hiding this comment

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

下面好像有了 是不是没用了
image

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 11.39241% with 210 lines in your changes missing coverage. Please review.

Project coverage is 98.58%. Comparing base (e0db15a) to head (267c262).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
packages/tron/src/provider/config-provider.tsx 0.00% 103 Missing ⚠️
packages/tron/src/provider/index.tsx 0.00% 32 Missing ⚠️
packages/tron/src/wallets/bitgetWallet.tsx 0.00% 21 Missing ⚠️
packages/tron/src/wallets/bybitWallet.tsx 0.00% 21 Missing ⚠️
packages/tron/src/wallets/tronlinkWallet.tsx 0.00% 20 Missing ⚠️
packages/tron/src/wallets/okxTronWallet.tsx 0.00% 6 Missing ⚠️
packages/tron/src/wallets/index.ts 0.00% 4 Missing ⚠️
packages/tron/src/utils.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1258      +/-   ##
==========================================
- Coverage   99.99%   98.58%   -1.41%     
==========================================
  Files         858      869      +11     
  Lines       14726    14963     +237     
  Branches     1589     1599      +10     
==========================================
+ Hits        14725    14752      +27     
- Misses          1      211     +210     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants