m10_sdk 0.32.0  m10_sdk: ^0.32.0 copied to clipboard
m10_sdk: ^0.32.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';
}