m10_sdk 1.0.0 copy "m10_sdk: ^1.0.0" to clipboard
m10_sdk: ^1.0.0 copied to clipboard

This package allows Flutter and Dart applications to interact with the M10 platform.

example/main.dart

import 'package:m10_sdk/m10_directory.dart';
import 'package:m10_sdk/m10_sdk.dart';
import 'package:m10_sdk/security/local_signing.dart';

Future<void> main() async {
  // Connect to the M10 directory
  final m10Directory = M10Directory(
    'https://example-host.io',
    tokenProvider: ExampleTokenProvider(),
  );

  // Create an instance of the SDK
  final m10 = M10Sdk(
    signer: await LocalSigning.loadKeyPair('/path/to/example_key'),
    ledgers: await m10Directory.listLedgers(),
  );

  // Create a user
  await m10.createUser(operator: 'Example operator');
}

class ExampleTokenProvider implements TokenProvider {
  @override
  Future<String> get accessToken async => 'Example token';

  @override
  String get subject => 'Example subject';
}
0
likes
140
points
381
downloads

Publisher

verified publisherm10.io

Weekly Downloads

This package allows Flutter and Dart applications to interact with the M10 platform.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

collection, convert, cryptography, dio, equatable, fixnum, grpc, path, protobuf, recase, uuid, xid, yaml

More

Packages that depend on m10_sdk