Wallet Standard
How Morsel registers with the Wallet Standard, the features it supports, and how to pick the right chain for Cookie Chain and Solana.
Morsel registers itself with the Wallet Standard in the Chrome extension and in the Morsel app's browser. Libraries that discover Wallet Standard wallets, such as @solana/wallet-adapter and @wallet-standard/app, list it automatically.
Registration
| Field | Value |
|---|---|
name | Morsel |
version | 1.0.0 |
icon | The Morsel mark, as a data URI |
chains | Solana mainnet, devnet and testnet, plus Cookie Chain |
Features
| Feature | Notes |
|---|---|
standard:connect | Supports silent: true for sites the user already approved. |
standard:disconnect | |
standard:events | change events for accounts. |
solana:signTransaction | Legacy and version 0 transactions. |
solana:signAndSendTransaction | Legacy and version 0. Always pass a chain. |
solana:signMessage | Shows the text to the user. |
solana:signIn | Sign in with Solana. Also exposed as experimental:signIn. |
Find Morsel
import { getWallets } from '@wallet-standard/app';
const morsel = getWallets()
.get()
.find((wallet) => wallet.name === 'Morsel');Choose the chain
Read chain identifiers from the wallet instead of hard-coding them. Solana uses the standard solana:mainnet. Cookie Chain has its own identifier in the same list.
const solana = morsel.chains.find((c) => c === 'solana:mainnet');
const cookie = morsel.chains.find((c) => !c.startsWith('solana:'));
const [{ signature }] = await morsel.features['solana:signAndSendTransaction'].signAndSendTransaction({
account: morsel.accounts[0],
chain: cookie, // or solana
transaction: serializedTransaction,
});Morsel also checks for itself which network a transaction was built for before showing it to the user, and sends it there.
Sign in with Solana
const [result] = await morsel.features['solana:signIn'].signIn({
domain: window.location.host,
statement: 'Sign in to MyDapp',
});Morsel shows Matches this site when domain is the site making the request. A sign-in for another domain asks the user to confirm they trust it. An expired sign-in, or one naming a different address, can't be signed.