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 registrationappKey: <String> Your App Key assigned during registrationdefaultChainId: NumberThe 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/typestype: String If you input theshowvalue, you can see the widget screen during the widget initialization process.defaultLanguage: String The default language for the widget. The default value isko. The currently supported languages areenandko.defaultCurrency: String The default currency for the widget. The default value isKRW. The currently supported currencies areUSDandKRW.
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
WepinConnector to wagmi configconst config = createConfig({
connectors: [
// ... Other connectors,
new WepinConnector({
chains,
options: connectorOptions,
}),
],
publicClient,
})Wrap app with WagmiConfig
WagmiConfigimport { 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
Was this helpful?