#!/bin/sh

set -eu

###############################################################################
# keygen wallet
###############################################################################
# create seed
keygen -coin xrp create seed

# create hdkey for client, deposit, payment account
keygen -coin xrp create hdkey -account client -keynum 10
keygen -coin xrp create hdkey -account deposit -keynum 1
keygen -coin xrp create hdkey -account payment -keynum 1
keygen -coin xrp create hdkey -account stored -keynum 1

# export address
file_address_client=$(keygen -coin xrp export address -account client)
file_address_deposit=$(keygen -coin xrp export address -account deposit)
file_address_payment=$(keygen -coin xrp export address -account payment)
file_address_stored=$(keygen -coin xrp export address -account stored)

###############################################################################
# watch only wallet
###############################################################################
# import addresses generated by keygen wallet
watch -coin xrp import address -file ${file_address_client##*\[fileName\]: }
watch -coin xrp import address -file ${file_address_deposit##*\[fileName\]: }
watch -coin xrp import address -file ${file_address_payment##*\[fileName\]: }
watch -coin xrp import address -file ${file_address_stored##*\[fileName\]: }
