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 |
Search - ERC20 asset transfer history list
GET
https://apis.cubeapi.io/v1/wallets/{wid}/assets/transfers
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 |
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 |
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 |
◾ POST
---------------------------------------------------------------------------------------------------
Check - Transfer Ticket V1
POST
https://apis.cubeapi.io/v1/transfers/estimate
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 |
Check - Transfer Ticket V2
POST
https://apis.cubeapi.io/v2/transfers/estimate
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 |
Create - Transfer Ticket V1
POST
https://apis.cubeapi.io/v1/transfers/tickets
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) |
Create - Transfer Ticket V2
POST
https://apis.cubeapi.io/v2/transfers/tickets
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 |
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 |