All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| constructionCombine | POST /construction/combine | Create Network Transaction from Signatures |
| constructionDerive | POST /construction/derive | Derive an Address from a PublicKey |
| constructionHash | POST /construction/hash | Get the Hash of a Signed Transaction |
| constructionMetadata | POST /construction/metadata | Get Metadata for Transaction Construction |
| constructionParse | POST /construction/parse | Parse a Transaction |
| constructionPayloads | POST /construction/payloads | Generate an Unsigned Transaction and Signing Payloads |
| constructionPreprocess | POST /construction/preprocess | Create a Request to Fetch Metadata |
| constructionSubmit | POST /construction/submit | Submit a Signed Transaction |
ConstructionCombineResponse constructionCombine(constructionCombineRequest)
Create Network Transaction from Signatures
Combine creates a network-specific transaction from an unsigned transaction and an array of provided signatures. The signed transaction returned from this method will be sent to the `/construction/submit` endpoint by the caller.
import Rosetta from 'rosetta';
let apiInstance = new Rosetta.ConstructionApi();
let constructionCombineRequest = new Rosetta.ConstructionCombineRequest(); // ConstructionCombineRequest |
apiInstance.constructionCombine(constructionCombineRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| constructionCombineRequest | ConstructionCombineRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
ConstructionDeriveResponse constructionDerive(constructionDeriveRequest)
Derive an Address from a PublicKey
Derive returns the network-specific address associated with a public key. Blockchains that require an on-chain action to create an account should not implement this method.
import Rosetta from 'rosetta';
let apiInstance = new Rosetta.ConstructionApi();
let constructionDeriveRequest = new Rosetta.ConstructionDeriveRequest(); // ConstructionDeriveRequest |
apiInstance.constructionDerive(constructionDeriveRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| constructionDeriveRequest | ConstructionDeriveRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
TransactionIdentifierResponse constructionHash(constructionHashRequest)
Get the Hash of a Signed Transaction
TransactionHash returns the network-specific transaction hash for a signed transaction.
import Rosetta from 'rosetta';
let apiInstance = new Rosetta.ConstructionApi();
let constructionHashRequest = new Rosetta.ConstructionHashRequest(); // ConstructionHashRequest |
apiInstance.constructionHash(constructionHashRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| constructionHashRequest | ConstructionHashRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
ConstructionMetadataResponse constructionMetadata(constructionMetadataRequest)
Get Metadata for Transaction Construction
Get any information required to construct a transaction for a specific network. Metadata returned here could be a recent hash to use, an account sequence number, or even arbitrary chain state. The request used when calling this endpoint is often created by calling `/construction/preprocess` in an offline environment. It is important to clarify that this endpoint should not pre-construct any transactions for the client (this should happen in `/construction/payloads`). This endpoint is left purposely unstructured because of the wide scope of metadata that could be required.
import Rosetta from 'rosetta';
let apiInstance = new Rosetta.ConstructionApi();
let constructionMetadataRequest = new Rosetta.ConstructionMetadataRequest(); // ConstructionMetadataRequest |
apiInstance.constructionMetadata(constructionMetadataRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| constructionMetadataRequest | ConstructionMetadataRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
ConstructionParseResponse constructionParse(constructionParseRequest)
Parse a Transaction
Parse is called on both unsigned and signed transactions to understand the intent of the formulated transaction. This is run as a sanity check before signing (after `/construction/payloads`) and before broadcast (after `/construction/combine`).
import Rosetta from 'rosetta';
let apiInstance = new Rosetta.ConstructionApi();
let constructionParseRequest = new Rosetta.ConstructionParseRequest(); // ConstructionParseRequest |
apiInstance.constructionParse(constructionParseRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| constructionParseRequest | ConstructionParseRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
ConstructionPayloadsResponse constructionPayloads(constructionPayloadsRequest)
Generate an Unsigned Transaction and Signing Payloads
Payloads is called with an array of operations and the response from `/construction/metadata`. It returns an unsigned transaction blob and a collection of payloads that must be signed by particular addresses using a certain SignatureType. The array of operations provided in transaction construction often times can not specify all "effects" of a transaction (consider invoked transactions in Ethereum). However, they can deterministically specify the "intent" of the transaction, which is sufficient for construction. For this reason, parsing the corresponding transaction in the Data API (when it lands on chain) will contain a superset of whatever operations were provided during construction.
import Rosetta from 'rosetta';
let apiInstance = new Rosetta.ConstructionApi();
let constructionPayloadsRequest = new Rosetta.ConstructionPayloadsRequest(); // ConstructionPayloadsRequest |
apiInstance.constructionPayloads(constructionPayloadsRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| constructionPayloadsRequest | ConstructionPayloadsRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
ConstructionPreprocessResponse constructionPreprocess(constructionPreprocessRequest)
Create a Request to Fetch Metadata
Preprocess is called prior to `/construction/payloads` to construct a request for any metadata that is needed for transaction construction given (i.e. account nonce). The request returned from this method will be used by the caller (in a different execution environment) to call the `/construction/metadata` endpoint.
import Rosetta from 'rosetta';
let apiInstance = new Rosetta.ConstructionApi();
let constructionPreprocessRequest = new Rosetta.ConstructionPreprocessRequest(); // ConstructionPreprocessRequest |
apiInstance.constructionPreprocess(constructionPreprocessRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| constructionPreprocessRequest | ConstructionPreprocessRequest |
ConstructionPreprocessResponse
No authorization required
- Content-Type: application/json
- Accept: application/json
TransactionIdentifierResponse constructionSubmit(constructionSubmitRequest)
Submit a Signed Transaction
Submit a pre-signed transaction to the node. This call should not block on the transaction being included in a block. Rather, it should return immediately with an indication of whether or not the transaction was included in the mempool. The transaction submission response should only return a 200 status if the submitted transaction could be included in the mempool. Otherwise, it should return an error.
import Rosetta from 'rosetta';
let apiInstance = new Rosetta.ConstructionApi();
let constructionSubmitRequest = new Rosetta.ConstructionSubmitRequest(); // ConstructionSubmitRequest |
apiInstance.constructionSubmit(constructionSubmitRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| constructionSubmitRequest | ConstructionSubmitRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json