WEPIN Developer Documentation
WepinBlogContact
English
English
  • Get Started
    • Introduction
  • Wepin
    • Features
    • Architecture
      • Key Generation
      • Signing
      • Key Backup
    • Workspace
      • App Registration and Key Issuance
      • Networks and Assets Addition
      • Widget Design
    • Supported blockchains
    • Account Abstraction
  • login
    • Overview
    • Social Login Auth Providers
      • Email/Password
      • Google
      • Apple
      • Discord
      • Naver
      • Facebook
      • Line
      • Kakao
    • User Interface
    • Simplified Login
    • Resource
  • Widget Integration
    • Prerequisites
    • Web: JavaScript SDK
      • Login Library
        • Installation
        • Initialization
        • Methods
      • PIN Pad Library
        • Installation
        • Initialization
        • Methods
      • Widget
        • Installation
        • Initialization
        • Methods
        • Final Review
      • Provider
        • Ethereum Provider
        • Kaia Provider
        • Solana Provider
        • Wagmi Connector
      • Wallet Adapter
        • Solana Wallet Adapter
    • Android: Java & Kotlin SDK
      • Login Library
        • Installation
        • Initialization
        • Methods
      • PIN Pad Library
        • Installation
        • Initialization
        • Methods
      • Widget Library
        • Installation
        • Initialization
        • Methods
    • iOS: Swift SDK
      • Login Library
        • Installation
        • Initialization
        • Methods
      • PIN Pad Library
        • Installation
        • Initialization
        • Methods
      • Widget Library
        • installation
        • initialization
        • Methods
    • Flutter SDK
      • Login Library
        • Installation
        • Initialization
        • Methods
      • Widget
        • Installation
        • Initialization
        • Methods
        • Final Review
      • PIN Pad Library
        • Installation
        • Initialization
        • Methods
    • React Native SDK
      • Login Library
        • Installation
        • Initialization
        • Methods
    • Unity SDK
      • Installation
      • Initialization
      • Methods
      • Final Review
    • Compose Multiplatform SDK
      • Login Library
        • Installation
        • Initialization
        • Methods
      • Widget
        • Installation
        • Initialization
        • Methods
        • Final Review
  • API
    • Overview
    • Registration
    • Login
    • Wallet
    • Token and NFT
    • Transaction
  • Deprecated
    • Web: JavaScript SDK
      • SDK
        • Installation
        • Initialization
        • Methods
        • Final Review
      • Provider
        • EVM-Compatible Networks
      • Wagmi Connector
    • Android: Java & Kotlin SDK
      • Installation
      • Initialization
      • Methods
      • Final Review
    • iOS: Swift SDK
      • Installation
      • Initialization
      • Methods
      • Final Review
    • Flutter SDK
      • Installation
      • Initialization
      • Methods
      • Final Review
    • React Native SDK
      • Installation
      • Initialization
      • Methods
      • Final Review
      • Providers
        • Ethereum Providers
  • MISC
    • Logo & Brand
Powered by GitBook
On this page
  • Supported Networks
  • Initialize Web3
  • Initialize Web3 using web3.js
  • Initialize Web3 using ethers.js
  • Methods
  • Get Accounts
  • Get Balance
  • Send Transaction
  • Contract Call

Was this helpful?

  1. Deprecated
  2. React Native SDK
  3. Providers

Ethereum Providers

PreviousProvidersNextLogo & Brand

Last updated 9 months ago

Was this helpful?

Using Ethers.js or Web3.js with the Wepin Provider allows you to interact with EVM-compatible blockchain networks.

Supported Networks

Is the blockchain you need not listed? Please team for blockchain support.

Chain ID
Network Name
Network Variable

1

Ethereum Mainnet

ethereum

5

Ethereum Goerli Testnet

evmeth-goerli

11155111

Ethereum Sepolia

evmeth-sepolia

19

Songbird Canary Network

evmsongbird

137

Polygon Mainnet

evmpolygon

80002

Polygon Amoy

evmpolygon-amoy

8217

Klaytn Mainnet

klaytn

1001

Klaytn Testnet

klaytn-testnet

2731

Ant-Time Testnet

evmanttime-testnet

Initialize Web3

First, initialize Wepin, then obtain the provider.

const appId = 'app_id_eg12sf3491azgs520' // Test App ID
const appKey = 'ak_test_ghq1D5s1sfG234sbnhdsw24mnovk313' // Test App Key
const attributes = {
	type: 'show'
}
// Initialize Wepin
await Wepin.init(appId, appKey, attributes)
// Obtain the provider from the initialized Wepin.
const provider = Wepin.getProvider({ network: 'ethereum' });

Initialize Web3 using web3.js

import Web3 from 'web3'
const provider = Wepin.getProvider({ network: 'ethereum' })
const web3 = new Web3(provider)

Initialize Web3 using ethers.js

import "react-native-get-random-values"
// Import the the ethers shims (**BEFORE** ethers)
import "@ethersproject/shims"
// Import the ethers library
import { ethers } from "ethers"
const provider = wepin.getProvider({ network: 'ethereum' })
const web3 = new ethers.providers.Web3Provider(provider)

Methods

Get Accounts

Through the initialized web3, you can retrieve account information.

const accounts = await web3.eth.getAccounts()

Get Balance

Using the account information, you can query the balance.

const balance = await web3.eth.getBalance(accounts[0])

You can refer to the link below to query not only the balance but also fee information, block number, etc.

Send Transaction

You can send transactions.

const accounts = await web3.eth.getAccounts()
const tx = {
    from: accounts[0],
    gasPrice: "2000000000",
    gas: "21000",
    to: '0x11f4d0A3c1......13F7E19D048276DAe',
    value: "10000000000000000",
}
const response = await web3.eth.sendTransaction(tx)

Contract Call

You can perform contract calls.

const callObject = {
	to: '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe', //contract address
	data: '0xc6888fa10000000000000000000000000000000000000000000000000000000000000003'
}
const response = await web3.eth.call(callObject)

For more details on the Ethereum-compatible network provider, please refer to the link below.

Please refer to:

contact the Wepin
ethers.js for React native
Getting Started — web3.js 1.0.0 documentation
Logo
EIP-1193: Ethereum Provider JavaScript APIEthereum Improvement Proposals