npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jcc_exchange

v3.2.0

Published

api of jcc exchange

Downloads

49

Readme

jcc_exchange

npm Build Status Coverage Status npm downloads

preface

jcc_exchange 可以提交订单和转账两种交易,而且都是在本地签名后发送到井通节点。自动管理 sequence 以提高交易频率。 如果 sequence 失效,支持重试机制(默认 3 次)。

jcc_exchange is toolkit to submit order/payment transaction to Jingtum node after local signature. Automatically manage sequence to increase transaction frequency. If sequence is ineffective, retry again (default thrice).

  • 支持浏览器 Support running in browsers

井畅应用交流群: 557524730

JCCDex Tech support QQ group ID: 557524730

Installtion

npm install jcc_exchange

Usage

Since v3.0.0, the transaction is submitted to chain node, see v3.0.0.

Breaking changes since v2.0.0, if you used v1.0.9 see v1.0.9.


(async () => {
    const JCCExchange = require('jcc_exchange').JCCExchange;
    // set chain config

    // default support jingtum chain
    // JCCExchange.setDefaultChain("jingtum");

    // support bizain chain
    // JCCExchange.setDefaultChain("bizain");

    // support seaaps chain
    // JCCExchange.setDefaultChain("seaaps");

    // example urls
    const urls = ["http://localhost"];

    const retry = 3; // default value

    // init value of urls & retry
    JCCExchange.init(urls, retry);

    // create an order
    // buy 1 jcc with 1 swt
    const address = "";
    const secret = "";
    const amount = "1";
    const base = "jjcc";
    const counter = "swt";
    const sum = "1";
    const type = "buy"; // if sell 1 jjcc with 1 swt, the value of type is "sell"
    const platform = ""; // swtc address for service charge
    const issuer = "jGa9J9TkqtBcUoHe2zqhVFFbgUVED6o9or"; // the default value is "jGa9J9TkqtBcUoHe2zqhVFFbgUVED6o9or"
    try {
        const hash = await JCCExchange.createOrder(address, secret, amount, base, counter, sum, type, platform, issuer);
        console.log(hash);
    } catch (error) {
        console.log(error);
    }

    // cancel an order
    const address = "";
    const secret = "";
    const orderSequence = 0;
    try {
        const hash = await JCCExchange.cancelOrder(address, secret, orderSequence);
        console.log(hash);
    } catch (error) {
        console.log(error);
    }

    // transfer token
    // transfer 1 jjcc to "jKTtq57iqHoHg3cP7Rryzug9Q2puLX1kHh" from "jpgWGpfHz8GxqUjz5nb6ej8eZJQtiF6KhH"
    const address = "jpgWGpfHz8GxqUjz5nb6ej8eZJQtiF6KhH";
    const secret = "";
    const amount = "1";
    const memo = "test";
    const to = "jKTtq57iqHoHg3cP7Rryzug9Q2puLX1kHh";
    const token = "jjcc";
    const issuer; // the default value is "jGa9J9TkqtBcUoHe2zqhVFFbgUVED6o9or"
    try {
        const hash = await JCCExchange.transfer(address, secret, amount, memo, to, token, issuer);
        console.log(hash);
    } catch (error) {
        console.log(error);
    }
})();