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
  • Retrieve Transaction Information
  • Sign Transaction
  • Broadcast Transaction
  • Response

Was this helpful?

  1. API

Transaction

PreviousToken and NFTNextWeb: JavaScript SDK

Last updated 1 month ago

Was this helpful?

The APIs related to executing transactions consist of three components:

  • /v1/tx/prepare

  • /v1/tx/sign

  • /v1/tx/broadcast

The necessary APIs can be executed sequentially depending on the situation

  • Generating a signature only: Retrieve Transaction Information ⇒ Sign Transaction

  • Generating a signature and broadcasting in a single step: Retrieve Transaction Information ⇒ Broadcast Transaction

    • (Optional) Generating a signature and broadcasting: Retrieve Transaction Information ⇒ Sign Transaction ⇒ Broadcast Transaction

Retrieve Transaction Information

Retrieve information such as the required transaction fee.

POST /v1/tx/prepare HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}

Request

Parameter

Name
Type
Description
Required

userId

String

O

accountId

String

Account ID to send from /v1/account response value.

O

contract

String

Contract address of the token to be sent when sending tokens.

X

to

String

Recipient address

O

isNft

String

ERC1155 | ERC721 Define NFT scheme type when transferring FT.

X

tokenId

Number String

NFT token ID when isNft is set and transferring an NFT.

X

amount

String

Amount of coin or token to send when transferring FT.

X

Response

Success Response

Name
Type
Description

balance

String

The current balance of the account to be transferred.

decimals

String

The decimals of the coin in the account to be transferred.

symbol

String

The symbol of the coin in the account to be transferred.

tokenId

Number

If the account to be transferred is a token account, the tokenId.

detail

TxData(Object)

The data required for the transaction. The TxData format differs depending on the type of account.

Sign Transaction

POST /v1/tx/sign HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}

Request

Parameter

Name
Type
Description
Required

userId

String

O

type

String

Types of Signatures •transaction (transaction) | msg_sign (Personal sign) | sign_data (typed data) • The configuration of txData differs depending on the type. •msg_sign | sign_data currently supports only EVM transactions.

O

pin

UVD

User's UVD

O

walletId

String

User Wallet ID

O

accountId

String

O

tokenId

String

tokenId for token transfers.

X

isNft

String

ERC1155 | ERC721

X

contract

String

Contract address for token transfers.

X

txData

TxData(Object)

O

otpCode

Object

OTP authentication information.

X

Response

Success Response

Name
Type
Description

signatureResult

Object

Sign result value. Structure varies by transmission network.

transaction

Object

Transmission details.

Broadcast Transaction

Sends the signed transaction.

POST /v1/tx/broadcast HTTP/1.1
Host: sdk.wepin.io
X-API-KEY: ${APP_KEY}
X-API-DOMAIN: {APP_DOMAIN}
X-SDK-TYPE: {platform}_rest_api
Content-Type: application/json
Authorization: Bearer ${access_token}

Request

Parameter

Name
Type
Description
Required

userId

String

O

type

String

Types of Signatures • transaction (transaction) | msg_sign (Personal sign) | sign_data (typed dat • The configuration of txData varies depending on the type. • msg_sign | sign_data currently supports only EVM transactions.

O

pin

UVD

User's UVD

O

walletId

String

User Wallet ID

O

accountId

String

O

tokenId

String

tokenId for token transfers.

X

contract

String

Contract address for token transfers.

X

isNft

String

ERC1155 | ERC721

X

signatureResult

String | Object

When executing in the order of /prepare, /sign, and /broadcast, this is the already signed data to be broadcasted. Use the data received after signing (/tx/sign) without modification.

X

txData

TxData(Object)

X

otpCode

Object

OTP authentication information.

X

Response

Success Response

Name
Type
Description

signatureResult

Object

Sign result value. The structure varies slightly depending on the transmission network.

transaction

Object

Transmission details.

broadcastData

String

Data sent to the network.

txid

String

Transaction ID

userId from the response.

The actual signing is performed using the data obtained through . If necessary, the fee value in TxData can be modified before signing. Before signing, the user's wallet PIN must be obtained using the PIN Pad Library, and the UVD must be sent together.

userId from the response.

ID of the account to be sent. Must match the accountId from .

Transaction data required. Includes the data values retrieved through , with a format differing based on the type of account.

userId from the response.

ID of the account to be sent. Must match the accountId from

When executing in the order of /prepare and /broadcast, this is the required transaction data when signing and broadcasting in a single process. Transaction data required. Includes the data retrieved through , with a format differing based on the type of account.

Retrieve Transaction Information
Sign Transaction
Broadcast Transaction
Retrieve Transaction Information
Retrieve Transaction Information
Retrieve Transaction Information
Retrieve Transaction Information
Retrieve Transaction Information
Login
Login
Login