Agent Dart
An agent library built for Internet Computer for Dart and Flutter apps.
📃 Table of content
- Agent Dart
⚡️ Quick start
For Dart/Flutter app
The latest stable version is:
dependencies:
agent_dart: ^latest-version
For iOS projects
When you're using the plugin in your Flutter projects that contains iOS platform, make sure you've done the following setup the build settings.
- Open
ios/Runner.xcworkspace
. - Select
Runner
on left folder view, andProject -> Runner
. - Select
Build Settings
,All
,Combined
and typestrip style
in the filter input field. - Switch
Strip Style
and selectNon-Global Symbols
.
For developing the plugin
-
Clone and follow Prerequisites, and make sure your Flutter installed properly.
-
MUST DO: Bootstrap your project
./scripts/bootstrap.sh
🚦 Prerequisites
🧰 Resources
📖 Documentation
- Reference on pub.dev
- Docs site, WIP...
🔧 Helpers/Tooling
- candid_dart, an automated candid builder for Dart classes
- agent_dart_auth, an extension plugin for authorization, used for Internet-Identity authorization.
💡 Examples
- simple counter, a simple counter demonstrate how to use agent_dart, a backend canister within.
- auth counter, a counter needs user's authorization from Internet-Identity, demonstrate how to combine with agent_dart_auth.
- ledger_app, a ledger app demonstrate how to import seed-phrase and make transactions.
🧘♂️ Motivation
The Internet Computer is powered by blockchain and its major impact is to bring WebApp to be truly decentralized. However, we are in the mobile internet era, even we can use Safari or Chrome on our cell phones. But most average people, not crypto enthusiasts, are likely to use native mobile apps, major users are there.
It's important to attract these people to use DApps of Internet Computer, by providing stable, fast, and fully integrated to Dfinity's blockchain. We likely to provide further solution to balancing the "Decentralization" and "Efficiency". But first things first, we have to make mobile native apps work.
agent-rs
and agent-js
are the actual lower level client-SDKs,
just like ether.js
or web3.js
of Ethereum's ecosystem.
This library is aiming to port and replicate features from them.
And this library is mainly for mobile apps to connect canisters,
not deploying contracts (you can do that if you want, but use dart directly).
We have tried our best to migrate most interface styles just like Javascript version, but there are limitations and differences between different programming languages, we will document them as much as possible.
🏆 Milestones
- Milestone 1: ✅ Core features/libraries implementation.
- Milestone 2: ✅ Enhanced built tool and more example apps
- Milestone 3: 👷 Documentation and community driven development
👨💻 Contributing
By contributing to agent_dart, you agree that your contributions will be licensed under its MIT License.
- Fork this library and add your own branch like
{feat|fix|test|dep}-{detail}
. - Follow the Prerequisites.
- Build rust dependencies for all supported platforms:
sh ./scripts/bootstrap
- Start the example.
cd example
flutter run
- Tests. (Unit Test and Integration Test)
flutter test
- Commit and make a pull request.
🔗 Reference and related projects
Feel free to list your project here, you can submit here.
⚠️ FAQ
Build rust libraries for iOS/MacOS
- All rust method have to be written inside
SwiftAgentDartPlugin.swift
to avoid tree shaking by XCode.
Network problem in macOS
- If you run example or build a flutter app, you may come up with this:
[macOS] SocketException: Connection failed (OS Error: Operation not permitted, errno = 1)
- Go to
macos/Runner
of macOS. - Add following in
DebugProfile.entitlements
andReleaseProfile.entitlements
:
<key>com.apple.security.network.client</key>
<true/>
Libraries
- agent/actor
- agent/agent
- agent/agent/api
- agent/agent/factory
- agent/agent/http/fetch
- agent/agent/http/index
- agent/agent/http/transform
- agent/agent/http/types
- agent/agent/index
- agent/agent/proxy
- agent/auth
- agent/bls
- agent/canisters/asset
- agent/canisters/asset_idl
- agent/canisters/index
- agent/canisters/management
- agent/canisters/management_idl
- agent/cbor
- agent/certificate
- agent/crypto/index
- agent/crypto/keystore/key_store
- agent/crypto/random
- agent/errors
- agent/polling/polling
- agent/polling/strategy
- agent/request_id
- agent/types
- agent/utils/buffer_pipe
- agent/utils/hash
- agent/utils/index
- agent/utils/leb128
- agent_dart_base
- archiver/archiver
- archiver/decoder
- archiver/encoder
- archiver/signing_block
- auth_client/auth_client
- authentication/authentication
- candid/idl
- frb
- identity/delegation
- identity/der
- identity/ed25519
- identity/identity
- identity/p256
- identity/schnorr
- identity/secp256k1
- principal/principal
- principal/utils/base32
- principal/utils/get_crc
- principal/utils/sha224
- principal/utils/sha256
- principal/utils/utils
- protobuf/ic_base_types/pb/v1/types.pb
- protobuf/ic_base_types/pb/v1/types.pbjson
- protobuf/ic_base_types/pb/v1/types.pbserver
- protobuf/ic_ledger/pb/v1/types.pb
- protobuf/ic_ledger/pb/v1/types.pbjson
- protobuf/ic_ledger/pb/v1/types.pbserver
- utils/base64
- utils/bech32
- utils/bn
- utils/extension
- utils/hex
- utils/is
- utils/map
- utils/number
- utils/string
- utils/u8a
- wallet/hashing
- wallet/keysmith
- wallet/ledger
- wallet/pem
- wallet/phrase
- wallet/rosetta
- wallet/signer
- wallet/types
- wallet/wallet