├── packages
├── agent_dart
│ ├── LICENSE
│ ├── README.md
│ ├── CHANGELOG.md
│ ├── linux
│ │ ├── .gitignore
│ │ └── CMakeLists.txt
│ ├── native
│ ├── example
│ │ ├── linux
│ │ │ ├── .gitignore
│ │ │ ├── main.cc
│ │ │ ├── flutter
│ │ │ │ ├── generated_plugin_registrant.cc
│ │ │ │ ├── generated_plugin_registrant.h
│ │ │ │ └── generated_plugins.cmake
│ │ │ └── my_application.h
│ │ ├── ios
│ │ │ ├── Runner
│ │ │ │ ├── Runner-Bridging-Header.h
│ │ │ │ ├── Assets.xcassets
│ │ │ │ │ ├── LaunchImage.imageset
│ │ │ │ │ │ ├── LaunchImage.png
│ │ │ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ │ │ ├── README.md
│ │ │ │ │ │ └── Contents.json
│ │ │ │ │ └── AppIcon.appiconset
│ │ │ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ │ │ ├── AppDelegate.swift
│ │ │ │ ├── Base.lproj
│ │ │ │ │ ├── Main.storyboard
│ │ │ │ │ └── LaunchScreen.storyboard
│ │ │ │ └── Info.plist
│ │ │ ├── Flutter
│ │ │ │ ├── Debug.xcconfig
│ │ │ │ ├── Release.xcconfig
│ │ │ │ └── AppFrameworkInfo.plist
│ │ │ ├── Runner.xcodeproj
│ │ │ │ └── project.xcworkspace
│ │ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ │ └── xcshareddata
│ │ │ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ ├── Runner.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ ├── .gitignore
│ │ │ └── Podfile
│ │ ├── macos
│ │ │ ├── Runner
│ │ │ │ ├── Configs
│ │ │ │ │ ├── Debug.xcconfig
│ │ │ │ │ ├── Release.xcconfig
│ │ │ │ │ ├── Warnings.xcconfig
│ │ │ │ │ └── AppInfo.xcconfig
│ │ │ │ ├── Assets.xcassets
│ │ │ │ │ └── AppIcon.appiconset
│ │ │ │ │ │ ├── app_icon_16.png
│ │ │ │ │ │ ├── app_icon_32.png
│ │ │ │ │ │ ├── app_icon_64.png
│ │ │ │ │ │ ├── app_icon_1024.png
│ │ │ │ │ │ ├── app_icon_128.png
│ │ │ │ │ │ ├── app_icon_256.png
│ │ │ │ │ │ ├── app_icon_512.png
│ │ │ │ │ │ └── Contents.json
│ │ │ │ ├── Release.entitlements
│ │ │ │ ├── AppDelegate.swift
│ │ │ │ ├── DebugProfile.entitlements
│ │ │ │ ├── MainFlutterWindow.swift
│ │ │ │ └── Info.plist
│ │ │ ├── .gitignore
│ │ │ ├── Flutter
│ │ │ │ ├── Flutter-Debug.xcconfig
│ │ │ │ ├── Flutter-Release.xcconfig
│ │ │ │ └── GeneratedPluginRegistrant.swift
│ │ │ ├── Runner.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ ├── Runner.xcodeproj
│ │ │ │ └── project.xcworkspace
│ │ │ │ │ └── xcshareddata
│ │ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ ├── Podfile.lock
│ │ │ └── Podfile
│ │ ├── windows
│ │ │ ├── runner
│ │ │ │ ├── resources
│ │ │ │ │ └── app_icon.ico
│ │ │ │ ├── resource.h
│ │ │ │ ├── utils.h
│ │ │ │ ├── runner.exe.manifest
│ │ │ │ ├── flutter_window.h
│ │ │ │ ├── main.cpp
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── utils.cpp
│ │ │ │ └── flutter_window.cpp
│ │ │ ├── flutter
│ │ │ │ ├── generated_plugin_registrant.cc
│ │ │ │ ├── generated_plugin_registrant.h
│ │ │ │ └── generated_plugins.cmake
│ │ │ └── .gitignore
│ │ ├── android
│ │ │ ├── gradle.properties
│ │ │ ├── app
│ │ │ │ ├── src
│ │ │ │ │ ├── main
│ │ │ │ │ │ ├── res
│ │ │ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ │ ├── drawable
│ │ │ │ │ │ │ │ └── launch_background.xml
│ │ │ │ │ │ │ ├── drawable-v21
│ │ │ │ │ │ │ │ └── launch_background.xml
│ │ │ │ │ │ │ ├── values
│ │ │ │ │ │ │ │ └── styles.xml
│ │ │ │ │ │ │ └── values-night
│ │ │ │ │ │ │ │ └── styles.xml
│ │ │ │ │ │ ├── kotlin
│ │ │ │ │ │ │ └── com
│ │ │ │ │ │ │ │ └── astrox
│ │ │ │ │ │ │ │ └── agent_dart
│ │ │ │ │ │ │ │ └── flutter_agent_dart_example
│ │ │ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ │ │ └── AndroidManifest.xml
│ │ │ │ │ ├── debug
│ │ │ │ │ │ └── AndroidManifest.xml
│ │ │ │ │ └── profile
│ │ │ │ │ │ └── AndroidManifest.xml
│ │ │ │ └── build.gradle
│ │ │ ├── gradle
│ │ │ │ └── wrapper
│ │ │ │ │ └── gradle-wrapper.properties
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ └── settings.gradle
│ │ ├── README.md
│ │ ├── .gitignore
│ │ ├── analysis_options.yaml
│ │ └── lib
│ │ │ └── main.dart
│ ├── cargokit
│ │ ├── .gitignore
│ │ ├── build_tool
│ │ │ ├── README.md
│ │ │ ├── bin
│ │ │ │ └── build_tool.dart
│ │ │ ├── lib
│ │ │ │ ├── build_tool.dart
│ │ │ │ └── src
│ │ │ │ │ ├── build_cmake.dart
│ │ │ │ │ ├── logging.dart
│ │ │ │ │ ├── cargo.dart
│ │ │ │ │ ├── build_gradle.dart
│ │ │ │ │ ├── environment.dart
│ │ │ │ │ └── verify_binaries.dart
│ │ │ ├── pubspec.yaml
│ │ │ └── analysis_options.yaml
│ │ ├── README
│ │ ├── cmake
│ │ │ └── resolve_symlinks.ps1
│ │ ├── LICENSE
│ │ ├── build_pod.sh
│ │ ├── run_build_tool.sh
│ │ └── run_build_tool.cmd
│ ├── android
│ │ ├── settings.gradle
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── AndroidManifest.xml
│ │ ├── .gitignore
│ │ └── build.gradle
│ ├── lib
│ │ ├── frb.dart
│ │ └── agent_dart.dart
│ ├── macos
│ │ ├── .gitignore
│ │ ├── Classes
│ │ │ └── dummy_file.c
│ │ └── agent_dart.podspec
│ ├── ios
│ │ ├── Classes
│ │ │ └── dummy_file.c
│ │ ├── .gitignore
│ │ └── agent_dart.podspec
│ ├── analysis_options.yaml
│ ├── windows
│ │ ├── .gitignore
│ │ └── CMakeLists.txt
│ ├── .gitignore
│ ├── pubspec.yaml
│ ├── .metadata
│ └── agent_dart.iml
├── agent_dart_base
│ ├── LICENSE
│ ├── README.md
│ ├── CHANGELOG.md
│ ├── native
│ ├── lib
│ │ ├── agent
│ │ │ ├── crypto
│ │ │ │ ├── index.dart
│ │ │ │ ├── keystore
│ │ │ │ │ ├── key_store.dart
│ │ │ │ │ └── key_derivator.dart
│ │ │ │ └── random.dart
│ │ │ ├── utils
│ │ │ │ ├── index.dart
│ │ │ │ ├── hash.dart
│ │ │ │ └── buffer_pipe.dart
│ │ │ ├── canisters
│ │ │ │ ├── index.dart
│ │ │ │ ├── asset.dart
│ │ │ │ ├── asset_idl.dart
│ │ │ │ ├── management.dart
│ │ │ │ └── management_idl.dart
│ │ │ ├── agent
│ │ │ │ ├── index.dart
│ │ │ │ ├── http
│ │ │ │ │ └── transform.dart
│ │ │ │ └── factory.dart
│ │ │ ├── agent.dart
│ │ │ ├── bls.dart
│ │ │ ├── errors.dart
│ │ │ └── types.dart
│ │ ├── frb.dart
│ │ ├── principal
│ │ │ └── utils
│ │ │ │ ├── utils.dart
│ │ │ │ ├── sha256.dart
│ │ │ │ ├── sha224.dart
│ │ │ │ └── base32.dart
│ │ ├── identity
│ │ │ └── identity.dart
│ │ ├── wallet
│ │ │ └── wallet.dart
│ │ ├── utils
│ │ │ ├── map.dart
│ │ │ ├── base64.dart
│ │ │ └── string.dart
│ │ ├── protobuf
│ │ │ ├── ic_ledger
│ │ │ │ └── pb
│ │ │ │ │ └── v1
│ │ │ │ │ ├── types.pbenum.dart
│ │ │ │ │ └── types.pbserver.dart
│ │ │ └── ic_base_types
│ │ │ │ └── pb
│ │ │ │ └── v1
│ │ │ │ ├── types.pbenum.dart
│ │ │ │ ├── types.pbserver.dart
│ │ │ │ └── types.pbjson.dart
│ │ └── agent_dart_base.dart
│ ├── test
│ │ ├── fixture
│ │ │ ├── counter
│ │ │ │ └── counter.wasm
│ │ │ ├── ed25519.pem
│ │ │ ├── dfx12.pem
│ │ │ └── secp256k1.pem
│ │ ├── wallet
│ │ │ ├── index.dart
│ │ │ ├── pem.dart
│ │ │ └── aes.dart
│ │ ├── principal
│ │ │ ├── index.dart
│ │ │ └── utils
│ │ │ │ ├── get_crc.dart
│ │ │ │ └── base32.dart
│ │ ├── identity
│ │ │ ├── identity.dart
│ │ │ ├── schnorr.dart
│ │ │ └── p256.dart
│ │ ├── utils
│ │ │ └── utils_test.dart
│ │ ├── agent
│ │ │ ├── agent.dart
│ │ │ ├── utils
│ │ │ │ ├── bls.dart
│ │ │ │ └── hash.dart
│ │ │ ├── actor.dart
│ │ │ ├── cbor.dart
│ │ │ ├── polling.dart
│ │ │ ├── http
│ │ │ │ └── http.dart
│ │ │ └── request_id.dart
│ │ ├── agent_dart_base_test.dart
│ │ ├── authentication
│ │ │ └── authentication.dart
│ │ └── test_utils.dart
│ ├── analysis_options.yaml
│ ├── scripts
│ │ └── compile_protobuf.sh
│ ├── agent_dart_base.iml
│ ├── protobuf
│ │ └── ic_base_types
│ │ │ └── pb
│ │ │ └── v1
│ │ │ └── types.proto
│ └── pubspec.yaml
└── agent_dart_ffi
│ ├── LICENSE
│ ├── README.md
│ ├── CHANGELOG.md
│ ├── analysis_options.yaml
│ ├── flutter_rust_bridge.yaml
│ ├── native
│ ├── agent_dart
│ │ ├── src
│ │ │ ├── bls
│ │ │ │ ├── mod.rs
│ │ │ │ ├── arch.rs
│ │ │ │ ├── bls12381
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── README.md
│ │ │ │ └── mod copy.rs
│ │ │ ├── errors.rs
│ │ │ ├── bls_ffi.rs
│ │ │ ├── lib.rs
│ │ │ ├── keyring.rs
│ │ │ └── ed25519.rs
│ │ └── Cargo.toml
│ ├── cbindgen.toml
│ └── ed_compact
│ │ ├── Cargo.toml
│ │ └── src
│ │ └── error.rs
│ ├── lib
│ ├── agent_dart_ffi.dart
│ └── src
│ │ ├── lib.dart
│ │ ├── schnorr.dart
│ │ ├── p256.dart
│ │ └── secp256k1.dart
│ ├── pubspec.yaml
│ └── agent_dart_ffi.iml
├── CODEOWNERS
├── pubspec.yaml
├── scripts
└── replace_symlinks_before_publish.sh
├── .metadata
├── Cargo.toml
├── .github
├── ISSUE_TEMPLATE
│ └── bounty.md
└── workflows
│ ├── publish.yml
│ └── runnable.yml
├── .gitignore
├── agent_dart_workspace.iml
├── melos.yaml
├── analysis_options.yaml
└── LICENSE
/packages/agent_dart/LICENSE:
--------------------------------------------------------------------------------
1 | ../../LICENSE
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @AstroxNetwork/flutter-dart
2 |
--------------------------------------------------------------------------------
/packages/agent_dart/README.md:
--------------------------------------------------------------------------------
1 | ../../README.md
--------------------------------------------------------------------------------
/packages/agent_dart_base/LICENSE:
--------------------------------------------------------------------------------
1 | ../../LICENSE
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/LICENSE:
--------------------------------------------------------------------------------
1 | ../../LICENSE
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/README.md:
--------------------------------------------------------------------------------
1 | ../../README.md
--------------------------------------------------------------------------------
/packages/agent_dart/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ../../CHANGELOG.md
--------------------------------------------------------------------------------
/packages/agent_dart/linux/.gitignore:
--------------------------------------------------------------------------------
1 | *.tar.gz
2 |
--------------------------------------------------------------------------------
/packages/agent_dart/native:
--------------------------------------------------------------------------------
1 | ../agent_dart_ffi/native
--------------------------------------------------------------------------------
/packages/agent_dart_base/README.md:
--------------------------------------------------------------------------------
1 | ../../README.md
--------------------------------------------------------------------------------
/packages/agent_dart_base/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ../../CHANGELOG.md
--------------------------------------------------------------------------------
/packages/agent_dart_base/native:
--------------------------------------------------------------------------------
1 | ../agent_dart_ffi/native
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ../../CHANGELOG.md
--------------------------------------------------------------------------------
/packages/agent_dart/example/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/packages/agent_dart/cargokit/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | .dart_tool
3 | *.iml
4 |
--------------------------------------------------------------------------------
/packages/agent_dart/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'agent_dart'
2 |
--------------------------------------------------------------------------------
/packages/agent_dart/lib/frb.dart:
--------------------------------------------------------------------------------
1 | export 'package:agent_dart_base/frb.dart';
2 |
--------------------------------------------------------------------------------
/packages/agent_dart/lib/agent_dart.dart:
--------------------------------------------------------------------------------
1 | export 'package:agent_dart_base/agent_dart_base.dart';
2 |
--------------------------------------------------------------------------------
/packages/agent_dart/macos/.gitignore:
--------------------------------------------------------------------------------
1 | Flutter/
2 | Runner/
3 | Frameworks/*
4 | !Frameworks/.gitkeep
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/packages/agent_dart/ios/Classes/dummy_file.c:
--------------------------------------------------------------------------------
1 | // This is an empty file to force CocoaPods to create a framework.
2 |
--------------------------------------------------------------------------------
/packages/agent_dart/macos/Classes/dummy_file.c:
--------------------------------------------------------------------------------
1 | // This is an empty file to force CocoaPods to create a framework.
2 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/crypto/index.dart:
--------------------------------------------------------------------------------
1 | export 'keystore/key_store.dart';
2 | export 'random.dart';
3 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/utils/index.dart:
--------------------------------------------------------------------------------
1 | export 'buffer_pipe.dart';
2 | export 'hash.dart';
3 | export 'leb128.dart';
4 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/frb.dart:
--------------------------------------------------------------------------------
1 | export 'package:agent_dart_ffi/agent_dart_ffi.dart'
2 | show AnyhowException, ExternalLibrary;
3 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: ../../analysis_options.yaml
2 |
3 | analyzer:
4 | exclude:
5 | - 'lib/src/**'
6 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: agent_dart_workspace
2 |
3 | environment:
4 | sdk: ^3.4.0
5 |
6 | dev_dependencies:
7 | melos: ^6.0.0
8 | lints: any
9 |
--------------------------------------------------------------------------------
/packages/agent_dart/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: ../../analysis_options.yaml
2 |
3 | analyzer:
4 | exclude:
5 | - cargokit/build_tool/**
6 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/canisters/index.dart:
--------------------------------------------------------------------------------
1 | export 'asset.dart';
2 | export 'asset_idl.dart';
3 | export 'management.dart';
4 | export 'management_idl.dart';
5 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 | DerivedData/
9 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/fixture/counter/counter.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart_base/test/fixture/counter/counter.wasm
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/flutter_rust_bridge.yaml:
--------------------------------------------------------------------------------
1 | dart_entrypoint_class_name: AgentDart
2 | rust_input: crate::api
3 | rust_root: native/agent_dart
4 | dart_output: lib/src
5 |
--------------------------------------------------------------------------------
/packages/agent_dart/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/principal/utils/utils.dart:
--------------------------------------------------------------------------------
1 | library principal_utils;
2 |
3 | export 'base32.dart';
4 | export 'get_crc.dart';
5 | export 'sha224.dart';
6 | export 'sha256.dart';
7 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/identity/identity.dart:
--------------------------------------------------------------------------------
1 | export 'delegation.dart';
2 | export 'der.dart';
3 | export 'ed25519.dart';
4 | export 'p256.dart';
5 | export 'schnorr.dart';
6 | export 'secp256k1.dart';
7 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/wallet/wallet.dart:
--------------------------------------------------------------------------------
1 | export 'hashing.dart';
2 | export 'keysmith.dart';
3 | export 'ledger.dart';
4 | export 'pem.dart';
5 | export 'phrase.dart';
6 | export 'rosetta.dart';
7 | export 'signer.dart';
8 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/fixture/ed25519.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MFMCAQEwBQYDK2VwBCIEIJTpTCaKwi0FtuE9+We+6QynpAtnbqqD9U009RGKx2uw
3 | oSMDIQBhrxKQuKf45AneI1BfAGENcHvYwJrVpv2xFoQ/A9kwvg==
4 | -----END PRIVATE KEY-----
5 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/linux/main.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | int main(int argc, char** argv) {
4 | g_autoptr(MyApplication) app = my_application_new();
5 | return g_application_run(G_APPLICATION(app), argc, argv);
6 | }
7 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/packages/agent_dart/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | /.cxx
10 |
11 | # Ignore Rust binaries
12 | src/main/jniLibs/
13 | *.tar.gz
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/agent/index.dart:
--------------------------------------------------------------------------------
1 | export 'api.dart';
2 | export 'factory.dart';
3 | export 'http/fetch.dart';
4 | export 'http/index.dart';
5 | export 'http/transform.dart';
6 | export 'http/types.dart';
7 | export 'proxy.dart';
8 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AstroxNetwork/agent_dart/HEAD/packages/agent_dart/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/packages/agent_dart_base/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: ../../analysis_options.yaml
2 |
3 | analyzer:
4 | exclude:
5 | - lib/**.freezed.dart
6 | - lib/**.g.dart
7 |
8 | linter:
9 | rules:
10 | constant_identifier_names: false
11 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 |
9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
10 | }
11 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/fixture/dfx12.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN EC PRIVATE KEY-----
2 | MHQCAQEEICJxApEbuZznKFpV+VKACRK30i6+7u5Z13/DOl18cIC+oAcGBSuBBAAK
3 | oUQDQgAEPas6Iag4TUx+Uop+3NhE6s3FlayFtbwdhRVjvOar0kPTfE/N8N6btRnd
4 | 74ly5xXEBNSXiENyxhEuzOZrIWMCNQ==
5 | -----END EC PRIVATE KEY-----
--------------------------------------------------------------------------------
/packages/agent_dart/example/linux/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 |
10 | void fl_register_plugins(FlPluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/wallet/index.dart:
--------------------------------------------------------------------------------
1 | import '../test_utils.dart';
2 | import 'aes.dart' as aes;
3 | import 'pem.dart' as pem;
4 | import 'signer.dart' as signer;
5 |
6 | void main() {
7 | ffiInit();
8 | aes.main();
9 | pem.main();
10 | signer.main();
11 | }
12 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/app/src/main/kotlin/com/astrox/agent_dart/flutter_agent_dart_example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.astrox.agent_dart.flutter_agent_dart_example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
6 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 |
10 | void RegisterPlugins(flutter::PluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/native/agent_dart/src/bls/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod aes;
2 | pub mod arch;
3 | pub mod bls12381;
4 | pub mod gcm;
5 | pub mod hash256;
6 | pub mod hash384;
7 | pub mod hash512;
8 | pub mod hmac;
9 | pub mod nhs;
10 | pub mod rand;
11 | pub mod sha3;
12 | pub mod share;
13 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/canisters/asset.dart:
--------------------------------------------------------------------------------
1 | import '../actor.dart';
2 | import 'asset_idl.dart';
3 |
4 | /// Create a management canister actor.
5 | /// @param config
6 | CanisterActor createAssetCanisterActor(ActorConfig config) {
7 | return Actor.createActor(assetIDL(), config);
8 | }
9 |
--------------------------------------------------------------------------------
/scripts/replace_symlinks_before_publish.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cd packages
4 | rm agent_dart/native agent_dart_base/native
5 | cp -r agent_dart_ffi/native agent_dart/native
6 | git rm --cached agent_dart/native
7 | cp -r agent_dart_ffi/native agent_dart_base/native
8 | git rm --cached agent_dart_base/native
9 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/native/cbindgen.toml:
--------------------------------------------------------------------------------
1 | language = "C"
2 | autogen_warning = "// NOTE: Append the lines below to ios/Classes/Plugin.h"
3 | #namespace = "ffi"
4 | #include_guard = "CBINDGEN_BINDINGS_H"
5 |
6 | [defines]
7 | "target_os = ios" = "TARGET_OS_IOS"
8 | "target_os = macos" = "TARGET_OS_MACOS"
9 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/principal/index.dart:
--------------------------------------------------------------------------------
1 | import '../test_utils.dart';
2 | import 'principal.dart' as principal;
3 | import 'utils/base32.dart' as base32;
4 | import 'utils/get_crc.dart' as get_crc;
5 |
6 | void main() {
7 | ffiInit();
8 | principal.main();
9 | base32.main();
10 | get_crc.main();
11 | }
12 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/scripts/compile_protobuf.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cd $(dirname "$0")
4 | cd ../
5 | # brew install cproto
6 | # dart pub global activate protoc_plugin
7 | protoc --proto_path=protobuf \
8 | --dart_out=lib/protobuf \
9 | protobuf/ic_base_types/pb/v1/types.proto \
10 | protobuf/ic_ledger/pb/v1/types.proto
11 |
--------------------------------------------------------------------------------
/packages/agent_dart/cargokit/build_tool/README.md:
--------------------------------------------------------------------------------
1 | /// This is copied from Cargokit (which is the official way to use it currently)
2 | /// Details: https://fzyzcjy.github.io/flutter_rust_bridge/manual/integrate/builtin
3 |
4 | A sample command-line application with an entrypoint in `bin/`, library code
5 | in `lib/`, and example unit test in `test/`.
6 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: fa5883b78e566877613ad1ccb48dd92075cb5c23
8 | channel: dev
9 |
10 | project_type: plugin
11 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [workspace]
2 | resolver = "1"
3 | members = [
4 | "packages/agent_dart_ffi/native/agent_dart",
5 | "packages/agent_dart_ffi/native/ed_compact",
6 | ]
7 | exclude = [
8 | "packages/agent_dart/native",
9 | "packages/agent_dart_base/native",
10 | ]
11 |
12 | [profile.release]
13 | debug = false
14 | lto = true
15 | opt-level = "z"
16 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/fixture/secp256k1.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN EC PARAMETERS-----
2 | BgUrgQQACg==
3 | -----END EC PARAMETERS-----
4 | -----BEGIN EC PRIVATE KEY-----
5 | MHQCAQEEIH0ncVBfM91+tPxqjpVRjphrnYlEizak78qPZQGZB2YQoAcGBSuBBAAK
6 | oUQDQgAELWzLmnTEX6IyczLvVSoDG7ZBNbqfxbb+05VBJq72E8tvw+/RnWx/kHV+
7 | VTKpW9pG5S4LFmw8ukzGI+euAFpFAg==
8 | -----END EC PRIVATE KEY-----
9 |
--------------------------------------------------------------------------------
/packages/agent_dart/cargokit/build_tool/bin/build_tool.dart:
--------------------------------------------------------------------------------
1 | /// This is copied from Cargokit (which is the official way to use it currently)
2 | /// Details: https://fzyzcjy.github.io/flutter_rust_bridge/manual/integrate/builtin
3 |
4 | import 'package:build_tool/build_tool.dart' as build_tool;
5 |
6 | void main(List arguments) {
7 | build_tool.runMain(arguments);
8 | }
9 |
--------------------------------------------------------------------------------
/packages/agent_dart/cargokit/build_tool/lib/build_tool.dart:
--------------------------------------------------------------------------------
1 | /// This is copied from Cargokit (which is the official way to use it currently)
2 | /// Details: https://fzyzcjy.github.io/flutter_rust_bridge/manual/integrate/builtin
3 |
4 | import 'src/build_tool.dart' as build_tool;
5 |
6 | Future runMain(List args) async {
7 | return build_tool.runMain(args);
8 | }
9 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/lib/agent_dart_ffi.dart:
--------------------------------------------------------------------------------
1 | export 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'
2 | show AnyhowException, ExternalLibrary;
3 |
4 | export 'src/api.dart';
5 | export 'src/frb_generated.dart' show AgentDart;
6 | export 'src/lib.dart';
7 | export 'src/p256.dart';
8 | export 'src/schnorr.dart';
9 | export 'src/secp256k1.dart';
10 | export 'src/types.dart';
11 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @main
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 |
10 | override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
11 | return true
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/agent.dart:
--------------------------------------------------------------------------------
1 | export './agent/index.dart';
2 | export './canisters/index.dart';
3 | export './crypto/index.dart';
4 | export './polling/polling.dart';
5 | export './utils/index.dart';
6 |
7 | export 'actor.dart';
8 | export 'auth.dart';
9 | export 'bls.dart';
10 | export 'cbor.dart';
11 | export 'certificate.dart';
12 | export 'errors.dart';
13 | export 'request_id.dart';
14 | export 'types.dart';
15 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/linux/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void fl_register_plugins(FlPluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/identity/identity.dart:
--------------------------------------------------------------------------------
1 | import '../test_utils.dart';
2 | import 'delegation.dart' as delegation;
3 | import 'ed25519.dart' as ed25519;
4 | import 'p256.dart' as p256;
5 | import 'schnorr.dart' as schnorr;
6 | import 'secp256k1.dart' as secp256k1;
7 |
8 | void main() {
9 | ffiInit();
10 | delegation.main();
11 | ed25519.main();
12 | p256.main();
13 | schnorr.main();
14 | secp256k1.main();
15 | }
16 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/native/agent_dart/src/errors.rs:
--------------------------------------------------------------------------------
1 | /// Error information
2 | use serde::*;
3 | #[derive(Debug, Clone, Ord, PartialOrd, Eq, PartialEq, Serialize)]
4 | pub struct ErrorInfo {
5 | /// Error code
6 | pub code: u32,
7 | /// Error message
8 | pub message: String,
9 | }
10 |
11 | impl ErrorInfo {
12 | pub fn to_json(&self) -> String {
13 | serde_json::to_string(self).unwrap()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 | }
7 |
8 | rootProject.buildDir = '../build'
9 | subprojects {
10 | project.buildDir = "${rootProject.buildDir}/${project.name}"
11 | }
12 | subprojects {
13 | project.evaluationDependsOn(':app')
14 | }
15 |
16 | tasks.register("clean", Delete) {
17 | delete rootProject.buildDir
18 | }
19 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bounty.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bounty
3 | about: Bounty Spec
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | # Description
11 | [a short paragraph to describe the bounty]
12 |
13 | ## Context
14 | [background and why]
15 |
16 | # Acceptance Criteria
17 | * [ ] [description on how this bounty can be completed]
18 | * [ ] [quantifiable criteria is better]
19 |
20 | # Reward
21 | [amount of tokens in ICP/ETH/Crypto]
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/utils/map.dart:
--------------------------------------------------------------------------------
1 | Map makeBigIntToString(Map input) {
2 | final newX = {};
3 | for (final index in input.entries) {
4 | newX.putIfAbsent(
5 | index.key is BigInt ? index.key.toString() : index.key,
6 | () => index.value is BigInt
7 | ? index.value.toString()
8 | : index.value is Map
9 | ? makeBigIntToString(index.value)
10 | : index.value,
11 | );
12 | }
13 | return newX;
14 | }
15 |
--------------------------------------------------------------------------------
/packages/agent_dart/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
19 | # Set up as allowlist
20 | *
21 |
22 | # Allowed files
23 | !.gitignore
24 | !CMakeLists.txt
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/lib/src/lib.dart:
--------------------------------------------------------------------------------
1 | // This file is automatically generated, so please do not edit it.
2 | // Generated by `flutter_rust_bridge`@ 2.0.0.
3 |
4 | // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
5 |
6 | import 'frb_generated.dart';
7 | import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
8 |
9 | // Rust type: RustOpaqueMoi
10 | abstract class WalletInstance implements RustOpaqueInterface {}
11 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @main
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/protobuf/ic_ledger/pb/v1/types.pbenum.dart:
--------------------------------------------------------------------------------
1 | //
2 | // Generated code. Do not modify.
3 | // source: ic_ledger/pb/v1/types.proto
4 | //
5 | // @dart = 3.3
6 |
7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references
8 | // ignore_for_file: constant_identifier_names, library_prefixes
9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields
10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import
11 |
12 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/utils/utils_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:agent_dart_base/agent_dart_base.dart';
2 | import 'package:test/test.dart';
3 |
4 | import '../test_utils.dart';
5 | import 'is.dart' as is_test;
6 |
7 | void main() {
8 | ffiInit();
9 | is_test.main();
10 |
11 | test('Hex string to u8', () {
12 | final u8 = 'efcdab000000000001'.toU8a();
13 | expect(u8.length, equals(9));
14 | expect(u8.toString(), '[239, 205, 171, 0, 0, 0, 0, 0, 1]');
15 | });
16 | }
17 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/protobuf/ic_base_types/pb/v1/types.pbenum.dart:
--------------------------------------------------------------------------------
1 | //
2 | // Generated code. Do not modify.
3 | // source: ic_base_types/pb/v1/types.proto
4 | //
5 | // @dart = 3.3
6 |
7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references
8 | // ignore_for_file: constant_identifier_names, library_prefixes
9 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields
10 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import
11 |
12 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/linux/my_application.h:
--------------------------------------------------------------------------------
1 | #ifndef FLUTTER_MY_APPLICATION_H_
2 | #define FLUTTER_MY_APPLICATION_H_
3 |
4 | #include
5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController.init()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/agent/agent.dart:
--------------------------------------------------------------------------------
1 | import '../test_utils.dart';
2 | import 'actor.dart' as actor;
3 | import 'cbor.dart' as cbor;
4 | import 'certificate.dart' as certificate;
5 | import 'request_id.dart' as request_id;
6 | import 'utils/bls.dart' as bls;
7 | import 'utils/hash.dart' as hash;
8 | import 'utils/leb128.dart' as leb128;
9 |
10 | void main() {
11 | ffiInit();
12 | actor.main();
13 | cbor.main();
14 | certificate.main();
15 | request_id.main();
16 | bls.main();
17 | hash.main();
18 | leb128.main();
19 | }
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 | .idea/
4 | .vscode/
5 |
6 | .packages
7 | .pub/
8 |
9 | build/
10 |
11 | .env
12 |
13 | # Miscellaneous
14 | *.class
15 | *.log
16 | *.pyc
17 | *.swp
18 | .atom/
19 | .buildlog/
20 | .history
21 | .svn/
22 |
23 | # IntelliJ related
24 | *.ipr
25 | *.iws
26 |
27 | # Flutter/Dart/Pub related
28 | pubspec_overrides.yaml
29 | **/doc/api/
30 | .pub-cache/
31 | .flutter-plugins
32 | .flutter-plugins-dependencies
33 | **/pubspec.lock
34 |
35 | # build files
36 | /platform-build/
37 | /target/
38 | /platform-build
39 |
--------------------------------------------------------------------------------
/packages/agent_dart/cargokit/README:
--------------------------------------------------------------------------------
1 | /// This is copied from Cargokit (which is the official way to use it currently)
2 | /// Details: https://fzyzcjy.github.io/flutter_rust_bridge/manual/integrate/builtin
3 |
4 | Experimental repository to provide glue for seamlessly integrating cargo build
5 | with flutter plugins and packages.
6 |
7 | See https://matejknopp.com/post/flutter_plugin_in_rust_with_no_prebuilt_binaries/
8 | for a tutorial on how to use Cargokit.
9 |
10 | Example plugin available at https://github.com/irondash/hello_rust_ffi_plugin.
11 |
12 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/native/agent_dart/src/bls_ffi.rs:
--------------------------------------------------------------------------------
1 | use crate::bls::bls12381::bls::{core_verify, init, BLS_OK};
2 | use crate::types::BLSVerifyReq;
3 |
4 | pub struct BlsFFI {}
5 |
6 | impl BlsFFI {
7 | pub fn bls_init() -> bool {
8 | init() == BLS_OK
9 | }
10 |
11 | pub fn bls_verify(req: BLSVerifyReq) -> bool {
12 | let verify = core_verify(
13 | req.signature.as_slice(),
14 | req.message.as_slice(),
15 | req.public_key.as_slice(),
16 | );
17 | verify == BLS_OK
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/principal/utils/get_crc.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | import 'package:agent_dart_base/agent_dart_base.dart';
4 | import 'package:test/test.dart';
5 |
6 | void main() {
7 | getCrc32Test();
8 | }
9 |
10 | void getCrc32Test() {
11 | test('getCrc32', () {
12 | expect(getCrc32(Uint8List.fromList([]).buffer), 0);
13 | expect(getCrc32(Uint8List.fromList([1, 2, 3]).buffer), 0x55bc801d);
14 | expect(
15 | getCrc32(Uint8List.fromList([100, 99, 98, 1, 2, 3]).buffer),
16 | 0xc7e787f5,
17 | );
18 | });
19 | }
20 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/protobuf/ic_ledger/pb/v1/types.pbserver.dart:
--------------------------------------------------------------------------------
1 | //
2 | // Generated code. Do not modify.
3 | // source: ic_ledger/pb/v1/types.proto
4 | //
5 | // @dart = 3.3
6 |
7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references
8 | // ignore_for_file: constant_identifier_names
9 | // ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
10 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields
11 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import
12 |
13 | export 'types.pb.dart';
14 |
15 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: agent_dart_ffi
2 | version: 1.0.0-dev.40
3 |
4 | description: The FFI plugin that bridges Rust implementation for agent_dart.
5 | repository: https://github.com/AstroxNetwork/agent_dart
6 | issue_tracker: https://github.com/AstroxNetwork/agent_dart/issues
7 |
8 | environment:
9 | sdk: '>=3.4.0 <4.0.0'
10 |
11 | dependencies:
12 | flutter_rust_bridge: ^2.11.1
13 |
14 | dev_dependencies:
15 | lints: # transparent
16 | build_runner: ^2.1.11
17 | ffi: ^2.1.0
18 | ffigen: ^18.0.0
19 |
20 | false_secrets:
21 | - 'native/ed_compact/src/pem.rs'
22 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/protobuf/ic_base_types/pb/v1/types.pbserver.dart:
--------------------------------------------------------------------------------
1 | //
2 | // Generated code. Do not modify.
3 | // source: ic_base_types/pb/v1/types.proto
4 | //
5 | // @dart = 3.3
6 |
7 | // ignore_for_file: annotate_overrides, camel_case_types, comment_references
8 | // ignore_for_file: constant_identifier_names
9 | // ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
10 | // ignore_for_file: non_constant_identifier_names, prefer_final_fields
11 | // ignore_for_file: unnecessary_import, unnecessary_this, unused_import
12 |
13 | export 'types.pb.dart';
14 |
15 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/agent_dart_base_test.dart:
--------------------------------------------------------------------------------
1 | import './test_utils.dart';
2 | import 'agent/agent.dart' as agent;
3 | import 'authentication/authentication.dart' as auth;
4 | import 'candid/idl.dart' as candid;
5 | import 'identity/identity.dart' as identity;
6 | import 'principal/index.dart' as principal;
7 | import 'utils/utils_test.dart' as utils;
8 | import 'wallet/index.dart' as wallet;
9 |
10 | void main() async {
11 | ffiInit();
12 | agent.main();
13 | auth.main();
14 | candid.main();
15 | identity.main();
16 | principal.main();
17 | utils.main();
18 | wallet.main();
19 | }
20 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/bls.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | import 'package:agent_dart_ffi/agent_dart_ffi.dart' as ffi;
4 |
5 | class AgentBLS {
6 | AgentBLS();
7 |
8 | bool get isInit => _isInit;
9 | late bool _isInit = false;
10 |
11 | Future blsInit() async {
12 | _isInit = await ffi.blsInit();
13 | return _isInit;
14 | }
15 |
16 | Future blsVerify(
17 | Uint8List pk,
18 | Uint8List sig,
19 | Uint8List msg,
20 | ) {
21 | return ffi.blsVerify(
22 | req: ffi.BLSVerifyReq(publicKey: pk, signature: sig, message: msg),
23 | );
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/native/agent_dart/src/lib.rs:
--------------------------------------------------------------------------------
1 | mod frb_generated; /* AUTO INJECTED BY flutter_rust_bridge. This line may not be accurate, and you can change it according to your needs. */
2 |
3 | #[allow(clippy::all)]
4 | #[allow(dead_code)]
5 | mod api;
6 | mod bls_ffi;
7 | mod ed25519;
8 | mod errors;
9 | mod keyring;
10 | mod keystore;
11 | mod p256;
12 | mod schnorr;
13 | mod secp256k1;
14 | mod types;
15 |
16 | #[allow(clippy::all)]
17 | #[allow(dead_code)]
18 | mod bls;
19 |
20 | #[cfg(test)]
21 | mod tests {
22 | #[test]
23 | fn it_works() {
24 | let result = 2 + 2;
25 | assert_eq!(result, 4);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/principal/utils/base32.dart:
--------------------------------------------------------------------------------
1 | import 'package:agent_dart_base/agent_dart_base.dart';
2 | import 'package:test/test.dart';
3 |
4 | void main() {
5 | base32Test();
6 | }
7 |
8 | void base32Test() {
9 | test('base32Decode', () {
10 | expect(
11 | base32Decode('irswgzloorzgc3djpjssazlwmvzhs5dinfxgoijb').u8aToString(),
12 | 'Decentralize everything!!',
13 | );
14 | });
15 |
16 | test('base32Encode', () {
17 | expect(
18 | base32Encode(
19 | 'Decentralize everything!!'.plainToU8a(useDartEncode: true),
20 | ),
21 | 'irswgzloorzgc3djpjssazlwmvzhs5dinfxgoijb',
22 | );
23 | });
24 | }
25 |
--------------------------------------------------------------------------------
/packages/agent_dart/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
25 | /pubspec.lock
26 | **/doc/api/
27 | .dart_tool/
28 | .packages
29 | build/
30 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - agent_dart (1.0.0):
3 | - FlutterMacOS
4 | - FlutterMacOS (1.0.0)
5 |
6 | DEPENDENCIES:
7 | - agent_dart (from `Flutter/ephemeral/.symlinks/plugins/agent_dart/macos`)
8 | - FlutterMacOS (from `Flutter/ephemeral`)
9 |
10 | EXTERNAL SOURCES:
11 | agent_dart:
12 | :path: Flutter/ephemeral/.symlinks/plugins/agent_dart/macos
13 | FlutterMacOS:
14 | :path: Flutter/ephemeral
15 |
16 | SPEC CHECKSUMS:
17 | agent_dart: c5f3c84df4c0bc1173e4d60ec5e0a3be7cb4c91d
18 | FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
19 |
20 | PODFILE CHECKSUM: 137ddf7b4dbe5a83427ebf04ae8dea674cfd87fa
21 |
22 | COCOAPODS: 1.16.2
23 |
--------------------------------------------------------------------------------
/packages/agent_dart/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/Generated.xcconfig
37 | /Flutter/ephemeral/
38 | /Flutter/flutter_export_environment.sh
39 |
40 | Flutter/
41 | Runner/
42 | Frameworks/*
43 | !Frameworks/.gitkeep
--------------------------------------------------------------------------------
/packages/agent_dart/example/README.md:
--------------------------------------------------------------------------------
1 | # flutter_agent_dart_example
2 |
3 | Demonstrates how to use the flutter_agent_dart plugin.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13 |
14 | For help getting started with Flutter development, view the
15 | [online documentation](https://docs.flutter.dev/), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/native/ed_compact/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "ed_compact"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7 | [features]
8 | default = ["random", "std"]
9 | pem = ["ct-codecs"]
10 | random = ["getrandom"]
11 | traits = ["ed25519"]
12 | self-verify = []
13 | blind-keys = []
14 | std = []
15 | opt_size = []
16 |
17 | [dependencies]
18 | ct-codecs = { version = "1.1.5", optional = true }
19 | getrandom = { version = "0.3.3", optional = true }
20 | ed25519 = { version = "1.5.3", optional = true }
21 |
22 | [dev-dependencies]
23 | getrandom = "0.3.3"
24 | ct-codecs = "1.1.5"
25 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = flutter_agent_dart_example
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.astrox.agentdart.flutterAgentDartExample
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.astrox.agent_dart. All rights reserved.
15 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 | Podfile.lock
30 |
31 | # Exceptions to above rules.
32 | !default.mode1v3
33 | !default.mode2v3
34 | !default.pbxuser
35 | !default.perspectivev3
36 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/utils/hash.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'dart:math';
3 |
4 | int idlHash(String s) {
5 | final arr = utf8.encode(s);
6 | int h = 0;
7 | for (final c in arr) {
8 | h = (h * 223 + c) % pow(2, 32).toInt();
9 | }
10 | return h;
11 | }
12 |
13 | num idlLabelToId(String label) {
14 | final reg1 = RegExp(r'^_\d+_$');
15 | final reg2 = RegExp(r'^_0x[\da-fA-F]+_$');
16 | if (reg1.hasMatch(label) || reg2.hasMatch(label)) {
17 | final lb = label.substring(1, label.length - 1);
18 | final result = num.tryParse(lb);
19 | if (result != null &&
20 | result is! BigInt &&
21 | result >= 0 &&
22 | result < pow(2, 32)) {
23 | return result;
24 | }
25 | }
26 | return idlHash(label);
27 | }
28 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/agent_dart_workspace.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent_dart_base.dart:
--------------------------------------------------------------------------------
1 | export 'package:agent_dart_ffi/agent_dart_ffi.dart';
2 |
3 | export 'agent/agent.dart';
4 | // auth_clinet;
5 | export 'auth_client/auth_client.dart';
6 | // authentication
7 | export 'authentication/authentication.dart';
8 | // candid
9 | export 'candid/idl.dart';
10 | // identity
11 | export 'identity/identity.dart';
12 | // principal;
13 | export 'principal/principal.dart';
14 | export 'principal/utils/utils.dart';
15 | // utils
16 | export 'utils/base64.dart';
17 | export 'utils/bech32.dart';
18 | export 'utils/bn.dart';
19 | export 'utils/extension.dart';
20 | export 'utils/hex.dart';
21 | export 'utils/is.dart';
22 | export 'utils/map.dart';
23 | export 'utils/number.dart';
24 | export 'utils/string.dart';
25 | export 'utils/u8a.dart';
26 | // wallet
27 | export 'wallet/wallet.dart';
28 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/agent_dart_base.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/packages/agent_dart/cargokit/cmake/resolve_symlinks.ps1:
--------------------------------------------------------------------------------
1 | function Resolve-Symlinks {
2 | [CmdletBinding()]
3 | [OutputType([string])]
4 | param(
5 | [Parameter(Position = 0, Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
6 | [string] $Path
7 | )
8 |
9 | [string] $separator = '/'
10 | [string[]] $parts = $Path.Split($separator)
11 |
12 | [string] $realPath = ''
13 | foreach ($part in $parts) {
14 | if ($realPath -and !$realPath.EndsWith($separator)) {
15 | $realPath += $separator
16 | }
17 | $realPath += $part
18 | $item = Get-Item $realPath
19 | if ($item.Target) {
20 | $realPath = $item.Target.Replace('\', '/')
21 | }
22 | }
23 | $realPath
24 | }
25 |
26 | $path=Resolve-Symlinks -Path $args[0]
27 | Write-Host $path
28 |
--------------------------------------------------------------------------------
/packages/agent_dart/linux/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # The Flutter tooling requires that developers have CMake 3.10 or later
2 | # installed. You should not increase this version, as doing so will cause
3 | # the plugin to fail to compile for some customers of the plugin.
4 | cmake_minimum_required(VERSION 3.10)
5 |
6 | # Project-level configuration.
7 | set(PROJECT_NAME "agent_dart")
8 | project(${PROJECT_NAME} LANGUAGES CXX)
9 |
10 | include("../cargokit/cmake/cargokit.cmake")
11 | apply_cargokit(${PROJECT_NAME} ../native/agent_dart agent_dart "")
12 |
13 | # List of absolute paths to libraries that should be bundled with the plugin.
14 | # This list could contain prebuilt libraries, or libraries created by an
15 | # external build triggered from this build file.
16 | set(agent_dart_bundled_libraries
17 | "${${PROJECT_NAME}_cargokit_lib}"
18 | PARENT_SCOPE
19 | )
20 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | def flutterSdkPath = {
3 | def properties = new Properties()
4 | file("local.properties").withInputStream { properties.load(it) }
5 | def flutterSdkPath = properties.getProperty("flutter.sdk")
6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7 | return flutterSdkPath
8 | }()
9 |
10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11 |
12 | repositories {
13 | google()
14 | mavenCentral()
15 | gradlePluginPortal()
16 | }
17 | }
18 |
19 | plugins {
20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21 | id "com.android.application" version "8.6.1" apply false
22 | id "org.jetbrains.kotlin.android" version "2.1.10" apply false
23 | }
24 |
25 | include ":app"
26 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/errors.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | import '../../utils/extension.dart';
4 |
5 | /// An fetch error when using agent to make HTTP/S requests.
6 | class AgentFetchError extends Error {
7 | /// Creates an agent error with the provided [message].
8 | AgentFetchError({this.statusCode, this.statusText, this.body});
9 |
10 | final Object? statusCode;
11 | final Object? statusText;
12 | final Object? body;
13 |
14 | @override
15 | String toString() {
16 | if (statusCode == null && statusText == null && body == null) {
17 | return 'Agent failed';
18 | }
19 | final b = body;
20 | return 'Agent failed: Server returned an error:\n'
21 | ' Code: $statusCode ($statusText)\n'
22 | ' Body: ${b is Uint8List ? b.u8aToString() : b}\n';
23 | }
24 | }
25 |
26 | class UnreachableError extends Error {}
27 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/crypto/keystore/key_store.dart:
--------------------------------------------------------------------------------
1 | library key_store;
2 |
3 | import 'dart:convert';
4 | import 'dart:core';
5 | import 'dart:typed_data';
6 |
7 | import 'package:agent_dart_ffi/agent_dart_ffi.dart';
8 | import 'package:collection/collection.dart';
9 | import 'package:meta/meta.dart';
10 | import 'package:pointycastle/export.dart';
11 | import 'package:uuid/uuid.dart';
12 |
13 | import '../../../identity/p256.dart';
14 | import '../../../identity/secp256k1.dart';
15 | import '../../../principal/utils/sha256.dart';
16 | import '../../../utils/extension.dart';
17 | import '../../../utils/u8a.dart';
18 | import '../../cbor.dart';
19 | import '../random.dart';
20 |
21 | part 'function.dart';
22 | part 'key_derivator.dart';
23 | part 'util.dart';
24 |
25 | @immutable
26 | abstract class KeyStore {
27 | const KeyStore();
28 |
29 | Map get keyStoreMap;
30 | }
31 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/protobuf/ic_base_types/pb/v1/types.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package ic_base_types.pb.v1;
4 |
5 | import "google/protobuf/descriptor.proto";
6 |
7 | // The annotated message is supported by hardware wallet signing.
8 | // The numbering was chosen as the range 19000-19999 is anyway reserved in protobuf.
9 | extend google.protobuf.MessageOptions {
10 | bool tui_signed_message = 20000;
11 | }
12 |
13 | // The annotated field is displayed on the hardware wallet in the specification
14 | // used by launch of the Internet Computer.
15 | extend google.protobuf.FieldOptions {
16 | bool tui_signed_display_q2_2021 = 20001;
17 | }
18 |
19 | // A PB container for a PrincipalId, which uniquely identifies
20 | // a principal.
21 | message PrincipalId {
22 | option (tui_signed_message) = true;
23 | bytes serialized_id = 1 [(tui_signed_display_q2_2021) = true];
24 | }
25 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/native/agent_dart/src/bls/arch.rs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012-2020 MIRACL UK Ltd.
3 | *
4 | * This file is part of MIRACL Core
5 | * (see https://github.com/miracl/core).
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 |
20 | pub type Chunk = i64;
21 | pub type DChunk = i128;
22 | pub const CHUNK: usize = 64;
23 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/linux/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | agent_dart
10 | )
11 |
12 | set(PLUGIN_BUNDLED_LIBRARIES)
13 |
14 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
19 | endforeach(plugin)
20 |
21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24 | endforeach(ffi_plugin)
25 |
--------------------------------------------------------------------------------
/packages/agent_dart/windows/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # The Flutter tooling requires that developers have a version of Visual Studio
2 | # installed that includes CMake 3.14 or later. You should not increase this
3 | # version, as doing so will cause the plugin to fail to compile for some
4 | # customers of the plugin.
5 | cmake_minimum_required(VERSION 3.14)
6 |
7 | # Project-level configuration.
8 | set(PROJECT_NAME "agent_dart")
9 | project(${PROJECT_NAME} LANGUAGES CXX)
10 |
11 | include("../cargokit/cmake/cargokit.cmake")
12 | apply_cargokit(${PROJECT_NAME} ../native/agent_dart agent_dart "")
13 |
14 | # List of absolute paths to libraries that should be bundled with the plugin.
15 | # This list could contain prebuilt libraries, or libraries created by an
16 | # external build triggered from this build file.
17 | set(agent_dart_bundled_libraries
18 | "${${PROJECT_NAME}_cargokit_lib}"
19 | PARENT_SCOPE
20 | )
21 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | agent_dart
10 | )
11 |
12 | set(PLUGIN_BUNDLED_LIBRARIES)
13 |
14 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
19 | endforeach(plugin)
20 |
21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
24 | endforeach(ffi_plugin)
25 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/principal/utils/sha256.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | import 'package:crypto/crypto.dart';
4 |
5 | // ignore: implementation_imports
6 | import 'package:crypto/src/digest_sink.dart';
7 |
8 | import '../../utils/number.dart';
9 |
10 | Uint8List sha256Hash(ByteBuffer buf) {
11 | return SHA256().update(buf.asUint8List()).toUint8List();
12 | }
13 |
14 | class SHA256 {
15 | SHA256();
16 |
17 | late final ds = DigestSink();
18 | late final sha = sha256.startChunkedConversion(ds);
19 |
20 | SHA256 update(List bytes) {
21 | sha.add(bytes);
22 | return this;
23 | }
24 |
25 | List _digest() {
26 | sha.close();
27 | return ds.value.bytes;
28 | }
29 |
30 | Uint8List toUint8List() => Uint8List.fromList(_digest());
31 |
32 | Uint8List digest() => toUint8List();
33 |
34 | @override
35 | String toString() => bytesToHex(_digest());
36 | }
37 |
--------------------------------------------------------------------------------
/melos.yaml:
--------------------------------------------------------------------------------
1 | name: agent_dart_workspace
2 | repository: https://github.com/AstroxNetwork/agent_dart
3 |
4 | packages:
5 | - packages/**
6 |
7 | ignore:
8 | - 'packages/agent_dart/cargokit/build_tool'
9 |
10 | ide:
11 | intellij:
12 | enabled: true
13 | moduleNamePrefix: ''
14 |
15 | command:
16 | bootstrap:
17 | runPubGetInParallel: false
18 |
19 | scripts:
20 | analyze:
21 | exec: flutter analyze .
22 | description: Analyze a specific package in this project.
23 |
24 | check-format:
25 | exec: dart format --set-exit-if-changed .
26 | description: Check the format of a specific package in this project.
27 |
28 | format:
29 | exec: dart format .
30 | description: Format a specific package in this project.
31 |
32 | publish-dry-run:
33 | description: Publish dry-run all packages
34 | exec: dart pub publish --dry-run
35 | packageFilters:
36 | noPrivate: true
37 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/principal/utils/sha224.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | import 'package:crypto/crypto.dart';
4 |
5 | // ignore: implementation_imports
6 | import 'package:crypto/src/digest_sink.dart';
7 |
8 | import '../../utils/number.dart';
9 |
10 | Uint8List sha224Hash(ByteBuffer buf) {
11 | return SHA224().update(buf.asUint8List()).toUint8List();
12 | }
13 |
14 | class SHA224 {
15 | SHA224() : ds = DigestSink();
16 |
17 | final DigestSink ds;
18 | late final sha = sha224.startChunkedConversion(ds);
19 |
20 | SHA224 update(List bytes) {
21 | sha.add(bytes);
22 | return this;
23 | }
24 |
25 | List _digest() {
26 | sha.close();
27 | return ds.value.bytes;
28 | }
29 |
30 | Uint8List toUint8List() => Uint8List.fromList(_digest());
31 |
32 | Uint8List digest() => toUint8List();
33 |
34 | @override
35 | String toString() => bytesToHex(_digest());
36 | }
37 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/agent/utils/bls.dart:
--------------------------------------------------------------------------------
1 | import 'package:agent_dart_base/agent_dart_base.dart';
2 | import 'package:test/test.dart';
3 |
4 | void main() {
5 | blsTest();
6 | }
7 |
8 | void blsTest() {
9 | test('verify', () async {
10 | const pk =
11 | 'a7623a93cdb56c4d23d99c14216afaab3dfd6d4f9eb3db23d038280b6d5cb2caaee2a19dd92c9df7001dede23bf036bc0f33982dfb41e8fa9b8e96b5dc3e83d55ca4dd146c7eb2e8b6859cb5a5db815db86810b8d12cee1588b5dbf34a4dc9a5';
12 | const sig =
13 | 'b89e13a212c830586eaa9ad53946cd968718ebecc27eda849d9232673dcd4f440e8b5df39bf14a88048c15e16cbcaabe';
14 | const msg = 'hello';
15 | final AgentBLS bls = AgentBLS();
16 | expect(
17 | await bls.blsVerify(pk.toU8a(), sig.toU8a(), msg.plainToU8a()),
18 | true,
19 | );
20 | expect(
21 | await bls.blsVerify(pk.toU8a(), sig.toU8a(), 'Hallo'.plainToU8a()),
22 | false,
23 | );
24 | });
25 | }
26 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 12.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .build/
9 | .buildlog/
10 | .history
11 | .svn/
12 | .swiftpm/
13 | migrate_working_dir/
14 |
15 | # IntelliJ related
16 | *.ipr
17 | *.iws
18 | .idea/
19 |
20 | # The .vscode folder contains launch configuration and tasks you configure in
21 | # VS Code which you may wish to be included in version control, so this line
22 | # is commented out by default.
23 | #.vscode/
24 |
25 | # Flutter/Dart/Pub related
26 | **/doc/api/
27 | **/ios/Flutter/.last_build_id
28 | .dart_tool/
29 | .flutter-plugins
30 | .flutter-plugins-dependencies
31 | .packages
32 | .pub-cache/
33 | .pub/
34 | /build/
35 |
36 | # Symbolication related
37 | app.*.symbols
38 |
39 | # Obfuscation related
40 | app.*.map.json
41 |
42 | # Android Studio will place build artifacts here
43 | /android/app/debug
44 | /android/app/profile
45 | /android/app/release
46 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/utils/buffer_pipe.dart:
--------------------------------------------------------------------------------
1 | import 'dart:collection';
2 |
3 | class BufferPipe {
4 | BufferPipe(Iterable list) {
5 | write(list);
6 | }
7 |
8 | final DoubleLinkedQueue _buffer = DoubleLinkedQueue();
9 | int _bytesRead = 0;
10 | int _bytesWrote = 0;
11 |
12 | bool get end => _buffer.isEmpty;
13 |
14 | int get bytesRead => _bytesRead;
15 |
16 | int get bytesWrote => _bytesWrote;
17 |
18 | int get length => _buffer.length;
19 |
20 | List get buffer => _buffer.toList();
21 |
22 | List read(int length) {
23 | final list = [];
24 |
25 | for (int i = 0; i < length && _buffer.isNotEmpty; i++) {
26 | list.add(_buffer.removeFirst());
27 | _bytesRead++;
28 | }
29 |
30 | return list;
31 | }
32 |
33 | void write(Iterable data) {
34 | final oldLength = _buffer.length;
35 | _buffer.addAll(data);
36 | _bytesWrote += _buffer.length - oldLength;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: agent_dart_base
2 | version: 1.0.0-dev.40
3 |
4 | description: The Dart plugin that bridges Rust implementation for agent_dart.
5 | repository: https://github.com/AstroxNetwork/agent_dart
6 | issue_tracker: https://github.com/AstroxNetwork/agent_dart/issues
7 |
8 | environment:
9 | sdk: '>=3.4.0 <4.0.0'
10 |
11 | dependencies:
12 | agent_dart_ffi: ^1.0.0-0
13 |
14 | bip32_plus: ^1.0.0
15 | bip39_mnemonic: ^3.0.9
16 | cbor: ^4.1.0
17 | collection: ^1.16.0
18 | convert: ^3.0.1
19 | crypto: ^3.0.2
20 | http: ^1.0.0
21 | meta: ^1.7.0
22 | pointycastle: ^4.0.0
23 | typed_data: ^1.3.1
24 | uuid: '>=3.0.0 <5.0.0'
25 | validators: ^3.0.0
26 |
27 | # Protocol Buffers
28 | protobuf: ^4.0.0
29 | fixnum: ^1.0.1
30 |
31 | dev_dependencies:
32 | lints: # transparent
33 | test: ^1.24.0
34 | build_runner: ^2.4.5
35 |
36 | false_secrets:
37 | - 'native/ed_compact/src/pem.rs'
38 | - 'test/fixture/*.pem'
39 |
--------------------------------------------------------------------------------
/packages/agent_dart/cargokit/build_tool/pubspec.yaml:
--------------------------------------------------------------------------------
1 | # This is copied from Cargokit (which is the official way to use it currently)
2 | # Details: https://fzyzcjy.github.io/flutter_rust_bridge/manual/integrate/builtin
3 |
4 | name: build_tool
5 | description: Cargokit build_tool. Facilitates the build of Rust crate during Flutter application build.
6 | publish_to: none
7 | version: 1.0.0
8 |
9 | environment:
10 | sdk: ">=3.0.0 <4.0.0"
11 |
12 | # Add regular dependencies here.
13 | dependencies:
14 | # these are pinned on purpose because the bundle_tool_runner doesn't have
15 | # pubspec.lock. See run_build_tool.sh
16 | logging: 1.2.0
17 | path: 1.8.0
18 | version: 3.0.0
19 | collection: 1.18.0
20 | ed25519_edwards: 0.3.1
21 | hex: 0.2.0
22 | yaml: 3.1.2
23 | source_span: 1.10.0
24 | github: 9.17.0
25 | args: 2.4.2
26 | crypto: 3.0.3
27 | convert: 3.1.1
28 | http: 1.1.0
29 | toml: 0.14.0
30 |
31 | dev_dependencies:
32 | lints: ^2.1.0
33 | test: ^1.24.0
34 |
--------------------------------------------------------------------------------
/packages/agent_dart/example/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/canisters/asset_idl.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | import '../../candid/idl.dart';
4 | import '../actor.dart';
5 |
6 | Service assetIDL() {
7 | return IDL.Service({
8 | 'retrieve': IDL.Func([IDL.Text], [IDL.Vec(IDL.Nat8)], ['query']),
9 | 'store': IDL.Func([IDL.Text, IDL.Vec(IDL.Nat8)], [], []),
10 | });
11 | }
12 |
13 | enum AssetMethod { retrieve, store }
14 |
15 | /// Try to understand how idl can be transformed.
16 | class AssetActor {
17 | AssetActor();
18 |
19 | late final CanisterActor actor;
20 |
21 | Future retrieve(String key) async {
22 | final res = await actor.getFunc(AssetMethod.retrieve.name)?.call([key]);
23 | if (res != null) {
24 | return res as Uint8List;
25 | }
26 | throw StateError('Request failed with the result: $res.');
27 | }
28 |
29 | Future store(String key, Uint8List value) async {
30 | await actor.getFunc(AssetMethod.store.name)?.call([key, value]);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/lib/src/schnorr.dart:
--------------------------------------------------------------------------------
1 | // This file is automatically generated, so please do not edit it.
2 | // @generated by `flutter_rust_bridge`@ 2.11.1.
3 |
4 | // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
5 |
6 | import 'frb_generated.dart';
7 | import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
8 |
9 | class SchnorrIdentityExport {
10 | final Uint8List privateKeyHash;
11 | final Uint8List publicKeyHash;
12 |
13 | const SchnorrIdentityExport({
14 | required this.privateKeyHash,
15 | required this.publicKeyHash,
16 | });
17 |
18 | @override
19 | int get hashCode => privateKeyHash.hashCode ^ publicKeyHash.hashCode;
20 |
21 | @override
22 | bool operator ==(Object other) =>
23 | identical(this, other) ||
24 | other is SchnorrIdentityExport &&
25 | runtimeType == other.runtimeType &&
26 | privateKeyHash == other.privateKeyHash &&
27 | publicKeyHash == other.publicKeyHash;
28 | }
29 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/native/agent_dart/src/bls/bls12381/mod.rs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012-2020 MIRACL UK Ltd.
3 | *
4 | * This file is part of MIRACL Core
5 | * (see https://github.com/miracl/core).
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 | pub mod big;
20 | pub mod bls;
21 | pub mod dbig;
22 | pub mod ecp;
23 | pub mod ecp2;
24 | pub mod fp;
25 | pub mod fp12;
26 | pub mod fp2;
27 | pub mod fp4;
28 | pub mod mpin;
29 | pub mod pair;
30 | pub mod rom;
31 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/lib/src/p256.dart:
--------------------------------------------------------------------------------
1 | // This file is automatically generated, so please do not edit it.
2 | // @generated by `flutter_rust_bridge`@ 2.11.1.
3 |
4 | // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
5 |
6 | import 'frb_generated.dart';
7 | import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
8 |
9 | class P256IdentityExport {
10 | final Uint8List privateKeyHash;
11 | final Uint8List derEncodedPublicKey;
12 |
13 | const P256IdentityExport({
14 | required this.privateKeyHash,
15 | required this.derEncodedPublicKey,
16 | });
17 |
18 | @override
19 | int get hashCode => privateKeyHash.hashCode ^ derEncodedPublicKey.hashCode;
20 |
21 | @override
22 | bool operator ==(Object other) =>
23 | identical(this, other) ||
24 | other is P256IdentityExport &&
25 | runtimeType == other.runtimeType &&
26 | privateKeyHash == other.privateKeyHash &&
27 | derEncodedPublicKey == other.derEncodedPublicKey;
28 | }
29 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/native/agent_dart/src/bls/README.md:
--------------------------------------------------------------------------------
1 | This is a convenience copy of the code in https://github.com/miracl/core
2 | produced from revision f9de005e0168f59a56afe177498b19f4d43f054f with these steps:
3 |
4 | * `cd rust/`
5 | * `python3 config64.py`
6 | * Select BLS12381 (enter 31, then enter 0)
7 | * Copy the files listed under `core/src` to this directory.
8 | * Remove `main.rs`; Rename `lib.rs` to `mod.rs`.
9 | * `sed -i .bak 's/crate::/crate::bls::/g' *.rs`
10 | * Patch the `bls12381/` directory as follows:
11 | * `ecp.rs`: Set `ALLOW_ALT_COMPRESS` to true
12 | * `bls.rs`: Change the domain separator to `BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_` (in `bls_hash_to_point` function)
13 | * `bls.rs`: Do not use the "new multi-pairing mechanism", but the alternative in `core_verify` function.
14 | (The commented code is out dated. We need the following patch before master fix it)
15 | ```
16 | //.. or alternatively
17 | let g = ECP2::generator();
18 | let mut v = pair::ate2(&g, &d, &pk, &hm);
19 | ```
20 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/wallet/pem.dart:
--------------------------------------------------------------------------------
1 | import 'package:agent_dart_base/agent_dart_base.dart';
2 | import 'package:test/test.dart';
3 |
4 | void main() {
5 | pemTest();
6 | }
7 |
8 | void pemTest() {
9 | const ed25519File = './test/fixture/ed25519.pem';
10 | const secp256k1File = './test/fixture/secp256k1.pem';
11 | test('from ed25519 pem', () async {
12 | final pem = await getPemFile(ed25519File);
13 | expect(pem.keyType, KeyType.ed25519);
14 | final id = await ed25519KeyIdentityFromPem(pem.rawString);
15 | expect(
16 | id.getPrincipal().toText(),
17 | 'uz7u7-ut6sf-gx45r-pb3ww-ntxjp-y4lv2-bdobd-65xa3-7yt6t-ti2lz-aqe',
18 | );
19 | });
20 | test('from secp256k1 pem', () async {
21 | final pem = await getPemFile(secp256k1File);
22 | expect(pem.keyType, KeyType.secp265k1);
23 | final id = await secp256k1KeyIdentityFromPem(pem.rawString);
24 | expect(
25 | id.getPrincipal().toText(),
26 | '4tu7k-esetu-2lfo6-zzg45-ivl5m-77h3d-gjszr-uoeg4-zh24n-jly75-dqe',
27 | );
28 | });
29 | }
30 |
--------------------------------------------------------------------------------
/packages/agent_dart_ffi/lib/src/secp256k1.dart:
--------------------------------------------------------------------------------
1 | // This file is automatically generated, so please do not edit it.
2 | // @generated by `flutter_rust_bridge`@ 2.11.1.
3 |
4 | // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
5 |
6 | import 'frb_generated.dart';
7 | import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
8 |
9 | class Secp256k1IdentityExport {
10 | final Uint8List privateKeyHash;
11 | final Uint8List derEncodedPublicKey;
12 |
13 | const Secp256k1IdentityExport({
14 | required this.privateKeyHash,
15 | required this.derEncodedPublicKey,
16 | });
17 |
18 | @override
19 | int get hashCode => privateKeyHash.hashCode ^ derEncodedPublicKey.hashCode;
20 |
21 | @override
22 | bool operator ==(Object other) =>
23 | identical(this, other) ||
24 | other is Secp256k1IdentityExport &&
25 | runtimeType == other.runtimeType &&
26 | privateKeyHash == other.privateKeyHash &&
27 | derEncodedPublicKey == other.derEncodedPublicKey;
28 | }
29 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/lib/agent/canisters/management.dart:
--------------------------------------------------------------------------------
1 | import '../../principal/principal.dart';
2 | import '../actor.dart';
3 | import 'management_idl.dart';
4 |
5 | // : ActorSubclass
6 | CanisterActor getManagementCanister(CallConfig config) {
7 | CallConfig transform(String methodName, List args, CallConfig callConfig) {
8 | final first = args[0];
9 | Principal effectiveCanisterId = Principal.fromHex('');
10 | if (first != null && first is Map && first['canister_id'] != null) {
11 | effectiveCanisterId = Principal.from(first['canister_id']);
12 | }
13 | return CallConfig(effectiveCanisterId: effectiveCanisterId);
14 | }
15 |
16 | final newConfig = ActorConfig(
17 | agent: config.agent,
18 | pollingStrategyFactory: config.pollingStrategyFactory,
19 | effectiveCanisterId: config.effectiveCanisterId,
20 | canisterId: Principal.fromHex(''),
21 | callTransform: transform,
22 | queryTransform: transform,
23 | );
24 | return Actor.createActor(managementIDL(), newConfig);
25 | }
26 |
--------------------------------------------------------------------------------
/packages/agent_dart/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: agent_dart
2 | version: 1.0.0-dev.40
3 |
4 | description: |
5 | An agent library built for Internet Computer,
6 | a plugin package for dart and flutter apps.
7 | Developers can build ones to interact with Dfinity's blockchain directly.
8 | repository: https://github.com/AstroxNetwork/agent_dart
9 | issue_tracker: https://github.com/AstroxNetwork/agent_dart/issues
10 |
11 | environment:
12 | sdk: '>=3.4.0 <4.0.0'
13 | flutter: '>=3.22.0'
14 |
15 | dependencies:
16 | flutter:
17 | sdk: flutter
18 |
19 | agent_dart_base: ^1.0.0-0
20 |
21 | dev_dependencies:
22 | flutter_lints: any
23 | flutter_test:
24 | sdk: flutter
25 | integration_test:
26 | sdk: flutter
27 |
28 | flutter:
29 | plugin:
30 | platforms:
31 | android:
32 | ffiPlugin: true
33 | ios:
34 | ffiPlugin: true
35 | linux:
36 | ffiPlugin: true
37 | macos:
38 | ffiPlugin: true
39 | windows:
40 | ffiPlugin: true
41 |
42 | false_secrets:
43 | - 'native/ed_compact/src/pem.rs'
44 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/agent/utils/hash.dart:
--------------------------------------------------------------------------------
1 | import 'package:agent_dart_base/agent_dart_base.dart';
2 | import 'package:test/test.dart';
3 |
4 | void main() {
5 | hashTest();
6 | }
7 |
8 | void hashTest() {
9 | test('IDL label', () {
10 | void testLabel(String str, int expected) {
11 | expect(idlLabelToId(str), expected);
12 | }
13 |
14 | testLabel('', 0);
15 | testLabel('id', 23515);
16 | testLabel('description', 1595738364);
17 | testLabel('short_name', 3261810734);
18 | testLabel('Hi ☃', 1419229646);
19 | testLabel('_0_', 0);
20 | testLabel('_1_', 1);
21 | testLabel('_+1_', 1055658234);
22 | testLabel('_-1_', 1055757692);
23 | testLabel('_123_', 123);
24 | testLabel('_4294967295_', 4294967295);
25 | testLabel('_4294967296_', 1569808370);
26 | testLabel('_0xa_', 10);
27 | testLabel('_0d_', 1055918252);
28 | testLabel('_1.23_', 1360503298);
29 | testLabel('_1e2_', 3552665568);
30 | testLabel('_', 95);
31 | testLabel('__', 21280);
32 | testLabel('___', 4745535);
33 | });
34 | }
35 |
--------------------------------------------------------------------------------
/packages/agent_dart_base/test/agent/actor.dart:
--------------------------------------------------------------------------------
1 | import 'package:agent_dart_base/agent_dart_base.dart';
2 | import 'package:test/test.dart';
3 |
4 | void main() {
5 | actorTest();
6 | }
7 |
8 | void actorTest() {
9 | test('actor', () async {
10 | final agent = HttpAgent(
11 | defaultHost: 'icp-api.io',
12 | defaultPort: 443,
13 | options: const HttpAgentOptions(identity: AnonymousIdentity()),
14 | );
15 | final idl = IDL.Service({
16 | 'create_challenge': IDL.Func(
17 | [],
18 | [
19 | IDL.Record({
20 | 'png_base64': IDL.Text,
21 | 'challenge_key': IDL.Text,
22 | }),
23 | ],
24 | [],
25 | ),
26 | });
27 | final actor = CanisterActor(
28 | ActorConfig(
29 | canisterId: Principal.fromText('rdmx6-jaaaa-aaaaa-aaadq-cai'),
30 | agent: agent,
31 | ),
32 | idl,
33 | );
34 | final result = await actor.getFunc('create_challenge')!.call([]);
35 | expect(result, isA