aptos_api_dart

The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.

This Dart package is automatically generated by the OpenAPI Generator project:

Requirements

Installation & Usage

pub-web.flutter-io.cn

To use the package from pub-web.flutter-io.cn, please include the following in pubspec.yaml

dependencies:
  aptos_api_dart: 0.0.1

Github

If this Dart package is published to Github, please include the following in pubspec.yaml

dependencies:
  aptos_api_dart:
    git:
      url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
      #ref: main

Local development

To use the package from your local drive, please include the following in pubspec.yaml

dependencies:
  aptos_api_dart:
    path: /path/to/aptos_api_dart

Getting Started

Please follow the installation procedure and then run the following:

import 'package:aptos_api_dart/aptos_api_dart.dart';


final api = AptosApiDart().getAccountsApi();
final String address = address_example; // String | Address of account with or without a `0x` prefix
final String ledgerVersion = ledgerVersion_example; // String | Ledger version to get state of account  If not provided, it will be the latest version

try {
    final response = await api.getAccount(address, ledgerVersion);
    print(response);
} catch on DioError (e) {
    print("Exception when calling AccountsApi->getAccount: $e\n");
}

Documentation for API Endpoints

All URIs are relative to https://raw.githubusercontent.com/v1

Class Method HTTP request Description
AccountsApi getAccount GET /accounts/{address} Get account
AccountsApi getAccountModule GET /accounts/{address}/module/{module_name} Get account module
AccountsApi getAccountModules GET /accounts/{address}/modules Get account modules
AccountsApi getAccountResource GET /accounts/{address}/resource/{resource_type} Get account resource
AccountsApi getAccountResources GET /accounts/{address}/resources Get account resources
BlocksApi getBlockByHeight GET /blocks/by_height/{block_height} Get blocks by height
BlocksApi getBlockByVersion GET /blocks/by_version/{version} Get blocks by version
EventsApi getEventsByCreationNumber GET /accounts/{address}/events/{creation_number} Get events by creation number
EventsApi getEventsByEventHandle GET /accounts/{address}/events/{event_handle}/{field_name} Get events by event handle
GeneralApi getLedgerInfo GET / Get ledger info
GeneralApi healthy GET /-/healthy Check basic node health
GeneralApi spec GET /spec Show OpenAPI explorer
TablesApi getRawTableItem POST /tables/{table_handle}/raw_item Get raw table item
TablesApi getTableItem POST /tables/{table_handle}/item Get table item
TransactionsApi encodeSubmission POST /transactions/encode_submission Encode submission
TransactionsApi estimateGasPrice GET /estimate_gas_price Estimate gas price
TransactionsApi getAccountTransactions GET /accounts/{address}/transactions Get account transactions
TransactionsApi getTransactionByHash GET /transactions/by_hash/{txn_hash} Get transaction by hash
TransactionsApi getTransactionByVersion GET /transactions/by_version/{txn_version} Get transaction by version
TransactionsApi getTransactions GET /transactions Get transactions
TransactionsApi simulateTransaction POST /transactions/simulate Simulate transaction
TransactionsApi submitBatchTransactions POST /transactions/batch Submit batch transactions
TransactionsApi submitTransaction POST /transactions Submit transaction
ViewApi view POST /view Execute view function of a module

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Author

Libraries

aptos_api_dart