Added testnet accounts

This commit is contained in:
Tushar Pardhe
2023-01-25 10:08:52 +00:00
parent e5456b95d2
commit 638dd82b24
3 changed files with 15 additions and 10 deletions

View File

@@ -4,14 +4,16 @@ if (typeof module !== "undefined") {
var xrpl = require('xrpl') var xrpl = require('xrpl')
} }
const secret = "sEdTPPEeMH6SAgpo6rSj8YW7a9vFfUj";
const main = async () => { const main = async () => {
try { try {
// Connect ------------------------------------------------------------------- // Connect -------------------------------------------------------------------
const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233'); const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233');
await client.connect(); await client.connect();
const wallet = await xrpl.Wallet.fromSeed(secret);
// Get credentials from the Testnet Faucet ------------------------------------
console.log("Requesting an address from the Testnet faucet...");
const { wallet } = await client.fundWallet();
console.log("Wallet: ", wallet.address);
const escrowCancelTransaction = { const escrowCancelTransaction = {
"Account": wallet.address, "Account": wallet.address,

View File

@@ -7,8 +7,6 @@ if (typeof module !== "undefined") {
const cc = require('five-bells-condition'); const cc = require('five-bells-condition');
const crypto = require('crypto'); const crypto = require('crypto');
const secret = "sEdTPPEeMH6SAgpo6rSj8YW7a9vFfUj";
const main = async () => { const main = async () => {
try { try {
@@ -17,8 +15,11 @@ const main = async () => {
const myFulfillment = new cc.PreimageSha256(); const myFulfillment = new cc.PreimageSha256();
myFulfillment.setPreimage(preimageData); myFulfillment.setPreimage(preimageData);
const conditionHex = myFulfillment.getConditionBinary().toString('hex').toUpperCase(); const conditionHex = myFulfillment.getConditionBinary().toString('hex').toUpperCase();
const wallet = await xrpl.Wallet.fromSeed(secret);
console.log("Wallet: ",wallet.address); // Get credentials from the Testnet Faucet ------------------------------------
console.log("Requesting an address from the Testnet faucet...");
const { wallet } = await client.fundWallet();
console.log("Wallet: ", wallet.address);
console.log('Condition:', conditionHex); console.log('Condition:', conditionHex);
console.log('Fulfillment:', myFulfillment.serializeBinary().toString('hex').toUpperCase()); console.log('Fulfillment:', myFulfillment.serializeBinary().toString('hex').toUpperCase());

View File

@@ -4,14 +4,16 @@ if (typeof module !== "undefined") {
var xrpl = require('xrpl') var xrpl = require('xrpl')
} }
const secret = "sEdTPPEeMH6SAgpo6rSj8YW7a9vFfUj";
const main = async () => { const main = async () => {
try { try {
// Connect ------------------------------------------------------------------- // Connect -------------------------------------------------------------------
const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233'); const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233');
await client.connect(); await client.connect();
const wallet = await xrpl.Wallet.fromSeed(secret);
// Get credentials from the Testnet Faucet ------------------------------------
console.log("Requesting an address from the Testnet faucet...");
const { wallet } = await client.fundWallet();
console.log("Wallet: ", wallet.address);
const escrowFinishTransaction = { const escrowFinishTransaction = {
"Account": wallet.address, "Account": wallet.address,