Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
leightkt authored Aug 9, 2023
2 parents dcafcb9 + cf2e5f7 commit d4673c4
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 35 deletions.
27 changes: 7 additions & 20 deletions docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ Web3-Onboard is the quickest and easiest way to add multi-wallet and multi-chain

- **Minimal Dependencies:** All wallet dependencies are included in separate packages, so you only include the ones you want to use in your app.

- **Multiple Wallets and Accounts Connection, Multichain Support:** Allow your users to connect multiple wallets and multiple accounts within each wallet at the same time to your app. Let users switch between chains/networks with ease. ALL EVM networks supported.
- **Multi Wallet and Multi Chain Support:** Allow your users to connect multiple wallets and multiple accounts within each wallet at the same time to your app. Let users switch between chains/networks with ease. ALL EVM networks supported.

- **Account Center:** An interface to manage wallet connections and networks, with a minimal version for mobile.

- **Themable:** Powerful customization options for all your needs. Style Web3 Onboard to fit into your existing designs, or pick from our pre-made themes.

- **Unified Provider Interface:** All wallet modules expose a provider that is patched to be compliant with the EIP-1193, EIP-1102, EIP-3085 and EIP-3326 specifications. Whether your user is using Ledger or Metamask the provider will operate identically.

- **Dynamic Imports:** Supporting multiple wallets in your app requires a lot of dependencies. Onboard dynamically imports a wallet
and its dependencies only when the user selects it, so that minimal bandwidth is used.
- **Dynamic Imports:** Supporting multiple wallets in your app requires a lot of dependencies. Onboard dynamically imports a wallet and its dependencies only when the user selects it, so that minimal bandwidth is used.

- **Framework Agnostic:** Avoid framework lock in -- Web3-Onboard works with any framework and includes helper packages for vue & react.

- **Account Center:** An interface to manage wallet connections and networks, with a minimal version for mobile

- **Notify:** Real-time transaction notifications for all transaction states for the connected wallet address(es). In-notification speedups & cancels for hardware wallet connections.

### Supported Networks
Expand Down Expand Up @@ -145,28 +146,14 @@ if (wallets[0]) {

## Wallet Modules

Add other wallet modules such as Wallet Connect or Ledger to increase the support and functionality of your web3-onboard implementation. All modules are listed below and can be accessed through the subpages of web3-onboard docs on the left.
Add other wallet modules such as Wallet Connect or Ledger to increase the support and functionality of your web3-onboard implementation. All modules can be accessed through the subpages of web3-onboard docs on the left.

We recommend you add the [Core Repo](../../modules/core.md#install) and consider adding the [Injected Wallets](../../wallets/injected.md#install) module to get connected with wallets like Metamask, Trust, Coinbase Wallet & more right away.

[**Core Repo**](../../modules/core.md#install)

[**Injected Wallets**](../../wallets/injected.md#install)

**SDK Wallets**

- [Arcana Auth](../../wallets/arcana.md#install)
- [Blocto](../../docs/wallets/blocto.md#install)
- [Coinbase](../../wallets/coinbase.md#install)
- [Fortmatic](../../wallets/fortmatic.md#install)
- [Frame](../../wallets/frame.md#install)
- [Gnosis](../../wallets/gnosis.md#install)
- [Magic](../../wallets/magic.md#login-options)
- [MEW](../../wallets/mewwallet.md#install)
- [Portis](../../wallets/portis.md#install)
- [Web3Auth](../../wallets/web3auth.md#install)
- [WalletConnect](../../wallets/walletconnect.md#install)

**Hardware Wallets**

- [D'cent](../../wallets/dcent.md#install)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ const injected = injectedModule({
- OneKey - _Desktop & Mobile_
- Fordefi - _Desktop_
- Ronin Wallet - _Desktop & Mobile_
- Coin98 Wallet - _Desktop & Mobile_

## Build Environments

Expand Down
2 changes: 1 addition & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@web3-onboard/gas": "^2.1.7",
"@web3-onboard/gnosis": "^2.1.9",
"@web3-onboard/infinity-wallet": "^2.0.3",
"@web3-onboard/injected-wallets": "^2.10.4",
"@web3-onboard/injected-wallets": "^2.10.5-alpha.1",
"@web3-onboard/keepkey": "^2.3.7",
"@web3-onboard/keystone": "^2.3.7",
"@web3-onboard/ledger": "^2.5.2",
Expand Down
1 change: 1 addition & 0 deletions packages/injected/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ console.log(connectedWallets)
- BifrostWallet - _Desktop & Mobile_
- Safeheron - _Desktop_
- Talisman - _Desktop_
- Coin98 Wallet - _Desktop & Mobile_

## Filtering Wallets

Expand Down
5 changes: 3 additions & 2 deletions packages/injected/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/injected-wallets",
"version": "2.10.4",
"version": "2.10.5-alpha.1",
"description": "Injected wallet module for connecting browser extension and mobile wallets to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised 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",
Expand Down Expand Up @@ -33,7 +33,8 @@
"GameStop",
"Phantom",
"DeFi Wallet",
"Fordefi"
"Fordefi",
"Coin98 Wallet"
],
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion packages/injected/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ export const WALLET_NAMES: { [key: string]: string } = {
talismanEth: 'Talisman',
onekey: 'OneKey',
fordefi: 'Fordefi',
roninWallet: 'Ronin Wallet'
roninWallet: 'Ronin Wallet',
coin98wallet:'Coin98 Wallet'
}
1 change: 1 addition & 0 deletions packages/injected/src/icons/coin98wallet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default `<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 70.074 70.089"><defs><linearGradient id="New_Gradient_Swatch_1" x1="66.493" y1="3.581" x2="4.549" y2="65.525" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f1d961"/><stop offset="1" stop-color="#cda146"/></linearGradient></defs><title>Coin98</title><rect x="0.009" y="0.009" width="70.056" height="70.056" rx="12.791" fill="url(#New_Gradient_Swatch_1)"/><path d="M23.594,17.5a10.941,10.941,0,1,0,10.95,10.95A10.956,10.956,0,0,0,23.594,17.5Zm0,17.4a6.456,6.456,0,1,1,6.456-6.455A6.477,6.477,0,0,1,23.594,34.9ZM55.848,26.86a9.21,9.21,0,0,1-1.15,4.477,12.567,12.567,0,0,0-3.928-2.165,4.93,4.93,0,0,0,.584-2.312,4.871,4.871,0,0,0-9.742,0,4.726,4.726,0,0,0,.584,2.312,12.583,12.583,0,0,0-3.929,2.165A9.349,9.349,0,0,1,46.486,17.5,9.372,9.372,0,0,1,55.848,26.86Zm-9.362,3.788A10.941,10.941,0,1,0,57.418,41.6,10.963,10.963,0,0,0,46.486,30.648Zm0,17.388A6.447,6.447,0,1,1,52.941,41.6,6.455,6.455,0,0,1,46.486,48.036Zm-13.53-4.868a9.365,9.365,0,0,1-18.73,0H18.72a4.871,4.871,0,1,0,9.742,0Z" fill="#252525"/></svg>`
27 changes: 17 additions & 10 deletions packages/injected/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,22 @@ export enum ProviderIdentityFlag {
Safeheron = 'isSafeheron',
Talisman = 'isTalisman',
OneKey = 'isOneKey',
Fordefi = 'isFordefi'
Fordefi = 'isFordefi',
Coin98Wallet = 'isCoin98'
}


/**
* The ProviderExternalUrl enum represents the external URLs associated
* with different injected providers. It is used to direct end users who
* do not have a wallet installed to the corresponding wallet installation page.
* For this to be displayed a dapp must set `displayUnavailable`
* to an array (to specify displayed unavailable wallets) or
* For this to be displayed a dapp must set `displayUnavailable`
* to an array (to specify displayed unavailable wallets) or
* true (to display all unavailable wallets) and a user select that wallet.
*/
export enum ProviderExternalUrl {
Binance = 'https://www.bnbchain.org/ru/blog/binance-extension-wallet/',
BitKeep = 'https://bitkeep.com/en/download?type=0',
BitKeep = 'https://bitkeep.com/en/download?type=0',
Coinbase = 'https://www.coinbase.com/wallet/downloads',
MetaMask = 'https://metamask.io/download/',
OKXWallet = 'https://okx.com/download',
Expand All @@ -87,6 +88,7 @@ export enum ProviderExternalUrl {
Trust = 'https://trustwallet.com/download/',
OneKey = 'https://onekey.so/download/',
RoninWallet = 'https://wallet.skymavis.com/',
Coin98Wallet = 'https://coin98.com/wallet/'
}

export enum ProviderLabel {
Expand Down Expand Up @@ -142,7 +144,8 @@ export enum ProviderLabel {
Talisman = 'Talisman',
OneKey = 'OneKey',
Fordefi = 'Fordefi',
RoninWallet = 'Ronin Wallet'
RoninWallet = 'Ronin Wallet',
Coin98Wallet = 'Coin98 Wallet'
}

export interface MeetOneProvider extends ExternalProvider {
Expand Down Expand Up @@ -176,7 +179,8 @@ export enum InjectedNameSpace {
Safeheron = 'safeheron',
Talisman = 'talismanEth',
OneKey = '$onekey',
RoninWallet = 'ronin'
RoninWallet = 'ronin',
Coin98Wallet = 'coin98'
}

export interface CustomWindow extends Window {
Expand Down Expand Up @@ -219,6 +223,9 @@ export interface CustomWindow extends Window {
ronin: {
provider: InjectedProvider
}
coin98: {
provider: InjectedProvider
}
}

export type InjectedProvider = ExternalProvider &
Expand Down Expand Up @@ -246,7 +253,7 @@ export interface InjectedWalletOptions {
* are not currently available to the end user.
* If set to an array of ProviderLabel.walletLabel
* those wallets will be the only unavailable injected wallets shown
* For example [ProviderLabel.MetaMask, ProviderLabel.Trust]
* For example [ProviderLabel.MetaMask, ProviderLabel.Trust]
*/
displayUnavailable?: boolean | string[]
/**A function that allows for customizing the message to be displayed if the wallet
Expand All @@ -261,9 +268,9 @@ export interface InjectedWalletModule extends WalletModule {
injectedNamespace: InjectedNameSpace
checkProviderIdentity: (helpers: { provider: any; device: Device }) => boolean
platforms: Platform[]
/**
* A Url to link users to a download page for the wallet
/**
* A Url to link users to a download page for the wallet
* to be shown if not installed or available on the browser
*/
*/
externalUrl?: string
}
32 changes: 31 additions & 1 deletion packages/injected/src/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,35 @@ const fordefi: InjectedWalletModule = {
platforms: ['desktop']
}

const coin98wallet: InjectedWalletModule = {
label: ProviderLabel.Coin98Wallet,
injectedNamespace: InjectedNameSpace.Ethereum,
checkProviderIdentity: ({ provider }) =>
!!provider && !!provider[ProviderIdentityFlag.Coin98Wallet],
getIcon: async () => (await import('./icons/coin98wallet.js')).default,
getInterface: async () => {
const ethereumInjectionExists = window.hasOwnProperty(
InjectedNameSpace.Ethereum
)

let provider: EIP1193Provider

// check if coin98 is injected into window.ethereum
if (ethereumInjectionExists && window[InjectedNameSpace.Ethereum].isCoin98) {
provider = window[InjectedNameSpace.Ethereum]
} else {
// directly use the window.coin98 injection
provider = window[InjectedNameSpace.Coin98Wallet].provider
}

return {
provider
}
},
platforms: ['all'],
externalUrl: ProviderExternalUrl.Coin98Wallet
}

const wallets = [
zeal,
exodus,
Expand Down Expand Up @@ -876,7 +905,8 @@ const wallets = [
talisman,
onekey,
fordefi,
ronin
ronin,
coin98wallet
]

export default wallets

0 comments on commit d4673c4

Please sign in to comment.