5

In the Tezos client manual I only find commands to get the manager and balance for an originated account (contract). How can such an account be added to the client for monitoring balances (such as add address <new> <src> for tz1 addresses) and, when the secret key for the manager (tz1 address) is available, how to spend from it?

2 Answers 2

8

To add an originated account to the cli wallet:

tezos-client remember contract <new alias> <kt1...>

Check if the originated account was successfully added to the client:

tezos-client list known contracts

Show balance of the originated account:

tezos-client get balance for <new alias>

In order to transfer from the originated account, the secret key of the implicit account (tz1...) must be known by the client:

tezos-client import secret key <new alias> <secret key>

Then transfers from originated accounts are similar to transfers for implicit accounts:

tezos-client transfer <amount> from <alias of kt1...> to <destination PKH>

Note that these examples are for use cases when you created the implicit and originated accounts in another wallet and you want to use these accounts also within the tezos-client.

If you want to create an originated account from an implicit account with the tezos-client, then use the command given by @cousinit.

5

when working with the Tezos command line client it's useful know that you can give accounts an alias to make it easier to enter commands:

client add address <new alias> <public key hash to which alias applies>

To create an originated account for a given tz1 alias, you need to be aware that it will burn 0.257 xtz, plus you need to specify a fee for the operation.

Rather than do it in multiple steps and pay multiple fees, you can do it all in one command. Assuming you want the originated account to able to delegate its amount to a baker, then you either need to flag it as delegatable or add the delegate at the time you create it.

The following command will create an originated account for the specified tz1 account, and transfer 1000xtz funds to it, mark it as delegatable, and assign its delegate while paying a single fee of 0.002 xtz PLUS you will see an extra 0.257 burned out of the tz1 account

    client originate account <enter an alias for the new account> 
for <alias or pkh of your tz1> transferring 1000.0 
from <alias or pkh of your tz1> --delegate 
<alias or pkh of the account to which you want to delegate your funds> 
--fee 0.002
1
  • 1
    I edited the original question to clarify the meaning, as I wanted to know how a kt1 account can simply be monitored and how one can spend from own kt1 addresses when the private key for the manager (tz1) is available. I appreciate your answer though.
    – cryptodad
    Commented Feb 9, 2019 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.