Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SLP SDK Maintnet token w/ slp addr

create

(async function() {
  let token = await SLP.TokenType1.create({
    fundingAddress: "simpleledger:qzdypx04slvnajpwefvzfm9ugcj2y365xy9c30058k",
    fundingWif: "L2bQTsVUsKnY7JvRi6myaWPvE8QVhKLwRKAXrSUiHix4CfB6BJEF",
    tokenReceiverAddress:
      "simpleledger:qzdypx04slvnajpwefvzfm9ugcj2y365xy9c30058k",
    batonReceiverAddress:
      "simpleledger:qzdypx04slvnajpwefvzfm9ugcj2y365xy9c30058k",
    bchChangeReceiverAddress:
      "simpleledger:qzdypx04slvnajpwefvzfm9ugcj2y365xy9c30058k",
    decimals: 8,
    name: "SLP SDK Mainnet Token 3",
    symbol: "MAINNET3",
    documentUri: "badger@bitcoin.com",
    documentHash: null,
    initialTokenQty: 10000
  });
  console.log(token);
})();

mint

(async function() {
  let mint = await SLP.TokenType1.mint({
    fundingAddress: "simpleledger:qzdypx04slvnajpwefvzfm9ugcj2y365xy9c30058k",
    fundingWif: "L2bQTsVUsKnY7JvRi6myaWPvE8QVhKLwRKAXrSUiHix4CfB6BJEF",
    tokenReceiverAddress:
      "simpleledger:qzdypx04slvnajpwefvzfm9ugcj2y365xy9c30058k",
    batonReceiverAddress:
      "simpleledger:qzdypx04slvnajpwefvzfm9ugcj2y365xy9c30058k",
    bchChangeReceiverAddress:
      "simpleledger:qzdypx04slvnajpwefvzfm9ugcj2y365xy9c30058k",
    tokenId: "e91f1230fffb8229f2360e227764ca205f3a00194fc844eb18ad0ed9457537f2",
    additionalTokenQty: 2000
  });
  console.log(mint);
})();

send

(async function() {
  let send = await SLP.TokenType1.send({
    fundingAddress: "simpleledger:qzdypx04slvnajpwefvzfm9ugcj2y365xy9c30058k",
    fundingWif: "L2bQTsVUsKnY7JvRi6myaWPvE8QVhKLwRKAXrSUiHix4CfB6BJEF",
    tokenReceiverAddress:
      "simpleledger:qzdrk0mjzfz6nge2xaw65f6604zyk0ev3g2yck72vw",
    bchChangeReceiverAddress:
      "simpleledger:qzdrk0mjzfz6nge2xaw65f6604zyk0ev3g2yck72vw",
    tokenId: "e91f1230fffb8229f2360e227764ca205f3a00194fc844eb18ad0ed9457537f2",
    amount: 5
  });
  console.log(send);
})();

check balance for address

(async () => {
  try {
    let balances = await SLP.Utils.balancesForAddress(
      "simpleledger:qzdrk0mjzfz6nge2xaw65f6604zyk0ev3g2yck72vw"
    );
    console.log(balances);
  } catch (error) {
    console.error(error);
  }
})();

list single token by id

(async () => {
  try {
    let list = await SLP.Utils.list(
      "e91f1230fffb8229f2360e227764ca205f3a00194fc844eb18ad0ed9457537f2"
    );
    console.log(list);
  } catch (error) {
    console.error(error);
  }
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment