How do you create a terra wallet account? or Transfer tokens?
- you don’t use an ‘api’ to create an wallet/account.
you first use something to create a private/public key pair ala terra-rust/terra-rust-api/src/keys at main · PFC-Validator/terra-rust · GitHub (make sure you have a good source of randomness), and don’t give anything about the key away with the exception of the ‘public’ key.
- to transfer tokens you will need the bank/send transaction
see: terra-rust/bank.rs at main · PFC-Validator/terra-rust · GitHub for fields.
this becomes a json message which then gets wrapped into a transaction.
you will need to query the server for the account#/sequence# of the public key, and use those (with the chain-id) as fields when you sign the message with your private key.
this piece of json (or protobuf) is then sent to LCD server
I wrote the rust one, and I believe there is a java one.
most of them have wrapper functions to do the above… one thing that isn’t easily understood, and out of scope for most of the apis is private key storage.
Be careful with that section, especially if you intend to hold the private key on a machine that is open on the internet.
Thanks for the response.
Which endpoint is used to create an account?
As for “sending tokens” I assume you would use the broadcast tx endpoint https://lcd.terra.dev/swagger/#/Service/BroadcastTx
Is there a request specification?
You don’t have to use an endpoint to create an account, just generate a private key locally with terra.js/terra.py .
You can find more info on the docs to send tokens Common examples — Terra Docs documentation
You have to use some algorithms to sign transactions.
More info on the cosmos docs: Accounts | Cosmos SDK