skalenetwork / docs.skale.space

https://docs.skale.space/
MIT License
0 stars 2 forks source link

Using Portis #34

Closed manuelbarbas closed 4 months ago

manuelbarbas commented 9 months ago

Portis

Portis is a non-custodial Web3 wallet SDK supported by a variety of "evergreen" browsers. The Portis SDK allows you to integrate your dApp with SKALE.

For more information and support, see https://docs.portis.io/#/quick-start

Install the NPM Packages

npm install --save web3 @portis/web3

Example Code

import Portis from '@portis/web3';
import Web3 from 'web3';

// Your setup information
const endpoint = 'https://your.skale.endpoint'; // your SKALE Chain endpoint
const skaleChainId = 123456                     // chainId of your SKALE Chain
const testAPIKey = 'your_api_key';

const mySKALEChain = {
    nodeUrl: endpoint,
    chainId: skaleChainId,
    nodeProtocol: "rpc"
}

// Setting network
const portis = new Portis(testAPIKey, mySKALEChain);
let web3 = new Web3(portis.provider);

Example Sandbox

https://codesandbox.io/s/portis-wallet-integration-skale-dev-docs-41knv

manuelbarbas commented 8 months ago

What is: Wallet Language: Javascript, Typescript Target: Web