Transferring KT1's between Wallets #1582
-
Hi All, Pretty new here, though experienced developer. The other more important piece i'm trying to understand is transfers of KT1. So wallet A (tz1A) owns contract A (KT1A) and wants to transfer it to wallet B (tz1B). Any help is really greatly appreciated. Been struggling for a little while now. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi! In addition to that, you can fetch the balance of an implicit account (i.e. tz1/2/3 address) or a contract (i.e. KT1 address) by using the following code:
|
Beta Was this translation helpful? Give feedback.
-
Tezos tokens fall into 2 different categories with 2 different (yet similar) standards: FA1.2 tokens and FA2 tokens (with links to get more details about the standards). When you own a certain token (like GOLD), your balance is represented within the token contract, in a bigmap that tracks the balances of every user (generally called "ledger"). An exchange of tokens is basically 2 updates in that bigmap: the first update removes the defined amount of tokens from the sender's account and the second update adds the defined amount to the recipient's account. The contract is in charge of tracking the balances and verifying the users have the rights to spend the tokens. To check a balance with Taquito, you must first fetch the contract storage, then search the bigmap tracking the balances. For example, if the bigmap is called "ledger":
To transfer tokens, both standards have a
If the parameters are correct, the tokens will be transferred from the sender to the recipient. |
Beta Was this translation helpful? Give feedback.
-
@claudebarde got it working! So for the sake of my complete solution being shared for anyone else: First I determine what token i want to spend from my admin wallet (get the address).
Then i transfer out from that admin to the recipient with the amount:
And i successfully see the amount transferred. |
Beta Was this translation helpful? Give feedback.
Tezos tokens fall into 2 different categories with 2 different (yet similar) standards: FA1.2 tokens and FA2 tokens (with links to get more details about the standards).
When you own a certain token (like GOLD), your balance is represented within the token contract, in a bigmap that tracks the balances of every user (generally called "ledger").
An exchange of tokens is basically 2 updates in that bigmap: the first update removes the defined amount of tokens from the sender's account and the second update adds the defined amount to the recipient's account. The contract is in charge of tracking the balances and verifying the users have the rights to spend the tokens.
To check a balance with…