NAV Navigation
HTTP

Hancock wallet hub v7.0.3

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Wallet hub allows you to send transactions to DLT and to sign the transactions with the help of a sign provider service previously configured

Current blockchains supported {dlt} ethereum

Base URLs:

Web: BBVA Hancock License: Apache 2.0

/{dlt}/sign-tx

Sign transaction

Code samples

POST https://host/{version}/wallet-hub/{dlt}/sign-tx HTTP/1.1
Host: host
Content-Type: application/json
Accept: application/json

POST /{dlt}/sign-tx

Method for sign raw transactions through a sign provider.

Body parameter

{
  "provider": "fakeprovider",
  "rawTx": {
    "to": "0xcffffffffffffff000000000000000000000000",
    "from": "0xcffffffffffffff000000000000000000000001",
    "data": "transaction",
    "value": "2",
    "gasPrice": "0x3b9aca00",
    "nonce": "0x642",
    "gas": "0x5208",
    "chainId": 1
  }
}

Parameters

Name In Type Required Description
dlt path string true Dlt to work with
body body signRequest true Sign request schema to request the signature

Example responses

200 Response

{
  "success": true
}

Responses

Status Meaning Description Schema
200 OK Sign success signResponse
400 Bad Request Bad request genericError
500 Internal Server Error Unexpected error genericError

/{dlt}/send-signed-tx

Send signed transaction

Code samples

POST https://host/{version}/wallet-hub/{dlt}/send-signed-tx HTTP/1.1
Host: host
Content-Type: application/json
Accept: application/json

POST /{dlt}/send-signed-tx

Method for send a signed raw transactions to the dlt.

Body parameter

{
  "tx": "0xf865820642843b9aca008252089410578a2886306b0fc551c79e85a723f3418ca0d502801ca0c089da6d1e8b665def3d53d4c2cb79ff51742ecbc95580420922ee4a599ee73ba041102ef1cffd00c6a731c604a64742bcab70362dc7d081139946c867440104cc"
}

Parameters

Name In Type Required Description
dlt path string true Dlt to work with
body body sendSignReqest true Send signed request schema to send to dlt

Example responses

200 Response

{
  "success": true,
  "transactionHash": "0x69cc5e3d33f1c12944b31b4953fc7a0301a42da1f48e7c35e3cdf114f4b3cb0e"
}

Responses

Status Meaning Description Schema
200 OK Send signed success sendSignResponse
400 Bad Request Bad request genericError
500 Internal Server Error Unexpected error genericError

/{dlt}/send-tx

Send transaction

Code samples

POST https://host/{version}/wallet-hub/{dlt}/send-tx HTTP/1.1
Host: host
Content-Type: application/json
Accept: application/json

POST /{dlt}/send-tx

Method for send raw transactions to dlt.

Body parameter

{
  "tx": {
    "to": "0xcffffffffffffff000000000000000000000000",
    "from": "0xcffffffffffffff000000000000000000000001",
    "data": "transaction",
    "value": "2",
    "gasPrice": "0x3b9aca00",
    "nonce": "0x642",
    "gas": "0x5208",
    "chainId": 1
  }
}

Parameters

Name In Type Required Description
dlt path string true Dlt to work with
body body sendRequest true Send request schema to send to dlt

Example responses

200 Response

{
  "success": true,
  "txReceipt": null,
  "transactionHash": "0x80b0617a5e4865cc99d05106fe2c57c922c6fdbe9fa04c7ba37c9c44b68eddad",
  "transactionIndex": 0,
  "blockHash": "0x10488ec191a8da55394450e645218eab871c3cb278ee4b759723da7db92b9e10",
  "blockNumber": 153,
  "gasUsed": 21000,
  "cumulativeGasUsed": "21000,",
  "contractAddress": null,
  "logs": [],
  "status": true,
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}

Responses

Status Meaning Description Schema
200 OK Send success sendResponse
400 Bad Request Bad request genericError
500 Internal Server Error Unexpected error genericError

Schemas

genericResponse

{
  "result": {
    "code": "20X",
    "description": "DLT - Operation successfully requested"
  }
}

Generic Response Schema

Properties

Name Type Required Restrictions Description
result object true none none
» code string true none Api code
» description string true none Description about the api code

genericError

{
  "error": "400 - 500",
  "internalError": "HKAD5000X",
  "message": "Call Error",
  "extendedMessage": "Error: Description"
}

Generic Response Schema

Properties

Name Type Required Restrictions Description
error string true none Identification error code
internalError string true none Hancock error code
message string false none Hancock message
extendedMessage string false none Detailed message

signRequest

{
  "provider": "fakeprovider",
  "rawTx": {
    "to": "0xcffffffffffffff000000000000000000000000",
    "from": "0xcffffffffffffff000000000000000000000001",
    "data": "transaction",
    "value": "2",
    "gasPrice": "0x3b9aca00",
    "nonce": "0x642",
    "gas": "0x5208",
    "chainId": 1
  }
}

Sign request schema

Properties

Name Type Required Restrictions Description
provider string true none Alias of the provider signature
rawTx object true none none
» nonce string false none Nonce assigned to transaction
» from string false none Address of the sender in the DLT
» gas string false none Gas value of transaction
» to string false none Address of the receiver in the DLT
» gasPrice string false none Gas estimated
» value string false none Value of Weis to be transferred
» data string false none Information about the transfer
» chainId number false none Identifier number of the petition

signResponse

{
  "success": true
}

Sign response schema

Properties

Name Type Required Restrictions Description
success boolean true none Boolean object to indicate that signer provider take in the order

sendSignReqest

{
  "tx": "0xf865820642843b9aca008252089410578a2886306b0fc551c79e85a723f3418ca0d502801ca0c089da6d1e8b665def3d53d4c2cb79ff51742ecbc95580420922ee4a599ee73ba041102ef1cffd00c6a731c604a64742bcab70362dc7d081139946c867440104cc"
}

Send signed request schema

Properties

Name Type Required Restrictions Description
tx string true none Raw transaction signed

sendSignResponse

{
  "success": true,
  "transactionHash": "0x69cc5e3d33f1c12944b31b4953fc7a0301a42da1f48e7c35e3cdf114f4b3cb0e"
}

Send signed response schema

Properties

Name Type Required Restrictions Description
success boolean true none Boolean object to indicate that signer provider take in the order
transactionHash string true none Transaction hash give us by dlt

sendRequest

{
  "tx": {
    "to": "0xcffffffffffffff000000000000000000000000",
    "from": "0xcffffffffffffff000000000000000000000001",
    "data": "transaction",
    "value": "2",
    "gasPrice": "0x3b9aca00",
    "nonce": "0x642",
    "gas": "0x5208",
    "chainId": 1
  }
}

Send request schema

Properties

Name Type Required Restrictions Description
tx object true none none
» nonce string false none Nonce assigned to transaction
» from string false none Address of the sender in the DLT
» gas string false none Gas value of transaction
» to string false none Address of the receiver in the DLT
» gasPrice string false none Gas estimated
» value string false none Value of Weis to be transferred
» data string false none Information about the transfer
» chainId number false none Identifier number of the petition

sendResponse

{
  "success": true,
  "txReceipt": null,
  "transactionHash": "0x80b0617a5e4865cc99d05106fe2c57c922c6fdbe9fa04c7ba37c9c44b68eddad",
  "transactionIndex": 0,
  "blockHash": "0x10488ec191a8da55394450e645218eab871c3cb278ee4b759723da7db92b9e10",
  "blockNumber": 153,
  "gasUsed": 21000,
  "cumulativeGasUsed": "21000,",
  "contractAddress": null,
  "logs": [],
  "status": true,
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}

Send response schema

Properties

Name Type Required Restrictions Description
success boolean true none Indicate if dlt network accepts the transaction
txReceipt object true none A payload with the transactions fields
» contractAddress string false none The contract address created, if the transaction was a contract creation, otherwise null
» gasUsed number false none Gas value of transaction
» cumulativeGasUsed number false none The total amount of gas used when this transaction was executed in the block
» logsBloom string false none The bloom filter for the logs of the block
» logs array false none Array of log objects, which this transaction generated
» status boolean false none True if transaction succeeded
» blockHash string false none Hash of the block where this transaction was in
» blockNumber number false none Block number in wich registered the transaction
» transactionIndex string false none Transactions index position in the block
» transactionHash string false none Hash of the transaction