skalenetwork / docs.skale.space

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

Using Bitski #25

Closed manuelbarbas closed 5 months ago

manuelbarbas commented 11 months ago

Bitski is a non-custodial OAuth-based Web3 wallet SDK. The Bitski SDK allows you to integrate your dApp with SKALE.

For more information and support, see https://docs.bitski.com/

Install the NPM Packages

npm install --save web3 bitski

Implementation Example

import { Bitski } from 'bitski';
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_client_id';
const callbackUrl = 'https://your.app/oath-callback.html';

const bitski = new Bitski(
    testAPIKey,
    callbackUrl
);

const network = {
    rpcUrl: endpoint,
    chainId: skaleChainId,
}

// Setting network
const provider = bitski.getProvider({ network });
let web3 = new Web3(provider);

function loginUser() {
  bitski.signIn().then(() => {
    console.log("sign in successful");
  });
}
manuelbarbas commented 9 months ago

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