# OctaCore.MetadataApi

All URIs are relative to *https://api.octacore.io*

Method | HTTP request | Description
------------- | ------------- | -------------
[**getCodeAtPost**](MetadataApi.md#getCodeAtPost) | **POST** /getCodeAt | getCodeAt
[**getGasPricePost**](MetadataApi.md#getGasPricePost) | **POST** /getGasPrice | getGasPrice
[**getNonceAtPost**](MetadataApi.md#getNonceAtPost) | **POST** /getNonceAt | getNonceAt
[**getPeerCountPost**](MetadataApi.md#getPeerCountPost) | **POST** /getPeerCount | getPeerCount
[**getPendingTransactionCountPost**](MetadataApi.md#getPendingTransactionCountPost) | **POST** /getPendingTransactionCount | getPendingTransactionCount
[**getStorageAtPost**](MetadataApi.md#getStorageAtPost) | **POST** /getStorageAt | getStorageAt


<a name="getCodeAtPost"></a>
# **getCodeAtPost**
> getCodeAtPost(chain, input)

getCodeAt

The /getCodeAt API endpoint allows you to retrieve the code of a smart contract that is stored at a specific address on the blockchain. The code of a smart contract is the compiled version of the contract's source code, and it is stored on the blockchain as part of the contract's data. ### Use cases: + Debugging a smart contract: if you are encountering an issue with a smart contract and you want to examine the contract's code to find the cause of the issue, you can use the /getCodeAt endpoint to retrieve the contract's code and analyze it. + Auditing a smart contract: if you want to assess the security or correctness of a smart contract, you can use the /getCodeAt endpoint to retrieve the contract's code and review it for any vulnerabilities or potential issues.

### Example
```javascript
var OctaCore = require('octa_core');
var defaultClient = OctaCore.ApiClient.instance;

// Configure API key authorization: JWT
var JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

var apiInstance = new OctaCore.MetadataApi();

var chain = "chain_example"; // String | Chain to be requested in.

var input = new OctaCore.ModelsAddressReq(); // ModelsAddressReq | Contract Address


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.getCodeAtPost(chain, input, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **chain** | **String**| Chain to be requested in. | 
 **input** | [**ModelsAddressReq**](ModelsAddressReq.md)| Contract Address | 

### Return type

null (empty response body)

### Authorization

[JWT](../README.md#JWT)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getGasPricePost"></a>
# **getGasPricePost**
> getGasPricePost(chain)

getGasPrice

The /getGasPrice API endpoint allows you to retrieve the current estimated gas prices for the Ethereum blockchain. The gas price is the amount of Ether (ETH) that you need to pay per unit of gas in order to have your transaction included in the next block. ### Use cases: + Setting the gas price for a transaction. + Monitoring the gas market. + Optimizing gas usage.

### Example
```javascript
var OctaCore = require('octa_core');
var defaultClient = OctaCore.ApiClient.instance;

// Configure API key authorization: JWT
var JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

var apiInstance = new OctaCore.MetadataApi();

var chain = "chain_example"; // String | Chain to be requested in.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.getGasPricePost(chain, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **chain** | **String**| Chain to be requested in. | 

### Return type

null (empty response body)

### Authorization

[JWT](../README.md#JWT)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getNonceAtPost"></a>
# **getNonceAtPost**
> getNonceAtPost(chain, input)

getNonceAt

The /getNonceAt API endpoint allows you to retrieve the account nonce of a specific address on the Ethereum blockchain. The account nonce is a counter that is incremented each time a transaction is sent from an account. It helps to ensure that transactions are processed in the order that they are intended, and it prevents replay attacks. ### Use cases: + Determining the next nonce to use for a transaction. + Validating the nonce of a transaction. + Monitoring the activity of an account.

### Example
```javascript
var OctaCore = require('octa_core');
var defaultClient = OctaCore.ApiClient.instance;

// Configure API key authorization: JWT
var JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

var apiInstance = new OctaCore.MetadataApi();

var chain = "chain_example"; // String | Chain to be requested in.

var input = new OctaCore.ModelsNonceReq(); // ModelsNonceReq | Address and Block number


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.getNonceAtPost(chain, input, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **chain** | **String**| Chain to be requested in. | 
 **input** | [**ModelsNonceReq**](ModelsNonceReq.md)| Address and Block number | 

### Return type

null (empty response body)

### Authorization

[JWT](../README.md#JWT)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getPeerCountPost"></a>
# **getPeerCountPost**
> getPeerCountPost(chain)

getPeerCount

The /getPeerCount API endpoint allows you to retrieve the number of peer-to-peer (P2P) connections that are currently connected to the Ethereum blockchain. P2P connections are established between nodes on the blockchain network, and they are used to exchange information and data. ### Use cases: + Monitoring the number of P2P connections on the Ethereum network. + Displaying the number of P2P connections on a blockchain explorer. + Allowing a user to view the number of P2P connections within a decentralized application.

### Example
```javascript
var OctaCore = require('octa_core');
var defaultClient = OctaCore.ApiClient.instance;

// Configure API key authorization: JWT
var JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

var apiInstance = new OctaCore.MetadataApi();

var chain = "chain_example"; // String | Chain to be requested in.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.getPeerCountPost(chain, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **chain** | **String**| Chain to be requested in. | 

### Return type

null (empty response body)

### Authorization

[JWT](../README.md#JWT)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getPendingTransactionCountPost"></a>
# **getPendingTransactionCountPost**
> getPendingTransactionCountPost(chain)

getPendingTransactionCount

Returns the number of pending transactions in the latest block. The /getPendingTransactionCount API endpoint allows you to retrieve the number of transactions that are currently pending on the Ethereum blockchain. Pending transactions are transactions that have been broadcast to the network but have not yet been included in a block. ### Use cases: + Monitoring the number of pending transactions on the Ethereum network. + Displaying the number of pending transactions on a blockchain explorer. + Transaction throughput analysis: By tracking the number of pending transactions over time, you can get a sense of the overall transaction throughput of the Ethereum network and identify any trends or patterns that may be emerging. + Queue management: If you are building a decentralized application that relies on transactions being processed in a specific order, you can use the /getPendingTransactionCount endpoint to monitor the size of the transaction queue and adjust your strategy accordingly.

### Example
```javascript
var OctaCore = require('octa_core');
var defaultClient = OctaCore.ApiClient.instance;

// Configure API key authorization: JWT
var JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

var apiInstance = new OctaCore.MetadataApi();

var chain = "chain_example"; // String | Chain to be requested in.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.getPendingTransactionCountPost(chain, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **chain** | **String**| Chain to be requested in. | 

### Return type

null (empty response body)

### Authorization

[JWT](../README.md#JWT)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

<a name="getStorageAtPost"></a>
# **getStorageAtPost**
> getStorageAtPost(chain, input)

getStorageAt

The /getStorageAt API endpoint allows you to retrieve the value of a specific key in the contract storage of a specific account on the Ethereum blockchain. Contract storage is a key-value store that is associated with each smart contract on the blockchain. It is used to persist data that is associated with the contract, and it can be accessed by calling functions on the contract or by using APIs like /getStorageAt. ### Use cases: + Retrieving data from a smart contract. + Debugging a smart contract.

### Example
```javascript
var OctaCore = require('octa_core');
var defaultClient = OctaCore.ApiClient.instance;

// Configure API key authorization: JWT
var JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

var apiInstance = new OctaCore.MetadataApi();

var chain = "chain_example"; // String | Chain to be requested in.

var input = new OctaCore.ModelsGetStorageAtReq(); // ModelsGetStorageAtReq | Contract Address and Key


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.getStorageAtPost(chain, input, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **chain** | **String**| Chain to be requested in. | 
 **input** | [**ModelsGetStorageAtReq**](ModelsGetStorageAtReq.md)| Contract Address and Key | 

### Return type

null (empty response body)

### Authorization

[JWT](../README.md#JWT)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

