Transaction API

Transaction API

AUTHORIZATION - Bearer Token

This folder is using Bearer Token

-------------------------------------------------------------------------------------------------

◾ Domain Code

TX Status

txStDcd
txSt

1007001

Pending

1007002

Success

1007003

Failed

Signature Type

SignatureType
desc

SIGNATURE_TYPE_FOR_ASSET_TRANSFER

General asset transfer(native coin, token, nft) asset id is required for native coin and token transfer nft id is required for nft transfer

SIGNATURE_TYPE_FOR_SMARTCONTRACT_EXECUTION

Using when running SmartContracts, must enter a contract address in transferTo, contractAddress * TX from the maket required contractAddress, txInput * nft transfer for wallet -> game required contractAddress, transferMethod, nftId

SIGNATURE_TYPE_FOR_WALLETCONNECT

Using when Wallet Contract

Transfer Method

Method
desc

gameNftLock

nft transfer for wallet -> game required transferMethod, nftid

GET

---------------------------------------------------------------------------------------------------

Search - Recent withdrawal list

GET https://apis.cubeapi.io/v1/wallets/{wid}/assets/transfers/recent

Path Parameters

Name
Type
Description

wid*

Int

wellet id

Query Parameters

Name
Type
Description

limit

Int

Default 5

{
    "apiVersion": "1",
    "status": {
        "code": 200,
        "message": "OK"
    },
    "data": {
        "items": [
            {
                "historySeq": 38642,
                "chainId": 0,
                "transferSeq": 35932,
                "fid": 1111112,
                "wid": 10361,
                "walletAddress": "walletAddress",
                "assetInfo": {
                    "assetId": 6,
                    "createKst": null,
                    "updateKst": null,
                    "chainId": 0,
                    "chainNm": null,
                    "assetTypeDcd": null,
                    "assetType": null,
                    "contractAddress": null,
                    "assetNm": null,
                    "assetSymbol": null,
                    "assetSymbolImg": null,
                    "assetDecimal": 0,
                    "fncyYn": null,
                    "cubeYn": null,
                    "gcoinYn": null,
                    "useYn": null,
                    "defaultAssetYn": null,
                    "assetDesc": null,
                    "marketId": null,
                    "gameCode": null,
                    "btnDepositYn": null,
                    "btnWithdrawYn": null,
                    "btnBridgeYn": null,
                    "btnCubetogcoinYn": null,
                    "btnExchangeYn": null,
                    "btnGcointopointYn": null,
                    "btnGcointocubeYn": null,
                    "btnBuywithcardYn": null,
                    "assetButtonTypeDcd": null,
                    "assetButtonType": null,
                    "assetOrder": 0
                },
                "transferEventIndex": 0,
                "transferEventDcd": "1008001",
                "transferEvent": "Transfer",
                "transferMethod": "Transfer",
                "txStDcd": null,
                "txSt": null,
                "inOutDcd": "1006002",
                "inOut": "Withdrawal",
                "transferFrom": "transferFrom",
                "transferTo": "transferTo",
                "transferVal": 10000000000000000000,
                "displayTransferVal": "10,000,000,000,000,000,000",
                "blockNumber": 0,
                "blockHash": null,
                "blockTimestamp": 1667800823,
                "txId": null,
                "txIndex": 0,
                "txNonce": 0,
                "txVal": 0,
                "txFee": 0,
                "displayTxFee": "0",
                "txAnnotation": "transfer",
                "historyUts": 1667800827,
                "historyKst": null
            },
            {
                "historySeq": 38641,
                "chainId": 0,
                "transferSeq": 35927,
                "fid": 1111112,
                "wid": 10361,
                "walletAddress": "walletAddress",
                "assetInfo": {
                    "assetId": 6,
                    "createKst": null,
                    "updateKst": null,
                    "chainId": 0,
                    "chainNm": null,
                    "assetTypeDcd": null,
                    "assetType": null,
                    "contractAddress": null,
                    "assetNm": null,
                    "assetSymbol": null,
                    "assetSymbolImg": null,
                    "assetDecimal": 0,
                    "fncyYn": null,
                    "cubeYn": null,
                    "gcoinYn": null,
                    "useYn": null,
                    "defaultAssetYn": null,
                    "assetDesc": null,
                    "marketId": null,
                    "gameCode": null,
                    "btnDepositYn": null,
                    "btnWithdrawYn": null,
                    "btnBridgeYn": null,
                    "btnCubetogcoinYn": null,
                    "btnExchangeYn": null,
                    "btnGcointopointYn": null,
                    "btnGcointocubeYn": null,
                    "btnBuywithcardYn": null,
                    "assetButtonTypeDcd": null,
                    "assetButtonType": null,
                    "assetOrder": 0
                },
                "transferEventIndex": 0,
                "transferEventDcd": "1008001",
                "transferEvent": "Transfer",
                "transferMethod": "Transfer",
                "txStDcd": null,
                "txSt": null,
                "inOutDcd": "1006002",
                "inOut": "Withdrawal",
                "transferFrom": "transferFrom",
                "transferTo": "transferTo",
                "transferVal": 1000000000000000000000,
                "displayTransferVal": "1,000,000,000,000,000,000,000",
                "blockNumber": 0,
                "blockHash": null,
                "blockTimestamp": 1667797583,
                "txId": null,
                "txIndex": 0,
                "txNonce": 0,
                "txVal": 0,
                "txFee": 0,
                "displayTxFee": "0",
                "txAnnotation": "transfer",
                "historyUts": 1667797586,
                "historyKst": null
            }
            ...
        ]
    }
}

Search - ERC20 asset transfer history list

GET https://apis.cubeapi.io/v1/wallets/{wid}/assets/transfers

TX Status

Path Parameters

Name
Type
Description

wid*

Int

wallet id

Query Parameters

Name
Type
Description

InOut

String

deposit | withdrawal

assetId

int

asset id managed by wallet server

{
    "apiVersion": "1",
    "status": {
        "code": 200,
        "message": "OK"
    },
    "data": {
        "paging": {
            "pageNo": 1,
            "pageSize": 20,
            "totalCount": 3,
            "hasMore": false
        },
        "items": [
            {
                "historySeq": 38642,
                "transferSeq": 35932,
                "wid": 10361,
                "walletAddress": "walletAddress",
                "assetInfo": {
                    "assetId": 6,
                    "contractAddress": null,
                    "assetNm": "FNCY",
                    "assetSymbol": "FNCY",
                    "assetSymbolImg": null,
                    "assetDecimal": 18,
                    "fncyYn": null,
                    "cubeYn": null,
                    "gcoinYn": "N",
                    "assetDesc": null
                },
                "transferEventDcd": "1008001",
                "transferEvent": "Send",
                "transferMethod": "Transfer",
                "txStDcd": "1007002",
                "txSt": "Success",
                "inOutDcd": "1006002",
                "inOut": "Withdrawal",
                "transferFrom": "transferFrom",
                "transferTo": "transferTo",
                "transferVal": 10000000000000000000,
                "displayTransferVal": "10",
                "blockTimestamp": 1667800823,
                "txAnnotation": "transfer",
                "historyUts": 1667800827
            },
            {
                "historySeq": 38641,
                "transferSeq": 35927,
                "wid": 10361,
                "walletAddress": "walletAddress",
                "assetInfo": {
                    "assetId": 6,
                    "contractAddress": null,
                    "assetNm": "FNCY",
                    "assetSymbol": "FNCY",
                    "assetSymbolImg": null,
                    "assetDecimal": 18,
                    "fncyYn": null,
                    "cubeYn": null,
                    "gcoinYn": "N",
                    "assetDesc": null
                },
                "transferEventDcd": "1008001",
                "transferEvent": "Send",
                "transferMethod": "Transfer",
                "txStDcd": "1007002",
                "txSt": "Success",
                "inOutDcd": "1006002",
                "inOut": "Withdrawal",
                "transferFrom": "transferFrom",
                "transferTo": "transferTo",
                "transferVal": 1000000000000000000000,
                "displayTransferVal": "1,000",
                "blockTimestamp": 1667797583,
                "txAnnotation": "transfer",
                "historyUts": 1667797586
            },
            ...
        ]
    }
}

Search - ERC20 asset transfer history detail V1

GET https://apis.cubeapi.io/v1/wallets/{wid}/assets/transfers/{transferSeq}

Path Parameters

Name
Type
Description

wid*

Int

wallet id

transferSeq*

Int

seq of transfer

Query Parameters

Name
Type
Description

chainId

Int

chain id

{
  "apiVersion": "1",
  "status": {
    "code": 200,
    "message": "OK"
  },
  "data": {
    "items": [
      {
        "transferSeq": 1,
        "wid": 10030,
        "walletAddress": "walletAddress",
        "assetInfo": {
          "assetId": 1,
          "assetNm": "Binance Coin",
          "assetSymbol": "BNB",
          "assetSymbolImg": "",
          "assetDecimal": 18,
          "gcoinYn": "N"
        },
        "transferEventDcd": "1008001",
        "transferEvent": "Transfer",
        "transferMethod": "Transfer",
        "txStDcd": "1007002",
        "txSt": "Success",
        "inOutDcd": "1006001",
        "inOut": "Deposit",
        "transferFrom": "transferFrom",
        "transferTo": "transferTo",
        "transferVal": 1000000000000000000,
        "blockTimestamp": 1646036385,
        "txId": "txId",
        "txIndex": 1,
        "txNonce": 3877852,
        "txVal": 1000000000000000000,
        "txFee": 378000000000000,
        "txAnnotation": null,
        "historyUts": 1646482520,
        "historyKst": null
      }
    ]
  }
}

Search - ERC20 asset transfer history detail V2

GET https://apis.cubeapi.io/v2/wallets/{wid}/assets/transfers/{historySeq}

Lost of existing key uniqueness due to chain addition

Reset key for detail

Change trasferSeq -> historySeq

Path Parameters

Name
Type
Description

wid*

Int

wallet id

historySeq*

Int

seq you want to search

Query Parameters

Name
Type
Description

inOut

String

deposit | withdraw

assetId

Int

asset id managed by wallet server

{
  "apiVersion": "2",
  "status": {
    "code": 200,
    "message": "OK"
  },
  "data": {
    "items": [
      {
        "transferSeq": 44,
        "fid": 2517,
        "wid": 10003,
        "walletAddress": "walletAddress",
        "assetInfo": {
          "assetId": 5,
          "contractAddress": null,
          "assetNm": "Ethereum Coin",
          "assetSymbol": "ETH",
          "assetSymbolImg": "assetSymbolImg URL",
          "assetDecimal": 18,
          "cubeYn": null,
          "gcoinYn": "N",
          "assetDesc": null
        },
        "transferEventDcd": "1008001",
        "transferEvent": "Transfer",
        "transferMethod": "Transfer",
        "txStDcd": "1007002",
        "txSt": "Success",
        "inOutDcd": "1006001",
        "inOut": "Deposit",
        "transferFrom": "transferFrom",
        "transferTo": "transferTo",
        "transferVal": 100000000000000000,
        "displayTransferVal": "0.1",
        "blockTimestamp": 1654674954,
        "txId": "txId",
        "txIndex": 55,
        "txNonce": 26,
        "txVal": 100000000000000000,
        "txFee": 31500000168000,
        "displayTxFee": "0.000031500000168",
        "txAnnotation": null,
        "historyUts": 1654675025
      }
    ]
  }
}

POST

---------------------------------------------------------------------------------------------------

Check - Transfer Ticket V1

POST https://apis.cubeapi.io/v1/transfers/estimate

Signature Type

Transfer Method

Checking transfer availability and checking nonce, gas limit before generate transfer ticket(/v1/transfers/tickets)

Returns the WalletSignatureTicketDomain from which tickets can be generated

Ethereum transfer is possible from V2

Transacion Generation Flow

1.Cheking transfer ticket -> Checking readiness to send and return by adding required values for transfer

2.Generate transfer ticket -> Generate transfer history as ticket to save database and return ticket UUID

3.transfer transaction -> Through the ticket UUID and wallet passwords obtained by the generated transfer tickets, promote signature and network in server

Request Body

Name
Type
Description

formerTicketUuid

String

Previous ticket UUID when using batch transaction

signatureType*

Enum

transferTo*

String

Address to send

transferVal

BigDecimal

Coin, nft quantity to send (Contract is typically 0)

transferMethod

String

txGasPrice

BigDecimal

Gas price(defualt 10 gwei)

txInput

String

contractAddress

String

assetId

Int

Required for asset transfer

nftId

Long

Required for nft transfer

contractParameters

List

not implemented-no need to put it in

wid*

Int

wallet id

{
  "apiVersion": "1",
  "status": {
    "code": 200,
    "message": "OK"
  },
  "data": {
    "resultType": "WalletSignatureTicketInsertResultCodes",
    "result": {
      "isSuccess": true|false,
      "code": "enum code of WalletSignatureTicketInsertResultCodes",
      "number": http status code,
      "message": http status message
    },
    "items": [
      {
        "formerTicketUuid": null,
        "wid": 10036,
        "signatureType": "SIGNATURE_TYPE_FOR_SMARTCONTRACT_EXECUTION",
        "transferFrom": "transferFrom",
        "transferTo": "transferTo",
        "transferVal": 0,
        "transferMethod": null,
        "txNonce": 9,
        "txGasPrice": 10000000000,
        "txGasLimit": 36103,
        "txInput": "txInput",
        "contractAddress": "contractAddress",
        "assetId": null,
        "nftId": null,
        "tokenId": null
      }
    ]
  }
}

Check - Transfer Ticket V2

POST https://apis.cubeapi.io/v2/transfers/estimate

Signature Type

Transfer Method

Checking transfer availability and checking nonce, gas limit before generate transfer ticket(/v2/transfers/tickets)

Returns the WalletSignatureTicketDomain from which tickets can be generated

Transacion Generation Flow

1.Cheking transfer ticket -> Checking readiness to send and return by adding required values for transfer

2.Generate transfer ticket -> Generate transfer history as ticket to save database and return ticket UUID

3.transfer transaction -> Through the ticket UUID and wallet passwords obtained by the generated transfer tickets, promote signature and network in server

Request Body

Name
Type
Description

signatureType*

Enum

transferTo*

String

Address to send

transferVal

BigDecimal

Coin, nft quantity to send (Contract is typically 0)

txGasPrice

BigDecimal

Gas price(defualt 10 gwei)

txInput

String

contractAddress

String

assetId

Int

Required for asset Transfer

nftId

Long

Required for nft Transfer

contractParameters

List

not implemented: no need to put it in

wid*

Int

wellet id

formerTicketUuid

String

Previous ticket UUID when using batch transaction

transferMethod

String

chainId*

Int

bsc, eth chain id (1 or 2)

maxPriorityPerGas

BigDecimal

eip-1559

maxFeePerGas

BigDecimal

eip-1559

txGasLimit

BigDecimal

if value is 0 apply value as gasLimit

{
  "apiVersion": "2",
  "status": {
    "code": 200,
    "message": "OK"
  },
  "data": {
    "resultType": "WalletSignatureTicketInsertResultCodes",
    "result": {
      "isSuccess": true,
      "code": "SUCCESS",
      "number": 200,
      "message": "Success"
    },
    "items": [
      {
        "formerTicketUuid": null,
        "wid": 10036,
        "signatureType": "SIGNATURE_TYPE_FOR_SMARTCONTRACT_EXECUTION",
        "transferFrom": "transferFrom",
        "transferTo": "transferTo",
        "transferVal": 0,
        "transferMethod": null,
        "txNonce": 9,
        "txGasPrice": 10000000000,
        "txGasLimit": 36103,
        "txInput": "txInput",
        "contractAddress": "contractAddress",
        "assetId": null,
        "nftId": null,
        "tokenId": null
      }
    ]
  }
}

Create - Transfer Ticket V1

POST https://apis.cubeapi.io/v1/transfers/tickets

SignatureType

Transaction transfer process

1.Ticket create(/v1/transfers/ticksets)

2.Ticket authenfication(/v1/transfers/tickets/:ticketUuid)

Transaction authenfication - get HASH

transferHash + ${transferTo} + ${transferVal} + ${txInput} + ${contractAddress}

Headers

Name
Type
Description

txInput

String

Use if walletconnect

transferTo*

String

Address to send

nftId

Long

Required for nft transfer (managed by wallet server)

contractAddress

String

Use if walletconnect nft,token - Not required for transmission

txGasPrice

BigDecimal

Gas price (defualt 10 gwei) (10 gwei -> 10000000000)

wid*

Int

wallet id

signatureType*

Enum

transferVal*

BigDecimal

Amount to transfer (1 BNB -> 100000000000000000)

assetId

Int

Required for native coin, token transmission If this value exists, transferVal is assetId

tokenId

String

Required for nft transfer (managed by wallet server)

{
  "apiVersion": "1",
  "status": {
    "code": 200,
    "message": "OK"
  },
  "data": {
    "resultType": "WalletSignatureTicketInsertResultCodes",
    "result": {
      "isSuccess": true,
      "code": "SUCCESS",
      "number": 200,
      "message": "Success"
    },
    "ticketUuid": "ticketUuid",
    "ticketHash": "ticketHash"
  }
}

Create - Transfer Ticket V2

POST https://apis.cubeapi.io/v2/transfers/tickets

SignatureType

Transaction transfer process

1.Ticket create(/v2/transfers/ticksets)

2.Ticket authenfication(/v2/transfers/tickets/:ticketUuid)

Transaction authenfication - get HASH

transferHash + ${transferTo} + ${transferVal} + ${txInput} + ${contractAddress}

Headers

Name
Type
Description

txInput

String

Use if walletconnect

transferTo*

String

Address to send

nftId

Long

Required for nft transfer (managed by wallet server)

contractAddress

String

Use if walletconnect nft,token - Not required for transmission

txGasPrice

BigDecimal

Gas price (defualt 10 gwei) (10 gwei -> 10000000000)

wid*

Int

wallet id

signatureType*

Enum

transferVal*

BigDecimal

Amount to transfer (1 BNB -> 100000000000000000)

assetId

Int

Required for native coin, token transmission If this value exists, transferVal is assetId

tokenId

String

Required for nft transfer (managed by blockchain)

chainId*

Int

bsc, eth chain id (1 or 2)

maxPriorityPerGas

BigDecimal

eip-1559

maxFeePerGas

BigDecimal

eip-1559

txGasLimit

BigDecimal

if value is 0 apply value as gasLimit

{
  "apiVersion": "2",
  "status": {
    "code": 200,
    "message": "OK"
  },
  "data": {
    "resultType": "WalletSignatureTicketInsertResultCodes",
    "result": {
      "isSuccess": true,
      "code": "SUCCESS",
      "number": 200,
      "message": "Success"
    },
    "ticketUuid": "ticketUuid",
    "ticketHash": "ticketHash"
  }
}

Transfer - Transaction V2

POST https://apis.cubeapi.io/v2/transfers/tickets/:ticketUuid

Batch Transaction available (Generate n transaction in one block)

Require pin encrypted with sha256

Headers

Name
Type
Description

ticketUuidList*

List

ticketUUID list obtained from transfer ticket generation If there is only one send, please put one

rsaEncryptedHashedPin*

String

Encrypted sha256 with rsa public key

{
  "apiVersion": "2",
  "status": {
    "code": 200,
    "message": "OK"
  },
  "data": {
    "resultType": "SignAndSendResultCodes",
    "result": {
      "isSuccess": true,
      "code": "SUCCESS",
      "number": 200,
      "message": "Success"
    },
    "items": [
      {
        "ticketUuid": "ticketUuid",
        "txId": "txId",
        "error": null
      }
    ]
  }
}