BLOC-service

JSON RPC API

BLOC-service RPC Wallet is a HTTP server which provides JSON 2.0 RPC interface for BLOC payment operations and address management. bloc-service RPC Wallet allows you to accept incoming payments, generate an address for each user via bloc-service RPC Wallet JSON RPC API and much more.

BLOC-service RPC Wallet JSON API

Automated services and solutions with BLOC-service

Start BLOC-service with arguments and use this page to connect to your BLOC-service RPC Wallet. Make sure to enter the address exactly like on the exemple.

Once connected, you will be able to use all the functions described below.

  • Enter the requested input for each function
  • Send command direcly to the BLOC-service RPC Wallet using the RPC port

A simple way to test your application or/and connect to a BLOC-service RPC Wallet and send commands.

Note: We are not saving any logs/requests on this website. Only you see the outputs.


Example: http://0.0.0.0:8070/json_rpc
this password will not be saved on server side



{API}
BLOC-DAEMON

BLOC integration

Make sure you follow this instructions before getting started with BLOC

BLOC integration process may differes from other cryptocurrencies. Firstly, the coin has three separate binaries:

 

 

We also support the following official client bindings:

 

 

Please click on each of the service you would like to use to see how does it work and how to implement BLOC into your application and/or website.



{API}
BLOC - DAEMON

Getting started

Use the form below to test the integration of the bloc-service API into your application. Make sure you have filled the connexion details at the top of this page.

This section describes BLOC integration process into your service with BLOC e-commerce solution called BLOC-service RPC Wallet.

 

Each method has its own example and description that can be found by clicking the details button of this method.

 

To start using BLOC-service you must first generate a container. Container file is the only file that stores all data required to run your service. It contains user addresses and private keys required to operate them. Make sure to backup this file regularly. To generate a new container visit the BLOC-service RPC Wallet command line arguments and look at the --generate-container function to read the explanation. More on how to start and operate BLOC-service RPC Wallet can be found here.

 

To start the BLOC-service JSON RPC API server at http://localhost:8070, run:

./BLOC-service

 

To make the server accessible from another computer, use the --rpc-bind-ip 0.0.0.0 switch.

./BLOCd --rpc-bind-ip=0.0.0.0

 

To make a JSON RPC request to your BLOC-service RPC Wallet you should use POST request that looks like this:

 

http://<service address>:<service port>/json_rpc

 

Where:

  • <service address> is an IP of BLOC-service RPC Wallet, if RPC Wallet is located on local machine it is either 127.0.0.1 or localhost,
  • <service port> is BLOC-service RPC Wallet port, by default it is binded to 8070 port, but it can be manually binded to any port you want, read more about this here.

 

Make sure you have filled the connexion details at the top of this page. Once you are ready, scroll down until your favorite function, fill the details and click TRY IT OUT button to send the request and get the the response.



Implementation Notes

reset() method reset your wallet and re-sync from block 0 or specified block number.


Input Parameters 1 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
scanHeight No The height to begin scanning for transactions at. This can greatly speed up wallet syncing time. integer 100000

There are no outputs for this Function


TRY IT OUT

Example : 100000



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"reset","params":{params}}' http://machine.domain:port/json_rpc

<?php
$scanHeight = 1000;
$response = $blocService->reset($scanHeight);
echo $response;

service.reset({
  scanHeight: 1000
}).then(() => {
  // do something
}).catch((error) => {
  // do something
})

scanHeight := 0 // starting height to scan
response, err := service.Reset(scanHeight)
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{}
}

No output in case of success.

Implementation Notes

save() method allows you to save your wallet by request.


There are no inputs for this Function


There are no outputs for this Function


TRY IT OUT



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"save","params":{params}}' http://machine.domain:port/json_rpc

<?php
$response = $blocService->save();
echo $response;

service.save().then(() => {
  // do something
}).catch((error) => {
  // do something
})

response, err := service.Save()
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{}
}

Implementation Notes

getViewKey() method returns your Private view key


There are no inputs for this Function


Output Parameters 1 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
viewSecretKey Private view key string

TRY IT OUT



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getViewKey","params":{_params_}}' http://machine.domain:port/json_rpc

<?php
$response = $blocService->getViewKey();
echo $response;

service.getViewKey().then((result) => {
  // do something
}).catch((error) => {
  // do something
})

response, err := service.GetViewKey()
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "viewSecretKey":"e0b250f7d56f9b7a4ac9b57e9c716dea731b59a7b3d06f51eacd9f5d0340630c"
  }
}

Implementation Notes

getSpendKeys() method returns your spendPublicKey and spendSecretKey


Input Parameters 1 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
address Yes Valid address that exists in this container string abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5

Output Parameters 2 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
spendPublicKey Public spend key string
spendSecretKey Private spend key string

TRY IT OUT

Example : abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getSpendKeys","params":{params}}' http://machine.domain:port/json_rpc

<?php
$address = 'abLoc...';
$response = $blocService->getSpendKeys($address);
echo $response;

service.getSpendKeys({
  address: 'abLoc....'
}).then((result) => {
  // do something
}).catch((error) => {
  // do something
})

address := "abLoc..."
response, err := service.GetSpendKeys(address)
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "spendPublicKey":"92024ad72b22e70c7540027173e5cbe6f73d2b955542d8712d7ed3e27ead7811",
    "spendSecretKey":"cda47a19e5d433060ab79c885817cd20fc394dc7043ac875678a3698804ede01"
  }
}

Implementation Notes

getMnemonicSeed() method returns the mnemonic seed for the given deterministic address.

  • A mnemonic seed is a list of words which can be used to recover a wallet and can be easily written on a paper.
  • The first wallet address that is generated when the container is created is the deterministic address.
  • Only one wallet from a multi-wallet container can be deterministic.
  • If a non-deterministic address is given, the RPC response will be an error with the message: Key not deterministic


Input Parameters 1 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
address Yes Valid deterministic address that exists in this container string abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg

Output Parameters 1 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
mnemonicSeed 25 words Mnemonic seed string

TRY IT OUT

Example : abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getMnemonicSeed","params":{params}}' http://machine.domain:port/json_rpc

<?php
$address = 'abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg...';
$response = $blocService->getMnemonicSeed($address);
echo $response;

service.getMnemonicSeed({
  address: 'abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg'
}).then((result) => {
  // do something
}).catch((error) => {
  // do something
})

address := "abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg"
response, err := service.GetMnemonicSeed(address)
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "mnemonicSeed":"dads vehicle fiat fountain repent radar aspire orbit awesome trolling guide drinks kickoff heron husband tutor onward legion nail yahoo arena were melting necklace vehicle"
  }
}

Implementation Notes

getStatus() method returns information about the current RPC Wallet state: block count known block count, last block hash and peer count.


There are no inputs for this Function


Output Parameters 4 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
blockCount Node's known number of blocks integer
knownBlockCount Maximum known number of blocks of all seeds that are connected to the node integer
lastBlockHash Hash of the last known block string
peerCount Connected peers number integer

TRY IT OUT



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getStatus","params":{params}}' http://machine.domain:port/json_rpc

<?php
$response = $blocService->getStatus();
echo $response;

service.getStatus().then((result) => {
  // do something
}).catch((error) => {
  // do something
})

response, err := service.GetStatus()
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "blockCount": 104557,
    "knownBlockCount": 104557,
    "lastBlockHash":"7f717ceca1875e51419a7a07a7d985310805e0b089b0fc87fbbcfe93010a755a",
    "peerCount":8
  }
}

Implementation Notes

getAddresses() returns an array of your RPC Wallet's addresses present in the container.


There are no inputs for this Function


Output Parameters 1 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
addresses Array of strings, where each string is an address array

TRY IT OUT



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getAddresses","params":{params}}' http://machine.domain:port/json_rpc

<?php
$response = $blocService->getAddresses();
echo $response;

service.getAddresses().then((result) => {
  // do something
}).catch((error) => {
  //do something
})

response, err := service.GetAddresses()
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "addresses":[
      "abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg",
      "abLoc8YamWu4XUKddV9NZ4fk3WCqzL2XCPQh9yB7Pd88UDpmSCiZsdWYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgC9fRqa"
    ]
  }
}

Implementation Notes

createAddress() method creates an additional address called a subaddress in your wallet container file.


Input Parameters 4 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
secretSpendKey No Private spend key. If secretSpendKey was specified, RPC Wallet creates spend address string f4abd8dfc3ffea2c96b131c22340d4b437b9722407769c9449f24d1a8bad0c0e
publicSpendKey No Public spend key. If publicSpendKey was specified, RPC Wallet creates view address string db20e68b00e69ba85d161af5378ab04551e0c10f23d1df6ea29da58ddc527b2e
newAddress No Is this a new address being created? If so, blocks before the creation timestamp will not be scanned. Defaults to true if neither keys are given, as it is guaranteed to be a new address. bool true
scanHeight No The height to begin scanning for transactions at. Only applies if a public/secret key is supplied. This can greatly speed up wallet syncing time. integer 100000

Output Parameters 1 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
address Array of string view, each string is an address array

TRY IT OUT

Example : f4abd8dfc3ffea2c96b131c22340d4b437b9722407769c9449f24d1a8bad0c0e

Example : db20e68b00e69ba85d161af5378ab04551e0c10f23d1df6ea29da58ddc527b2e

Example : true

Example : 100000



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"createAddress","params":{params}}' http://machine.domain:port/json_rpc

<?php
$secretSpendKey = null;
$publicSpendKey = null;
$response = $blocService->createAddress($secretSpendKey, $publicSpendKey);
echo $response;

service.createAddress({
  secretSpendKey: '',
  publicSpendKey: ''
}).then((result) => {
  // do something
}).catch((error) => {
  //do something
})

spendSecretKey := ""
spendPublicKey := ""
scanHeight := 8500
newAddress := true
response, err := service.CreateAddress(spendSecretKey, spendPublicKey, scanHeight, newAddress)
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "address":"abLocAiXVFeaF9JWodjvHrPYakpxf1Bfg1yoM11ydPBaNq4AXw5kbeUYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgB2VtRs"
  }
}

Implementation Notes

deleteAddress() method deletes a specified address from the wallet and container file.

Make sure you have a back up of your wallet before deleting it.


Input Parameters 1 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
address Yes An address to be deleted present in the wallet container file. string abLocv1pacKFJk9QgSmzk2LJWn14JGmTKzReFLz1RgY3K9Ryn7783RDT2TretzfYdck5GMCGzXTuwKfePWQYViNs4avKpnUbrwfQ

There are no outputs for this Function


TRY IT OUT

Example : abLocv1pacKFJk9QgSmzk2LJWn14JGmTKzReFLz1RgY3K9Ryn7783RDT2TretzfYdck5GMCGzXTuwKfePWQYViNs4avKpnUbrwfQ



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"deleteAddress","params":{params}}' http://machine.domain:port/json_rpc

<?php
$address = 'abLocv1pacKFJk9QgSmzk2LJWn14JGmTKzReFLz1RgY3K9Ryn7783RDT2TretzfYdck5GMCGzXTuwKfePWQYViNs4avKpnUbrwfQ';
$response = $blocService->deleteAddress($address);
echo $response;

service.deleteAddress({
  address: 'abLocv1pacKFJk9QgSmzk2LJWn14JGmTKzReFLz1RgY3K9Ryn7783RDT2TretzfYdck5GMCGzXTuwKfePWQYViNs4avKpnUbrwfQ'
}).then((result) => {
  // do something
})

address := "abLocv1pacKFJk9QgSmzk2LJWn14JGmTKzReFLz1RgY3K9Ryn7783RDT2TretzfYdck5GMCGzXTuwKfePWQYViNs4avKpnUbrwfQ"
response, err := service.DeleteAddress(address)
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

In case of success returns an empty JSON object.

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{}
}

Implementation Notes

getBalance() method returns a balance for a specified address.

  • Available balance is the funds that are available for transactions.
  • Locked amount shows the funds that are not yet available (unconfirmed transactions, the coins you've mined, time-locked transaction)

If address is not specified, getBalance() returns a cumulative balance of all RPC Wallet's addresses present in the container.

Also note, balances are expressed in BLOC atomic units, so a balance of 10000 is equal to 1 BLOC and a balance of 0.0001 BLOC = 1 BLOC Atomic unit.


Input Parameters 1 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
address No Valid address that exists in this container string abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5

Output Parameters 2 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
availableBalance Available balance of the specified address in BLOC units integer
lockedAmount Locked amount of the specified address in BLOC units. integer

TRY IT OUT

Example : abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getBalance","params":{params}}' http://machine.domain:port/json_rpc

<?php
$address = 'abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5';
$response = $blocService->getBalance($address);
echo $response;

// Address optional
service.getBalance({
  address: 'abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5'
}).then((result) => {
  // do something
})

address := "abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5"
response, err := service.GetBalance(address)
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "availableBalance":10000,
    "lockedAmount":0
  }
}

Implementation Notes

getBlockHashes() method returns an array of block hashes for a specified block range.


Input Parameters 2 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
firstBlockIndex Yes Starting height integer 100000
blockCount Yes Number of blocks to process integer 10

Output Parameters 1 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
blockHashes Array of strings, where each element is a block hash array

TRY IT OUT

Example : 100000

Example : 10



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getBlockHashes","params":{params}}' http://machine.domain:port/json_rpc

<?php
$firstBlockIndex = 100000;
$blockCount = 10;
$response = $blocService->getBlockHashes($firstBlockIndex, $blockCount);
echo $response;

service.getBlockHashes({
  firstBlockIndex: 100000,
  blockCount: 10
}).then((result) => {
  // do something
})

firstBlockIndex := 100000
blockCount := 10
response, err := service.GetBlockHashes(firstBlockIndex, blockCount)
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "blockHashes":[ 'e026316d0b95436a7d3d36247fc8adb5fcb342015eccc239b346a7e2fd64c262',
	     'd73f01f1417386243bd14854acd75817c853aee1b42bb805498a59b19f7c9b90',
	     'e538987e328c9166d88b60c3f78763bf14ec08a619179d96b8154712e6306f4f',
	     'f128754b54cbf1a93cd4e743f9ba0a44a8a8e00c614324145cb80b36f5349200',
	     '7ff0a7a78aeb01e7bd9b835642218d25dd153b001c1658b9869efdcd5d01cb6b',
	     '26238a80a7c52c8930b89053460e60a599e89d293cbea5f680911ecb2d000ade',
	     '56cf58de9e0d22c83c4bed757bdb56a35ad38364e5380ce3edbfb83dfc268e81',
	     '7661d773cd5ffc56a3e6e3deb377c8e0be5f46e9403d1000adb6055fd4ac5343',
	     'f7904821432dfdbb127419d885d292b56e9853e11468d9fa0e59c5906bf5db52',
	     'bd3dd101b769fc8b04949f9663c5bef3fa0578848c924281bc7487eb50b68c49' ]
  }
}

Implementation Notes

getTransactionHashes() returns an array of block and transaction hashes

A transaction consists of transfers. A transfer is an amount-address pair.
There could be several transfers in a single transaction.

If paymentId parameter is set, getTransactionHashes() method returns transaction hashes of transactions that contain specified payment ID in the given block range.

If addresses parameter is set, getTransactionHashes() method returns transaction hashes of transactions that contain transfer from at least one of specified addresses.

If both above mentioned parameters are set, getTransactionHashes() method returns transaction hashes of transactions that contain both specified payment ID and transfer from at least one of specified addresses.

Only one of either blockHash or firstBlockIndex may be supplied, but not both.


Input Parameters 5 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
addresses No Array of strings, where each string is an address array abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg, abLoc8YamWu4XUKddV9NZ4fk3WCqzL2XCPQh9yB7Pd88UDpmSCiZsdWYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgC9fRqa
blockHash No Only one of these parameters (blockHash or firstBlockIndex) is allowed. Hash of the starting block. string 5339e77b028a29ace5cfb2d94c1fe869dd810aed3a9d7e1280aa192311e427e5
firstBlockIndex No Only one of these parameters (blockHash or firstBlockIndex) is allowed. Starting height >0 (1,2,3...) integer 1
blockCount Yes Number of blocks to return transaction hashes from integer 1
paymentId No Valid payment ID 64 HEX characters string 09ed479d090f8a28d2c2ab3b581f663288cfcdf13bb894578d9fd9cf85301a21

Output Parameters 3 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
items array
items.blockHash Hash of the block which contains transaction hashes string
items.transactionHashes Array of strings, where each string is a transaction hash array

TRY IT OUT

Example : abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg, abLoc8YamWu4XUKddV9NZ4fk3WCqzL2XCPQh9yB7Pd88UDpmSCiZsdWYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgC9fRqa

Example : 5339e77b028a29ace5cfb2d94c1fe869dd810aed3a9d7e1280aa192311e427e5

Example : 1

Example : 1

Example : 09ed479d090f8a28d2c2ab3b581f663288cfcdf13bb894578d9fd9cf85301a21



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getTransactionHashes","params":{params}}' http://machine.domain:port/json_rpc

<?php
$blockCount = 1000;
$firstBlockIndex = 4000;
$blockHash = null;
$addresses = null;
$paymentId = null;

$response = $blocService->getTransactionHashes(
    $blockCount, $firstBlockIndex, $blockHash, $addresses, $paymentId
);

echo $response;

service.getTransactionHashes({
  addresses: [
    "abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg",
    "abLoc8YamWu4XUKddV9NZ4fk3WCqzL2XCPQh9yB7Pd88UDpmSCiZsdWYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgC9fRqa"
  ],
  blockHash: '5339e77b028a29ace5cfb2d94c1fe869dd810aed3a9d7e1280aa192311e427e5',
  blockCount: 1
}).then((result) => {
  // do something
})

addresses := []string{"abLoc8YamWu4XUKddV9NZ4fk3WCqzL2XCPQh9yB7Pd88UDpmSCiZsdWYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgC9fRqa"}
blockHash := ""
firstBlockIndex := 0
blockCount := 10000
paymentID := ""
response, err := service.GetTransactionHashes(addresses, blockHash, firstBlockIndex, blockCount, paymentID)
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "items":[ { blockHash:
	     'd537de1cd0492c67b49cbbe569c91a4f564bdd16dc4dc19c0f09172ee82da23c',
	    transactionHashes:
	     [ '6a7028e29b5796a31d2cbe5aeb5931694fe15caf0639c26045c9ac8103130a44' ] } ]
  }
}

Implementation Notes

getTransactions() method returns an array of block and transaction hashes.

A transaction consists of transfers. A transfer is an amount-address pair.
There could be several transfers in a single transaction.

If paymentId parameter is set, getTransactions() method returns transaction hashes of transactions that contain specified payment ID in the given block range.

If addresses parameter is set, getTransactions() method returns transaction hashes of transactions that contain transfer from at least one of specified addresses.

If both above mentioned parameters are set, getTransactions() method returns transaction hashes of transactions that contain both specified payment ID and transfer from at least one of specified addresses.

Only one of either blockHash or firstBlockIndex may be supplied, but not both.


Input Parameters 5 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
addresses No Array of strings, where each string is an address array abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg, abLoc8YamWu4XUKddV9NZ4fk3WCqzL2XCPQh9yB7Pd88UDpmSCiZsdWYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgC9fRqa
blockHash No Only one of these parameters (blockHash or firstBlockIndex) is allowed. Hash of the starting block. string bd95d859d58575f2a8685712354cd48e02f492080bc2f8c2447ebdc41f3dec68
firstBlockIndex No Only one of these parameters (blockHash or firstBlockIndex) is allowed. Starting height >0 (1,2,3...) integer 104570
blockCount Yes Number of blocks to return transaction hashes from integer 5
paymentId No 64 characters valid payment ID string 09ed479d090f8a28d2c2ab3b581f663288cfcdf13bb894578d9fd9cf85301a21

Output Parameters 13 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
items array
items.block_hash hash of the block which contains a transaction string
transactions see below array
transactions.transactionHash Hash of the transaction string
transactions.blockIndex Number of the block that contains a transaction integer
transactions.timestamp Timestamp of the transaction integer
transactions.isBase Shows if the transaction is a CoinBase transaction or not bool
transactions.unlockTime Height of the block when transaction is going to be available for spending integer
transactions.amount Amount of the transaction integer
transactions.fee Transaction fee integer
transactions.extra Hash of the transaction string
transactions.paymentId Payment ID of the transaction (optional) string
transactions.transfers Array of address (string), amount (int) array

TRY IT OUT

Example : abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg, abLoc8YamWu4XUKddV9NZ4fk3WCqzL2XCPQh9yB7Pd88UDpmSCiZsdWYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgC9fRqa

Example : bd95d859d58575f2a8685712354cd48e02f492080bc2f8c2447ebdc41f3dec68

Example : 104570

Example : 5

Example : 09ed479d090f8a28d2c2ab3b581f663288cfcdf13bb894578d9fd9cf85301a21



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getTransactions","params":{params}}' http://machine.domain:port/json_rpc

<?php
$blockCount = 1000;
$firstBlockIndex = 4000;
$blockHash = null;
$addresses = null;
$paymentId = null;

$response = $blocService->getTransactions(
    $blockCount, $firstBlockIndex, $blockHash, $addresses, $paymentId
);

echo $response;

service.getTransactions({
  addresses: [
    "abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg",
    "abLoc8YamWu4XUKddV9NZ4fk3WCqzL2XCPQh9yB7Pd88UDpmSCiZsdWYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgC9fRqa"
  ],
  firstBlockIndex: 40000,
  blockCount: 1
}).then((result) => {
  // do something
})

addresses := []string{"abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg"}
blockHash := ""
firstBlockIndex := 0
blockCount := 3
paymentID := ""
response, err := service.GetTransactions(addresses, blockHash, firstBlockIndex, blockCount, paymentID)
if err != nil {
  fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "items":[ { blockHash:
	     'd537de1cd0492c67b49cbbe569c91a4f564bdd16dc4dc19c0f09172ee82da23c',
	    transactionAmount: 5,
	    blockIndex: 104572,
	    extra:
	     '01800383a3084f99580038e74d2a02cdc104384ec7bc95243753595c10bf03e784',
	    fee: 1,
	    isBase: false,
	    paymentId: '',
	    state: 0,
	    timestamp: 1540835452,
	    transactionHash:
	     '6a7028e29b5796a31d2cbe5aeb5931694fe15caf0639c26045c9ac8103130a44',
	    address:
	     'abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg',
	    amount: 5,
	    type: 0,
	    inbound: true,
	    unlockTime: 0 } ]
  }
}

Implementation Notes

getUnconfirmedTransactionHashes() method returns an array of the current unconfirmed transaction pool or for a specified addresses.

A transaction consists of transfers. A transfer is an amount-address pair.
There could be several transfers in a single transaction.

If addresses parameter is set, getUnconfirmedTransactionHashes() method returns transaction hashes of transactions that contain transfer from at least one of specified addresses.


Input Parameters 1 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
addresses No Array of strings, where each string is a valid address array abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg

Output Parameters 1 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
transactionHashes Array of strings, where each string is a hash of an unconfirmed transaction array

TRY IT OUT

Example : abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getUnconfirmedTransactionHashes","params":{params}}' http://machine.domain:port/json_rpc

<?php
$addresses = null;
$response = $blocService->getUnconfirmedTransactionHashes($addresses);
echo $response;

service.getUnconfirmedTransactionHashes({
  address: 'abLocAR4dJi14yKV7ixsMMhW77HZt8c6HCYM5qdJDnwkDQByQwbBbPAYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgBaK6xg'
}).then((result) => {
  // do something
})

addresses := []string{"abLoc8YamWu4XUKddV9NZ4fk3WCqzL2XCPQh9yB7Pd88UDpmSCiZsdWYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgC9fRqa"}
response, err := service.GetUnconfirmedTransactionHashes(addresses)
if err != nil {
        fmt.Println(err)
} else {
  fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "transactionHashes":[
      "f731190b013ac313d6cf2edba86e1e1fe1f0220c2bb59b80d817b0957f0d0e4d"
    ]
  }
}

Implementation Notes

getTransaction() method returns information about a particular transaction.

Transaction consists of transfers. Transfer is an amount-address pair. There could be several transfers in a single transaction.

Remember amounts are expressed in BLOC Atomic units, so an amount of 10000 is equal to 1 BLOC and an amount of 1 equal to 0.0001 BLOC


Input Parameters 1 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
transactionHash Yes Array of strings, where each string is a hash of an unconfirmed transaction string be348bfb7f814fb40a4cde1d923daa4d90127534664c001d74f61f6ac6c88c92

Output Parameters 10 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
transactionHash Hash of the transaction string
blockIndex Number of the block that contains a transaction integer
timestamp Timestamp of the transaction integer
isBase Shows if the transaction is a CoinBase transaction or not bool
unlockTime Height of the block when transaction is going to be available for spending integer
amount Amount of the transaction integer
fee Transaction fee integer
extra Hash of the transaction string
paymentId Payment ID of the transaction (optional) string
transfers Array of addresses (string), amount (int) array

TRY IT OUT

Example : be348bfb7f814fb40a4cde1d923daa4d90127534664c001d74f61f6ac6c88c92



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getTransaction","params":{params}}' http://machine.domain:port/json_rpc

<?php
$transactionHash = '5339e77b028a29ace5cfb2d94c1fe869dd810aed3a9d7e1280aa192311e427e5';
$response = $blocService->getTransaction($transactionHash);
echo $response;

service.getTransaction({
  transactionHash: 'be348bfb7f814fb40a4cde1d923daa4d90127534664c001d74f61f6ac6c88c92'
}).then((result) => {
  // do something
})

transactionHash := "5339e77b028a29ace5cfb2d94c1fe869dd810aed3a9d7e1280aa192311e427e5"
response, err := service.GetTransaction(transactionHash)
if err != nil {
    fmt.Println(err)
} else {
    fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "transaction":{ amount: -3995,
	  blockIndex: 106556,
	  extra:
	   '01d09134d1821dd762ab8ddbfe7c4fa37d67bebf090c22ee99630b2ddce5265e1c',
	  fee: 1,
	  isBase: false,
	  paymentId: '',
	  state: 0,
	  timestamp: 1541078180,
	  transactionHash:
	   'be348bfb7f814fb40a4cde1d923daa4d90127534664c001d74f61f6ac6c88c92',
	  transfers:
	   [ { address:
	        'abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5',
	       amount: -3995,
	       type: 0 },
	     { address: '', amount: 3994, type: 0 } ],
	  unlockTime: 0 }
	
  }
}

Implementation Notes

sendTransaction() method allows you to send transaction(s) to one or several addresses. Also, it allows you to use a payment ID for a transaction to a single address.

  • If container contains only 1 address, changeAddress field can be left empty and the change is going to be sent to this address.
  • If addresses field contains only 1 address, changeAddress can be left empty and the change is going to be sent to this address.
  • In the rest of the cases, changeAddress field is mandatory and must contain an address.

Remember amounts are expressed in BLOC full units, so an amount of 10000 is equal to 1 BLOC and an amount of 1 equal to 0.0001 BLOC

 


Input Parameters 8 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
addresses No Array of strings, where each string is an address to take the funds from array abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5
transfers.address Yes Beneficiary of the transfer string abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5
transfers.amount Yes Amount to transfer integer 10
fee Yes Transaction fee. Minimal fee in BLOC network is 0.0001 BLOC. As with other amounts use whole units, 1 BLOC = 1000 units, so 0.0001 BLOC = 1 unit integer 1
unlockTime No The block height at which the transaction will be unlocked for spending. integer 100000
anonymity Yes Privacy (mixin) (level from 0 to 10) integer 0
extra No String of variable length. Can contain A-Z, 0-9 characters. string
paymentId No Payment ID (64 hex characters) string 09ed479d090f8a28d2c2ab3b581f663288cfcdf13bb894578d9fd9cf85301a21
changeAddress No Where to send any change from the transaction. If not specified, the first address in the wallet container is used. string abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5

Output Parameters 1 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
transactionHash Hash of the sent transaction string

TRY IT OUT

Example : abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5

Example : abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5

Example : 10

Example : 1

Example : 100000

Example : 0

Example :

Example : 09ed479d090f8a28d2c2ab3b581f663288cfcdf13bb894578d9fd9cf85301a21

Example : abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"sendTransaction","params":{params}' http://machine.domain:port/json_rpc

<?php
$anonymity = 0;
$fee = 1;
$addresses = null;
$unlockTime = null;
$extra = null;
$paymentId = null;
$changeAddress = 'abLocyyyy...';

$transfers = [
    ["address" => "abLocxxxx...", "amount"  => 5000],
];

$response = $blocService->sendTransaction(
    $anonymity, $transfers, $fee, $addresses, $unlockTime, $extra, $paymentId, $changeAddress
);

echo $response;

service.sendTransaction({
  transfers: [
    service.newTransfer('abLoc8YamWu4XUKddV9NZ4fk3WCqzL2XCPQh9yB7Pd88UDpmSCiZsdWYZuE4QGJVYfRc1TPmysMAuioPFuanAumEQoKCgC9fRqa', 100)
  ],
  fee: 1
}).then((result) => {
  // do something
})

addresses := []string{"abLocyyyy..."} // can be empty
unlockTime := 0
extra := ""
paymentID := ""
fee := 1
changeAddress := "abLocyyyy..."

transfers := []map[string]interface{}{
  {
    "address" : "abLocxxxx...",
    "amount" : 5000,
  },
}

response, err := service.SendTransaction(addresses, transfers, fee, unlockTime, extra, paymentID, changeAddress)
if err != nil {
    fmt.Println(err)
} else {
    fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "transactionHash":"0f3543118e5bc1e806ef28550f2199b653f25c913d5923bd635b95bc0020b747"
  }
}

Implementation Notes

createDelayedTransaction() method creates a delayed transaction. Such transactions are not sent into the network automatically and should be pushed using sendDelayedTransaction method.

  • If container contains only 1 address, changeAddress field can be left empty and the change is going to be sent to this address.
  • If addresses field contains only 1 address, changeAddress can be left empty and the change is going to be sent to this address.
  • In the rest of the cases, changeAddress field is mandatory and must contain an address.

Remember amounts are expressed in BLOC atomic units, so an amount of 10000 is equal to 1 BLOC and an amount of 1 equal to 0.0001 BLOC

Outputs that were used for this transactions will be locked until the transaction is sent or cancelled


Input Parameters 8 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
addresses No Array of strings, where each string is an address to take the funds from array TbLoc2R5d7HgwdAsnyLGnjS52z22v97LpVxdXwRaLwfw3sLadcYCiBEANSj3C7LpwbSx5UPnARB2xcZhHu1Q5jtaDsKfHKk5BXc
transfers.address Yes Beneficiary of the transfer string abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5
transfers.amount Yes Amount to transfer string 10
fee Yes Transaction fee. Minimal fee in BLOC network is 0.0001 BLOC. As with other amounts use whole units, 1 BLOC = 1000 units, so 0.0001 BLOC = 1 unit integer 1
unlockTime No The block height at which the transaction will be unlocked for spending. integer 10000
anonymity Yes Privacy (mixin) (level from 0 to 10) integer 0
extra No String of variable length. Can contain A-Z, 0-9 characters. string AZRTYUGFFHZJOIG9762534
paymentId No paymentId string 4126541177d951210fa7d8f8bfabcd76b3a839724248f1b3404e5785fa506e62
changeAddress No Where to send any change from the transaction. If not specified, the first address in the wallet container is used. string TbLoc2R5d7HgwdAsnyLGnjS52z22v97LpVxdXwRaLwfw3sLadcYCiBEANSj3C7LpwbSx5UPnARB2xcZhHu1Q5jtaDsKfHKk5BXc

Output Parameters 1 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
transactionHash Hash of the sent transaction string

TRY IT OUT

Example : TbLoc2R5d7HgwdAsnyLGnjS52z22v97LpVxdXwRaLwfw3sLadcYCiBEANSj3C7LpwbSx5UPnARB2xcZhHu1Q5jtaDsKfHKk5BXc

Example : abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5

Example : 10

Example : 1

Example : 10000

Example : 0

Example : AZRTYUGFFHZJOIG9762534

Example : 4126541177d951210fa7d8f8bfabcd76b3a839724248f1b3404e5785fa506e62

Example : TbLoc2R5d7HgwdAsnyLGnjS52z22v97LpVxdXwRaLwfw3sLadcYCiBEANSj3C7LpwbSx5UPnARB2xcZhHu1Q5jtaDsKfHKk5BXc



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"createDelayedTransaction","params":{params}}' http://machine.domain:port/json_rpc

<?php
$anonymity = 0;
$fee = 1;
$addresses = null;
$unlockTime = null;
$extra = null;
$paymentId = null;
$changeAddress = 'abLocyyyy...';

$transfers = [
    ["address" => "abLocxxxx...", "amount"  => 5000],
];

$response = $blocService->createDelayedTransaction(
    $anonymity, $transfers, $fee, $addresses, $unlockTime, $extra, $paymentId, $changeAddress
);

echo $response;

service.createDelayedTransaction({
  transfers: [
    service.newTransfer('abLoc', 100)
  ],
  fee: 1
}).then((result) => {
  // do something
})

addresses := []string{"abLocyyyy..."} // can be empty
unlockTime := 0
extra := ""
paymentID := ""
fee := 1
changeAddress := "abLocyyyy..."

transfers := []map[string]interface{}{
  {
    "address" : "abLocxxxx...",
    "amount" : 5000,
  },
}

response, err := service.CreateDelayedTransaction(addresses, transfers, fee, unlockTime, extra, paymentID, changeAddress)
if err != nil {
    fmt.Println(err)
} else {
    fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "transactionHash":"ae57e..."
  }
}

Implementation Notes

getDelayedTransactionHashes () method returns hashes of delayed transactions.


There are no inputs for this Function


Output Parameters 1 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
transactionHashes Array of strings, where each string is a transaction hash string

TRY IT OUT



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getDelayedTransactionHashes","params":{params}}' http://machine.domain:port/json_rpc

<?php
$response = $blocService->getDelayedTransactionHashes();
echo $response;

service.getDelayedTransactionHashes().then((result) => {
  // do something
})

response, err := service.GetDelayedTransactionHashes()
if err != nil {
    fmt.Println(err)
} else {
    fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "transactionHashes":["b3e374..."]
  }
}

Implementation Notes

deleteDelayedTransaction () method deletes a specified delayed transaction.

In case of success returns an empty JSON object.


Input Parameters 1 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
transactionHash Yes Valid, existing delayed transaction hash string 665d5cdd1aab703c0bfd872333ba26a65b282a76600da46260e39300565d9f5a

There are no outputs for this Function


TRY IT OUT

Example : 665d5cdd1aab703c0bfd872333ba26a65b282a76600da46260e39300565d9f5a



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"deleteDelayedTransaction","params":{}}' http://localhost:8070/json_rpc

<?php
$transactionHash = '665d5cdd1aab703c0bfd872333ba26a65b282a76600da46260e39300565d9f5a';
$response = $blocService->deleteDelayedTransaction($transactionHash);
echo $response;

service.deleteDelayedTransaction({
  transactionHash: '665d5cdd1aab703c0bfd872333ba26a65b282a76600da46260e39300565d9f5a'
}).then((result) => {
  // do something
})

transactionHash := "665d5cdd1aab703c0bfd872333ba26a65b282a76600da46260e39300565d9f5a"
response, err := service.DeleteDelayedTransaction(transactionHash)
if err != nil {
    fmt.Println(err)
} else {
    fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{}
}

Implementation Notes

sendDelayedTransaction () method sends a specified delayed transaction.

In case of success returns an empty JSON object.


Input Parameters 1 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
transactionHash Yes Valid, existing delayed transaction hash string 665d5cdd1aab703c0bfd872333ba26a65b282a76600da46260e39300565d9f5a

There are no outputs for this Function


TRY IT OUT

Example : 665d5cdd1aab703c0bfd872333ba26a65b282a76600da46260e39300565d9f5a



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"sendDelayedTransaction","params":{params}}' http://machine.domain:port/json_rpc

<?php
$transactionHash = '665d5cdd1aab703c0bfd872333ba26a65b282a76600da46260e39300565d9f5a';
$response = $blocService->sendDelayedTransaction($transactionHash);

echo $response;

service.sendDelayedTransaction({
  transactionHash: '665d5cdd1aab703c0bfd872333ba26a65b282a76600da46260e39300565d9f5a'
}).then((result) => {
  // do something
})

transactionHash := "665d5cdd1aab703c0bfd872333ba26a65b282a76600da46260e39300565d9f5a"
response, err := service.SendDelayedTransaction(transactionHash)
if err != nil {
    fmt.Println(err)
} else {
    fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{}
}

Implementation Notes

sendFusionTransaction() method allows you to send a fusion transaction, by taking funds from selected addresses and transferring them to the destination address. If there aren't any outputs that can be optimized, sendFusionTransaction() will return an error. You can use estimateFusion () to check the outputs, available for the optimization

  • If container contains only 1 address, destinationAddress field can be left empty and the funds are going to be sent to this address.
  • If addresses field contains only 1 address, destinationAddress can be left empty and the funds are going to be sent to this address.

In the rest of the cases, destinationAddress field is mandatory and must contain an address.


Input Parameters 4 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
threshold Yes Value that determines which outputs will be optimized. Only the outputs, lesser than the threshold value, will be included into a fusion transaction. integer 1
anonymity Yes Privacy (mixin) (level from 0 to 10) integer 0
addresses No Array of strings, where each string is an address to take the funds from. array abLoc2R5d7HgwdAsnyLGnjS52z22v97LpVxdXwRaLwfw3sLadcYCiBEANSj3C7LpwbSx5UPnARB2xcZhHu1Q5jtaDsKfHKk5BXc
destinationAddress No An address that the optimized funds will be sent to. Valid and existing in this container address. string abLoc2R5d7HgwdAsnyLGnjS52z22v97LpVxdXwRaLwfw3sLadcYCiBEANSj3C7LpwbSx5UPnARB2xcZhHu1Q5jtaDsKfHKk5BXc

Output Parameters 1 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
transactionHash Hash of the sent transaction string

TRY IT OUT

Example : 1

Example : 0

Example : abLoc2R5d7HgwdAsnyLGnjS52z22v97LpVxdXwRaLwfw3sLadcYCiBEANSj3C7LpwbSx5UPnARB2xcZhHu1Q5jtaDsKfHKk5BXc

Example : abLoc2R5d7HgwdAsnyLGnjS52z22v97LpVxdXwRaLwfw3sLadcYCiBEANSj3C7LpwbSx5UPnARB2xcZhHu1Q5jtaDsKfHKk5BXc



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"sendFusionTransaction","params":{}}' http://localhost:8070/json_rpc

<?php
$threshold = 1000000;
$anonymity = 0;
$addresses = ['abLocyyyy...', 'abLocyyyy...'];
$destinationAddress = 'abLoczzzz...';
$response = $blocService->sendFusionTransaction($threshold, $anonymity, $addresses, $destinationAddress);

echo $response;

service.sendFusionTransaction({
  destinationAddress: 'abLocyyyy'
}).then((result) => {
  // do something
})

threshold := 100000
addresses := []string{"abLocxxxx...", "abLocyyyy..."}
destinationAddress := "abLoczzzz..."
response, err := service.SendfusionTransaction(threshold, addresses, destinationAddress)
if err != nil {
    fmt.Println(err)
} else {
    fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "transactionHash":"93faed..."
  }
}

Implementation Notes

estimateFusion() method counts the number of unspent outputs of the specified addresses and returns how many of those outputs can be optimized. This method is used to understand if a fusion transaction can be created.

If fusionReadyCount returns a value = 0, then a fusion transaction cannot be created.


Input Parameters 2 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
threshold Yes Value that determines which outputs will be optimized. Only the outputs, lesser than the threshold value, will be included into a fusion transaction. integer 1
addresses No Array of strings, where each string is an address to take the funds from. array abLoc2R5d7HgwdAsnyLGnjS52z22v97LpVxdXwRaLwfw3sLadcYCiBEANSj3C7LpwbSx5UPnARB2xcZhHu1Q5jtaDsKfHKk5BXc

Output Parameters 2 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
totalOutputCount Total number of unspent outputs of the specified addresses. integer
fusionReadyCount Number of outputs that can be optimized. integer

TRY IT OUT

Example : 1

Example : abLoc2R5d7HgwdAsnyLGnjS52z22v97LpVxdXwRaLwfw3sLadcYCiBEANSj3C7LpwbSx5UPnARB2xcZhHu1Q5jtaDsKfHKk5BXc



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"estimateFusion","params":{params}}' http://machine.domain:port/json_rpc

<?php
$threshold = 1000000;
$addresses = ['abLocyyyy...', 'abLocxxxx...'];
$response = $blocService->estimateFusion($threshold, $addresses);

echo $response;

service.estimateFusion({
  threshold: 100000000,
  addresses:[
    'abLocyyy.....'
  ]
}).then((result) => {
  // do something
})

threshold := 1000000
addresses := []string{"abLocyyyy...","abLocxxxx..."}
response, err := service.EstimateFusion(threshold, addresses)
if err != nil {
    fmt.Println(err)
} else {
    fmt.Println(response)
}

Expected Output

{
  "id":1,
  "jsonrpc":"2.0",
  "result":{
    "fusionReadyCount":0,
    "totalOutputCount":8
  }
}

Implementation Notes

createIntegratedAddress() method allows you to create a combined address, containing a standard address and a paymentId, to be used in sendTransaction() or for supplying to a user, instead of using an address and paymentId as separate parameters.

This is helpful to ensure users cannot forget to supply a payment Id.


Input Parameters 2 inputs
Only display the first 3 inputs. Click for more inputs.

Argument Mandatory Description Format Example
address Yes A valid address present in the container string abLoc2R5d7HgwdAsnyLGnjS52z22v97LpVxdXwRaLwfw3sLadcYCiBEANSj3C7LpwbSx5UPnARB2xcZhHu1Q5jtaDsKfHKk5BXc
paymentId Yes A valid paymentId string 4126541177d951210fa7d8f8bfabcd76b3a839724248f1b3404e5785fa506e62

Output Parameters 1 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
integratedAddress The created integrated address string

TRY IT OUT

Example : abLoc2R5d7HgwdAsnyLGnjS52z22v97LpVxdXwRaLwfw3sLadcYCiBEANSj3C7LpwbSx5UPnARB2xcZhHu1Q5jtaDsKfHKk5BXc

Example : 4126541177d951210fa7d8f8bfabcd76b3a839724248f1b3404e5785fa506e62



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"createIntegratedAddress","params":{params}}' http://machine.domain:port/json_rpc

<?php
$address = 'abLocyyyy...';
$paymentId = '4126541177d951210fa7d8f8bfabcd76b3a839724248f1b3404e5785fa506e62';
$response = $blocService->createIntegratedAddress($address, $paymentId);

echo $response;

service.createIntegratedAddress({
  address: 'abLocyyyy....',
  paymentId: '4126541177d951210fa7d8f8bfabcd76b3a839724248f1b3404e5785fa506e62'
}).then((result) => {
  // do something
})

address := "abLocyyyy..."
paymentID := "4126541177d951210fa7d8f8bfabcd76b3a839724248f1b3404e5785fa506e62"
response, err := service.CreateIntegratedAddress(address, paymentID)
if err != nil {
    fmt.Println(err)
} else {
    fmt.Println(response)
}

Expected Output

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "integratedAddress": "abLocxxxxx..."
  }
}

Implementation Notes

getFeeInfo() method retrieves the fee and address (if any) from a remote node. This fee will automatically be added to any transactions sent by sendTransaction() or sendDelayedTransaction() using this node.

Note it does not apply to sendFusionTransaction().


There are no inputs for this Function


Output Parameters 2 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
address The address of the node owner string
amount The fee that will be sent to the node owners address with each transaction. integer

TRY IT OUT



curl -d '{"jsonrpc":"2.0","id":1,"password":"passw0rd","method":"getFeeInfo","params":{params}}' http://machine.domain:port/json_rpc

<?php
$response = $blocService->getFeeInfo();

echo $response;

service.getFeeInfo().then((result) => {
  // do something
})

response, err := service.GetFeeInfo()
if err != nil {
    fmt.Println(err)
} else {
    fmt.Println(response)
}

Expected Output

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "address": "abLocyyy...",
    "amount": 5000
  }
}