Skip to content

Latest commit

 

History

History
1175 lines (894 loc) · 91.1 KB

File metadata and controls

1175 lines (894 loc) · 91.1 KB

AvaCloudSDKTransactions

(data.evm.transactions)

Overview

Available Operations

getDeploymentTransaction

If the address is a smart contract, returns the transaction in which it was deployed.

Example Usage

import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.transactions.getDeploymentTransaction({
    address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
    currency: "usd",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataEvmTransactionsGetDeploymentTransaction } from "@avalabs/avacloud-sdk/funcs/dataEvmTransactionsGetDeploymentTransaction.js";

// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const res = await dataEvmTransactionsGetDeploymentTransaction(avaCloudSDK, {
    address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
    currency: "usd",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetDeploymentTransactionRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.
options.serverURL string An optional server URL to use.

Response

Promise<components.GetTransactionResponse>

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.TooManyRequests 429 application/json
errors.InternalServerError 500 application/json
errors.BadGateway 502 application/json
errors.ServiceUnavailable 503 application/json
errors.SDKError 4XX, 5XX */*

listContractDeployments

Lists all contracts deployed by the given address.

Example Usage

import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.transactions.listContractDeployments({
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataEvmTransactionsListContractDeployments } from "@avalabs/avacloud-sdk/funcs/dataEvmTransactionsListContractDeployments.js";

// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const res = await dataEvmTransactionsListContractDeployments(avaCloudSDK, {
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ListContractDeploymentsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.
options.serverURL string An optional server URL to use.

Response

Promise<operations.ListContractDeploymentsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.TooManyRequests 429 application/json
errors.InternalServerError 500 application/json
errors.BadGateway 502 application/json
errors.ServiceUnavailable 503 application/json
errors.SDKError 4XX, 5XX */*

listTransfers

Lists ERC transfers for an ERC-20, ERC-721, or ERC-1155 contract address.

Example Usage

import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.transactions.listTransfers({
    startBlock: 6479329,
    endBlock: 6479330,
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataEvmTransactionsListTransfers } from "@avalabs/avacloud-sdk/funcs/dataEvmTransactionsListTransfers.js";

// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const res = await dataEvmTransactionsListTransfers(avaCloudSDK, {
    startBlock: 6479329,
    endBlock: 6479330,
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ListTransfersRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.
options.serverURL string An optional server URL to use.

Response

Promise<operations.ListTransfersResponse>

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.TooManyRequests 429 application/json
errors.InternalServerError 500 application/json
errors.BadGateway 502 application/json
errors.ServiceUnavailable 503 application/json
errors.SDKError 4XX, 5XX */*

listTransactions

Returns a list of transactions where the given wallet address had an on-chain interaction for the given chain. The ERC-20 transfers, ERC-721 transfers, ERC-1155, and internal transactions returned are only those where the input address had an interaction. Specifically, those lists only inlcude entries where the input address was the sender (from field) or the receiver (to field) for the sub-transaction. Therefore the transactions returned from this list may not be complete representations of the on-chain data. For a complete view of a transaction use the /chains/:chainId/transactions/:txHash endpoint.

Filterable by block ranges.

Example Usage

import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.transactions.listTransactions({
    pageSize: 10,
    startBlock: 6479329,
    endBlock: 6479330,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
    sortOrder: "asc",
  });

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataEvmTransactionsListTransactions } from "@avalabs/avacloud-sdk/funcs/dataEvmTransactionsListTransactions.js";

// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const res = await dataEvmTransactionsListTransactions(avaCloudSDK, {
    pageSize: 10,
    startBlock: 6479329,
    endBlock: 6479330,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
    sortOrder: "asc",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ListTransactionsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.
options.serverURL string An optional server URL to use.

Response

Promise<operations.ListTransactionsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.TooManyRequests 429 application/json
errors.InternalServerError 500 application/json
errors.BadGateway 502 application/json
errors.ServiceUnavailable 503 application/json
errors.SDKError 4XX, 5XX */*

listNativeTransactions

Lists native transactions for an address. Filterable by block range.

Example Usage

import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.transactions.listNativeTransactions({
    startBlock: 6479329,
    endBlock: 6479330,
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataEvmTransactionsListNativeTransactions } from "@avalabs/avacloud-sdk/funcs/dataEvmTransactionsListNativeTransactions.js";

// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const res = await dataEvmTransactionsListNativeTransactions(avaCloudSDK, {
    startBlock: 6479329,
    endBlock: 6479330,
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ListNativeTransactionsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.
options.serverURL string An optional server URL to use.

Response

Promise<operations.ListNativeTransactionsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.TooManyRequests 429 application/json
errors.InternalServerError 500 application/json
errors.BadGateway 502 application/json
errors.ServiceUnavailable 503 application/json
errors.SDKError 4XX, 5XX */*

listErc20Transactions

Lists ERC-20 transfers for an address. Filterable by block range.

Example Usage

import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.transactions.listErc20Transactions({
    startBlock: 6479329,
    endBlock: 6479330,
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataEvmTransactionsListErc20Transactions } from "@avalabs/avacloud-sdk/funcs/dataEvmTransactionsListErc20Transactions.js";

// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const res = await dataEvmTransactionsListErc20Transactions(avaCloudSDK, {
    startBlock: 6479329,
    endBlock: 6479330,
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ListErc20TransactionsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.
options.serverURL string An optional server URL to use.

Response

Promise<operations.ListErc20TransactionsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.TooManyRequests 429 application/json
errors.InternalServerError 500 application/json
errors.BadGateway 502 application/json
errors.ServiceUnavailable 503 application/json
errors.SDKError 4XX, 5XX */*

listErc721Transactions

Lists ERC-721 transfers for an address. Filterable by block range.

Example Usage

import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.transactions.listErc721Transactions({
    startBlock: 6479329,
    endBlock: 6479330,
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataEvmTransactionsListErc721Transactions } from "@avalabs/avacloud-sdk/funcs/dataEvmTransactionsListErc721Transactions.js";

// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const res = await dataEvmTransactionsListErc721Transactions(avaCloudSDK, {
    startBlock: 6479329,
    endBlock: 6479330,
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ListErc721TransactionsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.
options.serverURL string An optional server URL to use.

Response

Promise<operations.ListErc721TransactionsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.TooManyRequests 429 application/json
errors.InternalServerError 500 application/json
errors.BadGateway 502 application/json
errors.ServiceUnavailable 503 application/json
errors.SDKError 4XX, 5XX */*

listErc1155Transactions

Lists ERC-1155 transfers for an address. Filterable by block range.

Example Usage

import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.transactions.listErc1155Transactions({
    startBlock: 6479329,
    endBlock: 6479330,
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataEvmTransactionsListErc1155Transactions } from "@avalabs/avacloud-sdk/funcs/dataEvmTransactionsListErc1155Transactions.js";

// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const res = await dataEvmTransactionsListErc1155Transactions(avaCloudSDK, {
    startBlock: 6479329,
    endBlock: 6479330,
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ListErc1155TransactionsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.
options.serverURL string An optional server URL to use.

Response

Promise<operations.ListErc1155TransactionsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.TooManyRequests 429 application/json
errors.InternalServerError 500 application/json
errors.BadGateway 502 application/json
errors.ServiceUnavailable 503 application/json
errors.SDKError 4XX, 5XX */*

listInternalTransactions

Returns a list of internal transactions for an address and chain. Filterable by block range.

Note that the internal transactions list only contains CALL or CALLCODE transactions with a non-zero value and CREATE/CREATE2 transactions. To get a complete list of internal transactions use the debug_ prefixed RPC methods on an archive node.

Example Usage

import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.transactions.listInternalTransactions({
    startBlock: 6479329,
    endBlock: 6479330,
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataEvmTransactionsListInternalTransactions } from "@avalabs/avacloud-sdk/funcs/dataEvmTransactionsListInternalTransactions.js";

// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const res = await dataEvmTransactionsListInternalTransactions(avaCloudSDK, {
    startBlock: 6479329,
    endBlock: 6479330,
    pageSize: 10,
    address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ListInternalTransactionsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.
options.serverURL string An optional server URL to use.

Response

Promise<operations.ListInternalTransactionsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.TooManyRequests 429 application/json
errors.InternalServerError 500 application/json
errors.BadGateway 502 application/json
errors.ServiceUnavailable 503 application/json
errors.SDKError 4XX, 5XX */*

getTransaction

Gets the details of a single transaction.

Example Usage

import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.transactions.getTransaction({
    txHash: "0x8bf584d7b14b92a32a339872a66b134a70ba3ba7c305823f348db6f860253f45",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataEvmTransactionsGetTransaction } from "@avalabs/avacloud-sdk/funcs/dataEvmTransactionsGetTransaction.js";

// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const res = await dataEvmTransactionsGetTransaction(avaCloudSDK, {
    txHash: "0x8bf584d7b14b92a32a339872a66b134a70ba3ba7c305823f348db6f860253f45",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetTransactionRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.
options.serverURL string An optional server URL to use.

Response

Promise<components.GetTransactionResponse>

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.TooManyRequests 429 application/json
errors.InternalServerError 500 application/json
errors.BadGateway 502 application/json
errors.ServiceUnavailable 503 application/json
errors.SDKError 4XX, 5XX */*

getTransactionsForBlock

Lists the transactions that occured in a given block.

Example Usage

import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.transactions.getTransactionsForBlock({
    blockId: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataEvmTransactionsGetTransactionsForBlock } from "@avalabs/avacloud-sdk/funcs/dataEvmTransactionsGetTransactionsForBlock.js";

// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const res = await dataEvmTransactionsGetTransactionsForBlock(avaCloudSDK, {
    blockId: "0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetTransactionsForBlockRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.
options.serverURL string An optional server URL to use.

Response

Promise<components.ListNativeTransactionsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.TooManyRequests 429 application/json
errors.InternalServerError 500 application/json
errors.BadGateway 502 application/json
errors.ServiceUnavailable 503 application/json
errors.SDKError 4XX, 5XX */*

listLatestTransactions

Lists the latest transactions. Filterable by status.

Example Usage

import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.evm.transactions.listLatestTransactions({
    pageSize: 10,
  });

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataEvmTransactionsListLatestTransactions } from "@avalabs/avacloud-sdk/funcs/dataEvmTransactionsListLatestTransactions.js";

// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const res = await dataEvmTransactionsListLatestTransactions(avaCloudSDK, {
    pageSize: 10,
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ListLatestTransactionsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.
options.serverURL string An optional server URL to use.

Response

Promise<operations.ListLatestTransactionsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.TooManyRequests 429 application/json
errors.InternalServerError 500 application/json
errors.BadGateway 502 application/json
errors.ServiceUnavailable 503 application/json
errors.SDKError 4XX, 5XX */*