1.0.16 • Published 5 months ago
@mintlayer/sdk v1.0.16
Mintlayer Connect SDK
A lightweight JavaScript/TypeScript SDK to connect your dApp to the Mintlayer blockchain. It allows you to build and request to sign transactions using a compatible wallet like Mojito.
Features
- 🔐 Secure connection to Mintlayer wallets
- 📦 Transaction builder for all major transaction types
- 🧮 Type-safe interfaces (TypeScript support)
- 🔄 UTXO-based transaction handling
- 🪙 Token minting, burning, and NFT issuance
Installation
npm install @mintlayer/sdkor with yarn:
yarn add @mintlayer/sdkUsage
1. Connect to wallet
import { Client } from '@mintlayer/sdk';
const client = new Client();
await client.connect(); // Opens wallet connection prompt2. Send Transfer
await client.transfer({
to: 'tmt1qxyz...', // recipient address
amount: 10, // in human-readable units
token_id: 'tmltk1...', // optional, omit for base coin
});3. Build transaction manually
const tx = await client.buildTransaction({
type: 'BurnToken',
params: {
amount: 10,
token_id: 'tmltk1...',
token_details: {
authority: 'tmt1q...',
number_of_decimals: 8,
// ... other metadata
},
},
});4. Sign transaction
TODO
Supported transaction types
TransferBurnTokenIssueFungibleTokenIssueNftMintTokenUnmintTokenLockTokenSupplyChangeMetadataUriChangeTokenAuthorityFreezeTokenUnfreezeTokenDataDepositCreateDelegationIdDelegationStakeDelegationWithdrawCreateOrderConcludeOrderFillOrder
Development & Testing
- Clone the repo and run
npm install - More tests coming soon (Jest + mocks)
- Contributions welcome!
Security
All sensitive actions (signing, wallet access) require user approval via the wallet. Private keys are never exposed.
License
MIT
Need help?
Join the community or open an issue on GitHub.