Wagmi Connector

Wepin supports wallet connections using wagmi. You can easily integrate Wepin wallet via the wagmi interface with @wepin/wagmi-connector. Detailed information about this can be found on the official wagmi website below.

  • appId: <String> Your App Id assigned during registration

  • appKey: <String> Your App Key assigned during registration

  • defaultChainId: Number

    • The default Chain ID for connecting the wallet

    • If no value is specified, it automatically connects to the first network registered in the app.

  • attributes: <IAttributes> (optional) Wepin connection attribute values declared in @wepin/types

    • type: String If you input the show value, you can see the widget screen during the widget initialization process.

    • defaultLanguage: String The default language for the widget. The default value is ko. The currently supported languages are en and ko.

    • defaultCurrency: String The default currency for the widget. The default value is KRW. The currently supported currencies are USD and KRW.

const connectorOptions: WepinConnectorOptions = {
  appId: 'YOUR_APP_ID',
  appKey: 'YOUR_APP_KEY',
  defaultChainId: 1, // optional
  attributes: {  // optional
    type: 'show',
    defaultLanguage: 'ko',
    defaultCurrency: 'krw'
  }
}

Add WepinConnector to wagmi config

const config = createConfig({
  connectors: [
    // ... Other connectors,
    new WepinConnector({
      chains,
      options: connectorOptions,
    }),
  ],
  publicClient,
})

Wrap app with WagmiConfig

import { WagmiConfig } from 'wagmi'

function App() {
  return (
    <WagmiConfig config={config}>
      <YourRoutes />
    </WagmiConfig>
  )
}

Check Further

Afterwards, please refer to the wagmi guide below for detailed integration methods with wagmi.

Example

An example using wepin-wagmi-connector can be found on the GitHub repository below.

Last updated