m10_sdk 0.34.0 copy "m10_sdk: ^0.34.0" to clipboard
m10_sdk: ^0.34.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
pub points
33%
popularity

Publisher

verified publisherm10.io

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

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

More

Packages that depend on m10_sdk