Methods
changeLanguage
To modify the widget's properties such as language and currency
Parameters
attributes
<WidgetAttributes>
defaultLanguage <String> Set the default language of the widget. The default value is
ko
, and currently supported languages areen
andko.
defaultCurrency
<String>
Set the default currency of the widget. The default value isKRW
, and currently supported currencies areUSD
andKRW.
Returns
None
Exception
Example
getStatus
Returns the lifecycle status of the WepinSDK.
Parameters
None
Returns
<WepinLifeCycle>
NOT_INITIALIZED - WepinSDK has not been initialized.
INITIALIZING - WepinSDK is in the process of initializing.
INITIALIZED - WepinSDK has been successfully initialized.
BEFORE_LOGIN - WepinSDK is initialized, but the user is not logged in.
LOGIN - The user is logged in and registered with Wepin.
LOGIN_BEFORE_REGISTER - The user is logged in but not registered with Wepin.
Exception
Example
login
The login
variable is a Wepin login library that includes various authentication methods, allowing users to log in using different approaches. It supports email and password login, OAuth provider login, login using ID tokens or access tokens, and more. For detailed information on each method, refer to the official Login Library guide.
Available Methods
These methods support various login scenarios, allowing you to select the appropriate method based on your needs
Exception
Example
openWidget
Opens the widget window. If the user is not logged in, the widget window will not open. Therefore, the user must be logged in to Wepin before calling openWidget
. To log in to Wepin, use the loginWepin
method from the login
variable.
Parameters
None
Returns
None
Exception
Example
closeWidget
Closes the widget window. Closing the window does not log out the user.
Parameters
None
Returns
None
Exception
Example
register
Registers the user with Wepin. After signing up and logging in, the Wepin widget’s registration page opens, allowing the user to register (create a wallet and account) with Wepin services. This function can only be used when WepinLifeCycle
is loginBeforeRegister
. After calling the loginWepin()
method from the login
variable, if the loginStatus
value in userStatus
is not 'complete', this method should be called
Parameters
None
Returns
<WepinUser>
status
<'success' | 'fail'>
The login statususerInfo
<UserInfo>
(optional) The user's information, including:userId
<String>
The user's IDemail
<String>
The user's emailprovider
<'google' | 'apple' | 'naver' | 'discord' | 'email' | 'external_token'>
The login provideruse2FA
<Boolean>
Whether the user uses two-factor authentication
walletId
<String>
The user's wallet IDuserStatus
<UserStatus>
(optional) The user's Wepin login status, including:loginStatus
<WepinLoginStatus - 'complete' | 'pinRequired' | 'registerRequired'>
If the user'sloginStatus
value is not 'complete', the user must register with Wepin.pinRequired
<Boolean>
Whether a PIN is required
token
<Token>
The user's Wepin tokenaccessToken
<String>
The access tokenrefreshToken
<String>
The refresh token
Exception
Example
getAccounts
Returns the user's account information (networks and addresses) available in the app. This function can only be used after logging in to Wepin. If no parameters are provided, it returns information for all the user's accounts.
Parameters
networks
<List<String>>
optional The networks for which you want to return account information. The supported blockchain networks can be found on the supported blockchain pagewithEoa
<Boolean>
optional If AA accounts are present, this determines whether to include EOA accounts in the return.
Returns
<ArrayList<Account>> optional
network
<String>
The network type of the user's accountaddress
<String>
User account addresscontract
<String>
optional The contract address of the tokenisAA
<Boolean>
optional Indicates if it is an AA account
Exception
Example
getBalance
Returns the balance information (amount) of accounts. This function can only be used after logging in to Wepin. If no accounts
parameter is provided, it returns the balance of all user accounts.
Parameters
accounts
<ArrayList<Account>>
network
<String>
The network type of the account for which to check the balanceaddress
<String>
The address of the account for which to check the balancecontract
<String>
optional The contract address of the tokenisAA
<Boolean>
optional Indicates if it is an AA account
Returns
<ArrayList<AccountBalanceInfo>>
address
<String>
The network type of the user's accountnetwork
<String>
The address of the user's accountsymbol
<String>
Network symbolbalance
<String>
The amount of the network coin heldtokens
<TokenBalanceInfo>
symbol
<String>
Token symbolbalance
<String>
The amount of the token heldcontract
<String>
Token contract address
Exception
Example
getNFTs
Returns the user's NFTs. This function can only be used after logging in to Wepin. If no networks
parameter is provided, it returns all of the user's NFT information.
Parameters
refresh
<Boolean>
optional Required parameter to indicate whether to refresh the NFT datanetworks
<List<String>>
A list of network names to filter the NFTs
Returns
<ArrayList<WepinNFT>>
account
<Account>
network
<String>
The network type of the account for which to check the balanceaddress
<String>
The address of the account for which to check the balancecontract
<String>
optional The contract address of the tokenisAA
<Boolean>
optional Indicates if it is an AA account
contract
<WepinNFTContract>
name
<String>
NFT contract nameaddress
<String>
NFT contract addressscheme
<String>
Scheme of the NFTdescription
<String>
optional Description of the NFT contractnetwork
<String>
Network associated with the NFT contractexternalLink
<String>
optional External link associated with the NFT contractimageUrl
<String>
optional Image URL associated with the NFT contract
name
<String>
Name of the NFTdescription
<String>
Description of the NFTexternalLink
<String>
External link associated with the NFTimageUrl
<String>
Image URL associated with the NFTcontentUrl
<String>
optional URL pointing to the content associated with the NFTquantity
<Int>
Quantity of the NFTcontentType
<String>
Content type of the NFT ('image' | 'video')state
<Int>
State of the NFT
Exception
Example
send
Performs the send function using the widget and returns the ID information of the send transaction. This function can only be used after logging in to Wepin.
Parameters
sendData
<SendData>
account
<Account>
The user's account information to send fromnetwork
<String>
The network type of the account for which to check the balanceaddress
<String>
The address of the account for which to check the balancecontract
<String>
optional The contract address of the tokenisAA
<Boolean>
optional Indicates if it is an AA account
txData
<TxData>
toAddress
<String>
The address to send toamount
<String>
The amount to send
Returns
<SendResponse>
txId
<String>
The transaction ID of the send transaction
Exception
Example
finalize
Terminates the use of WepinSDK. The WepinLifeCycle
changes to notInitialized
.
Parameters
None
Returns
None
Exception
Example
WepinError
Last updated