# OctaCore.ContractsApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**getApprovalEventsByContractAdressPost**](ContractsApi.md#getApprovalEventsByContractAdressPost) | **POST** /getApprovalEventsByContractAdress | getApprovalEventsByContractAdress
[**getTransferEventsByContractAdressPost**](ContractsApi.md#getTransferEventsByContractAdressPost) | **POST** /getTransferEventsByContractAdress | getTransferEventsByContractAdress
[**isContractPost**](ContractsApi.md#isContractPost) | **POST** /isContract | isContract


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

getApprovalEventsByContractAdress

Get Approval events emited by a given contract The /getApprovalEventsByContractAddress API endpoint allows you to retrieve all \"approval\" events emitted by a specific contract on the blockchain. An \"approval\" event is a type of event that is emitted when the allowance of an ERC20 token is set or changed by a contract or an address. ### Use cases: + Displaying the history of approval events on a blockchain explorer. + Allowing a user to view the approval events emitted by a specific contract 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.ContractsApi();

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

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


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **chain** | **String**| Chain to be requested in. | 
 **input** | [**ModelsTxReq**](ModelsTxReq.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="getTransferEventsByContractAdressPost"></a>
# **getTransferEventsByContractAdressPost**
> getTransferEventsByContractAdressPost(chain, input)

getTransferEventsByContractAdress

The /getTransferEventsByContractAddress API endpoint allows you to retrieve all \"transfer\" events emitted by a specific contract on the blockchain. A \"transfer\" event is a type of event that is emitted when an ERC20 token is transferred from one address to another. ### Use cases: + Displaying the history of transfer events on a blockchain explorer. + Allowing a user to view the transfer events emitted by a specific contract 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.ContractsApi();

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

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


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **chain** | **String**| Chain to be requested in. | 
 **input** | [**ModelsTxReq**](ModelsTxReq.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="isContractPost"></a>
# **isContractPost**
> isContractPost(chain, input)

isContract

The /isContract API endpoint allows you to check if a given address on the blockchain corresponds to a contract. ### Use cases: + Verifying if a given address is a contract on a blockchain explorer. + Allowing a user to check if a given address is a contract 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.ContractsApi();

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.isContractPost(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

