example: adjust generate-address example
this changes the example code for generating an address
to create an address, instead of returning the last unused
address, which stays the same.
@@ -19,12 +19,13 @@ async function run() {
// Always sync before doing anything with the account
const synced = await account.sync()
console.log('Syncing...')
- // let address = account.generateAddress()
- // get latest address
- let addressObject = account.latestAddress()
+ const { address } = account.generateAddress()
+ console.log('New address:', address)
- console.log("Address:", addressObject.address)
+ // You can also get the latest unused address:
+ // const addressObject = account.latestAddress()
+ // console.log("Address:", addressObject.address)
// Use the Chrysalis Faucet to send testnet tokens to your address:
console.log("Fill your address with the Faucet: https://faucet.testnet.chrysalis2.com/")
