-
Notifications
You must be signed in to change notification settings - Fork 12
/
sign.js
49 lines (43 loc) · 1.16 KB
/
sign.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const lib = require("../"); // require('xrpl-accountlib') after `npm install xrpl-accountlib` in prod.
console.log("XRPL-AccountLib");
console.log();
/**
* You can try this at TestNet,
* https://developers.ripple.com/xrp-test-net-faucet.html
* Using:
* https://xrp.fans/ (Click the "Switch to TESTNET" button)
*/
const Tx = {
TransactionType: "Payment",
Account: "rPdvC6ccq8hCdPKSPJkPmyZ4Mi1oG2FFkT",
Fee: "1000",
Destination: "rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY",
Amount: "133701337",
DestinationTag: 495,
Sequence: 4
};
console.log(
"Sign: one account",
lib.sign(Tx, lib.derive.familySeed("shqNUmrgnkBmK9iCijrtid2Ua4uHd"))
);
console.log();
console.log("Sign: multiSign");
console.dir(
lib.sign(Tx, [
lib.derive.familySeed("sp5mkm12oJj3t8fFRiaMNrDbc73N2"),
lib.derive.familySeed("shqNUmrgnkBmK9iCijrtid2Ua4uHd")
]),
{ depth: null }
);
console.log();
console.log("Sign: multiSign");
console.dir(
lib.sign(Tx, [
lib.derive.familySeed("sp5mkm12oJj3t8fFRiaMNrDbc73N2"),
lib.derive
.familySeed("snYHBZDJ51PPSuzWYVhEh1kb9zvEU")
.signAs("rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY")
]),
{ depth: null }
);
console.log();