Dart

The Dart SDK is the Dart client for the antd daemon.

Install

dart pub add antd

Connect to the daemon

import 'package:antd/antd.dart';

void main() async {
  final client = AntdClient(baseUrl: 'http://localhost:8082');
  final health = await client.health();
  print(health.network);
  client.close();
}

Store and retrieve data

import 'dart:convert';
import 'dart:typed_data';

import 'package:antd/antd.dart';

void main() async {
  final client = AntdClient();
  final result = await client.dataPutPublic(Uint8List.fromList(utf8.encode('Hello, Autonomi!')));
  print(result.address);

  final data = await client.dataGetPublic(result.address);
  print(utf8.decode(data));
  client.close();
}

Type mappings

Autonomi type
Dart type

HealthStatus

Dart model type

PutResult

Dart model type

Raw data

Uint8List

Error handling

Full API reference

For all available daemon endpoints, see the REST API.

Last updated