Skip to content

Instantly share code, notes, and snippets.

@nsjames
Last active October 26, 2018 15:14
Show Gist options
  • Save nsjames/9655f53ca2bfd8319ae17f798442a18d to your computer and use it in GitHub Desktop.
Save nsjames/9655f53ca2bfd8319ae17f798442a18d to your computer and use it in GitHub Desktop.
class InjectedObject {
// Check here for required fields: https://get-scatter.com/docs/requirable-fields
getIdentity(requiredFields){
//.. open your authentication popup, return:
return {
accounts:[{blockchain:'eos', name:'thename', authority:'active'}]
}
}
getIdentityFromPermissions(){
// if linked, return the same as above, otherwise return null. No popup.
}
forgetIdentity(){
//.. nuke permissions for linking that app, or however you guys do it
return true;
}
eos(){
// Here, just catch all methods, and transform them into your API structure.
return ProxyObject();
// so for instance if a dapp does
eos.transfer(...)
// you just take those parameters and mutate them into your own format
}
// Since you guys only support mainnet right now(?)
suggestNetwork(){ return false; }
// Since you don't have whitelisting, this is moot.
authenticate(){ return true; }
// Not sure how you'd deal with this. It just signs anything, not through eosjs.
getArbitrarySignature(){ return null; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment