skalenetwork / docs.skale.space

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

Using Coinbase Wallet #26

Closed manuelbarbas closed 5 months ago

manuelbarbas commented 11 months ago

Coinbase Wallet is a self-custody crypto wallet, available as a browser extension and a mobile app on Android and iOS

Install the NPM Packages

npm install --save web3 @coinbase/wallet-sdk

Example Code

import CoinbaseWalletSDK from '@coinbase/wallet-sdk'
import Web3 from 'web3'

const APP_NAME = 'My Awesome App'
const APP_LOGO_URL = 'https://example.com/logo.png'
const SKALE_JSONRPC_URL = 'https://your.skale.endpoint'
const SKALE_CHAIN_ID = 123456

// Initialize Coinbase Wallet SDK
export const coinbaseWallet = new CoinbaseWalletSDK({
  appName: APP_NAME,
  appLogoUrl: APP_LOGO_URL,
  darkMode: false
})

// Initialize a Web3 Provider object
export const skale = coinbaseWallet.makeWeb3Provider(SKALE_JSONRPC_URL, SKALE_CHAIN_ID)

// Initialize a Web3 object
export const web3 = new Web3(skale)
manuelbarbas commented 9 months ago

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