Toolkit of crossing chain from Call to SWTC chain
Transfer token automatically from Call to SWTC chain. Support CALL token.
e.g. you transfer 1 CALL
to Call Fingate from your call address if success, the contract will automatically transfer 1 JCALL
to your swtc address from Jingtum Fingate in a few minutes.
npm install jcc-call-utils
jcc_call_utils
as a global variable.
<script src="https://unpkg.com/jcc-call-utils/dist/jcc-call-utils.min.js"></script>
// 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();
}
see API.md