mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 12:15:50 +00:00
Added testnet accounts
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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());
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user