
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@okxweb3/coin-xrp
Advanced tools
XRP SDK is used to interact with the xrp blockchain, it contains various functions can be used to web3 wallet.
To obtain the latest version, simply require the project using npm :
npm install @okxweb3/coin-xrp
import { XrpWallet } from "@okxweb3/coin-xrp"
let wallet = new XrpWallet();
// get random key
let randomPrivateKey = await wallet.getRandomPrivateKey();
// get derived key
let params = {
mnemonic: "stool trumpet fame umbrella bench provide battle toward story fruit lock view",
chainPath: "m/44'/144'/0'/0/1"
}
let derivePrivateKey = await wallet.getDerivedPrivateKey(params);
import { XrpWallet } from "@okxweb3/coin-xrp"
let wallet = new XrpWallet();
let mnemonic = "stool trumpet fame umbrella bench provide battle toward story fruit lock view"
let param = {
mnemonic: mnemonic,
hdPath: "m/44'/144'/0'/0/0"
};
let privateKey = await wallet.getDerivedPrivateKey(param)
import { XrpWallet } from "@okxweb3/coin-xrp"
let wallet = new XrpWallet();
let params = {
privateKey: 'EDD2AF6288A903DED9860FC62E778600A985BDF804E40BD8266505553E3222C3DA'
}
let newAddress = await wallet.getNewAddress(params);
import { XrpWallet } from "@okxweb3/coin-xrp"
let wallet = new XrpWallet();
let params = {
address: "rQKQsPeE3iTRyfUypLhuq74gZdcRdwWqDp"
};
let valid = await wallet.validAddress(params);
Use the signTransaction function to get the signed hex to broadcast
import { XrpWallet } from "@okxweb3/coin-xrp"
let wallet = new XrpWallet();
let signParams = {
privateKey: seed1,
data: {
type: "transfer" ,
base: {
Account:"rnyyyTfmc4MLRXqn7fhJW51fxttPp4djHw",
Flags: 0,
Fee:"12",
Sequence:5779448,
LastLedgerSequence: 5784941
},
data: {
TransactionType: 'Payment',
Amount: '1.23',
Destination: 'rJdzXHR7qcPTqpESwJt5TJDhqaRe8oVAgE',
}
}
}
let tx = await wallet.signTransaction(signParams)
Use the signTransaction function to get the signed hex to broadcast
import { XrpWallet } from "@okxweb3/coin-xrp"
let wallet = new XrpWallet();
let signParams = {
privateKey: seed1,
data: {
type: "TrustSet" ,
base: {
Account:"rnyyyTfmc4MLRXqn7fhJW51fxttPp4djHw",
Flags: 0,
Fee:"12",
Sequence:5779449,
LastLedgerSequence: 5785541
},
data: {
Account: 'rnyyyTfmc4MLRXqn7fhJW51fxttPp4djHw',
LimitAmount: {
currency: "USD",
issuer: "rJdzXHR7qcPTqpESwJt5TJDhqaRe8oVAgE",
value:"123",
}
}
}
}
let tx = await wallet.signTransaction(signParams)
Use the signTransaction function to get the signed hex to broadcast
import { XrpWallet } from "@okxweb3/coin-xrp"
let wallet = new XrpWallet();
let signParams = {
privateKey: seed2,
data: {
type: "transfer" ,
base: {
Account:address2,
Flags: 0,
Fee:"12",
Sequence:5779442,
LastLedgerSequence: 5786248
},
data: {
Destination:address1,
Amount: {
currency: "USD",
issuer: address2,
value:"1.23",
}
}
}
}
let tx = await wallet.signTransaction(signParams)
const msg = {
messageId: "123",
url: "",
title: "",
favicon: "",
message: "",
}
const sig = await wallet.signMessage({
privateKey: "003BA2B1DB9231EEEB6F85EEEF0B4F71B493DBDC315E6458480B378D73FAFA1398",
data: msg,
})
FAQs
An XRP SDK for building Web3 wallets and applications.
We found that @okxweb3/coin-xrp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.