1.0.16 • Published 5 months ago

@mintlayer/sdk v1.0.16

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

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/sdk

or with yarn:

yarn add @mintlayer/sdk

Usage

1. Connect to wallet

import { Client } from '@mintlayer/sdk';

const client = new Client();
await client.connect(); // Opens wallet connection prompt

2. 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

  • Transfer
  • BurnToken
  • IssueFungibleToken
  • IssueNft
  • MintToken
  • UnmintToken
  • LockTokenSupply
  • ChangeMetadataUri
  • ChangeTokenAuthority
  • FreezeToken
  • UnfreezeToken
  • DataDeposit
  • CreateDelegationId
  • DelegationStake
  • DelegationWithdraw
  • CreateOrder
  • ConcludeOrder
  • FillOrder

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.

1.0.16

5 months ago

1.0.15

5 months ago

1.0.14

5 months ago

1.0.13

5 months ago

1.0.12

5 months ago

1.0.11

5 months ago

1.0.10

6 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago