Documentation

Linking a user's account

Web
JSON

linkAccount is part of the onboarding tools provided by Scatter and in most cases goes hand-in-hand with getPublicKey. Your application can prompt the user to bind an account and network to a public key which allows them to use it to interact with your application when using getIdentity

// EOS account
const account = {
  name:'helloworld',
  authority:'active',
  publicKey:'EOS....'
};

// Ethereum / Tron account ( don't use address, use publicKey, even though it's not technically correct )
const account = {
    publicKey:'0x....'
};

// Link the account inside Scatter
scatter.linkAccount(account, network).then(linked => {
    //...
})
{
    id:'random-uid',
    type:'linkAccount',
    plugin:'Your App Name',
    payload:{
        origin:'domain' || 'YOUR_APP',
        account:{...},
        network:{...}
    }
}