jcc-ripple-utils
v0.1.2
Published
Toolkit of crossing chain from Ripple to SWTC chain
Downloads
3
Maintainers
Readme
jcc-ripple-utils
Toolkit of crossing chain from Ripple to SWTC chain
Toolkit of crossing chain from Ripple to SWTC chain
Description
Transfer token automatically from Ripple to SWTC chain. Support XRP token.
e.g. you transfer 1 XRP
to Ripple Fingate from your ripple address if success, the contract will automatically transfer 1 JXRP
to your swtc address from Jingtum Fingate in a few minutes.
Installtion
npm install jcc-ripple-utils
Usage
// demo
import RippleFingate from "jcc-ripple-utils";
// This is a test websocket server. Don't use it in production environment.
const testServer = "wss://t1.ripple.com";
const instance = new RippleFingate(testServer);
const testSecret = "ss8tnkFNue4TZe1MKydL5TYNnz9w4";
const testAddress = "r3sMTxiYm17nDB1nYwGCWd19GJXUrVxuNR";
// Don't change it. The fingate address is it for now.
const destination = "rMUpPikgdhmtCida2zf4CMBLrBREfCeYcy";
const testMemo = {
jtaddress: "jpgWGpfHz8GxqUjz5nb6ej8eZJQtiF6KhH"
}
const amount = "1";
try {
// transfer 1 XRP
await instance.connect();
const hash = await inst.transfer(testSecret, destination, amount, testMemo);
console.log(hash);
} catch (error) {
console.log(error);
} finally {
instance.disconnect();
}