January 2020
Intermediate to advanced
530 pages
11h 11m
English
Before our trader can submit orders to the network, they need to have a valid Stellar account, funded with the trading assets. We created the trader's accounts using the nodejs utility in the previous section.
To load the user's account and balances and submit orders from their account, we need to map the user's secret key to the app. This secret key is kept on the client side in the ephemeral storage, and is not sent to the server side.
The AppLogin.js component renders a single field called secret key, to capture the user's secret key.
The setAccount() method is called to map this secret key and the public key to the app state, like this:
setAccount = () => { var account = StellarSdk.Keypair.fromSecret(this.state.fields.secretkey).publicKey() ...Read now
Unlock full access