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

2.0.1-alpha.1 : Capsule - logout on disconnect #2018

Merged
merged 10 commits into from
Dec 7, 2023
Merged
2 changes: 1 addition & 1 deletion packages/capsule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/capsule",
"version": "2.0.0",
"version": "2.0.1",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"version": "2.0.1",
"version": "2.0.1-alpha.1",

Copy link
Contributor

Choose a reason for hiding this comment

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

Resolved

"description": "Capsule SDK wallet module for connecting 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.",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand Down
6 changes: 4 additions & 2 deletions packages/capsule/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AppMetadata, WalletInit } from '@web3-onboard/common'
import type { AppMetadata, EIP1193Provider, WalletInit } from '@web3-onboard/common'
import type { CapsuleInitOptions } from './types'
import type { Chain } from '@wagmi/chains'
import type { Chain as BlocknativeChain } from '@web3-onboard/common'
Expand Down Expand Up @@ -89,7 +89,9 @@ function capsule(options: CapsuleInitOptions): WalletInit {
chainsMap
)
}
const provider = new CapsuleEIP1193Provider(providerOpts)
const provider: EIP1193Provider = new CapsuleEIP1193Provider(providerOpts)

provider.disconnect = () => { capsule.logout(); };

return {
instance: capsule,
Expand Down