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
  • openWidget
  • Example
  • closeWidget
  • Example
  • getAccounts
  • Account
  • finalize
  • Example
  • getStatus (Supporting from version 0.0.4-alpha or higher)
  • Example
  • The Returned Values
  • login (Supporting from version 0.0.4-alpha or higher)
  • Example
  • WepinUser
  • getSignForLogin (Supporting from version 0.0.4-alpha or higher)
  • Example
  • Parameters
  • Returned Values
  • loginWithExternalToken (Supporting from version 0.0.4-alpha or higher)
  • Example
  • Parameters
  • Returned Values
  • logout (Supporting from version 0.0.4-alpha or higher)
  • Example
  • Returned Values

Was this helpful?

  1. Deprecated
  2. Flutter SDK

Methods

The following shows the methods provided by the Wepin widget flutter SDK.

openWidget

The openWidget method shows the widget window.

Example

_wepin.openWidget();

closeWidget

The closeWidget method closes the widget window.

Example

_wepin.closeWidget();

getAccounts

The getAccounts method returns user accounts of the networks available in the app. The returned value is an array of Account object. getAccounts is a method available after widget login.

List<Account> accounts = _wepin.getAccounts();

Account

The interface of the class returned by the getAccounts function is as follows, and it is defined in wepin_outputs.dart.

class Account {
    final dynamic? _network;  // The blockchain network of the account
    final dynamic? _address; // The account address
}
  • network: dynamic The blockchain network of the account. The name of each network can be found below.

  • address: dynamic The account address

finalize

The state of Wepin is initialized.

Example

_wepin.finalize();

getStatus (Supporting from version 0.0.4-alpha or higher)

It returns the Lifecycle state value of Wepin.

Example

await _wepin.getStatus()

The Returned Values

  • not_initialized: Wepin is not initialized.

  • initializing: Wepin initialization is in progress.

  • initialized: Wepin initialization is completed.

  • before_login: Wepin initialized, but the user is not logged in.

  • login: The user is logged in.

login (Supporting from version 0.0.4-alpha or higher)

If the user is not logged in, it shows the widget window. If the user is already logged in, it returns the logged-in user information.

Example

await _wepin.login()

WepinUser

The interface of the returned value class for the function is defined as follows, and it is defined in wepin_outputs.dart.

class WepinUser {
    final String _status;
    final UserInfo? _userInfo;
}

class UserInfo {
  final dynamic _userId;
  final dynamic _email;
  final dynamic _provider;
}
  • status: <'success' | 'fail'> login success status <'success' | 'fail'>

  • UserInfo: Information about the user

    • userId: User ID

    • email: User email address

    • provider: Information about the logged-in provider <'google'|'apple'|'email'|'naver'|'discord'|'external_token'>

getSignForLogin (Supporting from version 0.0.4-alpha or higher)

Example

_wepin.getSignForLogin(privateKey, token);

Parameters

  • token<String>: Token value received after logging in with OAuth.

Returned Values

  • signedToken<String>: The value of the token signed with the privateKey.

loginWithExternalToken (Supporting from version 0.0.4-alpha or higher)

Log in to Wepin with the token value received after logging in with OAuth.

Example

await _wepin.loginWithExternalToken(token, signedToken)

Parameters

  • token<String>: External token value to be used for login (e.g., idToken).

Returned Values

  • WepinUser

    The interface of the returned value class for the function is defined as follows, and it is defined in wepin_outputs.dart.

    class WepinUser {
        final String _status;
        final UserInfo? _userInfo;
    }
    
    class UserInfo {
      final dynamic _userId;
      final dynamic _email;
      final dynamic _provider;
    }
    • status: <'success' | 'fail'> login success status <'success' | 'fail'>

    • UserInfo: Information about the user

      • userId: User ID

      • email: User email address

      • provider: Information about the logged-in provider <'google'|'apple'|'email'|'naver'|'discord'|'external_token'>

logout (Supporting from version 0.0.4-alpha or higher)

It logs out the user logged into Wepin.

Example

await _wepin.logout()

Returned Values

  • WepinUser

    The interface of the returned value class for the function is defined as follows, and it is defined in wepin_outputs.dart.

    class WepinUser {
        final String _status;
        final UserInfo? _userInfo;
    }
    
    class UserInfo {
      final dynamic _userId;
      final dynamic _email;
      final dynamic _provider;
    }
    • status: <'success' | 'fail'> login success status <'success' | 'fail'>

    • UserInfo: Information about the user

      • userId: User ID

      • email: User email address

      • provider: Information about the logged-in provider <'google'|'apple'|'email'|'naver'|'discord'|'external_token'>

PreviousInitializationNextFinal Review

Last updated 8 months ago

Was this helpful?

returns a signed token value used for login.

privateKey<String>: PrivateKey value used to sign the token for .

The key for signing can be obtained from . In the Development Tools menu, click Get your authentication key on the Login tab to retrieve the authentication key.

signedToken<String>: The signature value received after executing as the first parameter.

Supported blockchains
Wepin Workspace
loginWithExternalToken()
loginWithExternalToken()
getSignForLogin()