Integrate with Slope Wallet on Ethereum (Extension)
Slope Wallet injects a global API into websites visited by its users at window.slope.
This API specification borrows heavily from API MetaMask provided, considering the massive adoption. So Web3 site developers can easily connect their dApps with the Slope Wallet. The APIs allow websites to request users' Ethereum addresses, read data from the blockchain the user is connected to, and prompt the users to sign messages and transactions.
The presence of the provider object window.slope indicates a Slope Wallet user.
The API this extension wallet provides includes API specified by EIP-1193 and API defined by MetaMask (does not including some massively relied legacy ones).
Difference with MetaMask
Please read through this section if you are a web3 developer who has integrated with MetaMask and interested in integrating with Slope Wallet.
Inpage injected object
The biggest difference between Slope Wallet and MetaMask is we inject slope rather than ethereum (or web3) to the web page. So user could keep two extensions at the same time.
When this API is invoked without the user's approval, MetaMask would return an empty array.
In contrast, we would ask the user to unlock his wallet and return the address user connected to.
For any non-trivial Ethereum web application — a.k.a. web3 site — to work, you will have to:
Detect the Slope Wallet provider (window.slope)
Detect which Ethereum network the user is connected to
Get the user's Ethereum account(s)
The provider API is all you need to create a full-featured web3 application.
That said, many developers use a convenience library, such as ethers and web3.js, instead of using the provider directly. If you need higher-level abstractions than those provided by this API, we recommend that you use a convenience library.