Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/multisign.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ console.log();

/**
* You can try this at TestNet,
* https://developers.ripple.com/xrp-test-net-faucet.html
* https://xrpl.org/xrp-testnet-faucet.html
* Using:
* https://xrp.fans/ (Click the "Switch to TESTNET" button)
*/
Expand Down
4 changes: 2 additions & 2 deletions samples/sign-and-submit.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
derive,
utils,
signAndSubmit,
XRPL_Account,
} from "../dist/index.js"; // require('xrpl-accountlib') after `npm install xrpl-accountlib` in prod.

console.log("Sign & Submit (Custom Definitions)");
console.log();

const wss = 'wss://hooks-testnet-v3.xrpl-labs.com/'
const account = derive.familySeed("ssi4moYHYkWs2RPzRvrXzMrbpxqAJ")
const account = XRPL_Account.fromFamilySeed("ssi4moYHYkWs2RPzRvrXzMrbpxqAJ")

const networkInfo = await utils.txNetworkAndAccountValues(wss, account)

Expand Down
2 changes: 1 addition & 1 deletion samples/sign-custom-defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ console.log();

/**
* You can try this at TestNet,
* https://developers.ripple.com/xrp-test-net-faucet.html
* https://xrpl.org/xrp-testnet-faucet.html
* Using:
* https://xrp.fans/ (Click the "Switch to TESTNET" button)
*/
Expand Down
6 changes: 3 additions & 3 deletions samples/sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ console.log();

/**
* You can try this at TestNet,
* https://developers.ripple.com/xrp-test-net-faucet.html
* https://xrpl.org/xrp-testnet-faucet.html
* Using:
* https://xrp.fans/ (Click the "Switch to TESTNET" button)
*/
Expand All @@ -22,15 +22,15 @@ const Tx = {

console.log(
"Sign: one account",
lib.sign(Tx, lib.derive.familySeed("shqNUmrgnkBmK9iCijrtid2Ua4uHd"))
lib.sign(Tx, lib.XRPL_Account.fromFamilySeed("shqNUmrgnkBmK9iCijrtid2Ua4uHd"))
);
console.log();

console.log("Sign: multiSign");
console.dir(
lib.sign(Tx, [
lib.derive.familySeed("sp5mkm12oJj3t8fFRiaMNrDbc73N2"),
lib.derive.familySeed("shqNUmrgnkBmK9iCijrtid2Ua4uHd")
lib.XRPL_Account.fromFamilySeed("shqNUmrgnkBmK9iCijrtid2Ua4uHd")
]),
{ depth: null }
);
Expand Down
7 changes: 7 additions & 0 deletions src/schema/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { deriveAddress } from "ripple-keypairs";
import * as AddressCodec from "ripple-address-codec";
import * as Elliptic from "elliptic";
import * as Utils from "../utils";
import { derive } from "..";

const Ed25519 = new Elliptic.eddsa("ed25519");
const Secp256k1 = new Elliptic.ec("secp256k1");
Expand Down Expand Up @@ -173,6 +174,12 @@ export default class XRPL_Account {
return this;
}

static fromMnemonic: typeof derive.mnemonic = (...params) => derive.mnemonic(...params)
static fromFamilySeed: typeof derive.familySeed = (...params) => derive.familySeed(...params)
static fromSecretNumbers: typeof derive.secretNumbers = (...params) => derive.secretNumbers(...params)
static fromPrivatekey: typeof derive.privatekey = (...params) => derive.privatekey(...params)
static fromPassphrase: typeof derive.passphrase = (...params) => derive.passphrase(...params)

toString() {
return "XPRL Account" + (this.address ? ": " + this.address : "");
}
Expand Down