Compatible with email@example.com and below
Table of contents
Install library via
npm i --save @endpass/connectyarn add @endpass/connect
You don't need any dependencies like
web3, Endpass Connect includes it out of
Create instance of class and use it in your application. You can know about options and methods in the API section.
;;const web3 = '';const connect =appUrl: '';const provider = connect;web3;
Next, you can try to authentificate user.
tryconst res = await connect;// Now, you have active account address and network idcatch err// Something goes wrong! User is not authorized
If you want to use this library and process
web3 requests through
endpass services you should complete these conditions.
web3 library if you want to use it manually in you application. Create instance of
web3 and create provider based on it:
;;const web3 = '';const connect = ;const provider = connect;// If you are using old versions of web3 (0.30.0-beta and below) you should call// setProviderweb3;// If you are using new versions of web3 (1.0.0 and more) you can reassign// global property ethereum in application window objectwindowethereum = provider;// We highly recommend to use both methods for more stability and compatibilitywindowethereum = provider;web3;
web3 can be found in application window object you can not install
extendProvider also should try to find it.
||Url of Endpass Connect application.|
||Open Endpass Connect application for user authorization, return promise, which returns object with auth status. See Errors handling for more details.|
||Makes logout request and returns status or throw error|
||Returns authorized user active account.|
||Creates Web3 provider for injection in Web3 instance.|
||Set user settings to the injected
||Open Endpass Connect application for change user active address, network or logout|
Interactions with current account
If you use
openAccount method connect application will open screen with user base settings: current account and network.
You also can makes logout here. This method will return object with type field. This field determines response type. There is
two types of response:
logout– means user makes logout from his account.
update– means user update account settings. Response also contains
payloadfield with updated settings object.
At the same time
update will set new account settings to injected provider. After this, you can refresh browser page
or something else.
;const connect = ;connect;
||Builds application and library.|
||Starts application dev server.|
||Starts library development environment.|
||Runs unit tests.|
||Formats code of packages with