You need to update the wallet adapters with one of the following commands:
npm install @solana/wallet-adapter-wallets@latest
or
yarn add @solana/wallet-adapter-wallets@latest
You just need to update the wallet adapters and you're ready.
After you updated the wallet adapters you can remove the Solflare Web adapter.
Remove the web adapter (if used) and update the wallet adapters.
Follow this to add the new Solflare adapter: https://github.com/solana-labs/wallet-adapter
In most cases you just need to import SolflareWalletAdapter
and add this to the list of adapters:
new SolflareWalletAdapter({ network })
Install the Solflare SDK with one of the following commands:
npm install @solflare-wallet/sdk
or
yarn add @solflare-wallet/sdk
You can use the same implementation with some small changes:
Replace
import Wallet from '@project-serum/sol-wallet-adapter';
with
import Solflare from '@solflare-wallet/sdk';
Replace
const wallet = new Wallet(providerUrl);
with
const wallet = new Solflare({ network: 'mainnet-beta' });
You can also use devnet
or testnet
for the network.
You can see the JavaScript interface on https://www.npmjs.com/package/@solflare-wallet/sdk
You can also see an example implementation on Mango: blockworks-foundation/mango-ui-v3#146
You can use the same implementation with some small changes:
Import the SDK:
import Solflare from '@solflare-wallet/sdk';
Create a new instance of Solflare:
const solflare = new Solflare({ network: 'mainnet-beta' });
Instead of window.solana
use the new solflare
object.
For example instead of
await window.solana.connect()
use
await solflare.connect()
To implement the Solflare SDK check the example code on https://www.npmjs.com/package/@solflare-wallet/sdk