mesh-wallet
Original:🇺🇸 English
Translated
Use when integrating Cardano wallets with MeshJS SDK. Covers browser wallet connection (CIP-30) for Eternl, Nami, Lace, Flint, and Yoroi, headless server-side wallets from mnemonic or private keys, transaction signing, CIP-8 data signing for authentication, multi-signature workflows, and React wallet integration patterns.
2installs
Sourcemeshjs/skills
Added on
NPX Install
npx skill4agent add meshjs/skills mesh-walletTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Mesh SDK Wallet Skill
AI-assisted Cardano wallet integration using .
@meshsdk/walletPackage Info
bash
npm install @meshsdk/wallet
# or
npm install @meshsdk/core # includes wallet + transaction + providerTwo Wallet Types
| Type | Class | Use Case |
|---|---|---|
| Browser | | Web apps - connect to Eternl, Nami, Flint, etc. |
| Headless | | Server-side, CLI, backend - from mnemonic/keys |
Quick Reference
Browser Wallet (CIP-30)
typescript
import { MeshCardanoBrowserWallet } from '@meshsdk/wallet';
// List installed wallets
const wallets = MeshCardanoBrowserWallet.getInstalledWallets();
// → [{ id: 'eternl', name: 'Eternl', icon: '...', version: '...' }, ...]
// Connect to wallet
const wallet = await MeshCardanoBrowserWallet.enable('eternl');
// Get addresses (Bech32)
const addresses = await wallet.getUsedAddressesBech32();
const changeAddr = await wallet.getChangeAddressBech32();
const stakeAddrs = await wallet.getRewardAddressesBech32();
// Get UTxOs and balance (Mesh format)
const utxos = await wallet.getUtxosMesh();
const balance = await wallet.getBalanceMesh();
const collateral = await wallet.getCollateralMesh();
// Sign and submit
const signedTx = await wallet.signTxReturnFullTx(unsignedTxHex);
const txHash = await wallet.submitTx(signedTx);
// Sign data (CIP-8)
const signature = await wallet.signData(address, 'Hello Cardano!');Headless Wallet (Server-Side)
typescript
import { MeshCardanoHeadlessWallet } from '@meshsdk/wallet';
import { BlockfrostProvider } from '@meshsdk/core';
const provider = new BlockfrostProvider('your-api-key');
// From mnemonic
const wallet = await MeshCardanoHeadlessWallet.fromMnemonic({
mnemonic: ['word1', 'word2', ...], // 24 words
networkId: 0, // 0 = testnet, 1 = mainnet
walletAddressType: 'Base', // 'Base' or 'Enterprise'
fetcher: provider,
submitter: provider,
});
// Same API as browser wallet
const address = await wallet.getChangeAddressBech32();
const utxos = await wallet.getUtxosMesh();
const signedTx = await wallet.signTxReturnFullTx(unsignedTxHex);Files
- WALLET.md - Complete API reference
- PATTERNS.md - Common wallet patterns
- TROUBLESHOOTING.md - Error solutions
CIP-30 Methods
Standard wallet interface methods:
| Method | Returns | Description |
|---|---|---|
| | 0 = testnet, 1 = mainnet |
| | UTxOs in CBOR hex |
| | Collateral UTxOs in CBOR hex |
| | Balance in CBOR hex |
| | Addresses in hex |
| | Addresses in hex |
| | Address in hex |
| | Stake addresses in hex |
| | Witness set in CBOR hex |
| | CIP-8 signature |
| | Transaction hash |
Mesh Extensions
Enhanced methods for better developer experience:
| Method | Returns | Description |
|---|---|---|
| | UTxOs in Mesh format |
| | Collateral in Mesh format |
| | Balance in Mesh format |
| | Bech32 addresses |
| | Bech32 addresses |
| | Bech32 address |
| | Bech32 stake addresses |
| | Full signed tx (not just witness) |
Important Notes
- Browser wallet requires user interaction - prompts the user
enable() - Headless wallet needs fetcher - For UTxO queries and signing
- Network ID matters - 0 for testnet/preprod, 1 for mainnet
- Collateral is auto-selected - Returns smallest pure-ADA UTxO >= 5 ADA