Skip to content

Commit

Permalink
feat: Refactor & add ConnectButton & ProfileModal (#277)
Browse files Browse the repository at this point in the history
* feat: Support solana on mobile

* chore: update versions (alpha) (#225)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Add deeplink for tw solana on mobile

* chore: update versions (alpha) (#226)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Add phantom deeplink

* fix: Add deelink for phantom

* chore: update versions (alpha) (#227)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Update tron dependencies

* chore: update versions (alpha) (#230)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Fix an issue where solana is disconnected when trust evm wallet is disconnected

* chore: update versions (alpha) (#231)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Update demo

* fix: Fix the trust wallet will automatically connect when the page loaded

* chore: update versions (alpha) (#232)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Fix the trust wallet will automatically connect when the page loaded

* docs: Add change log

* chore: update versions (alpha) (#233)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Use window.trustwallet as TW provider to avoid conflicts

* chore: update versions (alpha) (#234)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Fix trust issue

* chore: update versions (alpha) (#235)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Fix binance web3 wallet successfully detected trustwallet on mobile

* chore: update versions (alpha) (#236)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Support tg wallet

* feat: Support tg wallet

* feat: Support tg wallet

* chore: update versions (alpha) (#237)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Add new wallet

* feat: Support tg wallet (#249)

* feat: Support solana on mobile

* chore: update versions (alpha) (#225)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Add deeplink for tw solana on mobile

* chore: update versions (alpha) (#226)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Add phantom deeplink

* fix: Add deelink for phantom

* chore: update versions (alpha) (#227)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Update tron dependencies

* chore: update versions (alpha) (#230)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Fix an issue where solana is disconnected when trust evm wallet is disconnected

* chore: update versions (alpha) (#231)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Update demo

* fix: Fix the trust wallet will automatically connect when the page loaded

* chore: update versions (alpha) (#232)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Fix the trust wallet will automatically connect when the page loaded

* docs: Add change log

* chore: update versions (alpha) (#233)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Use window.trustwallet as TW provider to avoid conflicts

* chore: update versions (alpha) (#234)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Fix trust issue

* chore: update versions (alpha) (#235)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Fix binance web3 wallet successfully detected trustwallet on mobile

* chore: update versions (alpha) (#236)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Support tg wallet

* feat: Support tg wallet

* feat: Support tg wallet

* chore: update versions (alpha) (#237)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Add new wallet

---------

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) (#250)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Only use binance sdk on pc

* fix: Update grid layout styles

* feat: Support tg

* feat: Use behavior configuration to control different connection behaviors on different platform

* chore: update versions (alpha) (#260)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Remove debug code (#261)

* chore: update versions (alpha) (#262)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Remove unused packages (#263)

* feat: Remove debug code

* fix: Fix type error

* feat: Remove unused packages

* chore: update versions (alpha) (#264)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Update demo (#265)

* feat: Remove debug code

* fix: Fix type error

* feat: Remove unused packages

* feat: Update demo

* chore: update versions (alpha) (#266)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Export a method to check whether a provider exists (#267)

* feat: Remove debug code

* fix: Fix type error

* feat: Remove unused packages

* feat: Update demo

* feat: Export a method to check whether a provider exists

* chore: update versions (alpha) (#268)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Remove metaMask support on tg (#269)

* feat: Remove debug code

* fix: Fix type error

* feat: Remove unused packages

* feat: Update demo

* feat: Export a method to check whether a provider exists

* refactor: Use uniform method to get wallet behavior on evm & non-evm wallets

* feat: Remove metaMask support on tg

* chore: update versions (alpha) (#270)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Support connecting to a specified wallet based on its wallet id (#271)

* feat: Remove debug code

* fix: Fix type error

* feat: Remove unused packages

* feat: Update demo

* feat: Export a method to check whether a provider exists

* refactor: Use uniform method to get wallet behavior on evm & non-evm wallets

* feat: Remove metaMask support on tg

* feat: Support connecting to a specified wallet based on its wallet id

* chore: update versions (alpha) (#272)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Fix styles

* chore: update versions (alpha) (#273)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: Update trust deeplink on ios

* chore: update versions (alpha) (#274)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: Trigger uri connection by user

* chore: update versions (alpha) (#275)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* refactor: Only uri jumping no delay

* feat: Refactor & add ConnectButton & ProfileModal

* docs: Add release docs

* chore: Update pnpm-lock.yaml

* feat: Update website

* chore: Only deploy docs on main branch

* docs: Update License

* chore: update versions (alpha) (#276)

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
3 people authored Feb 7, 2025
1 parent 9ad4741 commit 5758de4
Show file tree
Hide file tree
Showing 128 changed files with 5,124 additions and 4,073 deletions.
5 changes: 5 additions & 0 deletions .changeset/beige-cups-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Update website
5 changes: 5 additions & 0 deletions .changeset/big-donuts-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Support solana on mobile
5 changes: 5 additions & 0 deletions .changeset/chilled-laws-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Update trust deeplink on ios
5 changes: 5 additions & 0 deletions .changeset/chilled-pots-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Fix binance web3 wallet successfully detected trustwallet on mobile
5 changes: 5 additions & 0 deletions .changeset/clean-ducks-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Support connecting to a specified wallet based on its wallet id
5 changes: 5 additions & 0 deletions .changeset/clever-experts-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Remove debug code
5 changes: 5 additions & 0 deletions .changeset/cuddly-dragons-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': minor
---

Use behavior configuration to control different connection behaviors on different platform
5 changes: 5 additions & 0 deletions .changeset/curly-poems-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Fix styles
5 changes: 5 additions & 0 deletions .changeset/few-cats-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Only use binance sdk on pc
5 changes: 5 additions & 0 deletions .changeset/few-guests-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Fix trust issue
5 changes: 5 additions & 0 deletions .changeset/fifty-owls-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Export a method to check whether a provider exists
5 changes: 5 additions & 0 deletions .changeset/fuzzy-sheep-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Add new wallet
5 changes: 5 additions & 0 deletions .changeset/happy-countries-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Update tron dependencies
5 changes: 5 additions & 0 deletions .changeset/happy-jobs-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Fix an issue where solana is disconnected when trust evm wallet is disconnected
5 changes: 5 additions & 0 deletions .changeset/itchy-hats-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Add deeplink for tw solana on mobile
5 changes: 5 additions & 0 deletions .changeset/khaki-swans-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Remove metaMask support on tg
5 changes: 5 additions & 0 deletions .changeset/large-roses-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Remove unused packages
5 changes: 5 additions & 0 deletions .changeset/little-panthers-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Fix the trust wallet will automatically connect when the page loaded
5 changes: 5 additions & 0 deletions .changeset/neat-pans-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Trigger uri connection by user
5 changes: 5 additions & 0 deletions .changeset/nervous-horses-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Fix the trust wallet will automatically connect when the page loaded
5 changes: 5 additions & 0 deletions .changeset/perfect-ravens-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Update demo
5 changes: 5 additions & 0 deletions .changeset/pink-carrots-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Use window.trustwallet as TW provider to avoid conflicts
37 changes: 37 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"mode": "pre",
"tag": "alpha",
"initialVersions": {
"example-nextjs": "0.0.1",
"example-vite": "0.0.1",
"@node-real/walletkit": "2.4.0",
"website": "0.0.1"
},
"changesets": [
"beige-cups-poke",
"big-donuts-push",
"chilled-laws-kiss",
"chilled-pots-chew",
"clean-ducks-carry",
"clever-experts-smash",
"cuddly-dragons-talk",
"curly-poems-complain",
"few-cats-float",
"few-guests-melt",
"fifty-owls-kiss",
"fuzzy-sheep-buy",
"happy-countries-exercise",
"happy-jobs-hope",
"itchy-hats-applaud",
"khaki-swans-cough",
"large-roses-eat",
"little-panthers-tickle",
"neat-pans-give",
"nervous-horses-study",
"perfect-ravens-melt",
"pink-carrots-jam",
"rotten-mugs-fail",
"slimy-books-turn",
"wise-days-juggle"
]
}
5 changes: 5 additions & 0 deletions .changeset/rotten-mugs-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': minor
---

Refactor & add ConnectButton & ProfileModal
5 changes: 5 additions & 0 deletions .changeset/slimy-books-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Add deelink for phantom
5 changes: 5 additions & 0 deletions .changeset/wise-days-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': minor
---

Support tg
2 changes: 0 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ on:
push:
branches:
- main
- alpha
- dev

jobs:
release:
Expand Down
7 changes: 5 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pnpm install
pnpm dev
```

In default, this will run a [test example](./packages/walletkit/test) under walletkit package, you can use this example for development and debugging. Any changes in `packages/walletkit` will trigger a refresh.
In default, this will run a [test example](./packages/walletkit/__dev__) under walletkit package, you can use this example for development and debugging. Any changes in `packages/walletkit` will trigger a refresh.

## Coding standards

Expand Down Expand Up @@ -241,4 +241,7 @@ A complete development workflow like following:
branch
5. Then [github action](https://github.com/node-real/walletkit/actions) will automatically execute
and create a new [release PR](https://github.com/node-real/walletkit/pulls), merge this PR, a new
version will be released
`alpha version` will be released
6. After testing on the `alpha version`, we can merge the `alpha` branch into the `main` branch, and the [github action](https://github.com/node-real/walletkit/actions) will automatically execute
and create a new [release PR](https://github.com/node-real/walletkit/pulls), merge this PR, a new
`stable version` will be released
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 node-real
Copyright (c) 2025 node-real

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
Expand Down
84 changes: 43 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,61 +30,62 @@ npm i @node-real/walletkit@^2 wagmi@^2 viem@^2 @tanstack/react-query@^5
```tsx
import '@node-real/walletkit/styles.css';

import { trustWallet, metaMask, walletConnect } from '@node-real/walletkit/wallets';
import { binanceWallet, trustWallet, metaMask, walletConnect } from '@node-real/walletkit/wallets';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import {
defaultWagmiConfig,
SwitchNetworkModal,
WalletKitButton,
WalletKitOptions,
ConnectModal,
WalletKitConfig,
WalletKitProvider,
ConnectButton,
SwitchNetworkModal,
ProfileModal,
ConnectModal,
} from '@node-real/walletkit';
import { WagmiProvider } from 'wagmi';
import { AppProps } from 'next/app';
import { chains } from './chains';
import { bsc, mainnet } from 'wagmi/chains';

const queryClient = new QueryClient();

const config = defaultWagmiConfig({
appName: '[Your app name]', // Your app name
chains,
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: 'xxx',
});

const options: WalletKitOptions = {
initialChainId: 1,
const config: WalletKitConfig = {
options: {
closeModalOnEsc: false,
},
evmConfig: defaultEvmConfig({
autoConnect: true,
initialChainId: 1,

// 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: 'xxx',

wallets: [binanceWallet(), metaMask(), trustWallet(), walletConnect()],
chains: [mainnet, bsc],
}),
};


export default function App({ Component, pageProps }: AppProps) {
return (
<WagmiProvider config={config} reconnectOnMount={true}>
<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>
</QueryClientProvider>
</WagmiProvider>
<QueryClientProvider client={queryClient}>
<WalletKitProvider config={config} debugMode={true} mode="auto">
<Component {...pageProps} />

<ConnectButton />
<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>
</QueryClientProvider>
);
}
```
Expand All @@ -93,6 +94,7 @@ export default function App({ Component, pageProps }: AppProps) {

Please follow our [WalletKit Contribution Guide](./CONTRIBUTING.md).


## License

See [LICENSE](./LICENSE) for more information.
Loading

0 comments on commit 5758de4

Please sign in to comment.