[Dart/Flutter]agent_dart updates v0.1.16 - Flutter Web Supported

Hi eveyone.

We are making a dart/flutter version of agent library for Internet Computer. Dart and Flutter devs can use it to build either mobile wallets, Stand-alone/fusion Dapps powered by canisters, or even backend service.

You can get it here:

https://pub.dev/packages/agent_dart

And for source code, here:

https://github.com/AstroxNetwork/agent_dart

Current version is 0.1.16, we will update latest features and changes in this post.

0.1.16

  • added principal to accountId
  • added Flutter Web support
  • regroup project structure
  • fixed archiver overriding
  • fixed bls on dart:io and dart:html
  • fixed test compatible with flutter web

0.1.11 - 0.1.15

  • Fixed secp256k1 signature length
  • Expose AgentFactory
  • Fix Cbor with List casting
  • Minor Fix fetch and KeySmith
  • added Windows ffi support
  • BREAKING separating auth_provider to standalone agent_dart_auth package
  • IMPORTANT fix candid parser with BigInt and others

0.1.10

  • Added Secp256k1 Identity with ECDA sign

  • Added ledger with send and getBalance

0.1.9

  • BREAKING the auth_client flow is a little bit change due to Internet Identity service won’t give correct identity using local webpage like we use webAuthProvider here

  • How ever we keep the provider here, because we may have other Identity Provider to give other solution.

  • But we managed to change auth_client a bit.

0.1.8

  • fixed uri parser, added path to auth_client

0.1.7

  • IMPORATANT Use blsSync instead of async isolation, to fix memory leak in rust-dart-ffi interop

0.1.6

  • Fix cbordecode in the Delegation

  • Apply rosetta-api to current docker specs

0.1.5

  • BREAKING remove ICPSigner.fromPrivatekey and added ICPSigner.fromSeed

  • Won’t support import privatekey to signer anymore, may separate different signer, eg: Secp256k1Signer or SchnorrSigner in the future supporting different coin specs.

0.1.4

  • added sourceType of II, plugWallet, keysmith with different settings since they use different derivePath to generate seed

  • added Signer.importPhrase to use settings above

  • added related tests

0.1.3

  • fix delegation request sign and request_id

0.1.2

  • fix delegation chain transformRequest

0.1.1

  • fix error decoding

  • follow agent-js latest features

  • fix readme

Here are core features in this package:

  • agent, core library, with crypto and encoding/decoding methods , http call/query encapsulated, for interacting with canister.

  • auth_client, a popup window for flutter, used for getting authentication from Identity provider(eg, Internet Identity).

  • authentication, a library supports auth_client

  • candid, candid library, used for encoding/decoding candid data types, and used them in dart-lang.

  • principal, principal library, used for generate principal for many usage cases.

  • protobuf, protobuf library, used for interacting with rosetta-node in submit/query transaction

  • utils, common utils, including useful helpers like extension methods in dart.

  • wallet, wallet library, signer, rosetta, key-smith all-in-one library.

Updates since 0.1.16:

0.1.24

  • Add CurveType for signers.

  • Add bits getters for FixedIntClass and FixedNatClass.

  • Adopt Platform.environment for Flutter 3.

0.1.23+1

  • Fix issues when encoding OptClass.

0.1.23

  • Add encryptCborPhrase method.

0.1.22+1

  • :adhesive_bandage: HotFix :adhesive_bandage: Remove invalid asserts with defaultFetch. (#19)

  • Remove unused tests.

0.1.22

  • :light_bulb: BREAKING CHANGE :light_bulb: Fix fetch method type.

  • Remove unused files.

  • Use structured polling exceptions.

  • Improve defaultFetch.

  • Add decryptCborPhrase.

0.1.21

  • Fix function name typos.

  • Support toJson to candid.

0.1.20

  • Remove unused files and functions.

0.1.19+4

  • Use archive: 3.3.0.

0.1.19+3

  • Use Isolate.spawn and Isolate.exit` to optimize isolate functions.

0.1.19+2

  • Fix http request when IC returns dual headers using Flutter web.

0.1.19+1

  • Skip…

0.1.19

  • Use latest api of ledger.

  • Fix encoder.

0.1.18

  • Add identity from pem.

0.1.17+1

  • Fix type annotation applied to dart 2.15.0.

0.1.17

  • Add CanisterId class.

  • Fix rosetta api.

  • Prevent secp256k1 weak signatures.

  • Fix build scripts.

0.1.16+2

  • Add fromStorage to auth_client.

0.1.16+1

  • Fix rosetta with latest mainnet APIs.

  • Fix cbor with primitive types.

  • Format all files.

Hey @neeboo,

agent_dart is incredible, inspiring developers to create solutions with a mobile-first approach.

We recently transitioned our backend from a monolithic to a microservices architecture and are eager to leverage the “composite queries” feature introduced in dfx 0.15.0. I attempted to use agent_dart: ^1.0.0-dev.16, but encountered timeout issues with the endpoint request. Could you provide guidance on the likely cause of this problem? Thank you in advance.

P.S : We’re eagerly waiting to add composite queries to our dApp before we launch the pre-beta version. The boost in throughput from this feature is huge, making it totally worth the wait before our big release.

In js version, does it work?

And how do you generate dart code? Candid_dart or write manually?

I tried using Candid Ui and it returns the response as expected

I wrote the interface manually, not used candid_dart.