Skip to content

Commit

Permalink
0.x alpha (#120)
Browse files Browse the repository at this point in the history
* chore: Update release workflow

* test: Test binance web3 wallet

* chore: Update docs workflow

* chore: Update workflow

* feat: Update bnc w3w deeplink

* chore: Update workflow

* docs: Add change log

* docs: Remove unused files

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

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

* feat: Support binance web3 wallet on mobile

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

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

* Bitget wallet (#108)

* feat: integrate bitget wallet

* provider

---------

Co-authored-by: Jeff <jeff.xue@bitget.com>

* Bitget wallet (#108) (#109)

* feat: integrate bitget wallet

* provider

---------

Co-authored-by: BitgetWalletTeam <158799510+BitgetWalletTeam@users.noreply.github.com>
Co-authored-by: Jeff <jeff.xue@bitget.com>

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

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

* feat: Add bitget wallet (#111)

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

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

* feat: Update docs

* fix: Fixed automatic disconnection issue caused by WalletConnect.

* fix: Cancel auto connect for docs

* fix: Update walletConnect to support customized relayUrl

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

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

* style: Remove private attributes

* docs: Add changeset

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

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

* feat: Add upgrade tips for binance web3 wallet.

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

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>
Co-authored-by: BitgetWalletTeam <158799510+BitgetWalletTeam@users.noreply.github.com>
Co-authored-by: Jeff <jeff.xue@bitget.com>
  • Loading branch information
5 people authored Feb 27, 2024
1 parent 7a4ad5a commit b71618d
Show file tree
Hide file tree
Showing 28 changed files with 1,262 additions and 517 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-kangaroos-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@node-real/walletkit": patch
---

Fixed automatic disconnection issue caused by WalletConnect.
9 changes: 9 additions & 0 deletions .changeset/loud-waves-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@node-real/walletkit": patch
---

<<<<<<<< HEAD:.changeset/popular-peas-grin.md
Add bitget wallet
========
Update docs
>>>>>>>> dev:.changeset/loud-waves-switch.md
7 changes: 7 additions & 0 deletions .changeset/nice-hats-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@node-real/walletkit": patch
---

Support binance web3 wallet on mobile

Add bitget wallet
7 changes: 7 additions & 0 deletions .changeset/popular-peas-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@node-real/walletkit": patch
---

Add bitget wallet

Update docs
18 changes: 18 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"mode": "pre",
"tag": "alpha",
"initialVersions": {
"example-nextjs": "0.0.1",
"example-vite": "0.0.1",
"@node-real/walletkit": "0.2.10-alpha.0",
"website": "0.0.1"
},
"changesets": [
"early-kangaroos-rhyme",
"loud-waves-switch",
"nice-hats-explain",
"popular-peas-grin",
"sour-windows-refuse",
"tiny-dots-clap"
]
}
5 changes: 5 additions & 0 deletions .changeset/sour-windows-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@node-real/walletkit": patch
---

Add upgrade tips for binance web3 wallet.
5 changes: 5 additions & 0 deletions .changeset/tiny-dots-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@node-real/walletkit": patch
---

Remove js private properties and methods.
31 changes: 15 additions & 16 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,18 @@

## For adding a new wallet

For more detail, please click [here](../CONTRIBUTING.md#notice-test-cases-for-adding-a-new-wallet)

<!--- If you are adding a new wallet, we hope you can complete the following tests before the code is merged into the main branch -->
|test case|support?|connected?|switch networks?|support testnet?|
|-|-|-|-|-|
|PC, browser extension| ✔️ | ✔️ |||
|Android, in system browser| | | | |
|Android, in wallet dapp browser| | | | |
|iOS, in system browser| | | | |
|iOS, in wallet dapp browser| | | | |
|WalletConnect, PC| | | | |
|WalletConnect, Android, in system browser| | | | |
|WalletConnect, Android, in wallet dapp browser| | | | |
|WalletConnect, iOS, in system browser| | | | |
|WalletConnect, iOS, in wallet dapp browser| | | | |

Please fill out the form below if you are adding a new wallet, for more detail, please click [here](../CONTRIBUTING.md#notice-test-cases-for-adding-a-new-wallet)

<!--- If you are adding a new wallet, we hope you can complete the following tests before the code is merged into the alpha branch -->
|test case|Does the wallet support connecting by this way?|Does the wallet support switching networks?|Does the wallet support testnet?|
|-|-|-|-|
|PC, browser extension| ✔️ | ✔️ ||
|Android, in system browser| | | |
|Android, in wallet dapp browser| | | |
|iOS, in system browser| | | |
|iOS, in wallet dapp browser| | | |
|WalletConnect, PC| | | |
|WalletConnect, Android, in system browser| | | |
|WalletConnect, Android, in wallet dapp browser| | | |
|WalletConnect, iOS, in system browser| | | |
|WalletConnect, iOS, in wallet dapp browser| | | |
14 changes: 14 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: 'setup'
description: Prepare the environment

inputs:
npm_token:
description: 'npm token'
required: true

runs:
using: composite
steps:
Expand All @@ -23,3 +28,12 @@ runs:
- name: Install dependencies
shell: bash
run: pnpm install

- name: Creating .npmrc
shell: bash
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ inputs.npm_token }}
26 changes: 6 additions & 20 deletions .github/workflows/release.yaml → .github/workflows/alpha.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Release
name: Alpha release
on:
push:
branches:
- main
- alpha
- 0.x
- 0.x-alpha

jobs:
Expand All @@ -20,32 +18,20 @@ jobs:
fetch-depth: 0

- uses: ./.github/actions/setup
with:
npm_token: ${{ secrets.NPM_TOKEN }}

- name: Build packages
run: pnpm build

- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Enter pre mode
if: github.ref_name == 'alpha' || github.ref_name == '0.x-alpha'
run: |
pnpm ci:enter | exit 0
- name: Exit pre mode
if: github.ref_name == 'main' || github.ref_name == '0.x'
run: |
pnpm ci:exit | exit 0
if: github.event.commits[0].author.username != 'github-actions[bot]'
run: pnpm ci:enter

- name: Create and publish versions
uses: changesets/action@v1
with:
version: pnpm ci:version
version: pnpm ci:alpha-version
publish: pnpm ci:publish
commit: 'chore: update versions'
title: 'chore: update versions'
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ on:
branches:
- main
- alpha
- dev

jobs:
release:
name: deploy docs
if: github.repository == 'node-real/walletkit'
if: |
github.repository == 'node-real/walletkit' &&
github.event.commits[0].author.username != 'github-actions[bot]'
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Stable Release
on:
push:
branches:
- main
- 0.x

jobs:
release:
name: release
if: github.repository == 'node-real/walletkit'
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: ./.github/actions/setup
with:
npm_token: ${{ secrets.NPM_TOKEN }}

- name: Build packages
run: pnpm build

- name: Exit pre mode
if: github.event.commits[0].author.username != 'github-actions[bot]'
run: pnpm ci:exit

- name: Create and publish versions
uses: changesets/action@v1
with:
version: pnpm ci:stable-version
publish: pnpm ci:publish
commit: 'chore: update versions'
title: 'chore: update versions'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42 changes: 24 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ Before adding a new wallet, you need to collect some information:
| ------------------ | --------------------------------------------------------------------------------------------------- | ----------------------------------- | -------- |
| wallet name | - | Trust Wallet | ✔️ |
| short name | If display space is insufficient, the short name will be displayed. | Trust | optional |
| wallet logo | logo in svg format. | - | ✔️ |
| wallet logo | Logo in svg format. It should be noted that WalletKit supports both dark and light modes, for better presentation, you can provide logos in the two modes respectively. | - | ✔️ |
| download url | - | https://trustwallet.com/download | ✔️ |
| deeplink | After clicking deeplink in the system browser, we can directly open dapp in the app's dapp browser. | trust://open_url?coin_id=60&url=xxx | ✔️ |
| WalletConnect link | If your app supports WalletConnect, please provides the WalletConnect uri. | trust://wc?uri=xxx | optional |
| WalletConnect uri | If your app supports WalletConnect, please provides the WalletConnect uri. | trust://wc?uri=xxx | optional |

Then you can add it to project by following steps:

Expand Down Expand Up @@ -132,6 +132,9 @@ export function trustWallet(props: TrustWalletProps = {}): WalletProps {
)}`;
return dappPath;
},
getQRCodeUri(uri) {
return `trust://wc?uri=${encodeURIComponent(uri)}`;
},
...restProps,
};
}
Expand Down Expand Up @@ -175,14 +178,14 @@ export interface WalletProps {
export * from './trustWallet';
```
5. Open `examples/test/pages/_app.tsx` to test the new wallet
5. Open `packages/walletkit/test/App.tsx` to test the new wallet
```tsx
import {
trustWallet, // import new wallet
metaMask,
walletConnect,
} from '@node-real/walletkit/wallets';
} from '@/wallets';
import { useState } from 'react';

const config = createConfig(
Expand All @@ -204,25 +207,28 @@ const config = createConfig(
);
```
6. Once the tests pass, the code can be merged into the `alpha` branch
## Notice!!! Test cases for adding a new wallet
Before merging the PR to main branch, we hope you complete the following tests, and fill the test results into the PR template, otherwise the PR may not be approved.
In general, wallet is available at several different platforms, such as PC browser extension, Android, iOS and WalletConnect. If your wallet supports the corresponding platform, please make sure your wallet is worked, can it be connected, can it switch networks, and can it support testnet?
In general, wallet is available at several different platforms, such as PC browser extension, Android, iOS and WalletConnect. If your wallet supports the corresponding platform, please make sure your wallet is worked.
|test case|steps|Does the wallet support connecting by this way?|Does the wallet support switching networks?|Does the wallet support testnet?|
|-|-|-|-|-|
|PC, browser extension|<ol><li>Open dapp in PC browser</li><li>Select your wallet, check the functions</li><ol>|✔️|✔️|✔️|
|Android, in system browser|<ol><li>Open dapp in Android system browser, select your wallet</li><li>The wallet app will be evoked, and the dapp will be open in the wallet dapp browser</li><li>Select your wallet, check the functions</li></ol>|✔️|❌|✔️|
|Android, in wallet dapp browser|<ol><li>Open dapp in the wallet dapp browser</li><li>Select your wallet, check the functions</li><ol>|✔️|✔️|✔️|
|iOS, in system browser|<ol><li>Open dapp in iOS system browser, select your wallet</li><li>The wallet app will be evoked, and the dapp will be open in the wallet dapp browser</li><li>Select your wallet, check the functions</li></ol>|✔️|✔️|❌|
|iOS, in wallet dapp browser|<ol><li>Open dapp in the wallet dapp browser </li><li>Select your wallet, check the functions</li></ol>|✔️|✔️|❌|
|WalletConnect, PC|<ol><li>Scan the QR code of WalletConnect using your wallet app</li><li>You will see a popup on the wallet app that asks you to connect WalletConnect</li><li>Check the functions</li></ol>|✔️|✔️|✔️|
|WalletConnect, Android, in system browser|<ol><li>Open dapp in Android system browser, select WalletConnect, choose your wallet in WalletConnect wallet list</li><li>The wallet app will be evoked, a popup for applying to connect WalletConnect will be displayed. </li><li>Check the functions</li></ol>|✔️|✔️|✔️|
|WalletConnect, Android, in wallet dapp browser|<ol><li>Open dapp in the wallet dapp browser</li><li>Select WalletConnect, choose your wallet in WalletConnect wallet list</li><li>A popup for applying to connect WalletConnect will be displayed</li><li>Check the functions</li><ol>|✔️|✔️|✔️|
|WalletConnect, iOS, in system browser|<ol><li>Open dapp in iOS system browser, select WalletConnect, choose your wallet in WalletConnect wallet list</li><li>The wallet app will be evoked, a popup for applying to connect WalletConnect will be displayed. </li><li>Check the functions</li></ol>|✔️|✔️|✔️|
|WalletConnect, iOS, in wallet dapp browser|<ol><li>Open dapp in the wallet dapp browser</li><li>Select WalletConnect, choose your wallet in WalletConnect wallet list</li><li>A popup for applying to connect WalletConnect will be displayed</li><li>Check the functions</li><ol>|✔️|✔️|✔️|
|test case|steps|support?|connected?|switch networks?|support testnet?|
|-|-|-|-|-|-|
|PC, browser extension|<ol><li>Open dapp in PC browser</li><li>Select your wallet, check the functions</li><ol>|✔️|✔️|✔️|✔️|
|Android, in system browser|<ol><li>Open dapp in Android system browser, select your wallet</li><li>The wallet app will be evoked, and the dapp will be open in the wallet dapp browser</li><li>Select your wallet, check the functions</li></ol>|✔️|✔️|❌|✔️|
|Android, in wallet dapp browser|<ol><li>Open dapp in the wallet dapp browser</li><li>Select your wallet, check the functions</li><ol>|✔️|✔️|✔️|✔️|
|iOS, in system browser|<ol><li>Open dapp in iOS system browser, select your wallet</li><li>The wallet app will be evoked, and the dapp will be open in the wallet dapp browser</li><li>Select your wallet, check the functions</li></ol>|✔️|✔️|✔️|❌|
|iOS, in wallet dapp browser|<ol><li>Open dapp in the wallet dapp browser </li><li>Select your wallet, check the functions</li></ol>|✔️|✔️|✔️|❌|
|WalletConnect, PC|<ol><li>Scan the QR code of WalletConnect using your wallet app</li><li>You will see a popup on the wallet app that asks you to connect WalletConnect</li><li>Check the functions</li></ol>|✔️|✔️|✔️|✔️|
|WalletConnect, Android, in system browser|<ol><li>Open dapp in Android system browser, select WalletConnect, choose your wallet in WalletConnect wallet list</li><li>The wallet app will be evoked, a popup for applying to connect WalletConnect will be displayed. </li><li>Check the functions</li></ol>|✔️|✔️|✔️|✔️|
|WalletConnect, Android, in wallet dapp browser|<ol><li>Open dapp in the wallet dapp browser</li><li>Select WalletConnect, choose your wallet in WalletConnect wallet list</li><li>A popup for applying to connect WalletConnect will be displayed</li><li>Check the functions</li><ol>|✔️|✔️|✔️|✔️|
|WalletConnect, iOS, in system browser|<ol><li>Open dapp in iOS system browser, select WalletConnect, choose your wallet in WalletConnect wallet list</li><li>The wallet app will be evoked, a popup for applying to connect WalletConnect will be displayed. </li><li>Check the functions</li></ol>|✔️|✔️|✔️|✔️|
|WalletConnect, iOS, in wallet dapp browser|<ol><li>Open dapp in the wallet dapp browser</li><li>Select WalletConnect, choose your wallet in WalletConnect wallet list</li><li>A popup for applying to connect WalletConnect will be displayed</li><li>Check the functions</li><ol>|✔️|✔️|✔️|✔️|
## Release notes
Expand All @@ -231,7 +237,7 @@ A complete development workflow like following:
1. Create a new branch out of `main` branch
2. Make some changes, fix bugs or add new features
3. Run `pnpm changeset` to create a new changeset
4. Commit the code, code review is required, after code review, we can merge the code to `main`
4. Commit the code, code review is required, after code review, we can merge the code to `alpha`
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
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,24 @@
"build": "pnpm --F @node-real/walletkit build",
"dev:docs": "pnpm --F @node-real/walletkit build:watch & pnpm --F website dev",
"build:docs": "pnpm build && pnpm --F website build",
"ci:enter": "pnpm changeset pre enter alpha",
"ci:exit": "pnpm changeset pre exit",
"ci:enter": "pnpm changeset pre enter alpha || true",
"ci:exit": "pnpm changeset pre exit || true",
"ci:version": "pnpm changeset version && cp README.md packages/walletkit/README.md",
"ci:publish": "pnpm changeset publish"
"ci:publish": "pnpm changeset publish",
"ci:alpha-version": "pnpm ci:enter && pnpm ci:version",
"ci:stable-version": "pnpm ci:exit && pnpm ci:version"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^18.4.4",
"@commitlint/config-conventional": "^18.4.4",
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.2",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.56.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.5",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"prettier": "^3.2.2"
"lint-staged": "^15.2.2",
"prettier": "^3.2.5"
}
}
36 changes: 36 additions & 0 deletions packages/walletkit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# @node-real/walletkit

## 0.2.10-alpha.4

### Patch Changes

- 11786f0: Add upgrade tips for binance web3 wallet.

## 0.2.10-alpha.3

### Patch Changes

- c3a68fa: Remove js private properties and methods.

## 0.2.10-alpha.2

### Patch Changes

- 6092b05: Fixed automatic disconnection issue caused by WalletConnect.
- b9d9a06: <<<<<<<< HEAD:.changeset/popular-peas-grin.md
Add bitget wallet
========
Update docs
> > > > > > > > dev:.changeset/loud-waves-switch.md
## 0.2.10-alpha.1

### Patch Changes

- c33fbda: Support binance web3 wallet on mobile
- 3deba02: Add bitget wallet

## 0.2.10-alpha.0

### Patch Changes

- c33fbda: Support binance web3 wallet on mobile

## 0.2.9

### Patch Changes
Expand Down
Loading

0 comments on commit b71618d

Please sign in to comment.