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
  • Installation
  • Initialization
  • init
  • Parameters
  • Return value
  • Example
  • isInitialized
  • Parameters
  • Return value
  • Example
  • changeLanguage
  • Parameters
  • Return value
  • Example
  • Methods
  • getProvider
  • Parameters
  • Return value
  • Example
  • finalize
  • Parameters
  • Return value
  • Example

Was this helpful?

  1. Widget Integration
  2. Web: JavaScript SDK
  3. Provider

Ethereum Provider

PreviousProviderNextKaia Provider

Last updated 4 months ago

Was this helpful?

You can interact with EVM-based blockchains using Ethers.js or Web3.js together with the Wepin Provider.

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

8217

Kaia Mainnet

klaytn

1001

Kaia Kairos Testnet

klaytn-testnet

19

Songbird Canary Network

evmsongbird

137

Polygon Mainnet

evmpolygon

248

Oasys

evmoasys-games

34

XPLA Mainnet

evmxpla

7300

XPLA Verse Mainnet

evmxpla-verse

2731

TimeNetwork Testnet

evmtime-elizabeth

11155111

Ethereum Sepolia Testnet

evmeth-sepolia

80002

Polygon Amoy Testnet

evmpolygon-amoy

9372

Oasys Testnet

evmoasys-games-testnet

47

XPLA Testnet

evmxpla-testnet

2225

XPLA Verse Testnet

evmxpla-verse-testnet

204

opBNB Mainnet

evmopbnb

56

Binance Smart Chain

evmbsc

97

BSC-TESTNET

evmbsc-testnet

5611

opBNB Testnet

evmopbnb-testnet

656476

Open Campus Testnet

evmopencampus-testnet

43114

Avalanche

evmavax-c-chain

Installation

npm install @wepin/provider-js
yarn add @wepin/provider-js

Once the installation is complete, initialize the WepinProvider instance using the app ID and app key assigned after registering the app. This will enable the use of WepinProvider.

// 1. Import the package
import { WepinProvider } from '@wepin/provider-js'

// 2. Initialization
const WepinProvider = new WepinProvider({
    appId: 'your-wepin-app-id',
    appKey: 'your-wepin-api-key',
})

Initialization

Here's how to initialize the Wepin Provider.

init

await wepinProvider.init(attributes?)

Parameters

  • attributes <object> optional

    • defaultLanguage: The language to be displayed on the widget (default: 'ko') Currently, only 'ko' , 'en' and 'ja' are supported.

    • defaultCurrency: The currency to be displayed on the widget (default: 'KRW') Currently, only 'KRW' 'USD' and 'JPY' are supported.

Return value

  • Promise<void>

Example

await wepinProvider.init({
    defaultLanguage: 'ko',
    defaultCurrency: 'KRW',
})

isInitialized

It checks if WepinProvider is initialized properly.

wepinProvider.isInitialized()

Parameters

  • <void>

Return value

  • <boolean> Returns true if init was successful, otherwise returns false.

Example

if(wepinProvider.isInitialized()) {
  console.log('wepinProvider is initialized!')
}

changeLanguage

It allows changing the language and currency of the widget.

wepinProvider.changeLanguage(attributes)

Parameters

  • attributes <object>

    • language <string> It specifies the language to be displayed on the widget. Currently supported languages are en , ko and ja.

    • currency <string> It specifies the currency to be displayed on the widget. Currently supported currencies are USD , KRW and JPY.

Return value

  • <boolean> It returns true if the change was successful, otherwise returns false.

Example

if(wepinProvider.isInitialized()) {
  console.log('wepinProvider is initialized!')
}

Methods

Methods can be used after initializing the Wepin Provider.

getProvider

It returns the provider for the specified network.

await wepinProvider.getProvider(network)

Parameters

Return value

  • Promise<BaseProvider> - A EIP-1193 provider

Example

const provider = await wepinProvider.getProvider('ethereum')

finalize

It terminates the use of WepinProvider.

wepinProvider.finalize()

Parameters

  • <void>

Return value

  • <void>

Example

wepinProvider.finalize()

For more details on EVM-compatible network providers, please refer to the link below.

network <string> The Network Variable value for providers supported by Wepin, such as "ethereum" for Ethereum Mainnet, must be entered in lowercase. For the complete list, please refer to the "."

contact the Wepin
Supported Networks for Ethereum Provider
EIP-1193: Ethereum Provider JavaScript APIEthereum Improvement Proposals