Tokenize anything

SLP SDK

Secure Tokens on Bitcoin Cash

INSTALL VIA NPM

npm install slp-sdk --global

Simple Ledger Protocol

SLP SDK is a fully featured javascript framework powered by BITBOX. Everything you need to easily issue, spend or trade your own token.

Simple Ledger Protocol is simple, robust and extensible. All transactions are 100% on the blockchain for full auditability by any party. The first and currently only BCH token system to support light wallets. You can use multi signature addresses and other Bitcoin script features with SLP tokens.

List

List all tokens


  (async () => {
    try {
      let list = await SLP.Utils.list();
      console.log(list);
    } catch (error) {
      console.error(error);
    }
  })();
  // returns
  [ { id: '545cba6f72a08cbcb08c7d4e8166267942e8cb9a611328805c62fa538e861ba4',
   timestamp: '2018-08-14 13:42',
   symbol: '',
   name: '',
   document: '' },
  { id: '83bfe019fcf976142c55e7c0ad4a429f4be1bc2cb138bd8d0bab8dd4cd4758c4',
   timestamp: '2018-08-14 13:57',
   symbol: '',
   name: '',
   document: '' },
  { id: '323a1e35ae0b356316093d20f2d9fbc995d19314b5c0148b78dc8d9c0dab9d35',
   timestamp: '2018-08-14 17:53',
   symbol: '',
   name: '',
   document: ' } ]
   

List single token by id


 (async () => {
    try {
      let list = await SLP.Utils.list(
        "323a1e35ae0b356316093d20f2d9fbc995d19314b5c0148b78dc8d9c0dab9d35"
      );
      console.log(list);
    } catch (error) {
      console.error(error);
    }
  })();

  // returns
  { id: '323a1e35ae0b356316093d20f2d9fbc995d19314b5c0148b78dc8d9c0dab9d35',
    timestamp: '2018-08-14 17:53',
    symbol: '',
    name: '',
    document: '' }
   

Conversion

Convert cashAddr or legacyAddr to slpAddr


SLP.Utils.toSLPAddress(
  "bitcoincash:qrxwdlhfx5f4xsfnl0g887e5ccs5puy8sgj0z0md6k"
);
// "simpleledger:qrxwdlhfx5f4xsfnl0g887e5ccs5puy8sg75f5wdyg"

SLP.Conversion.toSLPAddress("1KgRZzxLUvZqL8EuufmdxqSjh3tgURwD6d");
//"simpleledger:qrxwdlhfx5f4xsfnl0g887e5ccs5puy8sg75f5wdyg"

Convert slpAddr or legacyAddr to cashAddr


SLP.Utils.toCashAddress(
  "simpleledger:qrxwdlhfx5f4xsfnl0g887e5ccs5puy8sg75f5wdyg"
);
// 'bitcoincash:qrxwdlhfx5f4xsfnl0g887e5ccs5puy8sgj0z0md6k'

SLP.Conversion.toCashAddress("1KgRZzxLUvZqL8EuufmdxqSjh3tgURwD6d");
// 'bitcoincash:qrxwdlhfx5f4xsfnl0g887e5ccs5puy8sgj0z0md6k'

Convert cashAddr or legacyAddr to legacyAddr


SLP.Utils.toLegacyAddress(
  "simpleledger:qrxwdlhfx5f4xsfnl0g887e5ccs5puy8sg75f5wdyg"
);
//'1KgRZzxLUvZqL8EuufmdxqSjh3tgURwD6d'

SLP.Conversion.toLegacyAddress(
  "bitcoincash:qrxwdlhfx5f4xsfnl0g887e5ccs5puy8sgj0z0md6k"
);
// "1KgRZzxLUvZqL8EuufmdxqSjh3tgURwD6d"

Built-in console

Custom REPL with the full BITBOX and Bitcoin Cash JSON RPC API built in. Test your ideas quickly with no overhead.

100% Documented

Every method, argument, data type and return value is documented in great detail.

REST integration

SLP SDK is coupled to REST with no further setup.

Share on...