Blockchain management

Documentation
DATABETA

Blockchain Management Overview

Build unstoppable blockchain applications. The Blockchain management API allows you to connect your application to a private or public blockchain, and create and manage your wallets and contracts easily. Use the contract-to-api conversion to directly interact with your Blockchain components using a REST api and integrate your app with an Ethereum Blockchain.

User-friendly

Create your End 2 End blockchain application in a matter of days. It is also easy to integrate with other assets. F.e. with our Blockchain-as-a-Service module you can create your own private chain based on Ethereum technology. Have a look at what it has to offer.

Go to Blockchain-as-a-Service

Integrate with other tools

Thanks to our CloudEngine module, Blockchain applications are very easy to build and integrate with other tools. If you haven't discovered our CloudEngine yet, now is the time!

Go to CloudEngine

Blockchain Management GUI

The graphical user interface for blockchain management can be found at https://blockchain.enco.io. You will need to be logged in into the EnCo Marketplace and have a subscription for the Blockchain Management API to be able to access it.

As can be seen in the overview below, Blockchain Management consists of 4 main components:

  1. A drop-down box to select on which blockchain you want to work.
  2. A tab page to manage your wallets on the blockchain selected in the drop-down box.
  3. A tab page to manage your contracts on the blockchain selected in the drop-down box.
  4. A place to inspect all transactions your wallets and contracts are involved in.

Overview of Blockchain Management GUI

1. Blockchain Selection

At the top of the page we can find a drop-down box to select the blockchain we want to work on. This can either be a public chain, one of your private chains or the encoshared_ chain.

  • A public chain is a chain that is accessible to the entire world. A public chain can be recognized in the drop-down box by its accompanying globe symbol. An example is the rinkeby chain in the screenshot below.
  • A private chain is a chain that is only accessible to a limited set of users. For it to become visible in the drop-down box, you will need to create a private chain first. This can be done with the [Blockchain-as-a-Service]() asset if you are logged in into the EnCo Marketplace and have a subscription for the Blockchain-as-a-Service API. A private chain can be recognized in the drop-down box by its accompanying lock symbol. An example is the MyPrivateChain chain in the screenshot below.
  • The enco_shared chain is a private chain that is accessible to all EnCo users. It can be recognized in the drop-down box by its accompanying users symbol.

Blockchain selection

2. Wallets

The wallet page gives you an overview of all the wallets you manage. For every wallet you can see

  • The name of your wallet. This is a user friendly name that is usable only within EnCo. This has no meaning/existence on the actual blockchain.
  • The address of your wallet. This is the identifier of your wallet on the blockchain. It can be copied to your clipboard by clicking the clipboard symbol right next to it.
  • The transaction count specifies how many transactions that you made with this wallet. This only includes the transactions that were mined into a block.
  • The balance of funds in your wallet.

Wallet overview

You get a few actions to manage your wallets:

  1. Create a new wallet (plus symbol).
  2. Import an existing wallet (down-arrow symbol).
  3. Transfer funds from your wallets (double-arrow symbol).
  4. Export the wallet file of your wallet (up-arrow symbol).
  5. Delete/archive your wallet (bin symbol).

2.1 Create Wallet

Creating a new wallet

When creating a wallet, you can give it a user friendly name. This name can be left empty if wanted; just press the Add button. To rename a wallet at a later time (even if has no name), just hover over the current name until a pencil symbol appears that allows you to change the name.

Rename a wallet

2.2 Import wallet

A existing wallet can be imported into EnCo. This way it can be used in all EnCo's blockchain management utilities. There are two ways of importing a wallet. Either you provide some sort of private key, or you don't.

Import wallet with raw private key

To import a wallet using its private key, it suffices to only provide the key itself. The address of the wallet it belongs to is calculated automatically.

Import a wallet using a private key

Import wallet with a mnemonic seed private key

A wallet can be imported from a mnemonic seed. You can choose to provide a custom derivation path for this seed. If you choose not to, the default path m/44'/60'/0'/0/0 will be used.

Import a wallet using a mnemonic seed

Note that EnCo does not store the mnemonic seed, so you can only import one wallet at a time. If you want to use the same seed with different derivation paths, it has to be done separately for every derivation path.

Import wallet with its address

A wallet can be imported by only using its address. This way you can keep the private key of the wallet for yourself while the wallet can still be used in all of EnCo's blockchain management utilities. But whenever the private key is required to make a transaction, a popup will be displayed with the unsigned generated transaction. You can copy that transaction and you'll have to sign it offline with your private key before broadcasting it to the blockchain.

Import a wallet with its address

2.3 Transfer funds

When transferring funds you can choose have a drop-down box to choose from which wallet you want to send the funds from. In the second box you can type the recipients' address. If you want to send the funds to one of your own managed wallets, you can choose it from the drop-down box.

The amount of funds to transfer can be represented in different units to make it easier to work with very small and very large amounts.

EnCo will, by default, transfer your funds using the current gas price. But you can specify your custom gas price if you'd like.

Transfer funds

2.4 Export Wallet File

If you would like to have acces to the private key of your wallet, you can choose to export an encrypted version of your wallet file.

Export wallet

The password needed to decrypt the wallet file can be copied to your clipboard while the encrypted wallet file itself can be downloaded as a JSON file to your computer.

2.5 Archive Wallet

You can choose to archive your wallet. That way it will no longer be visible by default in your wallet list. The wallet will obviously still exist on the blockchain because nothing on the blockchain can be deleted. If needed you can unarchive your archived wallets in case you'd like to for example retrieve funds from that wallet.

3 Contracts

The contract page gives you an overview of all the contracts you manage. For every contract you can see

  • The name of your contract. This is a user friendly name that is usable only within EnCo. This has no meaning/existence on the actual blockchain.
  • The address of your contract. This is the identifier of your contract on the blockchain. It can be copied to your clipboard by clicking the clipboard symbol right next to it.
  • The Application Binary Interface (ABI). This is a JSON representation of all the publicly accessible functions and events of your contract.
  • The solidity code of the contract. This code can potentially be absent for imported onctracts or contracts which were deployed from its binary data instead of source code.

Contracts overview

You get a few actions to manage your wallets:

  1. Deploy a new contract (plus symbol).
  2. Import an existing contract (down-arrow symbol).
  3. Delete your contract (bin symbol).
  4. Invoke a function of your contract (serrated-circle symbol).

3.1 Deploy Contract

When deploying a contract you have to specify which of your wallets will be doing the deployment. You'll also have to provide some source code or binary data of the contract to deploy. When the deployment is successful, the contract will be identifiable by its generated address and will be visible by everyone with access to the chain.

Simple contract deployment

When you have the source code for the contract, the deployment is really simple:

  • Provide a user friendly name for the contract
  • Specify which of your wallets will do the deployment
  • Provide the source code

Simple contract deployment

Advanced contract deployment

When you click the option to Show advanced options, you can tweak a few more settings of your deployment:

  • You can provide a Target Contract Name. This is the name of the contract in the solidity source code. Being able to specify this is very useful when your source code has multiple contracts inside it.
  • You can choose to provide your own custom values for the gas price and gas limit that will be used during deployment.
  • When you compiled your code locally, you can choose to not provide the source code and instead provide the ABI and the binary code.

Advanced contract deployment

Advanced zipped contract deployment

When your have multiple contracts that extend from each other or depend on each other to be compilable, you can zip all those contracts into one file and provide the zip file as source code.

In this case you will also need to specify, in the Target Contract File box, the name of the file (including extension) that needs to be deployed.

Zipped contract deployment

3.2 Import Contract

When you want to interact with a contract that you yourself did not deploy, you will need to import it first.

To import a contract you will need its address and its ABI. That ABI is generated from it's original source code or can be provided by you.

Simple contract import

The easiest way of importing a contract is to supply its address and its source code.

Simple contract import

Note: It is your responsibility to provide the correct source code. If the code does not match the contract that was deployed for the provided address, no error will be thrown. It�s very unlikely you will be able to successfully invoke any function on this contract.

Advanced contract import

When showing the advanced options for contract imports, it is possible to supply a Target Contract Name for your provided source code. This is needed when there are multiple contracts in your source code.

Alternatively it is also possible to provide the contract's ABI instead of source code.

Advanced contract import

3.3 Delete contract

When deleting a contract, it is removed from your list of managed contracts. It is however not deleted from the blockchain itself. To accomplish that you'd need to invoke the selfdestruct function in your contract.

Because the contracts are not actually deleted from the blockchain, they can always be reimported as long as you remember their address and source code/ABI.

3.4 Invoke contract

Contracts have two types of functions. Functions that only read from the blockchain and functions that can also write to he blockchain. Read functions are always free to invoke. Write functions have a transaction fee.

Invoke read function

Read from smart contract

Invoke write function

When invoking write functions it is necessary to provide a wallet that will pay for the transaction fee. Optionally you can provide a custom gas price and gas limit. If your function allows you to send Ether to it, then you'll be able to specify the amount in the value field.

Write to smart contract

4. Transaction explorer

The transaction explorer shows you all transactions for your wallets and contracts. For each transaction you see:

  • The hash of the transaction. This uniquely identifies each transaction on the blockchain.
  • The number of the block this transaction is in. If your transaction is not yet mined, this field is empty.
  • The age of the transaction. If your transaction is not yet mined, this field is empty.
  • The address of the wallet that made the transaction.
  • The address of the wallet/contract the transaction was made to. This can be empty in case of a contract deployment.
  • The value of WEI that was send with this transaction.
  • The status that can either be PENDING or MINED

Transaction explorer overview

You get a few actions for your transactions:

  1. Status filter
  2. Contract invocation filter
  3. Transaction update/delete
  4. Full transaction info.

4.1 Status filter

With the status filter you can choose to only see transactions pending transactions or only see mined transactions.

4.2 Contract invocation filter

With this filter you can choose to only see the transactions that were a contract invocation.

4.3 Transaction update/delete

When a transaction is still pending, it is possible to update the gas price or delete the transaction entirely.

Unblock pending transactions

4.4 Full transaction info

When clicking the info symbol, you get a more detailed look of each transaction:

Full transaction overview# Blockchain Management API EnCo uses OAuth2 to protect API resources. In order to gain access to the resources exposed by your API assets, you will need to pass along a valid OAuth2 bearer access token.

Header Value Required
Authorization Bearer Yes
Accept application/json Yes
Content-type application/json Yes

Latest version: 1.0.0
Base url: https://api.enco.io/bc-mgmt/1.0.0
Response format: JSON

Endpoint overview

Method Endpoint
GET /chains
GET /chains/{chainName}/faucet/{walletIdentifier}
GET /chains/{chainName}/wallets
POST /chains/{chainName}/wallets
GET /chains/{chainName}/wallets/archived
GET /chains/{chainName}/wallets/{walletIdentifier}
PUT /chains/{chainName}/wallets/{walletIdentifier}
DELETE /chains/{chainName}/wallets/{walletIdentifier}
PUT /chains/{chainName}/wallets/{walletIdentifier}/unarchive
POST /chains/{chainName}/wallets/{walletIdentifier}/transfer
PUT /chains/{chainName}/wallets/{walletIdentifier}/transfer/{transactionId}
DELETE /chains/{chainName}/wallets/{walletIdentifier}/transfer/{transactionId}
GET /chains/{chainName}/wallets/{walletIdentifier}/key
GET /chains/{chainName}/wallets/{walletIdentifier}/export
GET /chains/{chainName}/contracts
POST /chains/{chainName}/contracts
POST /chains/{chainName}/contracts/estimates
POST /chains/{chainName}/contracts/constructor
POST /chains/{chainName}/contracts/zip
POST /chains/{chainName}/contracts/zip/estimates
POST /chains/{chainName}/contracts/zip/constructor
GET /chains/{chainName}/contracts/{contractIdentifier}
PUT /chains/{chainName}/contracts/{contractIdentifier}
DELETE /chains/{chainName}/contracts/{contractIdentifier}
GET /chains/{chainName}/contracts/{contractName}/swagger
POST /chains/{chainName}/contracts/{contractName}/{functionName}
POST /chains/{chainName}/contracts/{contractName}/estimates/{functionName}
POST /chains/{chainName}/contracts/{contractName}/advancedInvocation
POST /chains/{chainName}/contracts/advancedInvocation
GET /chains/{chainName}/explorer/{hexString}
GET /chains/{chainName}/explorer/blocks
GET /chains/{chainName}/explorer/blocks/{blockHash}
GET /chains/{chainName}/explorer/blocks/{blockHash}/transactions
GET /chains/{chainName}/explorer/transactions
GET /chains/{chainName}/explorer/transactions/{transactionHash}
GET /chains/{chainName}/explorer/addresses/{address}
GET /chains/{chainName}/explorer/addresses/{address}/transactions
POST /chains/{chainName}/transactions
GET /chains/{chainName}/events/subscriptions
POST /chains/{chainName}/events/subscriptions
DELETE /chains/{chainName}/events/subscriptions
GET /chains/{chainName}/events

/chains GET

Returns an array of all chains you have access to. This includes all the public chains and your private chains. In the case of private chains, both a user chosen name and a technical name is returned. All the endpoints that require you to provide a chain name as path parameter refer to the technical name of your chain.

Response payload
[ 
    {  
        "name": "string",  
        "technicalName": "string",  
        "public": "boolean"  
    }
]
Description
[ 
    {  
        "name": "The user friendly name of a chain",  
        "technicalName": "The technical name. This name has to be used in requests",  
        "public": "True if this is a public chain"  
    } 
]
Response example
[  
    {  
        "name": "rinkeby",  
        "technicalName": "rinkeby",  
        "public": true  
    },
    {  
        "name": "enco_shared",  
        "technicalName": "enco_shared",  
        "public": true  
    },
    {  
        "name": "MyPrivateChain",  
        "technicalName": "uvvrtvocybmbqstl",  
        "public": false  
    }
]

/chains/{chainName}/faucet/{walletIdentifier} GET

Sends funds to your wallet. This endpoint only works for chains which have a faucet. Currently this only the case for the enco_shared chain. To counter abuse of this endpoint it can only be called once every 5 minutes. As response you get details of the transaction which funds your wallet.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to receive funds
walletIdentifier Name or address of your wallet
Query parameters
Query parameter Description Required Default
amount Amount of request funds. This could be capped. Yes
Response payload
{  
    "transactionHash": "string",  
    "fromAddress": "string",  
    "toAddress": "string",  
    "value": "integer",  
    "value_str": "string",  
    "nonce": "integer",  
    "nonce_str": "string",  
    "gasLimit": "integer",  
    "gasLimit_str": "string",  
    "gasPrice": "integer",  
    "gasPrice_str": "string"  
}
Description
{  
    "transactionHash": "Hash of this transaction",  
    "fromAddress": "The address of the faucet",  
    "toAddress": "Your wallet address",  
    "value": "The amount of sent funds",  
    "value_str": "String representation of the amount of sent funds",  
    "nonce": "The nonce of this transactions",  
    "nonce_str": "String representation of the nonce of thic transaction",  
    "gasLimit": "The gas limit provided for this transaction",  
    "gasLimit_str": "String representation of the gas limit provided for this transaction",  
    "gasPrice": "The gas price provided for this transaction",  
    "gasPrice_str": "String representation of the gas price provided for this transaction"  
}
Response example
{  
    "transactionHash": "0x7ff9a14ffe318eeca9af13865a7c3433ca3fbab2205dab1869a4489e03edbef9",  
    "fromAddress": "0x3Bd9400C0a27c2cB6D5cF32e376Af7Ef5Fe9C929",  
    "toAddress": "0x2E44c0a80D170C301E6aF18633e9Da21ECb26D0A",  
    "value": 9000000000000000000,  
    "value_str": "9000000000000000000",  
    "nonce": 167,  
    "nonce_str": "167",  
    "gasLimit": 21000,  
    "gasLimit_str": "21000",  
    "gasPrice": 1,  
    "gasPrice_str": "1"  
}

/chains/{chainName}/wallets GET

Returns an array with all your wallets on a chain and some very basic status information about your wallets

Path parameters
Path parameter Description
chainName Name of the chain on which your wallets reside
Query parameters
Query parameter Description Required Default
balanceUnit The unit in which a wallet's balance should be displayed No Wei
Response payload
[ 
    {  
        "chainName": "string",  
        "name": "string",  
        "address": "string",  
        "transactionCount": "integer",  
        "transactionCount_str": "string",  
        "balance": "number",  
        "balance_str": "string"  
    } 
]
Description
[ 
    {  
        "chainName": "Name of the chain",  
        "name": "User friendly name of the wallet",  
        "address": "Address of the wallet",  
        "transactionCount": "Number of transactions this wallet has made",  
        "transactionCount_str": "String representation of the number of transactions this wallet has made",  
        "balance": "Balance of this wallet displayed in the requested unit",  
        "balance_str": "String representation of the balance of this wallet displayed in the requested unit"  
    } 
]
Response example
[ 
    {  
        "chainName": "rinkeby",  
        "name": "demo-wallet",  
        "address": "0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3",  
        "transactionCount": 1882,  
        "transactionCount_str": "1882",  
        "balance": 3.88121628197681609,  
        "balance_str": "3.88121628197681609"  
    } 
]

/chains/{chainName}/wallets POST

Create a new wallet or import an existing wallet. An optional user friendly name can be provided.

Importing a wallet is possible both with and without providing a private key. If no private key is provided, the wallet will be read-only and will not be able to execute any transactions or deploy any contracts. As private key it is possible to use either the raw key or the mnemonic seed.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to create/import a wallet. The name can only contain a-Z0-9 and dashes, but not start with 0-9 or a dash.
Query parameters
Query parameter Description Required Default
name A user friendly name for the wallet No
Request payload
{  
    "address": "string",  
    "privateKey": "string",  
    "mnemonic": "string",  
    "derivationPath": "string"  
}
Description
{  
    "address": "Address of the wallet. Only required/used when importing a wallet without any form of private key",  
    "privateKey": "A raw private key",  
    "mnemonic": "A mnemonic seed/private key",  
    "derivationPath": "The derivation path that needs to be used for this mnemonic"  
}
Request example new wallet
{}
Request example import wallet
{  
    "privateKey": "0f140555fbbff8696c6f85108d730a7b1f473a230b194f201dd3d7d6cbbf23ca",  
}
Request example import wallet
{  
    "mnemonic": "gate heavy bring little defense odor misery oak purpose glass stock aim twenty skull spawn",  
    "derivationPath": "m/44'/60'/8'/26/6"  
}
Request example import without key
{  
    "address": "0xaa564c68cdCa2a9a091edaAC29FeF2D326a87636"  
}
Response payload
{  
    "name": "string",  
    "address": "string"  
}
Description
{  
    "name": "string",  
    "address": "string"  
}
Response example
{  
    "name": "MyNewWallet",  
    "address": "0xd3D7d61B0033027E481f35fB473671Bd71468dA4"  
}

/chains/{chainName}/wallets/archived GET

Returns an array of archived wallets. Archived wallets are hidden in Enco and not usable until unarchived. They obviously still exist on the blockchain as it is not possible to delete wallets.

Path parameters
Path parameter Description
chainName Name of the chain on which you want retrieve archived wallets.
Response payload
[ 
    {  
        "name": "string",  
        "address": "string"  
    }
]
Description
[ 
    {  
        "name": "User friendly name. Only available if this wallet has a name.",  
        "address": "Address of the wallet"  
    }
]
Response example
[ 
    {  
        "address": "0x6F5F0Bd9A9eC2526BCd9a25c5147a3685cBCC4Ae"  
    }, 
    {  
        "name": "MyDemoWallet",  
        "address": "0x726AD0474395F0C41B51d5D04E27AD39D128Cee3"  
    }
]

/chains/{chainName}/wallets/{walletIdentifier} GET

Returns a wallet on a chain and some very basic status information your the wallets. This also works if you provide the wallet address of a wallet you do not own.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to retrieve a wallet.
walletIdentifier Name or address of a wallet on the chain.
Query parameters
Query parameter Description Required Default
balanceUnit The unit in which the wallet's balance should be displayed No Wei
Response payload
{  
    "chainName": "string",  
    "name": "string",  
    "address": "string",  
    "transactionCount": "integer",  
    "transactionCount_str": "string",  
    "balance": "number",  
    "balance_str": "string"  
} 
Description
{  
    "chainName": "Name of the chain",  
    "name": "User friendly name of the wallet",  
    "address": "Address of the wallet",  
    "transactionCount": "Number of transactions this wallet has made",  
    "transactionCount_str": "String representation of the number of transactions this wallet has made",  
    "balance": "Balance of this wallet displayed in the requested unit",  
    "balance_str": "String representation of the balance of this wallet displayed in the requested unit"  
} 
Response example
{  
    "chainName": "rinkeby",  
    "name": "demo-wallet",  
    "address": "0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3",  
    "transactionCount": 1882,  
    "transactionCount_str": "1882",  
    "balance": 3.88121628197681609,  
    "balance_str": "3.88121628197681609"  
} 

/chains/{chainName}/wallets/{walletIdentifier} DELETE

Archives a wallet. Though it is an DELETE method, wallets do not get deleted because the private key would become unrecoverable. Instead they get archived.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to archive your wallet.
walletIdentifier Name or address of your wallet on the chain.
Returns an HTTP 200 when successfully deleted.

/chains/{chainName}/wallets/{walletIdentifier} PUT

Rename a wallet. The address will of course stay the same as this can not be updated.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to rename your wallet.
walletIdentifier Name or address of your wallet on the chain.
Request payload
{  
    "name": "string"  
}
Description
{  
    "name": "The new name of your wallet"  
}
Request example
{  
    "name": "renamed"  
}
Response payload
{  
    "name": "string",  
    "address": "string"  
}
Description
{  
    "name": "The new name",  
    "address": "The address of the wallet"  
}
Response example
{  
    "name": "renamed",  
    "address": "0xc3889A1628B7c9F25ff820281926E41DC402d6a1"  
}

/chains/{chainName}/wallets/{walletIdentifier}/unarchive PUT

Unarchive a previously archived wallet.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to unarchive your wallet.
walletIdentifier Address of your wallet on the chain.
Response payload
{  
    "name": "string",  
    "address": "string"  
}
Description
{  
    "name": "The name of the unarchived wallet, if it has one.",  
    "address": "The address of the unarchived wallet."  
}
Response example
{  
    "name": "MyNewWallet",  
    "address": "0xd3D7d61B0033027E481f35fB473671Bd71468dA4"  
}

/chains/{chainName}/wallets/{walletIdentifier}/transfer POST

Transfer funds between your wallet and a provided address.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to transfer funds.
walletIdentifier Name or address of your wallet on the chain from where you want to send funds.
Request payload
{  
    "to" : "string",  
    "amount" : "number",  
    "unit": "string",  
    "gasPrice": "integer"  
}
Description
{  
    "to" : "The address of the wallet you want to send funds to. This could also be the user friendly name if it is one of your wallets.",  
    "amount" : "The amount of funds you want to transfer.",  
    "unit": "The unit of the amount of funds you want to transfer. This is optional: for Ethereum WEI is the default.",  
    "gasPrice": "This optional: if needed but not provided a guess will be made."  
}
Request example
{  
    "to" : "demo-wallet",  
    "amount" : 2,  
    "unit": "ether",  
    "gasPrice": 2200000000  
}
Response payload
{  
    "transactionHash": "string",  
    "fromAddress": "string",  
    "toAddress": "string",  
    "value": "integer",  
    "value_str": "string",  
    "nonce": "integer",  
    "nonce_str": "string",  
    "gasLimit": "integer",  
    "gasLimit_str": "string",  
    "gasPrice": "integer",  
    "gasPrice_str": "string"  
}
Description
{  
    "transactionHash": "The hash of the transaction that transfers the funds.",  
    "fromAddress": "The address of the wallet where the funds come from.",  
    "toAddress": "The address of the wallet where the funds go to.",  
    "value": "The amount of funds transferred.",  
    "value_str": "String representation of the amount of funds transferred.",  
    "nonce": "Nonce of the transaction that transfers the funds.",  
    "nonce_str": "String representation of the nonce of the transaction that transfers the funds.",  
    "gasLimit": "The gas limit used to make an Ethereum transfer of funds.",  
    "gasLimit_str": "String representation of the gas limit used to make an Ethereum transfer of funds.",  
    "gasPrice": "The gas price used to make an Ethereum transfer of funds.",  
    "gasPrice_str": "String representation of the gas price used to make an Ethereum transfer of funds."  
}
Response example
{  
    "transactionHash": "0xaf0da4bcf00fed0143f4d1a57355f3a2ef6c1e58d9e1ca8df0c730871aed99f7",  
    "fromAddress": "0x52B0d2fCF7FF7d42E2a2dd9fc8065307eDAffF26",  
    "toAddress": "0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3",  
    "value": 2000000000000000000,  
    "value_str": "2000000000000000000",  
    "nonce": 134,  
    "nonce_str": "134",  
    "gasLimit": 21000,  
    "gasLimit_str": "21000",  
    "gasPrice": 1000000000,  
    "gasPrice_str": "1000000000"  
}

/chains/{chainName}/wallets/{walletIdentifier}/transfer/{transactionHash} PUT

For Ethereum, as long as a transaction is not mined, the gas limit can be updated. This is useful when the original provided gas limit was too low and the transaction does not get mined. An unmined transaction blocks your wallet from making other transactions.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to update a transfer-of-funds transaction.
walletIdentifier Name or address of a wallet that made the transfer-of-funds transaction.
transactionHash The transaction hash of the transfer-of-funds transaction to be updated.
Request payload
{  
    "gasPrice": "integer"  
}
Description
{  
    "gasPrice": "The new, increased gas price for this transaction. This is optional: if omitted an estimate will be made."  
}
Request example
{  
    "gasPrice": 2300000000  
}
Response payload
{  
    "transactionHash": "string",  
    "fromAddress": "string",  
    "toAddress": "string",  
    "value": "integer",  
    "value_str": "string",  
    "nonce": "integer",  
    "nonce_str": "string",  
    "gasLimit": "integer",  
    "gasLimit_str": "string",  
    "gasPrice": "integer",  
    "gasPrice_str": "string"  
}
Description
{  
    "transactionHash": "The new hash of the updated transaction.",  
    "fromAddress": "The address of the wallet where the funds come from.",  
    "toAddress": "The address of the wallet where the funds go to.",  
    "value": "The amount of funds transferred.",  
    "value_str": "String representation of the amount of funds transferred.",  
    "nonce": "Nonce of the transaction that transfers the funds.",  
    "nonce_str": "String representation of the nonce of the transaction that transfers the funds.",  
    "gasLimit": "The gas limit used to make an Ethereum transfer of funds.",  
    "gasLimit_str": "String representation of the gas limit used to make an Ethereum transfer of funds.",  
    "gasPrice": "The new gas price used to make an Ethereum transfer of funds.",  
    "gasPrice_str": "String representation of the new gas price used to make an Ethereum transfer of funds."  
}
Response example
{  
    "transactionHash": "0xaf0da4bcf00fed0143f4d1a57355f3a2ef6c1e58d9e1ca8df0c730871aed99f7",  
    "fromAddress": "0x52B0d2fCF7FF7d42E2a2dd9fc8065307eDAffF26",  
    "toAddress": "0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3",  
    "value": 2000000000000000000,  
    "value_str": "2000000000000000000",  
    "nonce": 135,  
    "nonce_str": "135",  
    "gasLimit": 21000,  
    "gasLimit_str": "21000",  
    "gasPrice": 2300000000,  
    "gasPrice_str": "2300000000"  
}

/chains/{chainName}/wallets/{walletIdentifier}/transfer/{transactionHash} DELETE

For Ethereum, as long as a transaction is not mined, it can be cancelled. However a fee of 21000 * gasLimit will still need to be paid.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to delete a transfer-of-funds transaction.
walletIdentifier Name or address of a wallet that made the transfer-of-funds transaction.
transactionHash The transaction hash of the transfer-of-funds transaction to be cancelled.
Query parameters
Query parameter Description Required Default
gasPrice The gas price you are willing to pay to cancel the transaction. This is optional: if omitted, a guess will be made. No guess
Response payload
{  
    "transactionHash": "string",  
    "fromAddress": "string",  
    "toAddress": "string",  
    "value": "integer",  
    "value_str": "string",  
    "nonce": "integer",  
    "nonce_str": "string",  
    "gasLimit": "integer",  
    "gasLimit_str": "string",  
    "gasPrice": "integer",  
    "gasPrice_str": "string"  
}
Description
{  
    "transactionHash": "The hash of the cancellation transaction.",  
    "fromAddress": "The address of the wallet where the funds come from.",  
    "toAddress": "The address of the wallet where the funds go to. This will be the same as the from address.",  
    "value": "The amount of funds transferred. This will be 0.",  
    "value_str": "String representation of the amount of funds transferred. This will be 0.",  
    "nonce": "Nonce of the transaction that transfers the funds.",  
    "nonce_str": "String representation of the nonce of the transaction that transfers the funds.",  
    "gasLimit": "The gas limit used to make an Ethereum transfer of funds.",  
    "gasLimit_str": "String representation of the gas limit used to make an Ethereum transfer of funds.",  
    "gasPrice": "The gas price used to make an Ethereum transfer of funds.",  
    "gasPrice_str": "String representation of the new gas price used to make an Ethereum transfer of funds."  
}
Response example
{  
    "transactionHash": "0xaf0da4bcf00fed0143f4d1a57355f3a2ef6c1e58d9e1ca8df0c730871aed99f7",  
    "fromAddress": "0x52B0d2fCF7FF7d42E2a2dd9fc8065307eDAffF26",  
    "toAddress": "0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3",  
    "value": 2000000000000000000,  
    "value_str": "2000000000000000000",  
    "nonce": 136,  
    "nonce_str": "136",  
    "gasLimit": 21000,  
    "gasLimit_str": "21000",  
    "gasPrice": 2300000000,  
    "gasPrice_str": "2300000000"  
}

To delete/cancel a transaction, a new transfer is made using the same transaction nonce which sends 0 Ether to your own wallet. The transaction in the response is this new transaction. Though no funds will be sent, a transaction fee still needs to be paid.

/chains/{chainName}/wallets/{walletIdentifier}/key GET

Returns the private key of your wallet

Path parameters
Path parameter Description
chainName Name of the chain on which your wallet resides.
walletIdentifier Name or address of a wallet for which the private key will be returned.
Response payload
{  
    "address": "string",  
    "privateKey": "string"  
}
Description
{  
    "address": "The address of your wallet.",  
    "privateKey": "The private key of this wallet."  
}
Response example
{  
    "address": "0xc3889A1628B7c9F25ff820281926E41DC402d6a1",  
    "privateKey": "5baa1171a6e0fb3be17680702d9660c2d048f1ad4e2d0fe6ac2e7d7a2b95334c"  
}

/chains/{chainName}/wallets/{walletIdentifier}/export GET

Returns the password and the keystore file of your wallet

Path parameters
Path parameter Description
chainName Name of the chain on which your wallet resides.
walletIdentifier Name or address of a wallet you want to export.
Response payload
{  
    "address": "string",    
    "password": "string",  
    "walletFile": "string"    
}
Description
{  
    "address": "The address of your wallet.",  
    "password": "The password of the wallet file.",  
    "walletFile": "The wallet file of your wallet."    
}
Response example
{  
    "address": "0xc3889A1628B7c9F25ff820281926E41DC402d6a1",    
    "password": "nwsab7hfSXHv9bc",  
    "walletFile": "{\"address\":\"c3889a1628b7c9f25ff820281926e41dc402d6a1\",\"id\":\"3acf5454-6b07-416b-8818-2922ab9b4b99\",\"version\":3,\"crypto\":{\"cipher\":\"aes-128-ctr\",\"ciphertext\":\"38a7e3a0042d19768c3b6a4b3093f951a5662025a7e76213df4af327090bc83e\",\"cipherparams\":{\"iv\":\"74683e4817d288e65c979714b015c2b4\"},\"kdf\":\"scrypt\",\"kdfparams\":{\"dklen\":32,\"n\":4096,\"p\":6,\"r\":8,\"salt\":\"7ce3f8fd62791019aeecf91caa62c1920d605a37ac2d047d00df41cf4f412291\"},\"mac\":\"0925e02fa5f5d6703a311d3fbaaa5a677c07fb5a7fa4f311757442fb19a5d2da\"}}"    
}

See wallet keystore for more information about wallet keystore files.

/chains/{chainName}/contracts GET

Returns an array of all contracts you manage on a chain. These are the contracts you have deployed and/or imported earlier.

Path parameters
Path parameter Description
chainName Name of the chain for which you want to retrieve your contracts.
Response payload
[ 
    {  
        "name": "string",  
        "address": "string",  
        "code": "string",  
        "abi": "string",  
        "origin": "string"  
    }
]
Description
[ 
    {  
        "name": "The user friendly name of your contract.",  
        "address": "The address of your contract",  
        "code": "The source code of your contract. This is only available if it was supplied during deployment.",  
        "abi": "The ABI of your contract",  
        "origin": "The address that deployed this contract. This is only available if the contract was deployed through Enco."  
    }
]
Response example
[ 
    {  
        "name": "SimpleContract",  
        "address": "0x12b32D3C7A8963a0c3349E45C38B4Df69A160869",  
        "code": "pragma solidity >=0.4.0 <0.6.0;\n\ncontract Simple {\n    \n    uint256 _var;\n    \n    function set(uint256 input) public {\n        _var = input;\n    }\n    \n    function get() public view returns(uint256 variable) {\n        return _var;\n    }\n}",  
        "abi": "[{\"name\":\"set\",\"payable\":false,\"stateMutability\":\"nonpayable\",\"constant\":false,\"inputs\":[{\"name\":\"input\",\"type\":\"uint256\"}],\"outputs\":[],\"type\":\"function\"},{\"name\":\"get\",\"payable\":false,\"stateMutability\":\"view\",\"constant\":true,\"inputs\":[],\"outputs\":[{\"name\":\"variable\",\"type\":\"uint256\"}],\"type\":\"function\"}]",  
        "origin": "0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3"  
    }
]

/chains/{chainName}/contracts POST

Deploy and/or import a contract.

Deploying a contract can be done by providing either source code, or ABI and Binary data.

Importing an already deployed contract makes it possible for you to interact with it.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to deploy a contract.
Query parameters
Query parameter Description Required Default
deploy A boolean specifying if the contract needs to be deployed or imported. No TRUE

Deploy a contract using source code

Request payload
{  
    "fromAddress": "string",  
    "friendlyName": "string",  
    "targetContractName": "string",  
    "sourceCode": "string",  
    "constructorParameters": [ 
        {  
            "name": "string",  
            "value": "string/integer/array/boolean"  
        }
    ],  
    "gasPrice": "integer",  
    "gasLimit": "integer" 
}
Description
{  
    "fromAddress": "The name or the address of the wallet who will deploy the contract.",  
    "friendlyName": "A user friendly name you cant to give your contract.",  
    "targetContractName": "The name of the contract in your source code you want to deploy. This is optional, and only necessary when your source code contains multiple contracts.",  
    "sourceCode": "Source code of the contract as an escaped JSON string.",  
    "constructorParameters": "An array of constructor arguments. Each argument is an object with two properties: its name and its value. The value can be an integer, a string, an array, ... whatever the value needs to be.",  
    "gasPrice": "The gas price to deploy this contract. This is optional; if omitted a guess will be made.",  
    "gasLimit": "The gas limit to deploy this contract. This is optional; if omitted a guess will be made." 
}
Request example
{  
    "fromAddress": "demo-wallet",  
    "friendlyName": "SimpleSmartContractWithConstructor",  
    "targetContractName": "Simple",  
    "sourceCode": "pragma solidity >=0.4.0 <0.6.0;\r\n\r\ncontract Simple {\r\n    \r\n    uint256 _var;\r\n    \r\n    constructor(uint256 initValue) public {\r\n        _var = initValue;\r\n    }\r\n    \r\n    function set(uint256 input) public {\r\n        _var = input;\r\n    }\r\n    \r\n    function get() public view returns(uint256 variable) {\r\n        return _var;\r\n    }\r\n}",  
    "constructorParameters": [ 
        {  
            "name": "initValue",  
            "value": 15  
        }
    ],  
    "gasPrice": 2200000000,  
    "gasLimit": 200000  
}
Response payload
{  
    "name": "string",  
    "address": "string",  
    "code": "string",  
    "abi": "string",  
    "origin": "string"  
}
Description
{  
    "name": "The user friendly name of the contract.",  
    "address": "The address of the contract.",  
    "code": "The provided source code of the contract.",  
    "abi": "The ABI generated from the compiled source code.",  
    "origin": "The address of the wallet that deployed this contract."  
}
Response example
{  
    "name": "SimpleSmartContractWithConstructor",  
    "address": "0x27A14D513C6Ac6a0B7156D4c51104a23c8ae0F55",  
    "code": "pragma solidity >=0.4.0 <0.6.0;\r\n\r\ncontract Simple {\r\n    \r\n    uint256 _var;\r\n    \r\n    constructor(uint256 initValue) public {\r\n        _var = initValue;\r\n    }\r\n    \r\n    function set(uint256 input) public {\r\n        _var = input;\r\n    }\r\n    \r\n    function get() public view returns(uint256 variable) {\r\n        return _var;\r\n    }\r\n}",  
    "abi": "[{\"name\":\"set\",\"payable\":false,\"stateMutability\":\"nonpayable\",\"constant\":false,\"inputs\":[{\"name\":\"input\",\"type\":\"uint256\"}],\"outputs\":[],\"type\":\"function\"},{\"name\":\"get\",\"payable\":false,\"stateMutability\":\"view\",\"constant\":true,\"inputs\":[],\"outputs\":[{\"name\":\"variable\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"payable\":false,\"stateMutability\":\"nonpayable\",\"inputs\":[{\"name\":\"initValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}]",  
    "origin": "0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3"  
}

Deploy a contract with ABI and binary data

Request payload
{  
    "fromAddress": "string",  
    "friendlyName": "string",  
    "abi": "string",  
    "data": "string",  
    "constructorParameters": "string",  
    "gasPrice": "integer",  
    "gasLimit": "integer"  
}
Description
{  
    "fromAddress": "The name or the address of the wallet who will deploy the contract.",  
    "friendlyName": "A user friendly name you cant to give your contract.",  
    "abi": "ABI of the contract as an escaped JSON string.",  
    "data": "Bytecode of the compiled contract.",  
    "constructorParameters": "An array of constructor arguments. Each argument is an object with two properties: its name and its value. The value can be an integer, a string, an array, ... whatever the value needs to be.",  
    "gasPrice": "The gas price to deploy this contract. This is optional; if omitted a guess will be made.",  
    "gasLimit": "The gas limit to deploy this contract. This is optional; if omitted a guess will be made."  
}
Request payload
{  
    "fromAddress": "demo-wallet",  
    "friendlyName": "SimpleSmartContractWithConstructor",  
    "abi": "[{\"constant\":false,\"inputs\":[{\"name\":\"input\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"variable\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"initValue\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}]",  
    "data": "608060405234801561001057600080fd5b5060405160208061013d8339810180604052602081101561003057600080fd5b8101908080519060200190929190505050806000819055505060e6806100576000396000f3fe6080604052600436106043576000357c01000000000000000000000000000000000000000000000000000000009004806360fe47b11460485780636d4ce63c14607f575b600080fd5b348015605357600080fd5b50607d60048036036020811015606857600080fd5b810190808035906020019092919050505060a7565b005b348015608a57600080fd5b50609160b1565b6040518082815260200191505060405180910390f35b8060008190555050565b6000805490509056fea165627a7a7230582059b2294f69c04446969d1682d938f62c9d00fa3ad33d72fdae6a1b3ecbc8e8030029",  
    "constructorParameters": [
        {  
            "name": "initValue",  
            "value": 15  
        }
    ],  
    "gasPrice": 2200000000,  
    "gasLimit": 200000  
}
Response payload
{
    "name": "string",  
    "address": "string",  
    "abi": "string",  
    "origin": "string"  
}
Description
{  
    "name": "The user friendly name of the contract.",  
    "address": "The address of the contract.",  
    "abi": "The provided ABI of the contract.",  
    "origin": "The address of the wallet that deployed this contract."  
}
Response example
{
    "name": "SimpleSmartContractWithConstructor",
    "address": "0x2Ea7FD624B6C0D7cb044A327a1CfaC5C32F39eCB",
    "abi": "[{\"name\":\"set\",\"payable\":false,\"stateMutability\":\"nonpayable\",\"constant\":false,\"inputs\":[{\"name\":\"input\",\"type\":\"uint256\"}],\"outputs\":[],\"type\":\"function\"},{\"name\":\"get\",\"payable\":false,\"stateMutability\":\"view\",\"constant\":true,\"inputs\":[],\"outputs\":[{\"name\":\"variable\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"payable\":false,\"stateMutability\":\"nonpayable\",\"inputs\":[{\"name\":\"initValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}]",
    "origin": "0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3"
}

Import an existing contract

Request payload
{  
    "contractAddress": "string",  
    "friendlyName": "string",  
    "abi": "string",  
    "sourceCode": "string", 
}
Description
{  
    "contractAddress": "The address of the contract you want to import.",  
    "friendlyName": "A user friendly name for this contract.",  
    "abi": "The ABI of this contract. It is necessary to provide either the ABI or the source code.",  
    "sourceCode": "The source code of this contract. It is necessary to provide either the ABI or the source code.", 
}
Request payload
{  
    "contractAddress": "0x2Ea7FD624B6C0D7cb044A327a1CfaC5C32F39eCB",  
    "friendlyName": "SimpleSmartContractWithConstructor",  
    "abi": "[{\"constant\":false,\"inputs\":[{\"name\":\"input\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"name\":\"variable\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"initValue\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}]"
}
Response payload
{
    "name": "string",  
    "address": "string",  
    "abi": "string",  
    "code": "string"  
}
Description
{  
    "name": "The user friendly name of the contract.",  
    "address": "The address of the contract.",  
    "abi": "The ABI of the contract.",  
    "code": "The source code of the contract. Only available if provided." 
}
Response example
{
    "name": "SimpleSmartContractWithConstructor",
    "address": "0x2Ea7FD624B6C0D7cb044A327a1CfaC5C32F39eCB",
    "abi": "[{\"name\":\"set\",\"payable\":false,\"stateMutability\":\"nonpayable\",\"constant\":false,\"inputs\":[{\"name\":\"input\",\"type\":\"uint256\"}],\"outputs\":[],\"type\":\"function\"},{\"name\":\"get\",\"payable\":false,\"stateMutability\":\"view\",\"constant\":true,\"inputs\":[],\"outputs\":[{\"name\":\"variable\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"payable\":false,\"stateMutability\":\"nonpayable\",\"inputs\":[{\"name\":\"initValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}]",
}

/chains/{chainName}/contracts/estimates POST

Returns an estimation of the current gas price, an estimation of the required gas limit to deploy a contract and the gas block limit.

The request to this API is the exact same one as when deploying a contract with the POST to /chains/{chainName}/contracts. So it could either contain source code or ABI and binary data.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to estimate a contract deployment.
Response payload
{  
    "gasPrice": "integer",  
    "gasPrice_str": "string",  
    "gasLimit": "integer",  
    "gasLimit_str": "string",  
    "blockLimit": "integer",  
    "blockLimit_str": "string"  
}
Description
{  
    "gasPrice": "Estimation of the current gas price required to have your contract deployment mined.",  
    "gasPrice_str": "String representation of the estimation of the current gas price required to have your contract deployment mined.",  
    "gasLimit": "Estimation of the required amount of gas to have your contract deployed.",  
    "gasLimit_str": "String representation of the estimation of the required amount of gas to have your contract deployed.",  
    "blockLimit": "Limit of gas in a block; setting a higher gas limit for your contract deployment than this block limit is futile.",  
    "blockLimit_str": "String representation of the limit of gas in a block; setting a higher gas limit for your contract deployment than this block limit is futile."  
}
Response example
{
    "gasPrice": 1000000000,
    "gasPrice_str": "1000000000",
    "gasLimit": 118037,
    "gasLimit_str": "118037",
    "blockLimit": 7015011,
    "blockLimit_str": "7015011"
}

/chains/{chainName}/contracts/zip POST

When multiple contracts depend on one another to be compiled/deployed, you can provide all the necessary source code files in a zipped file. The source files can be in multiple directories in the zip, but the one that will get deployed needs to be at the top level.

To supply the zip file, this api has a multipart/form-data content-type. One part consists of JSON properties and the other part is the actual zip file.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to deploy your contract.
Multipart form-data curl example
curl -X POST \  
  https://api.enco.io/bc-mgmt/1.0.0/chains/enco_shared/contracts/zip \  
  -H 'Authorization: Bearer <token>' \  
  -H 'Content-Type: multipart/form-data' \  
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \  
  -F 'contractInfo={  
    "fromAddress": "0x2E44c0a80D170C301E6aF18633e9Da21ECb26D0A",  
    "friendlyName": "ZippedContract",  
    "targetContractFile": "Demo.sol",  
    "targetContractName": "Demo",  
    "constructorParameters": [{"name":"input1","value":15},{"name":"input2","value":9}]  
}' \  
  -F 'contractZip=@C:\zippedContracts.zip'  
Request payload
{  
    "fromAddress": "string",  
    "friendlyName": "string",  
    "targetContractFile": "string",  
    "targetContractName": "string",  
    "constructorParameters": "array"  
}
Description
{  
    "fromAddress": "The address or name of the wallet which will deploy the contract.",  
    "friendlyName": "A user friendly name for the contract.",  
    "targetContractFile": "The name of a top level file in the zip which contains the contract that will be deployed. This file name has to have an extension if available.",  
    "targetContractName": "The name of the contract as used in the source code of the targetContractFile. This is required when the targetContractFile contains multiple contracts in the same source code file.",  
    "constructorParameters": "An array of constructor arguments. Each argument is an object with two properties: its name and its value. The value can be an integer, a string, an array, a boolean, ... whatever the value needs to be."  
}
Request example
{  
    "fromAddress": "0x2E44c0a80D170C301E6aF18633e9Da21ECb26D0A",  
    "friendlyName": "ZippedContract",  
    "targetContractFile": "Demo.sol",  
    "targetContractName": "Demo",  
    "constructorParameters": [
        {
            "name":"input1",
            "value":15
        },{
            "name":"input2",
            "value":9
        }
    ]  
}
Response payload
{  
    "name": "string",  
    "address": "string",  
    "code": "string",  
    "abi": "string",  
    "origin": "string"  
}
Description
{  
    "name": "The user friendly name of the contract.",  
    "address": "The address of the contract.",  
    "code": "The provided source code of the contract. This contains only the code of the whatever was in the provided targetContractFile.",  
    "abi": "The ABI generated from the compiled source code.",  
    "origin": "The address of the wallet that deployed this contract."  
}
Response example
{  
    "name": "Demo",  
    "address": "0x27A14D513C6Ac6a0B7156D4c51104a23c8ae0F55",  
    "code": "pragma solidity >=0.4.0 <0.6.0;\r\n\r\ncontract Simple {\r\n    \r\n    uint256 _var;\r\n    \r\n    constructor(uint256 initValue) public {\r\n        _var = initValue;\r\n    }\r\n    \r\n    function set(uint256 input) public {\r\n        _var = input;\r\n    }\r\n    \r\n    function get() public view returns(uint256 variable) {\r\n        return _var;\r\n    }\r\n}",  
    "abi": "[{\"name\":\"set\",\"payable\":false,\"stateMutability\":\"nonpayable\",\"constant\":false,\"inputs\":[{\"name\":\"input\",\"type\":\"uint256\"}],\"outputs\":[],\"type\":\"function\"},{\"name\":\"get\",\"payable\":false,\"stateMutability\":\"view\",\"constant\":true,\"inputs\":[],\"outputs\":[{\"name\":\"variable\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"payable\":false,\"stateMutability\":\"nonpayable\",\"inputs\":[{\"name\":\"initValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}]",  
    "origin": "0x2E44c0a80D170C301E6aF18633e9Da21ECb26D0A"  
}

/chains/{chainName}/contracts/zip/estimates POST

Returns an estimation of the current gas price, an estimation of the required gas limit to deploy a zipped contract and the gas block limit.

The request to this API is the exact same one as when deploying a zipped contract with the POST to /chains/{chainName}/contracts/zip. So it requires a multipart/form-data content-type.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to estimate a zipped contract deployment.
Response payload
{  
    "gasPrice": "integer",  
    "gasPrice_str": "string",  
    "gasLimit": "integer",  
    "gasLimit_str": "string",  
    "blockLimit": "integer",  
    "blockLimit_str": "string"  
}
Description
{  
    "gasPrice": "Estimation of the current gas price required to have your zipped contract deployment mined.",  
    "gasPrice_str": "String representation of the estimation of the current gas price required to have your zipped contract deployment mined.",  
    "gasLimit": "Estimation of the required amount of gas to have your zipped contract deployed.",  
    "gasLimit_str": "String representation of the estimation of the required amount of gas to have your zipped contract deployed.",  
    "blockLimit": "Limit of gas in a block; setting a higher gas limit for your zipped contract deployment than this block limit is futile.",  
    "blockLimit_str": "String representation of the limit of gas in a block; setting a higher gas limit for your zipped contract deployment than this block limit is futile."  
}
Response example
{
    "gasPrice": 1000000000,
    "gasPrice_str": "1000000000",
    "gasLimit": 118037,
    "gasLimit_str": "118037",
    "blockLimit": 7015011,
    "blockLimit_str": "7015011"
}

/chains/{chainName}/contracts/{contractIdentifier} GET

Returns the details of a contract that you deployed/imported.

Path parameters
Path parameter Description
chainName Name of the chain on which your contract is deployed/imported.
contractIdentifier The name or address of your contract.
Response payload
{
    "name": "string",  
    "address": "string",  
    "code": "string",  
    "abi": "string",  
    "origin": "string",  
}
Description
{
    "name": "The name of your contract.",  
    "address": "The address of your contract.",  
    "code": "The source code of your contract. Only available when you provided it during contract deployment.",  
    "abi": "The ABI of your contract.",  
    "origin": "The address of the wallet that deployed the contract."  
}
Response example
{
    "name": "SimpleSmartContractWithConstructor",  
    "address": "0x2Ea7FD624B6C0D7cb044A327a1CfaC5C32F39eCB",  
    "code": "",  
    "abi": "[{\"name\":\"set\",\"payable\":false,\"stateMutability\":\"nonpayable\",\"constant\":false,\"inputs\":[{\"name\":\"input\",\"type\":\"uint256\"}],\"outputs\":[],\"type\":\"function\"},{\"name\":\"get\",\"payable\":false,\"stateMutability\":\"view\",\"constant\":true,\"inputs\":[],\"outputs\":[{\"name\":\"variable\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"payable\":false,\"stateMutability\":\"nonpayable\",\"inputs\":[{\"name\":\"initValue\",\"type\":\"uint256\"}],\"type\":\"constructor\"}]",  
    "origin": "0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3"  
}

/chains/{chainName}/contracts/{contractIdentifier} DELETE

This removes a contract from your list of managed contracts. The contract is not actually deleted on the chain though. That would only be possible if your contract implements and invokes the selfdestruct function.

If you remember the address and ABI of the deleted contract, it could be re-imported with a POST /chains/{chainName}/contracts.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to remove a contract.
contractIdentifier The name or address of your contract.

Returns an HTTP 200 when successfully deleted.

/chains/{chainName}/contracts/{contractIdentifier} PUT

Update one of your contracts. Know that the actual contract on the chain can not be updated.

This resource takes the same request as POST /chains/{chainName}/contracts.

If the friendly name of the contract differs from the contractIdentifier path param, the only thing that will happen is renaming your contract.
If the friendly name of the contract is the same as the contractIdentifier path param, then the newly provided contract will be deployed with this friendly name and the previous one will be deleted. Be aware that in this case the previous contract still exists on the blockchain but can only be used if you remember the address and ABI to re-import it with POST /chains/{chainName}/contracts.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to update your contract.
contractIdentifier The name or address of your contract.

/chains/{chainName}/contracts/{contractIdentifier}/swagger GET

Returns a JSON swagger 2.0 file describing all the invokable functions of your smart contract including all the parameters as to how to invoke the functions.

Path parameters
Path parameter Description
chainName Name of the chain on which you have your contract.
contractIdentifier The name or address of your contract.
Response example
{  
    "swagger": "2.0",  
    "info": {  
        "title": "Smart Contract Invocation API",  
        "version": "1.0.0",  
        "description": "Invoke deployed smart contracts through a REST API"  
    },  
    "tags": [
        {  
            "name": "Read",  
            "description": "Pure, constant and view functions. They do not change any blockchain state so they can be executed locally and will return a response immediately."  
        },
        {  
            "name": "Write",  
            "description": "Functions that change the state of the blockchain. A response can only be provided when the transaction call is mined. Additionally, for payable functions it is possible to send ether to the function."  
        }
    ],  
    "schemes": [
        "https"
    ],  
    "host": "api.enco.io",  
    "basePath": "/bc-mgmt/1.0.0",  
    "securityDefinitions": {
        "EnCo Application": {
            "type": "oauth2",
            "tokenUrl": "https://api.enco.io/token",
            "flow": "application",
            "scopes": {}
        }
    },  
    "security": [
        {
            "EnCo Application": []
        }
    ],  
    "paths": {
        ...
    },  
    "parameters": {
        ...
    },  
    "definitions": {
        ...
    }  
}

/chains/{chainName}/contracts/{contractIdentifier}/{functionName} POST

Resource to invoke a function of your contract. The request body will likely differ between functions; for details check the swagger file via GET /chains/{chainName}/contracts/{contractIdentifier}/swagger.

Path parameters
Path parameter Description
chainName Name of the chain on which you have your contract.
contractIdentifier The name or address of your contract.
functionName The name of the function you want to invoke.
Query parameters
Query parameter Description Required Default
walletIdentifier Name or address of the wallet that invokes the function. Yes
gasPrice Price of gas for invoking this function. No estimate
gasLimit Limit on gas to be spend on invoking this function. No estimate
value Amount of WEI to be send while invoking this function. No 0

/chains/{chainName}/contracts/{contractIdentifier}/estimates/{functionName} POST

Returns an estimation of the current gas price, an estimation of the required gas limit to invoke the function and the gas block limit.

The request to this API is the exact same one as when actually invoking the function with the POST to /chains/{chainName}/contracts/{contractIdentifier}/{functionName}.

Path parameters
Path parameter Description
chainName Name of the chain on which you have your contract.
contractIdentifier The name or address of your contract.
functionName The name of the function you want to invoke.
Query parameters
Query parameter Description Required Default
walletIdentifier Name or address of the wallet that invokes the function. Yes
value Amount of WEI to be send while invoking this function. No 0
Response payload
{  
    "gasPrice": "integer",  
    "gasPrice_str": "string",  
    "gasLimit": "integer",  
    "gasLimit_str": "string",  
    "blockLimit": "integer",  
    "blockLimit_str": "string"  
}
Description
{  
    "gasPrice": "Estimation of the current gas price required to invoke the function.",  
    "gasPrice_str": "String representation of the estimation of the current gas price required to invoke the function.",  
    "gasLimit": "Estimation of the required amount of gas to invoke the function.",  
    "gasLimit_str": "String representation of the estimation of the required amount of gas to invoke the function.",  
    "blockLimit": "Limit of gas in a block; setting a higher gas limit for your function invocation than this block limit is futile.",  
    "blockLimit_str": "String representation of the limit of gas in a block; setting a higher gas limit for your function invocation than this block limit is futile."  
}
Response example
{
    "gasPrice": 1000000000,
    "gasPrice_str": "1000000000",
    "gasLimit": 118037,
    "gasLimit_str": "118037",
    "blockLimit": 7015011,
    "blockLimit_str": "7015011"
}

/chains/{chainName}/contracts/{contractIdentifier}/advancedInvocation POST

Resource to invoke any function (existent or nonexistent) on a contract. This can be used to encode an arbitrary function invocation. If you use this for an nonexistent function, the fallback function of your contract will be invoked.

Path parameters
Path parameter Description
chainName Name of the chain on which you have your contract.
contractIdentifier The name or address of your contract.
Query parameters
Query parameter Description Required Default
walletIdentifier Name or address of the wallet that invokes the function. Yes
gasPrice Price of gas for invoking this function. No estimate
gasLimit Limit on gas to be spend on invoking this function. No estimate
value Amount of WEI to be send while invoking this function. No 0
Request payload
{  
    "functionName": "string",  
    "inputArgs": "array",  
    "outputArgs": "array"  
}
Description
{  
    "functionName": "The name of the function you want to invoke.",  
    "inputArgs": "An array with the arguments of your function. Each argument is an object with 2 properties: the type and the value. The value can be an integer, string, array, boolean, ... whatever the value needs to be.",  
    "outputArgs": "An array with the expected output arguments. If this array is omitted or left empty, it means you will make a write call to the blockchain and you will receive a transaction as response. If this array has values, the output of the read call towards your function will be returned. This is an array of objects with 2 properties: the type of the output argument and the name. The name does not necessarily need to match the name used in your contract's source code."  
}
Request example
{  
    "functionName": "myFunction",  
    "inputArgs": [
        {
            "type": "uint256",
            "value": 2
        }
    ],  
    "outputArgs": [
        {
            "type": "uint256",
            "name": "myOutputArgument"
        }
    ]  
}

/chains/{chainName}/contracts/advancedInvocation POST

Resource to invoke any function (existent or nonexistent) on any contract, even contracts you do not manage. This can be used to encode an arbitrary function invocation to an arbitrary contract. If you use this for an nonexistent function, the fallback function of your contract will be invoked.

Path parameters
Path parameter Description
chainName Name of the chain on which you want to invoke a contract.
Query parameters
Query parameter Description Required Default
walletIdentifier Name or address of the wallet that invokes the function. Yes
gasPrice Price of gas for invoking this function. No estimate
gasLimit Limit on gas to be spend on invoking this function. No estimate
value Amount of WEI to be send while invoking this function. No 0
Request payload
{  
    "contract": "string",
    "functionName": "string",  
    "inputArgs": "array",  
    "outputArgs": "array"  
}
Description
{  
    "contract": "The name or address of the contract. If you are invoking a contract you do not manage, this will always be an address.",
    "functionName": "The name of the function you want to invoke.",  
    "inputArgs": "An array with the arguments of your function. Each argument is an object with 2 properties: the type and the value. The value can be an integer, string, array, boolean, ... whatever the value needs to be.",  
    "outputArgs": "An array with the expected output arguments. If this array is omitted or left empty, it means you will make a write call to the blockchain and you will receive a transaction as response. If this array has values, the output of the read call towards your function will be returned. This is an array of objects with 2 properties: the type of the output argument and the name. The name does not necessarily need to match the name used in your contract's source code."  
}
Request example
{  
    "contract": "0x2Ea7FD624B6C0D7cb044A327a1CfaC5C32F39eCB",  
    "functionName": "myFunction",  
    "inputArgs": [
        {
            "type": "uint256",
            "value": 2
        }
    ],  
    "outputArgs": [
        {
            "type": "uint256",
            "name": "myOutputArgument"
        }
    ]  
}

/chains/{chainName}/explorer/{hexString}

This calls the endpoints to search for a block, a transaction or a wallet address (in that order).

Path parameters
Path parameter Description
chainName Name of the chain on where you try to find a block, transaction or wallet.
hexString A hex string representing a block hash, a transaction hash or a wallet.
Request example

curl -X GET \
https://api.enco.io/bc-mgmt/1.0.0/chains/rinkeby/explorer/0xe205b085ff36c8d0ee872d2a43506e5fa29200c1b8c6d33142b908c287bfd832 \
-H 'Authorization: Bearer ' \ -H 'Content-Type: application/json'

Response example: block
{  
    "entity": "BLOCK",  
    "hash": "0xe205b085ff36c8d0ee872d2a43506e5fa29200c1b8c6d33142b908c287bfd832",  
    "number": 4150588,  
    "timestamp": "2019-04-04T14:29:38",  
    "size": 21624,  
    "transactions": [  
        "0x0516a48b638a7faa6a90eace55f931f8e11b70614236ee92a7d03a6434b0e43d",  
        "0xdb0a82b4833c39a41187a147227987b2fa81a85a9e911eb88d27426b7249a6c5",  
        "0x76aa714f24ad9489cb15ffba3e5e65d649dd34470d3b9da3693931a20bdc3a79",  
        "0x5f043d53e2d56dafd7565b6c046b387c729441ce7f64cd52747ed4c14ff04a97",  
        "0x03a6863be785ee22d515fd704d867b77b45f0e8db78a2d238aa24f6da82e9590",  
        "0xf72eb171d0abc0a1ec42a021395c870046f2c281f41554cf20d1e07659f6ca2a",  
        "0x44ffc13acfc4863bd14f1a63dafb8a2ad040bc6ebf270d8267305e0dbeb193ed",  
        "0x7a6385b47ebe355301709066dd371d2eb82a378b01296b9949cba05f3f8fa77d",  
        "0x21cdbc28818526af3893b6a294516d10a5b78835ed28f51c275831333abadc8e",  
        "0x2083320164b40e148c579614cc6fbe32772e592289d773a0340460a9b574004d"  
    ]  
}
Request example
curl -X GET \  
  https://api.enco.io/bc-mgmt/1.0.0/chains/rinkeby/explorer/0x2083320164b40e148c579614cc6fbe32772e592289d773a0340460a9b574004d \  
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json'
Response example: transaction
{  
    "entity": "TRANSACTION",  
    "hash": "0x2083320164b40e148c579614cc6fbe32772e592289d773a0340460a9b574004d",  
    "blockHash": "0xe205b085ff36c8d0ee872d2a43506e5fa29200c1b8c6d33142b908c287bfd832",  
    "blockNumber": 4150588,  
    "status": "MINED",  
    "timestamp": "2019-04-04T14:29:38",  
    "from": "0xEF606698e20e8cCcbb10Bfe4E6f7313BDFff968B",  
    "to": "0x5937f7cDa3670A6fA111Ae83Ab4A39Cfb5b89EC1",  
    "isToContract": true,  
    "value": 10000000000000000,  
    "value_str": "10000000000000000",  
    "gasLimit": 300000,  
    "gasLimit_str": "300000",  
    "gasPrice": 1000000000,  
    "gasPrice_str": "1000000000",  
    "gasUsed": 24913,  
    "gasUsed_str": "24913",  
    "nonce": 725,  
    "data": "0xa543bae7c0933f9be51a284acb6b1a6617a48d795bdeaa80000000000000000000000000000000000000000000000000ef606698e20e8cccbb10bfe4e6f7313bdfff968b",  
    "receiptStatus": 0  
}
Request example
curl -X GET \  
  https://api.enco.io/bc-mgmt/1.0.0/chains/rinkeby/explorer/0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3 \  
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json'
Response example: wallet
{  
     "entity": "ADDRESS",  
     "address": "0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3",  
     "balance": 5870980768776816090,  
     "balance_str": "5870980768776816090",  
     "isContract": false,  
     "transactions": [  
         "0x910ae3aa7b27272421b4d2ebacbecdab05d799109573be2a05c690b9dfafeb7a",  
         "0x8da67b428ea9819a13a3652fe2d6534ef899596e19cf26f3e49d99cfe8340951",  
         "0x32f6aad03ca8a57ee4c2b83ff0a48698015d928e88aacfe7b91e1c91704f0f73",  
         "0xc910a415f85cf99de96d0b199e8a2959f26b9d1ae0fc9e19a497eec726e54390",  
         "0x37358234160694268e282e240f00e78e33b15dc69f39ada4778bcd62ae2f2de9",  
         "0x3b784afde25f3fdfb63ac72851ddaef4514666a69cddec0b0a81a07f0cf74639",  
         "0xaf0da4bcf00fed0143f4d1a57355f3a2ef6c1e58d9e1ca8df0c730871aed99f7"  
     ],  
     "contract": false  
}

/chains/{chainName}/explorer/blocks GET

Resource to fetch an array of blocks for a chain. The blocks are returned in reverse chronological order: newest one first.

Path parameters
Path parameter Description
chainName Name of the chain for which to fetch blocks.
Query parameters
Query parameter Description Required Default
count The number of blocks to return. This can be between 1 and 25. No 10
start The block hash of the most recent block to return. No newest
Response payload
[
    {  
        "entity": "string",  
        "hash": "string",  
        "number": "integer",  
        "timestamp": "string",  
        "size": "integer",  
        "transactions": [  
            "string"
        ]  
    }
]
Description
[
    {  
        "entity": "The type of the entity: in this case a block.",  
        "hash": "The block hash.",  
        "number": "The block number.",  
        "timestamp": "The timestamp for when the block was mined/created.",  
        "size": "The size of the block in bytes.",  
        "transactions": "An array of transaction hashes of the transactions that are mined in this block."  
    }
]
Response example
[
    {  
        "entity": "BLOCK",  
        "hash": "0xb847a444ce5728f046d5825b98dfb94dd8c3435059876fcee6bc0b9b817d0288",  
        "number": 4150646,  
        "timestamp": "2019-04-04T14:44:08",  
        "size": 14199,  
        "transactions": [  
            "0xce18997eaf709b21ee56f06a40eccfa3128d98965efdf1ab08bd0f26d270beca",  
            "0xa9e7c17b8fb203389e44fc5e084be2715e4b9c7fdb0c05db81a5d134c106267a",  
            "0x0e1f369c10e8da97948f6273d5329f2bef37e41207462c5ccb9744f89ec92b07",  
            "0xccdd337a362c7142f347936d8b9db085b846013b791a45f82c0f60646c09215a",  
            "0x32dfa560aae07147a38478f9a5fe334b31d91fafca000fac6c3374edea6302fe",  
            "0xd21e87c272733a5197dab69c2cff3c1a3c5453cf11306e09c32cf3adbb8ac793",  
            "0x0ff79952fa0e3e739abb3338a54997660b2f55d3692ea3134a3d2184f1006280",  
            "0x13ece320983e2613abba6853f5da726b3db2452835233ee4e7b65790394aa9b2",  
            "0x044d31758880d3451482b151b29c8928bc6bf99d452bd0e46692995fb37f93c1",  
            "0x297bedd4c2d2ad0ad7801b56224986eba7419d0ad4a84cab6e93b5b19f9de0f2"  
        ]  
    }  
]

/chains/{chainName}/explorer/blocks/{blockHash} GET

Resource to fetch an a block of a chain.

Path parameters
Path parameter Description
chainName Name of the chain for which to fetch a block.
blockHash The hash of the block you want to fetch.
Response payload
{  
    "entity": "string",  
    "hash": "string",  
    "number": "integer",  
    "timestamp": "string",  
    "size": "integer",  
    "transactions": [  
        "string"
    ]  
}
Description
{  
    "entity": "The type of the entity: in this case a block.",  
    "hash": "The block hash.",  
    "number": "The block number.",  
    "timestamp": "The timestamp for when the block was mined/created.",  
    "size": "The size of the block in bytes.",  
    "transactions": "An array of transaction hashes of the transactions that are mined in this block."  
}
Response example
{  
    "entity": "BLOCK",  
    "hash": "0xb847a444ce5728f046d5825b98dfb94dd8c3435059876fcee6bc0b9b817d0288",  
    "number": 4150646,  
    "timestamp": "2019-04-04T14:44:08",  
    "size": 14199,  
    "transactions": [  
        "0xce18997eaf709b21ee56f06a40eccfa3128d98965efdf1ab08bd0f26d270beca",  
        "0xa9e7c17b8fb203389e44fc5e084be2715e4b9c7fdb0c05db81a5d134c106267a",  
        "0x0e1f369c10e8da97948f6273d5329f2bef37e41207462c5ccb9744f89ec92b07",  
        "0xccdd337a362c7142f347936d8b9db085b846013b791a45f82c0f60646c09215a",  
        "0x32dfa560aae07147a38478f9a5fe334b31d91fafca000fac6c3374edea6302fe",  
        "0xd21e87c272733a5197dab69c2cff3c1a3c5453cf11306e09c32cf3adbb8ac793",  
        "0x0ff79952fa0e3e739abb3338a54997660b2f55d3692ea3134a3d2184f1006280",  
        "0x13ece320983e2613abba6853f5da726b3db2452835233ee4e7b65790394aa9b2",  
        "0x044d31758880d3451482b151b29c8928bc6bf99d452bd0e46692995fb37f93c1",  
        "0x297bedd4c2d2ad0ad7801b56224986eba7419d0ad4a84cab6e93b5b19f9de0f2"  
    ]  
}

/chains/{chainName}/explorer/blocks/{blockHash}/transactions

Resource to fetch an array of all the transactions in a block.

Path parameters
Path parameter Description
chainName Name of the chain for which to fetch block transactions.
blockHash The hash of the block.
Response payload
[
    {  
        "entity": "string",  
        "hash": "string",  
        "blockHash": "string",  
        "blockNumber": "integer",  
        "status": "string",  
        "timestamp": "string",  
        "from": "string",  
        "to": "string",  
        "isToContract": "boolean",  
        "value": "integer",  
        "value_str": "string",  
        "gasLimit": "integer",  
        "gasLimit_str": "string",  
        "gasPrice": "integer",  
        "gasPrice_str": "string",  
        "gasUsed": "integer",  
        "gasUsed_str": "string",  
        "nonce": "integer",  
        "data": "string",  
        "receiptStatus": "integer"  
    }
]
Response payload
[
    {  
        "entity": "The type of the entity: in this case a transaction.",  
        "hash": "The transaction hash.",  
        "blockHash": "The block hash of the block in which this transaction was mined.",  
        "blockNumber": "The block number of the block in which this transaction was mined.",  
        "status": "Indicating if a transaction is mined or still pending.",  
        "timestamp": "The timestamp for when the block was mined/created.",  
        "from": "The address of the wallet that made the transaction.",  
        "to": "The receiving end of this transaction. If this is absent, this transaction was a contract creation.",  
        "isToContract": "A boolean specifying if this transaction is a contract invocation.",  
        "value": "Amount of funds that were send in this transaction.",  
        "value_str": "String representation of the amount of funds that were send in this transaction.",  
        "gasLimit": "The gas limit that was set when making this transaction.",  
        "gasLimit_str": "String representation of the gas limit that was set when making this transaction.",  
        "gasPrice": "The price of gas paid for making this transaction.",  
        "gasPrice_str": "String representation of the price of gas paid for making this transaction.",  
        "gasUsed": "The actual amount of gas used for doing this transaction.",  
        "gasUsed_str": "String representation of the actual amount of gas used for doing this transaction.",  
        "nonce": "The nonce of this transaction. Indicates how many transactions this from address has made.",  
        "data": "The hex encoded binary data that was send during this transaction",  
        "receiptStatus": "Either 1 or 0. 1 indicates success."  
    }
]
Response example
[
    {  
        "entity": "TRANSACTION",  
        "hash": "0xa4151cdc591e82eca61c7ebaf1ad6cbb63ce03499856abe5a65800557fc0cd05",  
        "blockHash": "0x45f273dff9e1f70980c9b45aeb269246f75338295103f136992d46a959dacf0f",  
        "blockNumber": 4150713,  
        "status": "MINED",  
        "timestamp": "2019-04-04T15:00:53",  
        "from": "0x00225484150EA4B74b95FB9eb698eA581217F368",  
        "to": "0x41c8AC6900e382866fC145D2C3FEA101E0b594Eb",  
        "isToContract": true,  
        "value": 0,  
        "value_str": "0",  
        "gasLimit": 6870000,  
        "gasLimit_str": "6870000",  
        "gasPrice": 30000000000,  
        "gasPrice_str": "30000000000",  
        "gasUsed": 41908,  
        "gasUsed_str": "41908",  
        "nonce": 7127,  
        "data": "0xfdacd5760000000000000000000000000000000000000000000000000000000000000001",  
        "receiptStatus": 1  
    }
]

/chains/{chainName}/explorer/transactions GET

Resource to fetch an array of transactions that involve wallets or contracts managed by you. The transactions are returned in reverse chronological order: newest one first.

Path parameters
Path parameter Description
chainName Name of the chain for which to fetch transactions.
Query parameters
Query parameter Description Required Default
count The number of transactions to return. This can be between 1 and 25. No 10
start The transaction hash of the most recent transaction to return. No newest
status A filter on the type of transactions to return. This could be 'MINED', 'PENDING', 'ALL'. No ALL
walletOrContractIdentifier Filter to only return transactions for a specific wallet or contract. This is the name or address of a wallet or contract No
contracts A boolean filter to only return contract invocation transactions when set to TRUE No FALSE
Response payload
[
    {  
        "entity": "string",  
        "hash": "string",  
        "blockHash": "string",  
        "blockNumber": "integer",  
        "status": "string",  
        "timestamp": "string",  
        "from": "string",  
        "to": "string",  
        "isToContract": "boolean",  
        "value": "integer",  
        "value_str": "string",  
        "gasLimit": "integer",  
        "gasLimit_str": "string",  
        "gasPrice": "integer",  
        "gasPrice_str": "string",  
        "gasUsed": "integer",  
        "gasUsed_str": "string",  
        "nonce": "integer",  
        "data": "string",  
        "receiptStatus": "integer"  
    }
]
Response payload
[
    {  
        "entity": "The type of the entity: in this case a transaction.",  
        "hash": "The transaction hash.",  
        "blockHash": "The block hash of the block in which this transaction was mined.",  
        "blockNumber": "The block number of the block in which this transaction was mined.",  
        "status": "Indicating if a transaction is mined or still pending.",  
        "timestamp": "The timestamp for when the block was mined/created.",  
        "from": "The address of the wallet that made the transaction.",  
        "to": "The receiving end of this transaction. If this is absent, this transaction was a contract creation.",  
        "isToContract": "A boolean specifying if this transaction is a contract invocation.",  
        "value": "Amount of funds that were send in this transaction.",  
        "value_str": "String representation of the amount of funds that were send in this transaction.",  
        "gasLimit": "The gas limit that was set when making this transaction.",  
        "gasLimit_str": "String representation of the gas limit that was set when making this transaction.",  
        "gasPrice": "The price of gas paid for making this transaction.",  
        "gasPrice_str": "String representation of the price of gas paid for making this transaction.",  
        "gasUsed": "The actual amount of gas used for doing this transaction.",  
        "gasUsed_str": "String representation of the actual amount of gas used for doing this transaction.",  
        "nonce": "The nonce of this transaction. Indicates how many transactions this from address has made.",  
        "data": "The hex encoded binary data that was send during this transaction",  
        "receiptStatus": "Either 1 or 0. 1 indicates success."  
    }
]
Response example
[
    {  
        "entity": "TRANSACTION",  
        "hash": "0xa4151cdc591e82eca61c7ebaf1ad6cbb63ce03499856abe5a65800557fc0cd05",  
        "blockHash": "0x45f273dff9e1f70980c9b45aeb269246f75338295103f136992d46a959dacf0f",  
        "blockNumber": 4150713,  
        "status": "MINED",  
        "timestamp": "2019-04-04T15:00:53",  
        "from": "0x00225484150EA4B74b95FB9eb698eA581217F368",  
        "to": "0x41c8AC6900e382866fC145D2C3FEA101E0b594Eb",  
        "isToContract": true,  
        "value": 0,  
        "value_str": "0",  
        "gasLimit": 6870000,  
        "gasLimit_str": "6870000",  
        "gasPrice": 30000000000,  
        "gasPrice_str": "30000000000",  
        "gasUsed": 41908,  
        "gasUsed_str": "41908",  
        "nonce": 7127,  
        "data": "0xfdacd5760000000000000000000000000000000000000000000000000000000000000001",  
        "receiptStatus": 1  
    }
]

/chains/{chainName}/explorer/transactions/{transactionHash} GET

Resource to fetch a transaction by its hash.

Path parameters
Path parameter Description
chainName Name of the chain for which to fetch transactions.
transactionHash Hash of the transaction.
##### Response payload
{  
    "entity": "string",  
    "hash": "string",  
    "blockHash": "string",  
    "blockNumber": "integer",  
    "status": "string",  
    "timestamp": "string",  
    "from": "string",  
    "to": "string",  
    "isToContract": "boolean",  
    "value": "integer",  
    "value_str": "string",  
    "gasLimit": "integer",  
    "gasLimit_str": "string",  
    "gasPrice": "integer",  
    "gasPrice_str": "string",  
    "gasUsed": "integer",  
    "gasUsed_str": "string",  
    "nonce": "integer",  
    "data": "string",  
    "receiptStatus": "integer"  
}
Response payload
{  
    "entity": "The type of the entity: in this case a transaction.",  
    "hash": "The transaction hash.",  
    "blockHash": "The block hash of the block in which this transaction was mined.",  
    "blockNumber": "The block number of the block in which this transaction was mined.",  
    "status": "Indicating if a transaction is mined or still pending.",  
    "timestamp": "The timestamp for when the block was mined/created.",  
    "from": "The address of the wallet that made the transaction.",  
    "to": "The receiving end of this transaction. If this is absent, this transaction was a contract creation.",  
    "isToContract": "A boolean specifying if this transaction is a contract invocation.",  
    "value": "Amount of funds that were send in this transaction.",  
    "value_str": "String representation of the amount of funds that were send in this transaction.",  
    "gasLimit": "The gas limit that was set when making this transaction.",  
    "gasLimit_str": "String representation of the gas limit that was set when making this transaction.",  
    "gasPrice": "The price of gas paid for making this transaction.",  
    "gasPrice_str": "String representation of the price of gas paid for making this transaction.",  
    "gasUsed": "The actual amount of gas used for doing this transaction.",  
    "gasUsed_str": "String representation of the actual amount of gas used for doing this transaction.",  
    "nonce": "The nonce of this transaction. Indicates how many transactions this from address has made.",  
    "data": "The hex encoded binary data that was send during this transaction",  
    "receiptStatus": "Either 1 or 0. 1 indicates success."  
}
Response example
{  
    "entity": "TRANSACTION",  
    "hash": "0xa4151cdc591e82eca61c7ebaf1ad6cbb63ce03499856abe5a65800557fc0cd05",  
    "blockHash": "0x45f273dff9e1f70980c9b45aeb269246f75338295103f136992d46a959dacf0f",  
    "blockNumber": 4150713,  
    "status": "MINED",  
    "timestamp": "2019-04-04T15:00:53",  
    "from": "0x00225484150EA4B74b95FB9eb698eA581217F368",  
    "to": "0x41c8AC6900e382866fC145D2C3FEA101E0b594Eb",  
    "isToContract": true,  
    "value": 0,  
    "value_str": "0",  
    "gasLimit": 6870000,  
    "gasLimit_str": "6870000",  
    "gasPrice": 30000000000,  
    "gasPrice_str": "30000000000",  
    "gasUsed": 41908,  
    "gasUsed_str": "41908",  
    "nonce": 7127,  
    "data": "0xfdacd5760000000000000000000000000000000000000000000000000000000000000001",  
    "receiptStatus": 1  
}

/chains/{chainName}/explorer/addresses/{address}

Resource to fetch information about a wallet/contract address.

Path parameters
Path parameter Description
chainName Name of the chain for which to fetch address details.
address Name or address of the wallet or contract.
Response payload
{  
    "entity": "string",  
    "address": "string",  
    "balance": "integer",  
    "balance_str": "string",  
    "isContract": "boolean",  
    "transactions": [  
        "string"
    ]  
}
Description
{  
    "entity": "The type of the entity: in this case an address.",  
    "address": "The address of this wallet/contract.",  
    "balance": "The current balance of this wallet/contract in WEI.",  
    "balance_str": "String representation of the current balance of this wallet/contract in WEI.",  
    "isContract": "A boolean indicating if this address is a contract or a wallet.",  
    "transactions": "An array of transaction hashes for transactions involving this address."
}
Response example
{  
    "entity": "ADDRESS",  
    "address": "0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3",  
    "balance": 5870980768776816090,  
    "balance_str": "5870980768776816090",  
    "isContract": false,  
    "transactions": [  
        "0x910ae3aa7b27272421b4d2ebacbecdab05d799109573be2a05c690b9dfafeb7a",  
        "0x8da67b428ea9819a13a3652fe2d6534ef899596e19cf26f3e49d99cfe8340951",  
        "0x32f6aad03ca8a57ee4c2b83ff0a48698015d928e88aacfe7b91e1c91704f0f73",  
        "0xc910a415f85cf99de96d0b199e8a2959f26b9d1ae0fc9e19a497eec726e54390",  
        "0x37358234160694268e282e240f00e78e33b15dc69f39ada4778bcd62ae2f2de9",  
        "0x3b784afde25f3fdfb63ac72851ddaef4514666a69cddec0b0a81a07f0cf74639",  
        "0xaf0da4bcf00fed0143f4d1a57355f3a2ef6c1e58d9e1ca8df0c730871aed99f7"  
    ]  
}

/chains/{chainName}/explorer/transactions GET

Resource to fetch an array of transactions for a specific wallet/contract address.

Path parameters
Path parameter Description
chainName Name of the chain for which to fetch transactions.
address Name or address of the wallet or contract.
Response payload
[
    {  
        "entity": "string",  
        "hash": "string",  
        "blockHash": "string",  
        "blockNumber": "integer",  
        "status": "string",  
        "timestamp": "string",  
        "from": "string",  
        "to": "string",  
        "isToContract": "boolean",  
        "value": "integer",  
        "value_str": "string",  
        "gasLimit": "integer",  
        "gasLimit_str": "string",  
        "gasPrice": "integer",  
        "gasPrice_str": "string",  
        "gasUsed": "integer",  
        "gasUsed_str": "string",  
        "nonce": "integer",  
        "data": "string",  
        "receiptStatus": "integer"  
    }
]
Response payload
[
    {  
        "entity": "The type of the entity: in this case a transaction.",  
        "hash": "The transaction hash.",  
        "blockHash": "The block hash of the block in which this transaction was mined.",  
        "blockNumber": "The block number of the block in which this transaction was mined.",  
        "status": "Indicating if a transaction is mined or still pending.",  
        "timestamp": "The timestamp for when the block was mined/created.",  
        "from": "The address of the wallet that made the transaction.",  
        "to": "The receiving end of this transaction. If this is absent, this transaction was a contract creation.",  
        "isToContract": "A boolean specifying if this transaction is a contract invocation.",  
        "value": "Amount of funds that were send in this transaction.",  
        "value_str": "String representation of the amount of funds that were send in this transaction.",  
        "gasLimit": "The gas limit that was set when making this transaction.",  
        "gasLimit_str": "String representation of the gas limit that was set when making this transaction.",  
        "gasPrice": "The price of gas paid for making this transaction.",  
        "gasPrice_str": "String representation of the price of gas paid for making this transaction.",  
        "gasUsed": "The actual amount of gas used for doing this transaction.",  
        "gasUsed_str": "String representation of the actual amount of gas used for doing this transaction.",  
        "nonce": "The nonce of this transaction. Indicates how many transactions this from address has made.",  
        "data": "The hex encoded binary data that was send during this transaction",  
        "receiptStatus": "Either 1 or 0. 1 indicates success."  
    }
]
Response example
[
    {  
        "entity": "TRANSACTION",  
        "hash": "0xa4151cdc591e82eca61c7ebaf1ad6cbb63ce03499856abe5a65800557fc0cd05",  
        "blockHash": "0x45f273dff9e1f70980c9b45aeb269246f75338295103f136992d46a959dacf0f",  
        "blockNumber": 4150713,  
        "status": "MINED",  
        "timestamp": "2019-04-04T15:00:53",  
        "from": "0x00225484150EA4B74b95FB9eb698eA581217F368",  
        "to": "0x41c8AC6900e382866fC145D2C3FEA101E0b594Eb",  
        "isToContract": true,  
        "value": 0,  
        "value_str": "0",  
        "gasLimit": 6870000,  
        "gasLimit_str": "6870000",  
        "gasPrice": 30000000000,  
        "gasPrice_str": "30000000000",  
        "gasUsed": 41908,  
        "gasUsed_str": "41908",  
        "nonce": 7127,  
        "data": "0xfdacd5760000000000000000000000000000000000000000000000000000000000000001",  
        "receiptStatus": 1  
    }
]

/chains/{chainName}/transactions POST

Resource to submit any (signed) transaction to a chain. This can be used when you want to sign your transactions offline. Offline transaction signing is required when you want to make a transaction with an imported wallet without private key.

Path parameters
Path parameter Description
chainName Name of the chain for which to submit a transaction.
Request payload
{
    "signedTransaction": "string"
}
Description
{
    "signedTransaction": "A signed transaction."
}
Request example
{
    "signedTransaction": "0xf90a2a8085174876e800830c35008080b909d7608060405234801561001057600080fd5b506109b78061001910161068e565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902090505b92915050565b6106ed82826107e7565b6106f85760006106fa565b815b600160a060020a03928316600081815260208181526040808320600160e060020a031"
}
Response payload
{  
    "transactionHash": "string",  
    "fromAddress": "string",  
    "toAddress": "string",  
    "value": "integer",  
    "value_str": "string",  
    "nonce": "integer",  
    "nonce_str": "string",  
    "gasLimit": "integer",  
    "gasLimit_str": "string",  
    "gasPrice": "integer",  
    "gasPrice_str": "string"  
}
Description
{  
    "transactionHash": "The hash of the transaction.",  
    "fromAddress": "The address of the wallet.",  
    "toAddress": "The address of the wallet or contract that was interacted with.",  
    "value": "The amount of funds transferred.",  
    "value_str": "String representation of the amount of funds transferred.",  
    "nonce": "Nonce of the transaction.",  
    "nonce_str": "String representation of the nonce of the transaction.",  
    "gasLimit": "The gas limit used to make an the transaction.",  
    "gasLimit_str": "String representation of the gas limit used to make the transaction.",  
    "gasPrice": "The gas price used to make the transaction.",  
    "gasPrice_str": "String representation of the gas price used to make the transaction."  
}
Response example
{  
    "transactionHash": "0xaf0da4bcf00fed0143f4d1a57355f3a2ef6c1e58d9e1ca8df0c730871aed99f7",  
    "fromAddress": "0x52B0d2fCF7FF7d42E2a2dd9fc8065307eDAffF26",  
    "toAddress": "0x8a072AB3D30d2d618780Fd42cB7B31e14cAf30e3",  
    "value": 2000000000000000000,  
    "value_str": "2000000000000000000",  
    "nonce": 134,  
    "nonce_str": "134",  
    "gasLimit": 21000,  
    "gasLimit_str": "21000",  
    "gasPrice": 1000000000,  
    "gasPrice_str": "1000000000"  
}

/chains/{chainName}/events/subscriptions GET

Returns an array of your current event subscriptions.

Path parameters
Path parameter Description
chainName Name of the chain for which to retrieve event subscriptions.
In the examples we'll use this solidity event: event MyEvent(uint256 indexed oldValue, uint256 indexed newValue);
Response payload
[
    {  
        "contractIdentifier": "string",  
        "eventIdentifier": "string",  
        "topics": [
            {
                "name": "string",  
                "types": [
                    "string"
                ]  
            }
        ],  
        "startBlock": "string",  
        "endBlock": "string"  
    }
]
Description
[
    {  
        "contractIdentifier": "The address of the contract which contains the event.",  
        "eventIdentifier": "The name you gave to this event subscription.",  
        "topics": [
            {  
                "name": "The name you gave your event in your Solidity code.",  
                "types": "The ordered list of types your event has."  
            }
        ],  
        "startBlock": "The start block for this subscription. This could either be a number or the keyword 'CURRENT'.",  
        "endBlock": "The end block for this subscription. This could either be a number or the keyword 'LATEST'."  
    }
]
Response example
[
    {  
        "contractIdentifier": "0xFEB8a61a411F25dB532A6611B94471140EaaA89f",  
        "eventIdentifier": "MyEventListener",  
        "topics": [
            {  
                "name": "MyEvent",  
                "types": [  
                    "uint256",  
                    "uint256"  
                ]
            }
        ],  
        "startBlock": "CURRENT",  
        "endBlock": "LATEST"  
    }
]

/chains/{chainName}/events/subscriptions POST

Resource to create an event subscription.

Path parameters
Path parameter Description
chainName Name of the chain on which to create an event subscription.
In the examples we'll use this solidity event: event MyEvent(uint256 indexed oldValue, uint256 indexed newValue);
Request payload
{  
    "contractIdentifier": "string",  
    "eventIdentifier": "string",  
    "topics": [
        {  
            "name": "string",  
            "types": [  
                "string"  
            ]
        }
    ],  
    "startBlock": "string",  
    "endBlock": "string"  
}
Description
{  
    "contractIdentifier": "The name or address of the contract which contains the events.",  
    "eventIdentifier": "The name you want to give to this event subscription",  
    "topics": [
        {  
            "name": "The name you gave your event in your Solidity code.",  
            "types": "The ordered list of types your event has."
        }
    ],  
    "startBlock": "The start block for this subscription. This could either be a number or the keyword 'CURRENT'.",  
    "endBlock": "The end block for this subscription. This could either be a number or the keyword 'LATEST'."  
}
Request example
{  
    "contractIdentifier": "MyContractWithEvents",  
    "eventIdentifier": "MyEventListener",  
    "topics": [
        {  
            "name": "MyEvent",  
            "types": [  
                "uint256",  
                "uint256"  
            ]
        }
    ],  
    "startBlock": "CURRENT",  
    "endBlock": "LATEST"  
}
Response payload
{  
    "contractIdentifier": "string",  
    "eventIdentifier": "string",  
    "topics": [
        {
            "name": "string",  
            "types": [
                "string"
            ]  
        }
    ],  
    "startBlock": "string",  
    "endBlock": "string"  
}
Description
{  
    "contractIdentifier": "The address of the contract which contains the event.",  
    "eventIdentifier": "The name you gave to this event subscription.",  
    "topics": [
        {  
            "name": "The name you gave your event in your Solidity code.",  
            "types": "The ordered list of types your event has."  
        }
    ],  
    "startBlock": "The start block for this subscription. This could either be a number or the keyword 'CURRENT'.",  
    "endBlock": "The end block for this subscription. This could either be a number or the keyword 'LATEST'."  
}
Response example
{  
    "contractIdentifier": "0xFEB8a61a411F25dB532A6611B94471140EaaA89f",  
    "eventIdentifier": "MyEventListener",  
    "topics": [
        {  
            "name": "MyEvent",  
            "types": [  
                "uint256",  
                "uint256"  
            ]
        }
    ],  
    "startBlock": "CURRENT",  
    "endBlock": "LATEST"  
}

/chains/{chainName}/events/subscriptions DELETE

Resource to remove an event subscription.

Path parameters
Path parameter Description
chainName Name of the chain on which to remove the event subscription.
Query parameters
Query parameter Description Required Default
contractId Name or address of the contract on which you have an event subscription. Yes
eventId Name of the event subscription. Yes
This resource returns an HTTP 200 when the event subscription is successfully removed.

/chains/{chainName}/events GET

Returns an array of all the events that were triggered for your subscriptions.

Path parameters
Path parameter Description
chainName Name of the chain on which to retrieve events.
Query parameters
Query parameter Description Required Default
contractId Name or address of the contract on which you have an event subscription. Yes
eventId Name of the event subscription. Yes
newOnly Boolean filter to specify if you either want to see all events or only want to retrieve events you have not yet retrieved before No TRUE
Response payload
[
    {
        "name": "string",
        "blockNumber": "string",
        "transactionIndex": "string",
        "topics": [
            "string"
        ],
        "timestamp": "string"
    }
]
Description
[
    {
        "name": "The name of the triggered event",
        "blockNumber": "The block number in which it happened",
        "transactionIndex": "The index of the event-triggering transaction in the block.",
        "topics": [
            "The decode values from the event."
        ],
        "timestamp": "The timestamp of when this event was triggered."
    }
]
Response example
[
    {
        "name": "MyEvent",
        "blockNumber": "4154294",
        "transactionIndex": "9",
        "topics": [
            "30",
            "40"
        ],
        "timestamp": "2019-04-05T05:56:12.666+0000"
    },
    {
        "name": "MyEvent",
        "blockNumber": "4154296",
        "transactionIndex": "4",
        "topics": [
            "40",
            "50"
        ],
        "timestamp": "2019-04-05T05:56:51.672+0000"
    }
]
  • All rights reserved. © 2019 Proximus|Cookie policy
  • This site was created and is managed in accordance with Belgian law.
  • Proximus API Solutions - powered by ClearMedia NV. Merksemsesteenweg 148, B-2100 Deurne. BE 0831.425.897