JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 58
  • Score
    100M100P100Q59372F
  • License MIT

jingtum lib

Package Exports

  • @jccdex/jingtum-lib
  • @jccdex/jingtum-lib/lib/fetch
  • @jccdex/jingtum-lib/lib/fetch.js
  • @jccdex/jingtum-lib/lib/index.js
  • @jccdex/jingtum-lib/lib/tx
  • @jccdex/jingtum-lib/lib/tx.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jccdex/jingtum-lib) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jcc-jingtum-lib

Installtion

npm install @jccdex/jingtum-lib

Example

import { Transaction } from "@jccdex/jingtum-lib";

// create new tx object by chainid, nodes, retry times
let tx = new Transaction("jingtum", ["https://xxx.xxx.xxx.xxx"], 0);

// set token issuer
const hash1 = await tx.setTokenIssue(
  issuerAdminAddress,
  issuerAdminSecret,
  publisherAddress,
  amount,
  nftTokenName,
  transferSetFlag /**  default set 0, other means owner can not transfer to other */
);

// publisher mint 721 token
const hash2 = await tx.publish721(publisherAddress, publisherSecret, reciverAddress, tokenName, tokenId, tokenInfos);
// tokenInfos is json array like [{type: "uri", data: "https://xxx"}, {type: "color", data: "red"}]

// transfer 721
const hash3 = await tx.transfer721(senderAddress, senderSecret, reciverAddress, tokenId);

// delete 721
const hash4 = await tx.delete721(publisherAddress, publisherSecret, tokenId);

// request token info
const info = await tx.requestTokenInfo("https://xxx.xxx", tokenId);

// request token in account
const result = await tx.requestAccountToken("https://xxx.xxx", address);