Skip to content

Commit

Permalink
Deprecate wallet adapters (#13359)
Browse files Browse the repository at this point in the history
## Description 

This deprecates all wallet adapters, in favor of the wallet standard
being _the_ way to interact with wallets. Wallets that do not conform to
the standard are expected to bridge to it, instead of the current
approach of using adapters to adapt over wallets. This dramatically
simplifies a lot of logic, should be considerably less error-prone,
makes it easier to extend functionality in a consistent way (using the
standard instead of adapters), removes several packages, etc.

## Test Plan 

How did you test the new or updated feature?

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
Jordan-Mysten authored Aug 14, 2023
1 parent 8b7b85e commit 85f785c
Show file tree
Hide file tree
Showing 42 changed files with 283 additions and 2,975 deletions.
7 changes: 7 additions & 0 deletions .changeset/smart-flies-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@mysten/wallet-kit-core': minor
'@mysten/wallet-standard': minor
'@mysten/wallet-kit': minor
---

Rebuild wallet kit and wallet standard to no longer use wallet adapters.
13 changes: 4 additions & 9 deletions apps/explorer/src/components/validator/StakeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@

import { useFeatureIsOn } from '@growthbook/growthbook-react';
import { Button } from '@mysten/ui';
import {
ConnectButton,
useWalletKit,
type StandardWalletAdapter,
type WalletWithFeatures,
} from '@mysten/wallet-kit';
import { ConnectButton, useWalletKit, type WalletWithFeatures } from '@mysten/wallet-kit';
import { useParams } from 'react-router-dom';

// This is a custom feature supported by the Sui Wallet:
Expand Down Expand Up @@ -82,9 +77,9 @@ export function StakeButton() {
<Button
size="lg"
onClick={() => {
((currentWallet as StandardWalletAdapter).wallet as StakeWallet).features[
'suiWallet:stake'
]?.stake({ validatorAddress: id! });
(currentWallet as StakeWallet).features['suiWallet:stake']?.stake({
validatorAddress: id!,
});
}}
>
Stake SUI
Expand Down
170 changes: 2 additions & 168 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions sdk/wallet-adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ Sui Wallet Adapter is a set of libraries that makes it easy to connect your dApp

We recommend using [Sui Wallet Kit](./wallet-kit/README.md) for connecting to wallets from React
applications.

If you're not using React, you can use the underlying [wallet adapter packages](./adapters/) to
determine which wallets are currently available in the dApp, and interact with the wallets.
2 changes: 0 additions & 2 deletions sdk/wallet-adapter/adapters/all-wallets/.prettierignore

This file was deleted.

Loading

5 comments on commit 85f785c

@vercel
Copy link

@vercel vercel bot commented on 85f785c Aug 14, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

sui-kiosk – ./dapps/kiosk

sui-kiosk.vercel.app
sui-kiosk-mysten-labs.vercel.app
sui-kiosk-git-main-mysten-labs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 85f785c Aug 14, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 85f785c Aug 14, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

sui-typescript-docs – ./sdk/docs

sui-typescript-docs-git-main-mysten-labs.vercel.app
sui-typescript-docs-mysten-labs.vercel.app
sui-typescript-docs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 85f785c Aug 14, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

sui-wallet-kit – ./sdk/wallet-adapter/site

sui-wallet-kit.vercel.app
sui-wallet-kit-git-main-mysten-labs.vercel.app
sui-wallet-kit-mysten-labs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 85f785c Aug 14, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.