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 packages/bitget/package.json
Original file line number Diff line number Diff line change
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"
}
}
32 changes: 16 additions & 16 deletions packages/bitget/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
import type { WalletInit, EIP1193Provider } from '@web3-onboard/common'

let bitgetDependencies: any = null
let bitgetAdapter: any = null
let bitgetWalletDependencies: any = null
let bitgetWalletAdapter: any = null

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

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

return () => {
return {
label: 'Bitget',
label: 'Bitget Wallet',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line will update the client naming of the wallet.
You can probably revert the changes to add Wallet to variable names as it will be implied

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks for reply

getIcon: async () => {
const sdkAdapter = await loadBitgetDependencies(true)
return sdkAdapter.getLogo()
const { WalletInfo } = await loadBitgetWalletDependencies()
return WalletInfo.logolist.svg[256];
},
getInterface: async () => {
const {
currentProvider,
getIsInstall,
getDownload,
installWalletMessage
} = await loadBitgetDependencies()
} = await loadBitgetWalletDependencies()

let provider: EIP1193Provider
if (getIsInstall()) {
Expand All @@ -48,4 +48,4 @@ function bitget(): WalletInit {
}
}

export default bitget
export default bitgetWallet
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