Integrate Embedded Wallets with the Skale Blockchain in JavaScript
While using the Web3Auth React SDK, you get access to the Web3Auth provider. You can pair it up with the libraries like ethers.js, viem etc. to make EVM based blockchain calls, like getting user's account, fetch balance, sign transaction, send transaction, read from and write to the smart contract, etc. We have highlighted a few here for getting you started quickly on that.
Chain Details for Skale
- Europa Hub
- Calypso Hub
- Nebula Gaming Hub
- Titan Hub
- Mainnet
- Testnet
- Chain ID: 0x79f99296
- Public RPC URL: https://mainnet.skalenodes.com/v1/elated-tan-skat
- Display Name: SKALE Europa Hub Mainnet
- Block Explorer Link: https://elated-tan-skat.explorer.mainnet.skalenodes.com
- Ticker: sFUEL
- Ticker Name: SKALE Fuel
- Chain ID: 0x561bf78b
- Public RPC URL: https://testnet.skalenodes.com/v1/juicy-low-small-testnet
- Display Name: SKALE Europa Hub Testnet
- Block Explorer Link: https://juicy-low-small-testnet.explorer.testnet.skalenodes.com
- Ticker: sFUEL
- Ticker Name: SKALE Fuel
- Mainnet
- Testnet
- Chain ID: 0x5d456c62
- Public RPC URL: https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague
- Display Name: SKALE Calypso Hub Mainnet
- Block Explorer Link: https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com
- Ticker: sFUEL
- Ticker Name: SKALE Fuel
- Chain ID: 0x3a14269b
- Public RPC URL: https://testnet.skalenodes.com/v1/giant-half-dual-testnet
- Display Name: SKALE Calypso Hub Testnet
- Block Explorer Link: https://giant-half-dual-testnet.explorer.testnet.skalenodes.com
- Ticker: sFUEL
- Ticker Name: SKALE Fuel
- Mainnet
- Testnet
- Chain ID: 0x585eb4b1
- Public RPC URL: https://mainnet.skalenodes.com/v1/green-giddy-denebola
- Display Name: SKALE Nebula Gaming Hub Mainnet
- Block Explorer Link: https://green-giddy-denebola.explorer.mainnet.skalenodes.com
- Ticker: sFUEL
- Ticker Name: SKALE Fuel
- Chain ID: 0x0235ddd0
- Public RPC URL: https://testnet.skalenodes.com/v1/lanky-ill-funny-testnet
- Display Name: SKALE Nebula Gaming Hub Testnet
- Block Explorer Link: https://lanky-ill-funny-testnet.explorer.testnet.skalenodes.com
- Ticker: sFUEL
- Ticker Name: SKALE Fuel
- Mainnet
- Testnet
- Chain ID: 0x507aaa2a
- Public RPC URL: https://mainnet.skalenodes.com/v1/parallel-stormy-spica
- Display Name: SKALE Titan Hub Mainnet
- Block Explorer Link: https://parallel-stormy-spica.explorer.mainnet.skalenodes.com
- Ticker: sFUEL
- Ticker Name: SKALE Fuel
- Chain ID: 0x0233382c
- Public RPC URL: https://testnet.skalenodes.com/v1/aware-fake-trim-testnet
- Display Name: SKALE Titan Hub Testnet
- Block Explorer Link: https://aware-fake-trim-testnet.explorer.testnet.skalenodes.com
- Ticker: sFUEL
- Ticker Name: SKALE Fuel
For VanillaJS, Angular and other frameworks
Installation
To interact with the blockchain, you can use either the viem or
ethers.js library with Web3Auth.
- viem
- ethers.js
- npm
- Yarn
- pnpm
- Bun
npm install --save viem
yarn add viem
pnpm add viem
bun add viem
- npm
- Yarn
- pnpm
- Bun
npm install --save ethers
yarn add ethers
pnpm add ethers
bun add ethers
Initializing Provider
Using eip155 as chainNamespace while initializing web3auth will provide an
EIP1193 compatible provider as web3auth.provider
after successful authentication.
Initializing and instantiating the Web3Auth SDK
import { Web3Auth, WEB3AUTH_NETWORK } from "@web3auth/modal";
const web3AuthOptions: Web3AuthOptions = {
clientId,
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
};
Getting the Web3Auth provider
After initializing Web3Auth, the next step is to initialize the provider and use it for your operations.
// Initialize for PnP Web SDK
await web3auth.init();
// Trigger the login
await web3auth.connect();
// await web3auth.connectTo(); // For custom flow
// Get the provider
const provider = web3auth.provider;
// Continue using the `provider`