add userAgent and usageContext to faucet transactions (#2309)

This commit is contained in:
jonathanlei
2023-06-13 10:56:40 -07:00
committed by GitHub
parent 695c89eda4
commit 5726a6251d
9 changed files with 56 additions and 16 deletions

View File

@@ -15,9 +15,15 @@ async function multisigning(): Promise<void> {
* In practice, users generally will not have all keys in one spot,
* hence, users need to implement a way to get signatures.
*/
const { wallet: wallet1 } = await client.fundWallet()
const { wallet: wallet2 } = await client.fundWallet()
const { wallet: walletMaster } = await client.fundWallet()
const { wallet: wallet1 } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
const { wallet: wallet2 } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
const { wallet: walletMaster } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
const signerListSet: SignerListSet = {
TransactionType: 'SignerListSet',
Account: walletMaster.classicAddress,

View File

@@ -7,8 +7,12 @@ async function partialPayment(): Promise<void> {
await client.connect()
// creating wallets as prerequisite
const { wallet: wallet1 } = await client.fundWallet()
const { wallet: wallet2 } = await client.fundWallet()
const { wallet: wallet1 } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
const { wallet: wallet2 } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
// create a trustline to issue an IOU `FOO` and set limit on it.
const trust_set_tx: TrustSet = {

View File

@@ -5,7 +5,9 @@ const client = new Client('wss://s.altnet.rippletest.net:51233')
async function createTxWithPaths(): Promise<void> {
await client.connect()
const { wallet } = await client.fundWallet()
const { wallet } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
const destination_account = 'rKT4JX4cCof6LcDYRz8o3rGRu7qxzZ2Zwj'
const destination_amount = {
value: '0.001',

View File

@@ -45,8 +45,12 @@ async function sendReliableTx(): Promise<void> {
await client.connect()
// creating wallets as prerequisite
const { wallet: wallet1 } = await client.fundWallet()
const { wallet: wallet2 } = await client.fundWallet()
const { wallet: wallet1 } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
const { wallet: wallet2 } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
console.log('Balances of wallets before Payment tx')
console.log(

View File

@@ -15,8 +15,12 @@ async function sendEscrow(): Promise<void> {
await client.connect()
// creating wallets as prerequisite
const { wallet: wallet1 } = await client.fundWallet()
const { wallet: wallet2 } = await client.fundWallet()
const { wallet: wallet1 } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
const { wallet: wallet2 } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
console.log('Balances of wallets before Escrow tx was created:')
console.log(

View File

@@ -8,9 +8,15 @@ const client = new Client('wss://s.altnet.rippletest.net:51233')
*/
async function setRegularKey(): Promise<void> {
await client.connect()
const { wallet: wallet1 } = await client.fundWallet()
const { wallet: wallet2 } = await client.fundWallet()
const { wallet: regularKeyWallet } = await client.fundWallet()
const { wallet: wallet1 } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
const { wallet: wallet2 } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
const { wallet: regularKeyWallet } = await client.fundWallet(null, {
usageContext: 'code snippets',
})
console.log('Balances before payment')
console.log(await client.getXrpBalance(wallet1.classicAddress))