Skip to content

Commit

Permalink
refactor: Remove @solana/wallet-adapter-wallets re-exports dep (#885)
Browse files Browse the repository at this point in the history
* refactor: Remove @solana/wallet-adapter-wallets re-exports dep

* changeset

* docs: add adapters link
  • Loading branch information
gin-lsl committed May 20, 2024
1 parent 5b576a3 commit 5312696
Show file tree
Hide file tree
Showing 10 changed files with 253 additions and 3,852 deletions.
5 changes: 5 additions & 0 deletions .changeset/little-weeks-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ant-design/web3-solana": patch
---

refactor: Remove '@solana/wallet-adapter-wallets' dep
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"@changesets/changelog-git": "^0.2.0",
"@changesets/cli": "^2.27.1",
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@solana/wallet-adapter-wallets": "^0.19.32",
"@solana/wallet-adapter-coinbase": "^0.1.19",
"@solana/wallet-adapter-trust": "^0.1.13",
"@tanstack/react-query": "^5.28.4",
"@testing-library/react": "^14.2.2",
"@types/lodash": "^4.14.202",
Expand Down
4 changes: 3 additions & 1 deletion packages/solana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"@metaplex-foundation/js": "^0.20.1",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/wallet-adapter-react": "^0.15.35",
"@solana/wallet-adapter-wallets": "^0.19.32",
"@solana/wallet-adapter-coinbase": "^0.1.19",
"@solana/wallet-adapter-trust": "^0.1.13",
"@walletconnect/core": "^2.12.1",
"@walletconnect/universal-provider": "^2.13.0",
"@walletconnect/utils": "^2.13.0",
Expand All @@ -56,6 +57,7 @@
},
"devDependencies": {
"@types/debug": "^4.1.12",
"@solana/wallet-adapter-phantom": "^0.9.24",
"father": "^4.4.0",
"typescript": "^5.4.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import React from 'react';
import { useProvider } from '@ant-design/web3';
import { metadata_CoinbaseWallet } from '@ant-design/web3-assets';
import { CoinbaseWalletAdapter } from '@solana/wallet-adapter-coinbase';
import type { ConnectionContextState } from '@solana/wallet-adapter-react';
import { CoinbaseWalletAdapter } from '@solana/wallet-adapter-wallets';
import { fireEvent } from '@testing-library/react';
import { afterEach, describe, expect, it, vi } from 'vitest';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { ConnectButton, Connector, useProvider } from '@ant-design/web3';
import { metadata_CoinbaseWallet } from '@ant-design/web3-assets';
import { SolanaDevnet } from '@ant-design/web3-assets/solana';
import { CoinbaseWalletAdapter } from '@solana/wallet-adapter-coinbase';
import type { ConnectionContextState } from '@solana/wallet-adapter-react';
import { CoinbaseWalletAdapter } from '@solana/wallet-adapter-wallets';
import { fireEvent } from '@testing-library/react';
import { afterEach, describe, expect, it, vi } from 'vitest';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { useProvider } from '@ant-design/web3';
import { metadata_CoinbaseWallet, metadata_Phantom } from '@ant-design/web3-assets';
import { Solana, SolanaDevnet } from '@ant-design/web3-assets/solana';
import { WalletReadyState, type Adapter } from '@solana/wallet-adapter-base';
import { CoinbaseWalletAdapter } from '@solana/wallet-adapter-coinbase';
import { PhantomWalletAdapter } from '@solana/wallet-adapter-phantom';
import type { Wallet } from '@solana/wallet-adapter-react';
import { CoinbaseWalletAdapter, PhantomWalletAdapter } from '@solana/wallet-adapter-wallets';
import { fireEvent } from '@testing-library/react';
import { afterAll, describe, expect, it, vi } from 'vitest';

Expand Down
3 changes: 2 additions & 1 deletion packages/solana/src/wallets/built-in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
metadata_Trust,
metadata_WalletConnect,
} from '@ant-design/web3-assets';
import { CoinbaseWalletAdapter, TrustWalletAdapter } from '@solana/wallet-adapter-wallets';
import { CoinbaseWalletAdapter } from '@solana/wallet-adapter-coinbase';
import { TrustWalletAdapter } from '@solana/wallet-adapter-trust';

import { WalletConnectWalletAdapter } from '../wallet-connect-adapter';
import { StandardWalletFactory, WalletConnectWalletFactory, WalletFactory } from './factory';
Expand Down
6 changes: 5 additions & 1 deletion packages/web3/src/solana/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ The recommended configuration mainly includes:

## Add more wallets

To reduce the size of the package you're including, you need to manually configure the `wallets` to import the relevant wallets. You can export the necessary resources from `@ant-design/web3-assets` and `@solana/wallet-adapter-wallets`. If you don't find the resources you need, you can let us know by submitting a [GitHub issue](https://github.com/ant-design/ant-design-web3/issues). You can also configure it yourself or submit a Pull Request to us for support.
To reduce the size of the package you're including, you need to manually configure the `wallets` to import the relevant wallets. You can export the necessary resources from `@ant-design/web3-assets` and `@solana/wallet-adapter-ADAPTER_YOUR_NEED`. If you don't find the resources you need, you can let us know by submitting a [GitHub issue](https://github.com/ant-design/ant-design-web3/issues). You can also configure it yourself or submit a Pull Request to us for support.

`@solana/wallet-adapter-ADAPTER_YOUR_NEED`:

Available adapters can be found here: [wallet-adapters](https://github.com/anza-xyz/wallet-adapter/blob/master/packages/wallets/wallets/src/index.ts)

<code src="./demos/more-wallets.tsx"></code>

Expand Down
6 changes: 5 additions & 1 deletion packages/web3/src/solana/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ Ant Design Web3 官方提供了 `@ant-design/web3-solana` 来适配 Solana,它

## 添加更多钱包

为了降低引入包的大小,你需要手动配置 `wallets` 引入相关钱包。你可以从 `@ant-design/web3-assets``@solana/wallet-adapter-wallets` 中导出相关资源,如果没有你需要的资源,你可以通过提交 [GitHub issue](https://github.com/ant-design/ant-design-web3/issues) 告诉我们。当然,你也可以自己配置或者给我们提交 PR 支持。
为了降低引入包的大小,你需要手动配置 `wallets` 引入相关钱包。你可以从 `@ant-design/web3-assets``@solana/wallet-adapter-ADAPTER_YOUR_NEED` 中导出相关资源,如果没有你需要的资源,你可以通过提交 [GitHub issue](https://github.com/ant-design/ant-design-web3/issues) 告诉我们。当然,你也可以自己配置或者给我们提交 PR 支持。

`@solana/wallet-adapter-ADAPTER_YOUR_NEED`:

能够在这里找到可用的适配器:[wallet-adapters](https://github.com/anza-xyz/wallet-adapter/blob/master/packages/wallets/wallets/src/index.ts)

<code src="./demos/more-wallets.tsx"></code>

Expand Down
Loading

0 comments on commit 5312696

Please sign in to comment.