Glittr SDK

The Glittr SDK is a client-side library written in Typescript designed to facilitates interaction with the Glittr protocol, allowing developers to integrate Glittr with their dApps.

By utilizing this library, developers can create contracts, call contracs, and transfer Glittr assets on Bitcoin using the Glittr infrastructure.

Prerequisites:

Installation with npm

npm install @glittr-sdk/sdk

Installation with yarn

yarn add @glittr-sdk/sdk

Usage

Init SDK

Javascript

const { GlittrSDK } = require("@glittr-sdk/sdk");

const NETWORK = "regtest";

const client = new GlittrSDK({
  network: NETWORK,
  electrumApi: "https://devnet-electrum.glittr.fi",
  glittrApi: "https://devnet-core-api.glittr.fi",
  apiKey: "<your-api-key>"
});
console.log(client)

Typescript/ES6

Load Account

Import Bitcoin account using private key hex:

Or using WIF (Wallet Import Format) text

Construct Glittr Transaction

Example Create and Send Glittr Transaction

Freemint Contract Creation

Last updated