Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Update the Wallet name from bitget to Bitget Wallet #1967

Merged
merged 10 commits into from
Oct 25, 2023
4 changes: 2 additions & 2 deletions docs/src/routes/docs/[...4]wallets/[...2]bitget/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ Bitget Wallet SDK wallet module for connecting to Web3-Onboard. Web3-Onboard mak
<TabPanel value="yarn">

```sh copy
yarn add @web3-onboard/bitget
yarn add @web3-onboard/bitget-wallet
Adamj1232 marked this conversation as resolved.
Show resolved Hide resolved
```

</TabPanel>
<TabPanel value="npm">

```sh copy
npm install @web3-onboard/bitget
npm install @web3-onboard/bitget-wallet
Adamj1232 marked this conversation as resolved.
Show resolved Hide resolved
```

</TabPanel>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@web3-onboard/bitget",
"name": "@web3-onboard/bitget-wallet",
Adamj1232 marked this conversation as resolved.
Show resolved Hide resolved
"version": "2.0.0",
"description": "bitget-wallet SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
Expand Down Expand Up @@ -33,7 +33,7 @@
"Crypto",
"Crypto Wallet",
"Enkrypt",
"bitgetWallet"
"Bitget Wallet"
],
"repository": {
"type": "git",
Expand Down Expand Up @@ -61,7 +61,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@bitget-wallet/web3-sdk": "^0.0.6",
"@bitget-wallet/web3-sdk": "^0.0.8",
"@web3-onboard/common": "^2.3.3"
}
}
51 changes: 51 additions & 0 deletions packages/bitget-wallet/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import type { WalletInit, EIP1193Provider } from '@web3-onboard/common'

let bitgetWalletDependencies: any = null
let bitgetWalletAdapter: any = null

const loadBitgetWalletDependencies = async (getAdapter?: boolean) => {
if (!bitgetWalletDependencies) {
bitgetWalletDependencies = await import('@bitget-wallet/web3-sdk')
}
if (getAdapter && !bitgetWalletAdapter) {
bitgetWalletAdapter = new bitgetWalletDependencies.LegacyEip1193Adapter()
return bitgetWalletAdapter
}
if (getAdapter) {
return bitgetWalletAdapter
}
return bitgetWalletDependencies
}

function bitgetWallet(): WalletInit {
if (typeof window === 'undefined') return () => null

return () => {
return {
label: 'Bitget Wallet',
getIcon: async () => {
const { WalletInfo } = await loadBitgetWalletDependencies()
return WalletInfo.logolist.svg[256];
},
getInterface: async () => {
const {
currentProvider,
getIsInstall,
getDownload,
installWalletMessage
} = await loadBitgetWalletDependencies()

let provider: EIP1193Provider
if (getIsInstall()) {
provider = currentProvider()
} else {
window.open(getDownload(), '_blank')
throw new Error(installWalletMessage)
}
return { provider }
}
}
}
}

export default bitgetWallet
File renamed without changes.
51 changes: 0 additions & 51 deletions packages/bitget/src/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/bitkeep/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"Crypto",
"Crypto Wallet",
"Enkrypt",
"bitkeep"
"Bitget Wallet"
],
"repository": {
"type": "git",
Expand Down Expand Up @@ -61,7 +61,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@bitget-wallet/web3-sdk": "^0.0.6",
"@bitget-wallet/web3-sdk": "^0.0.8",
"@web3-onboard/common": "^2.3.3"
}
}
4 changes: 2 additions & 2 deletions packages/bitkeep/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function bitKeep(): WalletInit {
return {
label: 'BitKeep',
getIcon: async () => {
const sdkAdapter = await loadBitKeepDependencies(true)
return sdkAdapter.getLogo()
const { WalletInfo } = await loadBitKeepDependencies();
return WalletInfo.logolist.svg[256];
},
getInterface: async () => {
const {
Expand Down
Loading