-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat:add @web3-onboard/bitget packages * dosc:bitget Wallet * feat:Upgrade npm package * feat:Change package name * feat:Change package name * Update packages/bitkeep/package.json * Update packages/bitget-wallet/package.json * Format code * Add CI * Rename bitget * delete wrong type * Test and remove type file for bitkeep * Import deps dynamically * Add bitkeep and bitget to docs site --------- Co-authored-by: kean <[email protected]@bitget.com> Co-authored-by: Adam Carpenter <[email protected]>
- Loading branch information
1 parent
ffb01e3
commit 24c825d
Showing
44 changed files
with
534 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
title: Bitget | ||
--- | ||
|
||
# {$frontmatter.title} | ||
|
||
## Wallet module for connecting Bitget Wallet through web3-onboard | ||
|
||
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. | ||
|
||
### Install | ||
|
||
<Tabs values={['yarn', 'npm']}> | ||
<TabPanel value="yarn"> | ||
|
||
```sh copy | ||
yarn add @web3-onboard/bitget | ||
``` | ||
|
||
</TabPanel> | ||
<TabPanel value="npm"> | ||
|
||
```sh copy | ||
npm install @web3-onboard/bitget | ||
``` | ||
|
||
</TabPanel> | ||
</Tabs> | ||
|
||
## Usage | ||
|
||
```typescript | ||
import Onboard from '@web3-onboard/core' | ||
import bitgetWalletModule from '@web3-onboard/bitget' | ||
|
||
const bitgetWallet = bitgetWalletModule() | ||
|
||
const onboard = Onboard({ | ||
// ... other Onboard options | ||
wallets: [ | ||
bitgetWallet() | ||
//... other wallets | ||
] | ||
}) | ||
|
||
const connectedWallets = await onboard.connectWallet() | ||
console.log(connectedWallets) | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
title: BitKeep | ||
--- | ||
|
||
# {$frontmatter.title} | ||
|
||
## Wallet module for connecting BitKeep Wallet through web3-onboard | ||
|
||
BitKeep 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. | ||
|
||
### Install | ||
|
||
<Tabs values={['yarn', 'npm']}> | ||
<TabPanel value="yarn"> | ||
|
||
```sh copy | ||
yarn add @web3-onboard/bitkeep | ||
``` | ||
|
||
</TabPanel> | ||
<TabPanel value="npm"> | ||
|
||
```sh copy | ||
npm install @web3-onboard/bitkeep | ||
``` | ||
|
||
</TabPanel> | ||
</Tabs> | ||
|
||
## Usage | ||
|
||
```typescript | ||
import Onboard from '@web3-onboard/core' | ||
import bitKeepWalletModule from '@web3-onboard/bitkeep' | ||
|
||
const bitKeepWallet = bitKeepWalletModule() | ||
|
||
const onboard = Onboard({ | ||
// ... other Onboard options | ||
wallets: [ | ||
bitKeepWallet() | ||
//... other wallets | ||
] | ||
}) | ||
|
||
const connectedWallets = await onboard.connectWallet() | ||
console.log(connectedWallets) | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# @web3-onboard/bitget | ||
|
||
## Wallet module for connecting Bitget Wallet through web3-onboard | ||
|
||
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. | ||
|
||
### Install | ||
|
||
**NPM** | ||
`npm i @web3-onboard/core @web3-onboard/bitget` | ||
|
||
**Yarn** | ||
`yarn add @web3-onboard/core @web3-onboard/bitget` | ||
|
||
## Usage | ||
|
||
```typescript | ||
import Onboard from '@web3-onboard/core' | ||
import bitgetWalletModule from '@web3-onboard/bitget' | ||
|
||
const bitgetWallet = bitgetWalletModule() | ||
|
||
const onboard = Onboard({ | ||
// ... other Onboard options | ||
wallets: [ | ||
bitgetWallet() | ||
//... other wallets | ||
] | ||
}) | ||
|
||
const connectedWallets = await onboard.connectWallet() | ||
console.log(connectedWallets) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"name": "@web3-onboard/bitget", | ||
"version": "2.0.0-alpha.1", | ||
"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": [ | ||
"Ethereum", | ||
"Web3", | ||
"EVM", | ||
"dapp", | ||
"Multichain", | ||
"Wallet", | ||
"Transaction", | ||
"Provider", | ||
"Hardware Wallet", | ||
"Notifications", | ||
"React", | ||
"Svelte", | ||
"Vue", | ||
"Next", | ||
"Nuxt", | ||
"MetaMask", | ||
"Coinbase", | ||
"WalletConnect", | ||
"Ledger", | ||
"Trezor", | ||
"Connect Wallet", | ||
"Ethereum Hooks", | ||
"Blocknative", | ||
"Mempool", | ||
"pending", | ||
"confirmed", | ||
"Injected Wallet", | ||
"Crypto", | ||
"Crypto Wallet", | ||
"Enkrypt", | ||
"bitgetWallet" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/blocknative/web3-onboard.git", | ||
"directory": "packages/bitget-wallet" | ||
}, | ||
"homepage": "https://www.blocknative.com/onboard", | ||
"bugs": "https://github.com/blocknative/web3-onboard/issues", | ||
"module": "dist/index.js", | ||
"browser": "dist/index.js", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
"typings": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "tsc", | ||
"dev": "tsc -w", | ||
"type-check": "tsc --noEmit" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/node": "^17.0.21", | ||
"typescript": "^4.5.5" | ||
}, | ||
"dependencies": { | ||
"@bitget-wallet/web3-sdk": "^0.0.6", | ||
"@web3-onboard/common": "^2.3.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import type { WalletInit, EIP1193Provider } from '@web3-onboard/common' | ||
|
||
let bitgetDependencies: any = null | ||
let bitgetAdapter: any = null | ||
|
||
const loadBitgetDependencies = async (getAdapter?: boolean) => { | ||
if (!bitgetDependencies) { | ||
bitgetDependencies = await import('@bitget-wallet/web3-sdk') | ||
} | ||
if (getAdapter && !bitgetAdapter) { | ||
bitgetAdapter = new bitgetDependencies.LegacyEip1193Adapter() | ||
return bitgetAdapter | ||
} | ||
if (getAdapter) { | ||
return bitgetAdapter | ||
} | ||
return bitgetDependencies | ||
} | ||
|
||
function bitget(): WalletInit { | ||
if (typeof window === 'undefined') return () => null | ||
|
||
return () => { | ||
return { | ||
label: 'Bitget', | ||
getIcon: async () => { | ||
const sdkAdapter = await loadBitgetDependencies(true) | ||
return sdkAdapter.getLogo() | ||
}, | ||
getInterface: async () => { | ||
const { | ||
currentProvider, | ||
getIsInstall, | ||
getDownload, | ||
installWalletMessage | ||
} = await loadBitgetDependencies() | ||
|
||
let provider: EIP1193Provider | ||
if (getIsInstall()) { | ||
provider = currentProvider() | ||
} else { | ||
window.open(getDownload(), '_blank') | ||
throw new Error(installWalletMessage) | ||
} | ||
return { provider } | ||
} | ||
} | ||
} | ||
} | ||
|
||
export default bitget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": ["src/**/*"], | ||
|
||
"compilerOptions": { | ||
"outDir": "dist", | ||
"rootDir": "src", | ||
"declaration": true, | ||
"declarationDir": "dist", | ||
"paths": { | ||
"*": ["./src/*", "./node_modules/*"] | ||
}, | ||
"typeRoots": ["node_modules/@types"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# @web3-onboard/bitkeep | ||
|
||
## Wallet module for connecting Bitkeep Wallet through web3-onboard | ||
|
||
Bitkeep 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. | ||
|
||
### Install | ||
|
||
**NPM** | ||
`npm i @web3-onboard/core @web3-onboard/bitkeep` | ||
|
||
**Yarn** | ||
`yarn add @web3-onboard/core @web3-onboard/bitkeep` | ||
|
||
## Usage | ||
|
||
```typescript | ||
import Onboard from '@web3-onboard/core' | ||
import bitkeepModule from '@web3-onboard/bitkeep' | ||
|
||
const bitKeep = bitkeepModule() | ||
|
||
const onboard = Onboard({ | ||
// ... other Onboard options | ||
wallets: [ | ||
bitKeep() | ||
//... other wallets | ||
] | ||
}) | ||
|
||
const connectedWallets = await onboard.connectWallet() | ||
console.log(connectedWallets) | ||
``` |
Oops, something went wrong.