custom faucet hosts and various typing fixes for NFT support that were originally missed (#1882)

* various typing fixes for NFT support that were originally missed

* add optional faucet URL to fundWallet

* run docgen and commit changes

* fixes integration tests
This commit is contained in:
ledhed2222
2022-01-24 13:08:35 -05:00
committed by GitHub
parent d9089b9c1f
commit 4f035fd0d6
163 changed files with 1285 additions and 1182 deletions

View File

@@ -40,6 +40,7 @@ describe('fundWallet', function () {
await api.disconnect()
})
it('submit generates a devnet wallet', async function () {
const api = new Client('wss://s.devnet.rippletest.net:51233')
@@ -67,4 +68,36 @@ describe('fundWallet', function () {
await api.disconnect()
})
it('can generate and fund wallets using a custom host', async function () {
const api = new Client('ws://xls20-sandbox.rippletest.net:51233')
await api.connect()
const { wallet, balance } = await api.fundWallet(null, {
faucetHost: 'faucet-nft.ripple.com',
})
assert.notEqual(wallet, undefined)
assert(isValidClassicAddress(wallet.classicAddress))
assert(isValidXAddress(wallet.getXAddress()))
const info = await api.request({
command: 'account_info',
account: wallet.classicAddress,
})
assert.equal(dropsToXrp(info.result.account_data.Balance), balance)
const { balance: newBalance } = await api.fundWallet(wallet, {
faucetHost: 'faucet-nft.ripple.com',
})
const afterSent = await api.request({
command: 'account_info',
account: wallet.classicAddress,
})
assert.equal(dropsToXrp(afterSent.result.account_data.Balance), newBalance)
await api.disconnect()
})
})