-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Add adapter for Solana * fix: conflict * chore: format * test: update snapshot * test: fix test cases * chore: update deps * refactor: update types * docs: del solana basic demo * chore(solana): remove re-export web3-assets * feat: revert chain.id type to number * test: add chain id duplicate check * chore: add changeset * feat: handle switch chain * docs: add SolanaWeb3ConfigProvider * feat: SolanaProvider support pass chains and balance * feat: price prop * feat: add solana testnet and devnet * docs: udpate api doc * feat: add address prefix * docs: add solana demos * test: add solana test cases * feat: improve * test: update test * test: fix test * chore: remove log * chore: update web3-assets entry point * feat: delete mainnet * fix: rename solana index.tsx to index.ts for fix ci * chore: fix build and typescript error * docs: enable demos * test: add tests * refactor: format * chore: update pnpm-lock.yaml * feat: Components adapts Solana's address format * test: add address format tests * chore: add changeset * chore: update changeset * feat: remove selectWallet event and solana chain check * test: add test * test: remove unused tests * chore: remove comment * test: fix vitest config * chore: improve assets multi entry conf --------- Co-authored-by: tingzhao.ytz <[email protected]>
- Loading branch information
Showing
57 changed files
with
5,710 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@ant-design/web3-solana': major | ||
'@ant-design/web3-assets': minor | ||
'@ant-design/web3': minor | ||
--- | ||
|
||
Add support for Solana |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@ant-design/web3-solana': major | ||
--- | ||
|
||
Add support for Solana |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@ant-design/web3-assets': minor | ||
'@ant-design/web3': minor | ||
--- | ||
|
||
Address-like components support addressPrefix prop, add solana chain configs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './wallets'; | ||
export * from './chains'; | ||
export * from './chains/ethereum'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { createGetBrowserLink, SolanaChainIds, type Chain } from '@ant-design/web3-common'; | ||
import { SolanaColorful } from '@ant-design/web3-icons'; | ||
|
||
export interface SolanaChain extends Chain { | ||
id: SolanaChainIds; | ||
} | ||
|
||
export const Solana: SolanaChain = { | ||
id: SolanaChainIds.MainnetBeta, | ||
name: 'Solana', | ||
icon: <SolanaColorful />, | ||
browser: { | ||
icon: <SolanaColorful />, | ||
getBrowserLink: createGetBrowserLink('https://explorer.solana.com'), | ||
}, | ||
nativeCurrency: { name: 'Solana', symbol: 'SOL', decimals: 9 }, | ||
}; | ||
|
||
export const SolanaDevnet: SolanaChain = { | ||
id: SolanaChainIds.Devnet, | ||
name: 'Solana Devnet', | ||
icon: <SolanaColorful />, | ||
browser: { | ||
icon: <SolanaColorful />, | ||
getBrowserLink: createGetBrowserLink('https://explorer.solana.com/?cluster=devnet'), | ||
}, | ||
nativeCurrency: { name: 'Solana', symbol: 'SOL', decimals: 9 }, | ||
}; | ||
|
||
export const SolanaTestnet: SolanaChain = { | ||
id: SolanaChainIds.Testnet, | ||
name: 'Solana Testnet', | ||
icon: <SolanaColorful />, | ||
browser: { | ||
icon: <SolanaColorful />, | ||
getBrowserLink: createGetBrowserLink('https://explorer.solana.com/?cluster=testnet'), | ||
}, | ||
nativeCurrency: { name: 'Solana', symbol: 'SOL', decimals: 9 }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './chains'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { WalletMetadata } from '@ant-design/web3-common'; | ||
import { ChromeCircleColorful, PhantomColorful } from '@ant-design/web3-icons'; | ||
|
||
export const metadata_Phantom: WalletMetadata = { | ||
icon: <PhantomColorful />, | ||
name: 'Phantom', | ||
remark: 'Phantom Wallet', | ||
app: { | ||
link: 'https://phantom.app/', | ||
}, | ||
extensions: [ | ||
{ | ||
key: 'Chrome', | ||
browserIcon: <ChromeCircleColorful />, | ||
browserName: 'Chrome', | ||
link: 'https://chromewebstore.google.com/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa', | ||
description: 'Access your wallet right from your favorite web browser.', | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { defineConfig } from 'father'; | ||
|
||
export default defineConfig({ | ||
extends: '../../.fatherrc.base.ts', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @ant-design/web3-solana | ||
|
||
[https://web3.ant.design](https://web3.ant.design) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"name": "@ant-design/web3-solana", | ||
"version": "0.0.1", | ||
"main": "dist/lib/index.js", | ||
"module": "dist/esm/index.js", | ||
"typings": "dist/esm/index.d.ts", | ||
"exports": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/lib/index.js", | ||
"types": "./dist/esm/index.d.ts" | ||
}, | ||
"files": [ | ||
"dist", | ||
"CHANGELOG.md", | ||
"README.md" | ||
], | ||
"keywords": [ | ||
"ant", | ||
"component", | ||
"components", | ||
"design", | ||
"framework", | ||
"frontend", | ||
"react", | ||
"react-component", | ||
"ui", | ||
"web3", | ||
"solana" | ||
], | ||
"homepage": "https://we3.ant.design", | ||
"bugs": { | ||
"url": "https://github.com/ant-design/ant-design-web3/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ant-design/ant-design-web3" | ||
}, | ||
"scripts": { | ||
"dev": "father dev", | ||
"build": "father build" | ||
}, | ||
"dependencies": { | ||
"@ant-design/web3-assets": "workspace:*", | ||
"@ant-design/web3-common": "workspace:*", | ||
"@metaplex-foundation/js": "^0.20.1", | ||
"@solana/wallet-adapter-react": "^0.15.35", | ||
"@solana/wallet-adapter-wallets": "^0.19.24", | ||
"debug": "^4.3.4" | ||
}, | ||
"devDependencies": { | ||
"@types/debug": "^4.1.12", | ||
"father": "^4.3.8", | ||
"typescript": "^5.3.3", | ||
"@solana/wallet-adapter-base": "^0.9.23" | ||
}, | ||
"peerDependencies": { | ||
"@solana/web3.js": "^1.89.1" | ||
}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org", | ||
"access": "public" | ||
}, | ||
"browserslist": [ | ||
"last 2 versions", | ||
"Firefox ESR", | ||
"> 1%", | ||
"ie >= 11" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { SolanaChainIds } from '@ant-design/web3-common'; | ||
|
||
export interface SolanaChainConfig { | ||
id: SolanaChainIds; | ||
name: string; | ||
network: string; | ||
rpcUrls: Record<string, string>; | ||
} | ||
|
||
export const solana: SolanaChainConfig = { | ||
id: SolanaChainIds.MainnetBeta, | ||
name: 'Solana', | ||
network: 'mainnet-beta', | ||
rpcUrls: { | ||
default: 'https://api.mainnet-beta.solana.com', | ||
}, | ||
}; | ||
|
||
export const solanaDevnet: SolanaChainConfig = { | ||
id: SolanaChainIds.Devnet, | ||
name: 'Solana Devnet', | ||
network: 'devnet', | ||
rpcUrls: { | ||
default: 'https://api.devnet.solana.com', | ||
}, | ||
}; | ||
|
||
export const solanaTestnet: SolanaChainConfig = { | ||
id: SolanaChainIds.Testnet, | ||
name: 'Solana Testnet', | ||
network: 'testnet', | ||
rpcUrls: { | ||
default: 'https://api.testnet.solana.com', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export { useWallet } from '@solana/wallet-adapter-react'; | ||
|
||
export * from './solana-provider'; | ||
export { solana, solanaDevnet, solanaTestnet, type SolanaChainConfig } from './chains'; | ||
export * from './wallets/factory'; | ||
export * from './wallets/built-in'; |
Oops, something went wrong.