https://github.com/jccdex/jcc-call-utils
Toolkit of crossing chain from Call chain to SWTC chain
https://github.com/jccdex/jcc-call-utils
blockchain call-chain cross-chain jccdex swtc-chain
Last synced: 2 months ago
JSON representation
Toolkit of crossing chain from Call chain to SWTC chain
- Host: GitHub
- URL: https://github.com/jccdex/jcc-call-utils
- Owner: JCCDex
- License: apache-2.0
- Created: 2019-05-31T03:47:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T06:37:01.000Z (over 2 years ago)
- Last Synced: 2025-03-21T10:02:15.764Z (3 months ago)
- Topics: blockchain, call-chain, cross-chain, jccdex, swtc-chain
- Language: JavaScript
- Size: 3.24 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jcc-call-utils
Toolkit of crossing chain from [Call](http://www.callchain.live/) to [SWTC chain](http://www.swtc.top/#/)

[](https://travis-ci.com/JCCDex/jcc-call-utils)
[](https://coveralls.io/github/JCCDex/jcc-call-utils?branch=master)
[](https://david-dm.org/JCCDex/jcc-call-utils)
[](http://npm-stat.com/charts.html?package=jcc-call-utils)
[](http://makeapullrequest.com)## Description
Transfer token automatically from [Call](http://www.callchain.live/) to [SWTC](http://www.swtc.top/#/) chain. Support CALL token.
e.g. you transfer 1 `CALL` to [Call Fingate](http://block.callchain.live/#/account/cs9AWskwRmJrcMsszqC4hWeedCL5vSpexv) from your call address if success, the contract will automatically transfer 1 `JCALL` to your swtc address from [Jingtum Fingate](https://explorec9d536e.jccdex.cn/#/wallet/?wallet=jMCJrXRmycsT5tsVuge7Y65v9MrQi9r11E) in a few minutes.
## Installtion
```shell
npm install jcc-call-utils
```## CDN
`jcc_call_utils` as a global variable.
```javascript
```
## Usage
```javascript
// demo
import CallFingate from "jcc-call-utils";// websocket server
const server = "";const instance = new CallFingate(server);
const testSecret = "shaXxkbcS8NoHrL1TzTfWBRCbsD2K";
const testAddress = "c3oPNfL3k3EUTBQMFQ2LTZM5W5TUM7Qq5N";
// Don't change it. The fingate address is it for now.
const destination = "cs9AWskwRmJrcMsszqC4hWeedCL5vSpexv";const testMemo = {
jtaddress: "jpgWGpfHz8GxqUjz5nb6ej8eZJQtiF6KhH"
}const amount = "1";
try {
// transfer 1 CALL
await instance.connect();
const hash = await inst.transfer(testSecret, destination, amount, testMemo);
console.log(hash);
} catch (error) {
console.log(error);
} finally {
instance.disconnect();
}
```## API
see [API.md](https://github.com/JCCDex/jcc-call-utils/blob/master/docs/API.md)