mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
README example: encode test address
This commit is contained in:
@@ -20,6 +20,14 @@ Convert a classic address and (optional) tag to an X-address. If `tag` is `false
|
|||||||
'XVLhHMPHU98es4dbozjVtdWzVrDjtV18pX8yuPT7y4xaEHi'
|
'XVLhHMPHU98es4dbozjVtdWzVrDjtV18pX8yuPT7y4xaEHi'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Encode a test address e.g. for use with [Testnet or Devnet](https://xrpl.org/xrp-testnet-faucet.html):
|
||||||
|
|
||||||
|
```js
|
||||||
|
> const api = require('ripple-address-codec')
|
||||||
|
> api.classicAddressToXAddress('r3SVzk8ApofDJuVBPKdmbbLjWGCCXpBQ2g', 123, true)
|
||||||
|
'T7oKJ3q7s94kDH6tpkBowhetT1JKfcfdSCmAXbS75iATyLD'
|
||||||
|
```
|
||||||
|
|
||||||
### xAddressToClassicAddress(xAddress: string): {classicAddress: string, tag: number | false, test: boolean}
|
### xAddressToClassicAddress(xAddress: string): {classicAddress: string, tag: number | false, test: boolean}
|
||||||
|
|
||||||
Convert an X-address to a classic address and tag. If the X-address did not have a tag, the returned object will not have a `tag` field. If the X-address is intended for use on test network(s), `test` will be `true`; if it is intended for use on the main network (mainnet), `test` will be `false`.
|
Convert an X-address to a classic address and tag. If the X-address did not have a tag, the returned object will not have a `tag` field. If the X-address is intended for use on test network(s), `test` will be `true`; if it is intended for use on the main network (mainnet), `test` will be `false`.
|
||||||
@@ -44,6 +52,8 @@ Returns `true` if the provided X-address is valid, or `false` otherwise.
|
|||||||
true
|
true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This method always returns `false` for classic addresses (starting with `r`).
|
||||||
|
|
||||||
### Other functions
|
### Other functions
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|||||||
Reference in New Issue
Block a user