Skip to content

Commit

Permalink
fix: Fixed binance web3 wallet disconnect after refresh page. (#157)
Browse files Browse the repository at this point in the history
* test: Test binance web3 wallet

* test: Test binance web3 wallet

* test: Test binance web3 wallet

* test: Test

* test: Test

* test: Test

* test: Test binance web3 wallet

* test: Test

* test: Test binance web3 wallet

* docs: Add log

* test: Test binance web3 wallet

* test: Test

* test: Test

* test: Test

* refactor: Remove unused code

* docs: Add log

* refactor: Adjust structure

* refactor: Update cicd workflows
  • Loading branch information
wenty22 authored Jun 19, 2024
1 parent b11c309 commit 9ff9a6d
Show file tree
Hide file tree
Showing 14 changed files with 6,437 additions and 4,686 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,9 @@ jobs:

- uses: ./.github/actions/setup

- name: Creating .env
run: |
cat << EOF > "./website/.env"
VITE_PARTICLE_APP_APP_ID=$PARTICLE_APP_APP_ID
VITE_PARTICLE_APP_PROJECT_ID=$PARTICLE_APP_PROJECT_ID
VITE_PARTICLE_APP_CLIENT_KEY=$PARTICLE_APP_CLIENT_KEY
EOF
env:
PARTICLE_APP_APP_ID: ${{ secrets.PARTICLE_APP_APP_ID }}
PARTICLE_APP_PROJECT_ID: ${{ secrets.PARTICLE_APP_PROJECT_ID }}
PARTICLE_APP_CLIENT_KEY: ${{ secrets.PARTICLE_APP_CLIENT_KEY }}

- name: Build docs
run: pnpm build:docs

- name: Redirect
run: |
mkdir -p ./website/dist/website/dist
cat << EOF > "./website/dist/website/dist/index.html"
<script>window.location.href='https://node-real.github.io/walletkit'</script>
EOF
- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@node-real/walletkit": "workspace:*",
"next": "^13.5.6",
"next": "^14",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"viem": "^1.19.9",
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
"ci:stable-version": "pnpm ci:exit && pnpm ci:version"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@changesets/cli": "^2.27.5",
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.2",
"@commitlint/config-conventional": "^18.6.3",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.3.5",
"husky": "^8.0.3",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5"
"lint-staged": "^15.2.7",
"prettier": "^3.3.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
useModal,
useProfileModal,
useSwitchNetworkModal,
} from '../src/index';
} from '@/index';

import {
binanceWeb3Wallet,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/walletkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@node-real/walletkit",
"version": "1.0.13-alpha.0",
"version": "1.1.0",
"author": "node-real",
"private": false,
"description": "WalletKit is a React component library for easily connecting a wallet to your dApp.",
Expand Down Expand Up @@ -30,7 +30,7 @@
"./wallets": "./dist/wallets/index.js"
},
"scripts": {
"dev": "vite test --config ./test/vite.config.ts --port 3010 --host 0.0.0.0",
"dev": "vite __dev__ --config vite.config.ts --port 3332 --host 0.0.0.0 --open",
"build:watch": "vite build --watch --emptyOutDir=false",
"build": "vite build"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/walletkit/src/wallets/binanceWeb3Wallet/connector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sleep } from '@/utils/common';
import { Chain } from 'wagmi';
import { Chain, WindowProvider } from 'wagmi';
import { InjectedConnector } from 'wagmi/connectors/injected';
import { BINANCE_WEB3_WALLET_ID, BINANCE_WEB3_WALLET_NAME } from '.';
import { isMobile } from '@/base/utils/mobile';
Expand Down Expand Up @@ -37,7 +37,7 @@ export class BinanceWeb3WalletConnector extends InjectedConnector {
});
}

public async getProvider() {
public async getProvider(): Promise<WindowProvider | undefined> {
await sleep();
return this.options.getProvider();
}
Expand Down
4 changes: 0 additions & 4 deletions packages/walletkit/test/.env.example

This file was deleted.

21 changes: 0 additions & 21 deletions packages/walletkit/test/vite.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/walletkit/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@/*": ["src/*"]
}
},
"include": ["src", "test"],
"include": ["src", "__dev__"],
"exclude": ["node_modules"],
"references": [{ "path": "./tsconfig.node.json" }]
}
Loading

0 comments on commit 9ff9a6d

Please sign in to comment.