-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Wenty/dev (#185) * feat: Split into four packages: ui, wagmi, solana and walletkit * feat: Split packages & support solana * feat: Split package into solana & wagmi * feat: Split package into solana & wagmi * feat: Update soft link * feat: Update soft link (#179) * feat: Split into four packages: ui, wagmi, solana and walletkit * feat: Split packages & support solana * feat: Split package into solana & wagmi * feat: Split package into solana & wagmi * feat: Update soft link * chore: update versions (alpha) (#180) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * refactor: Refactor walletkit * refactor: Refactor wallets * feat: Update pack config * feat: Add ConnectModal * refactor: Normalized names * refactor: solana and evm are unified into one package * refactor: Update configs * feat: Add EmbeddedConnectModal --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update versions (alpha) (#186) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat: Add log * chore: update versions (alpha) (#187) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat: Add initialChainId to connectModal * fix: Add default `initialChainId` if it is ignored by onOpen * test: test release * refactor: Expose `evmConfig` and `solanaConfig` as wallet configurations * feat: Support connecting to a specified wallet * docs: Remove unused docs * docs: Update examples * docs: update version * fix: Fix style order issue * docs: Update version * feat: Add `ConnectWithWalletConnect` view * feat: support TMA * feat: Support telegram mini app * feat: Add tma sdk * fix: fix module resolve issue * feat: Make walletConnect uri as global variable * docs: Update version * feat: Update examples * docs: update examples * refactor: All configurations are obtained from useWalletKit * feat: Add `useConnectWallet` to evm * refactor: Rename evm hooks * refactor: Rename views * feat: Update log format * refactor: Add `refreshUriOnError` * docs: Add change log * chore: update versions (alpha) (#207) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix: Set `refreshUriOnError=true` as default * chore: update versions (alpha) (#209) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix: Open modal after config is ready * feat: Using metaMaskSDK as default metaMask wallet * refactor: Refactor wallet * feat: Support telegram mini app * chore: update versions (alpha) (#210) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat: Support async connect a wallet (#211) * chore: update versions (alpha) (#212) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Dev metamask (#213) * feat: Support async connect a wallet * chore: update versions (alpha) (#212) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix: Connect is no longer invoked if wallet is connected --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: update versions (alpha) (#214) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat: Remove `useConnectWallet` * feat(walletkit): Support tron wallets * docs: Add change log * chore: update versions (alpha) (#215) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat(walletkit): Support TronLink on mobile * chore: update versions (alpha) (#216) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat(walletkit): Adjust the priority of the user style & Update wallet icon size * chore: update versions (alpha) (#217) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat: Scroll the wallet list if overflow * chore: update versions (alpha) (#218) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix: Fix scrollbar color issue * chore: update versions (alpha) (#219) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat: Add callback once wallet is connected * chore: update versions (alpha) (#220) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat: Support switch network for tron * chore: update versions (alpha) (#221) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix: No need to invoke switchChain on mobile * chore: update versions (alpha) (#222) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
fcf0e97
commit 953e77c
Showing
309 changed files
with
21,622 additions
and
9,886 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,5 @@ | ||
--- | ||
'@node-real/walletkit': patch | ||
--- | ||
|
||
Support switch network for tron |
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 @@ | ||
--- | ||
'@node-real/walletkit': patch | ||
--- | ||
|
||
Support telegram mini app |
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 @@ | ||
--- | ||
'@node-real/walletkit': patch | ||
--- | ||
|
||
Support async connect a wallet |
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 @@ | ||
--- | ||
'@node-real/walletkit': patch | ||
--- | ||
|
||
No need to invoke switchChain on mobile |
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 @@ | ||
--- | ||
'@node-real/walletkit': minor | ||
--- | ||
|
||
Support tron wallets |
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 @@ | ||
--- | ||
'@node-real/walletkit': patch | ||
--- | ||
|
||
Connect is no longer invoked if wallet is connected |
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 @@ | ||
--- | ||
'@node-real/walletkit': patch | ||
--- | ||
|
||
Adjust the priority of the user style & update wallet icon size |
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 @@ | ||
--- | ||
'@node-real/walletkit': patch | ||
--- | ||
|
||
Fix scrollbar color issue |
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 @@ | ||
--- | ||
'@node-real/walletkit': patch | ||
--- | ||
|
||
Support tronLink on mobile |
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,23 @@ | ||
{ | ||
"mode": "pre", | ||
"tag": "alpha", | ||
"initialVersions": { | ||
"example-nextjs": "0.0.1", | ||
"example-vite": "0.0.1", | ||
"@node-real/walletkit": "2.3.5", | ||
"website": "0.0.1" | ||
}, | ||
"changesets": [ | ||
"breezy-buttons-walk", | ||
"brown-laws-drum", | ||
"empty-pianos-impress", | ||
"fast-bikes-look", | ||
"fluffy-colts-run", | ||
"great-trainers-care", | ||
"plenty-needles-march", | ||
"polite-onions-double", | ||
"popular-forks-warn", | ||
"silly-tables-tease", | ||
"tasty-yaks-chew" | ||
] | ||
} |
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 @@ | ||
--- | ||
'@node-real/walletkit': patch | ||
--- | ||
|
||
Scroll the wallet list if overflow |
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 @@ | ||
--- | ||
'@node-real/walletkit': patch | ||
--- | ||
|
||
Add callback once wallet is connected |
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
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,62 +1,59 @@ | ||
import '@node-real/walletkit/styles.css'; | ||
import '@/styles/globals.css'; | ||
import { bsc, mainnet, opBNB } from 'wagmi/chains'; | ||
import { mainnet } from 'wagmi/chains'; | ||
|
||
import { trustWallet, metaMask, walletConnect } from '@node-real/walletkit/wallets'; | ||
import { trustWallet, metaMask, walletConnect, defaultEvmConfig } from '@node-real/walletkit/evm'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
import { | ||
defaultWagmiConfig, | ||
SwitchNetworkModal, | ||
WalletKitButton, | ||
WalletKitOptions, | ||
WalletKitProvider, | ||
ProfileModal, | ||
ConnectModal, | ||
useConnectModal, | ||
WalletKitConfig, | ||
} from '@node-real/walletkit'; | ||
import { WagmiProvider } from 'wagmi'; | ||
import { AppProps } from 'next/app'; | ||
import { useAccount, useDisconnect } from 'wagmi'; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
const config = defaultWagmiConfig({ | ||
appName: 'WalletKit', | ||
chains: [bsc, mainnet, opBNB], | ||
connectors: [trustWallet(), metaMask(), walletConnect()], | ||
|
||
// WalletConnect 2.0 requires a projectId which you can create quickly | ||
// and easily for free over at WalletConnect Cloud https://cloud.walletconnect.com/sign-in | ||
walletConnectProjectId: 'e68a1816d39726c2afabf05661a32767', | ||
}); | ||
|
||
const options: WalletKitOptions = { | ||
initialChainId: 1, | ||
const config: WalletKitConfig = { | ||
options: { | ||
closeModalOnEsc: false, | ||
}, | ||
evmConfig: defaultEvmConfig({ | ||
autoConnect: true, | ||
initialChainId: 1, | ||
walletConnectProjectId: 'e68a1816d39726c2afabf05661a32767', | ||
wallets: [metaMask(), trustWallet(), walletConnect()], | ||
chains: [mainnet], | ||
}), | ||
}; | ||
|
||
export default function App({ Component, pageProps }: AppProps) { | ||
return ( | ||
<WagmiProvider config={config} reconnectOnMount={true}> | ||
<WalletKitProvider config={config} debugMode={true} mode="auto"> | ||
<QueryClientProvider client={queryClient}> | ||
<WalletKitProvider options={options} mode="light"> | ||
<Component {...pageProps} /> | ||
|
||
<WalletKitButton /> | ||
|
||
<ConnectModal /> | ||
|
||
{/* | ||
Profile modal shows some basic information about the current account, | ||
If you don't need this modal, you can remove it. | ||
*/} | ||
<ProfileModal /> | ||
|
||
{/* | ||
👇 Here's the SwitchNetworkModal | ||
If the user switches to a network that is not supported by our dApp, | ||
this modal will be displayed to remind the user to switch to our supported networks. | ||
*/} | ||
<SwitchNetworkModal /> | ||
</WalletKitProvider> | ||
<Component {...pageProps} /> | ||
<ConnectButton /> | ||
<ConnectModal /> | ||
</QueryClientProvider> | ||
</WagmiProvider> | ||
</WalletKitProvider> | ||
); | ||
} | ||
|
||
function ConnectButton() { | ||
const { onOpen } = useConnectModal(); | ||
|
||
const { address } = useAccount(); | ||
const { disconnect } = useDisconnect(); | ||
|
||
if (address) { | ||
return ( | ||
<> | ||
<div>address:{address}</div> | ||
<button onClick={() => disconnect()}>disconnect</button> | ||
</> | ||
); | ||
} | ||
|
||
return <button onClick={() => onOpen()}>connect</button>; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,54 @@ | ||
import '@node-real/walletkit/styles.css'; | ||
import './global.css'; | ||
import { bsc, mainnet, opBNB } from 'wagmi/chains'; | ||
|
||
import { trustWallet, metaMask, walletConnect } from '@node-real/walletkit/wallets'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
import { | ||
ConnectModal, | ||
defaultWagmiConfig, | ||
ProfileModal, | ||
SwitchNetworkModal, | ||
WalletKitButton, | ||
WalletKitOptions, | ||
useConnectModal, | ||
WalletKitConfig, | ||
WalletKitProvider, | ||
} from '@node-real/walletkit'; | ||
import { WagmiProvider } from 'wagmi'; | ||
import { defaultEvmConfig, metaMask, trustWallet, walletConnect } from '@node-real/walletkit/evm'; | ||
import { mainnet } from 'viem/chains'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
import { useAccount, useDisconnect } from 'wagmi'; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
const config = defaultWagmiConfig({ | ||
appName: 'WalletKit', | ||
chains: [mainnet, bsc, opBNB], | ||
connectors: [trustWallet(), metaMask(), walletConnect()], | ||
|
||
// WalletConnect 2.0 requires a projectId which you can create quickly | ||
// and easily for free over at WalletConnect Cloud https://cloud.walletconnect.com/sign-in | ||
walletConnectProjectId: 'e68a1816d39726c2afabf05661a32767', | ||
}); | ||
|
||
const options: WalletKitOptions = { | ||
initialChainId: 1, | ||
const config: WalletKitConfig = { | ||
options: { | ||
closeModalOnEsc: false, | ||
}, | ||
evmConfig: defaultEvmConfig({ | ||
autoConnect: true, | ||
initialChainId: 1, | ||
walletConnectProjectId: 'e68a1816d39726c2afabf05661a32767', | ||
wallets: [metaMask(), trustWallet(), walletConnect()], | ||
chains: [mainnet], | ||
}), | ||
}; | ||
|
||
export default function App() { | ||
return ( | ||
<WagmiProvider config={config} reconnectOnMount={false}> | ||
<WalletKitProvider config={config} debugMode={true} mode="auto"> | ||
<QueryClientProvider client={queryClient}> | ||
<WalletKitProvider options={options} mode="light"> | ||
<WalletKitButton /> | ||
<ConnectModal /> | ||
<ProfileModal /> | ||
<SwitchNetworkModal /> | ||
</WalletKitProvider> | ||
<ConnectButton /> | ||
<ConnectModal /> | ||
</QueryClientProvider> | ||
</WagmiProvider> | ||
</WalletKitProvider> | ||
); | ||
} | ||
|
||
function ConnectButton() { | ||
const { onOpen } = useConnectModal(); | ||
|
||
const { address } = useAccount(); | ||
const { disconnect } = useDisconnect(); | ||
|
||
if (address) { | ||
return ( | ||
<> | ||
<div>address:{address}</div> | ||
<button onClick={() => disconnect()}>disconnect</button> | ||
</> | ||
); | ||
} | ||
|
||
return <button onClick={() => onOpen()}>connect</button>; | ||
} |
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
Oops, something went wrong.