Skip to content

Dart bindings to wormhole-william (Go) magic wormhole client implementation.

License

Notifications You must be signed in to change notification settings

LeastAuthority/dart_wormhole_william

Repository files navigation

Magic Wormhole for Dart

⚠ This plugin is a work in progress, use at your own risk ⚠

A flutter plugin that wraps wormhole-william into a Dart API.

Supported functionality

  • Send/Receive files
  • Send/Receive text

Examples

Sending files:

final client = Client();
client.sendFile(File("/home/user/hello.txt")).then((codegenResult) {
  print("Enter ${codegenResult.code} to receive the file");
});

Receiving files:

final client = Client();
final download = client.recvFile("1-revenue-gazelle");
download.pendingDownload.accept(File("/home/user/${download.pendingDownload.fileName}"));
download.done.then((result) {
  print("Received file ${download.pendingDownload.fileName}");
});

Building

Currently this plugin is only buildable as part of the build for this app.

Known Issues

Dart does not support callbacks from wormhole-william from multiple threads. The plugin implements function calls by sending the arguments to a Dart send port and handling the messages to resolve on Dart. The C stack is kept in a busy loop until the dart function is completed. Once this issue is resolved, we can cleanup that code to be much simpler and less error prone.

About

Dart bindings to wormhole-william (Go) magic wormhole client implementation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •