Merge branch 'main' into expanded-signer-list

This commit is contained in:
Omar Khan
2022-06-15 18:54:01 -04:00
committed by GitHub
3 changed files with 35 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr
## Unreleased
### Added
* Add ExpandedSignerList amendment support
* When connected to nft-devnet, Client.fundWallet now defaults to using the nft-devnet faucet instead of requiring specification.
## 2.3.0 (2022-06-02)
### Added

View File

@@ -21,6 +21,7 @@ interface FaucetWallet {
enum FaucetNetwork {
Testnet = 'faucet.altnet.rippletest.net',
Devnet = 'faucet.devnet.rippletest.net',
NFTDevnet = 'faucet-nft.ripple.com',
}
// Interval to check an account balance
@@ -312,6 +313,10 @@ function getFaucetHost(client: Client): FaucetNetwork | undefined {
return FaucetNetwork.Devnet
}
if (connectionUrl.includes('xls20-sandbox')) {
return FaucetNetwork.NFTDevnet
}
throw new XRPLFaucetError('Faucet URL is not defined or inferrable.')
}

View File

@@ -69,6 +69,35 @@ describe('fundWallet', function () {
await api.disconnect()
})
it('can generate and fund wallets on nft-devnet', async function () {
const api = new Client('ws://xls20-sandbox.rippletest.net:51233')
await api.connect()
const { wallet, balance } = await api.fundWallet()
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()
})
it('can generate and fund wallets using a custom host', async function () {
const api = new Client('ws://xls20-sandbox.rippletest.net:51233')