Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

ayanworks/ARNIMA-flutter-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aries Flutter Mobile SDK

This sdk is compatible to be used with both Android and iOS platforms. Please refer Installation section on how to set up the sdk and start running. This SDK is compliant and interoperable with the standards defined in the Aries RFCs.

Features

Finished

âś… Issue Credential Protocol âś… Present Proof Protocol âś… Connection Protocol âś… Trust Ping Protocol

TODO

⌨️ Basic Message Protocol ⌨️ Mediator coordination protocol ⌨️ Connection-less Issuance and Verification ⌨️ Support with other Mediator Agent ⌨️ Store all exchange messages into the Wallet itself

Notes: Currently, SDK supports our custom build mediator agent and we are planning to open-source the mediator agent soon.


Getting Started

  1. Clone this SDK repository git clone https://gitlab.com/Blockster/aries-flutter-sdk.git

  2. Open the pubspec.yaml file located inside the DemoApp folder, and add SDK under dependencies.

 dependencies:
 flutter:
   sdk: flutter

 AriesFlutterMobileAgent:
   path: ../<Your SDK repository path>/aries-flutter-sdk
  1. Install it
    • From the terminal: Run flutter pub get.

      OR

    • From Android Studio/IntelliJ: Click Packages get in the action ribbon at the top of pubspec.yaml.
    • From VS Code: Click Get Packages located in right side of the action ribbon at the top of pubspec.yaml.

Android

  1. Make sure there is a min. SDK version setup in android/build.gradle:.
    buildscript {
    ext {
            ...
            minSdkVersion = 18
            ...
        }
    }
    

iOS

Xcode : Make sure you have installed Xcode

  1. Include below lines on top of your project's Podfile.
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/hyperledger/indy-sdk.git'
  1. Change platform :ios, '9.0' to platform :ios, '13.0'
  2. Remove use_frameworks! from Podfile
  3. Do pod install.
  4. You need to download and replace the file "Indy.framework" from Pods folder inside your Mobile app project from the following link (only if your xcode version is above 10.5) Download from - https://drive.google.com/drive/folders/1_WJ3mEHqk5GHH9p5SI4bRKRXPwy5w_0e Replace at - <Your_Project>/ios/Pods/libindy-objc/libindy-objc
  5. Now open .xcworkspace file into the xcode and run the application

Permissions

  1. Read/Write permissions: To access device storage for creating wallet.

Using the SDK

  1. Import the library

    import 'package:AriesFlutterMobileAgent/AriesAgent.dart';
  2. Add WidgetsFlutterBinding.ensureInitialized(); in main function of app, This binds the framework to the Flutter engine.

  3. Use the following methods

Methods

init() -> void


This method initializes the sdk and setup database.

Example:

import 'package:AriesFlutterMobileAgent/AriesAgent.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  AriesFlutterMobileAgent.init();
  runApp(MyApp());
}

createWallet(config, credential, label) -> Array


This method is called after the user has set up their wallet name & passcode for the first time.

config: JSON - Wallet configuration that takes in the wallet name as an id (e.g. Proof)

{
    id: <WALLET_NAME>
}

credential: JSON - Wallet credentials json that takes in the passcode the user has setup during onboarding

{
    key: <PASSCODE>
}

label : String - Your label to show to the counter party during connection

Example:

import 'package:AriesFlutterMobileAgent/AriesAgent.dart';

var response = await AriesFlutterMobileAgent.createWallet(
          {'id': 'John'},
          {'key': '123456'},
          'John',
        );

Returns:

Success: Array[<public_did>, , ] Sample Output: ["K7P6Xoe31NBYn7md8qBm4F", "AsVcY4GUvJyeP2k78vJK2mTuPHT1sSdZjQBXbCUyXEbz", "John"]

Error: Below is a list of anticipated errors

  1. Storage permissions error. Sample: {"code":"114","message":"org.hyperledger.indy.sdk.IOException: An IO error occurred."}]
  2. Wallet already error. Sample: {"code":"203","message":"Wallet already exists."}].

ConnectWithMediator(url, apiBody, poolConfig) -> Boolean


This method connects to an instantiated service of a mediator agent that is in charge of holding messages if the application is offline and to push messages to this sdk the moment mobile app is active.

url: String - endpoint url of the instantiated mediator agent

"http://127.0.0.0:4000"

apiBody: String - Stringified JSON that contains the wallet information needed to attach to the mediator agent. (myDid, verkey and label you received from response of the create wallet function.)

jsonEncode({
    'myDid': "<WALLET_PUBLIC_DID>",
    'verkey': "<WALLET_VERIFIED_KEY>",
    'label': "<WALLET_LABEL>",
})

poolConfig: String - A genesis transaction string.

"""{"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node1", "blskey": "4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba", "blskey_pop": "RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1", "client_ip": "127.0.0.0", "client_port": 9702, "node_ip": "127.0.0.0", "node_port": 9701, "services": ["VALIDATOR"]}, "dest": "Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"}, "metadata": {"from": "Th7MpTaRZVRYnPiabds81Y"}, "type": "0"}, "txnMetadata": {"seqNo": 1, "txnId": "fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"}, "ver": "1"}
            {"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node2", "blskey": "37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk", "blskey_pop": "Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5", "client_ip": "127.0.0.0", "client_port": 9704, "node_ip": "127.0.0.0", "node_port": 9703, "services": ["VALIDATOR"]}, "dest": "8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"}, "metadata": {"from": "EbP4aYNeTHL6q385GuVpRV"}, "type": "0"}, "txnMetadata": {"seqNo": 2, "txnId": "1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"}, "ver": "1"}
            {"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node3", "blskey": "3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5", "blskey_pop": "QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh", "client_ip": "127.0.0.0", "client_port": 9706, "node_ip": "127.0.0.0", "node_port": 9705, "services": ["VALIDATOR"]}, "dest": "DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"}, "metadata": {"from": "4cU41vWW82ArfxJxHkzXPG"}, "type": "0"}, "txnMetadata": {"seqNo": 3, "txnId": "7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"}, "ver": "1"}
            {"reqSignature": {}, "txn": {"data": {"data": {"alias": "Node4", "blskey": "2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw", "blskey_pop": "RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP", "client_ip": "127.0.0.0", "client_port": 9708, "node_ip": "127.0.0.0", "node_port": 9707, "services": ["VALIDATOR"]}, "dest": "4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"}, "metadata": {"from": "TWwCRQRZ2ZHMJFn9TzLp7W"}, "type": "0"}, "txnMetadata": {"seqNo": 4, "txnId": "aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"}, "ver": "1"}""";

Example:

import 'package:AriesFlutterMobileAgent/AriesAgent.dart';

var response = await AriesFlutterMobileAgent.connectWithMediator(
        "$MediatorAgentUrl/discover",
        jsonEncode({
            'myDid': "<WALLET_PUBLIC_DID>",
            'verkey': "<WALLET_VERIFIED_KEY>",
            'label': "<WALLET_LABEL>",
        }),
        PoolConfig,
      );

Returns:

success : returns true

acceptInvitation(didJson, invitationUrl) -> Boolean

Function is useful for accepting the connection invitation of any aries based agent. Once your connection is established successfully then only you can exchange the credential and proof request.

didJson: Json - Identity information as json

{
    "did": string, (optional;
            if not provided and cid param is false then the first 16 bit of the verkey will be used as a new DID;
            if not provided and cid is true then the full verkey will be used as a new DID;
            if provided, then keys will be replaced - key rotation use case)
    "seed": string, (optional) Seed that allows deterministic did creation (if not set random one will be created).
                               Can be UTF-8, base64 or hex string.
    "crypto_type": string, (optional; if not set then ed25519 curve is used;
              currently only 'ed25519' value is supported for this field)
    "cid": bool, (optional; if not set then false is used;)
    "method_name": string, (optional) method name to create fully qualified did (Example:  `did:method_name:NcYxiDXkpYi6ov5FcYDi1e`).
}

invitationUrl: String - Encoded url invitation.

"http://127.0.0.0:4000?c_i=eyJAdHlwZSI6ImRpZDpzb3Y6QnpDYnNOWWhNcmpIaXFaRFRVQVNIZztzcGVjL2Nvbm5lY3Rpb25zLzEuMC9pbnZpdGF0aW9uIiwiQGlkIjoiMzQyNmUzYWQtZGQ5Zi00OWZmLWE2Y2QtMGI2OTJmZmIyMDg5IiwibGFiZWwiOiJBeWFud29ya3MiLCJyZWNpcGllbnRLZXlzIjpbIjNHOUtXa3o3aWZwWUNiNUVqWEtab1lndWloQ0FjbmFON2RrN1d5bnAxOWFHIl0sInNlcnZpY2VFbmRwb2ludCI6Imh0dHA6Ly8xMjcuMC4wLjA6NDAwMCIsInJvdXRpbmdLZXlzIjpbIjVOcnJWQlk1RktZcnVGTFpodVdLSEs2NzRoUFk3UzZHZDVCaG1MbmhrNTczIl19"

Example:

import 'package:AriesFlutterMobileAgent/AriesAgent.dart';

var status = await AriesFlutterMobileAgent.acceptInvitation(
    {},
    invitationUrl,
);

Returns:

Success: true

getAllConnections() -> Array

Function returns an array of Objects. It returns Aries based peer to peer connection records with status. If the status is COMPLETE means your connection is established successfully. REQUESTED means the connection still is on negotiation state. Example:

import 'package:AriesFlutterMobileAgent/AriesAgent.dart';

var response = await AriesFlutterMobileAgent.getAllConnections();

Returns:

Success: Array[ { connectionId: string, connection: string, }, ... ] Sample Output:

[{
connection: "{"did":"ADGeeTatN2KSqRaSXDb3jv","didDoc":{"@context":"https://w3id.org/did/v1","id":"ADGeeTatN2KSqRaSXDb3jv","publicKey":[{"id":"ADGeeTatN2KSqRaSXDb3jv#1","type":"Ed25519VerificationKey2018","controller":"ADGeeTatN2KSqRaSXDb3jv","publicKeyBase58":"62CKgBmargJ8mpCw5HWvcn2u3KAmvWNQ1ToyUzY5EkiV"}],"authentication":[{"type":"Ed25519SignatureAuthentication2018","publicKey":"ADGeeTatN2KSqRaSXDb3jv#1"}],"service":[{"id":"ADGeeTatN2KSqRaSXDb3jv;indy","type":"IndyAgent","priority":0,"serviceEndpoint":"http://127.0.0.0:4001/endpoint","recipientKeys":["62CKgBmargJ8mpCw5HWvcn2u3KAmvWNQ1ToyUzY5EkiV"],"routingKeys":["ApWggHJ9wSVCjLbjvjgRthjEC8jS1sUKJbBXxjVpPRxS"]}]},"verkey":"62CKgBmargJ8mpCw5HWvcn2u3KAmvWNQ1ToyUzY5EkiV","theirLabel":"ABC FIRM","state":"COMPLETE","theirDid":"6rLDWC9VPNz4f2TNePno9t","theirDidDoc":{"@context":"https://w3id.org/did/v1","id":"did:sov:6rLDWC9VPNz4f2TNePno9t","publicKey":[{"id":"did:sov:6rLDWC9VPNz4f2TNePno9t#1","type":"Ed25519VerificationKey2018","controller":"did:sov:6rLDWC9VPNz4f2TNePno9t","publicKeyBase58":"4Bww2NMiuWy2NBHyJUZXxU16SXydchHJfBwWohuzqTWd"}],"authentication":[{"type":"Ed25519SignatureAuthentication2018","publicKey":"did:sov:6rLDWC9VPNz4f2TNePno9t#1"}],"service":[{"id":"did:sov:6rLDWC9VPNz4f2TNePno9t;indy","type":"IndyAgent","priority":0,"recipientKeys":["4Bww2NMiuWy2NBHyJUZXxU16SXydchHJfBwWohuzqTWd"],"serviceEndpoint":"http://127.0.0.1:8004"}]}}"
connectionId: "62CKgBmargJ8mpCw5HWvcn2u3KAmvWNQ1ToyUzY5EkiV"
}, ...]

listAllCredentials() -> Array

Function returns all stored credentials inside holder's wallet.

Example:

import 'package:AriesFlutterMobileAgent/AriesAgent.dart';

var response = await AriesFlutterMobileAgent.listAllCredentials();

Returns Array[{ referent: string, attrs: {"key1":"raw_value1", "key2":"raw_value2"}, schema_id: string, cred_def_id: string, rev_reg_id: Optional<string>, cred_rev_id: Optional<string> }]

Sample Output

[{
"attrs": {expirydate: "19 june 2080", age: "22", place: "England", name: "Jadon"}
"cred_def_id": "XKQLXXzT73roYvSqZjV469:3:CL:238:Indian Passport"
"cred_rev_id": "9"
"referent": "9c9cdb06-c7a6-46ba-bec9-bf4203eef7e9"
"rev_reg_id": "XKQLXXzT73roYvSqZjV469:4:XKQLXXzT73roYvSqZjV469:3:CL:238:Indian 
"schema_id": "XKQLXXzT73roYvSqZjV469:2:Passport:1.1"
}]

getAllActionMessages() -> Array

Function returns an array of Objects. It returns the action messages where the user interaction is required i.e accept the credential, send proof.

Example:

import 'package:AriesFlutterMobileAgent/AriesAgent.dart';

var messages = await AriesFlutterMobileAgent.getAllActionMessages();

Returns

Array[{ messageId: string, messages: string, auto: bool, thId: string, isProcessed: bool, connectionId: string, }]

Sample Output:

Array<Object>

acceptCredentialOffer(messageId,inboundMessage) -> Boolean


Function is used to accept the credential offer which you received from any agent. You can fetch the credential from the getAllActionMessages() messageId: String - Identifier for unique message

"8904"

message: JSON object - Contains following keys

  • message
  • recipient_verkey
  • sender_verkey
"{
"messageId": 853,
"messages": {
	"sender_verkey": "SBNEn54iv2weQmHFrebeJWX7svFS12u9cxL7dPCbzJw",
	"recipient_verkey": "GqDhdigmpk46yfihcFu3xjNUdxYitcZgfnyJ3U4t3AXf",
	"message": {
		"@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/offer-credential",
		"@id": "316e566d-b8ad-4bef-b65c-0aeaa4d8f1f2",
		"~thread": {},
		"credential_preview": {
			"@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/credential-preview",
			"attributes": [{
				"name": "minor",
				"value": "electronics"
			}, {
				"name": "gpa",
				"value": "84"
			}, {
				"name": "major",
				"value": "Computer"
			}, {
				"name": "issue_date",
				"value": "2021-01-21"
			}, {
				"name": "full_name",
				"value": "sairanjit"
			}]
		},
		"comment": "create automated credential exchange",
		"offers~attach": [{
			"@id": "libindy-cred-offer-0",
			"mime-type": "application/json",
			"data": {
				"base64": "eyJzY2hlbWFfaWQiOiAiUExRQlM1bnI0dUVSczRlM0ZNbkZmTjoyOkhpZ2hfU2Nob29sX0RpcGxvbWE6MS4wIiwgImNyZWRfZGVmX2lkIjogIlBMUUJTNW5yNHVFUnM0ZTNGTW5GZk46MzpDTDo0OTpVU0MgSGlnaCBTY2hvb2wgRGlwb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M4NzM4OTgyNDM3NTgxOTY1NTk5NTg0NTIwOTkzMzAyMjkzMzM0NDIwMzgwMDkwODM3NzgwODY3ODQzMjI5NjI0NDM0NTQ1MDA5Njg0MTgwMTAzODI3ODE1ODEwNDU2Njg1OTAxNDI2ODIwMTAzMjU5MTEwNzUxMzc1NjgyOTM4NDA3NjIyOTk3NTA1NzM5ODE4MjE5MjA2NTg5MTMxMjQ5NjI2NjY3MjgwMDE1NDg0MzgxODE0MTQ0NzUyNTAyOTE4ODIwMDMwMzEwMTI5MjUxMjE2ODAxNTM5NTEzNzc4ODM2NzIyNTQ3MDAwNzYzMTg0NjU0MjI1NzQyNTQ1MTI0NjE0MzgxMTIwNzMzODc0NDIzNjA2NDcwNTE0NDk1NzIxOTg4Njg2MDkxODYzNjMwNTU1MTkyNzk1MjI1NTIxMzI4OTcyNDE1MDEzNDM3MTAyMjI4MjU1MzkzMzMwOTY5NTEwNTI0ODI4ODA3MjY1MTkxOTg0NjAyMjg4MDk4OTY5MTE1MDgwMzU3MjcyMDAzODUyMzM2MjQ4NjkwMDc1MzA0NDQzMDI3NjE3MjA5OTc4OTg2Njc1NDY2MjI5MTAxMjEyNDk2ODgwNDAwMzk3NzI5MTU3NTU4ODIyNjg4OTYxOTk5MjkwMjEwMDI5ODI0MzYxNTc4NjM5MDIzNjkxMjEyODU0MjYiXV19LCAibm9uY2UiOiAiNjU3MzAyOTc3MjgyNDQxMjkyNDI3Njc4In0 = "
			}
		}]
	}
},
"auto": false,
"thId": "316e566d-b8ad-4bef-b65c-0aeaa4d8f1f2",
"isProcessed": true,
"connectionId": "GqDhdigmpk46yfihcFu3xjNUdxYitcZgfnyJ3U4t3AXf"
}"

Example:

import 'package:AriesFlutterMobileAgent/AriesAgent.dart';

bool response = await AriesFlutterMobileAgent.acceptCredentialOffer(
    message.messages,
    message.messages,
);

Returns Success true

Error Below is a list of errors anticipated: Sample

  1. Common invalid structure {"code":"113","message":"Common invalid structure."}]

sendProof(messageId, message) -> Boolean


Function sends proof against a proof request found inside response of getAllActionMessages.

messageId: String - Identifier for unique mes

"8904"

inboundMessage: JSON object - Contains following keys

  • message
  • recipient_verkey
  • sender_verkey
"{
	"messageId": 854,
	"messages": {
		"sender_verkey": "SBNEn54iv2weQmHFrebeJWX7svFS12u9cxL7dPCbzJw",
		"recipient_verkey": "GqDhdigmpk46yfihcFu3xjNUdxYitcZgfnyJ3U4t3AXf",
		"message": {
			"@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/request-presentation",
			"@id": "677c6af5-b312-47ec-9e9d-6873468fef4d",
			"comment": "Send Proof Request",
			"request_presentations~attach": [{
				"@id": "libindy-request-presentation-0",
				"mime-type": "application/json",
				"data": {
					"base64": "eyJuYW1lIjogIkhpZ2hfU2Nob29sX0RpcGxvbWEiLCAicmVxdWVzdGVkX3ByZWRpY2F0ZXMiOiB7fSwgInJlcXVlc3RlZF9hdHRyaWJ1dGVzIjogeyJhZGRpdGlvbmFsUHJvcDEiOiB7Im5hbWUiOiAibWlub3IiLCAicmVzdHJpY3Rpb25zIjogW3sic2NoZW1hX2lkIjogIlBMUUJTNW5yNHVFUnM0ZTNGTW5GZk46MjpIaWdoX1NjaG9vbF9EaXBsb21hOjEuMCIsICJjcmVkX2RlZl9pZCI6ICJQTFFCUzVucjR1RVJzNGUzRk1uRmZOOjM6Q0w6NDk6VVNDIEhpZ2ggU2Nob29sIERpcGxvbWEifV19LCAiYWRkaXRpb25hbFByb3AyIjogeyJuYW1lIjogIm1ham9yIiwgInJlc3RyaWN0aW9ucyI6IFt7InNjaGVtYV9pZCI6ICJQTFFCUzVucjR1RVJzNGUzRk1uRmZOOjI6SGlnaF9TY2hvb2xfRGlwbG9tYToxLjAiLCAiY3JlZF9kZWZfaWQiOiAiUExRQlM1bnI0dUVSczRlM0ZNbkZmTjozOkNMOjQ5OlVTQyBIaWdoIFNjaG9vbCBEaXBsb21hIn1dfX0sICJ2ZXJzaW9uIjogIjEuMCIsICJub25jZSI6ICI3MTUyNjE4MTAxODY1In0="
				}
			}]
		}
	},
	"auto": false,
	"thId": "677c6af5-b312-47ec-9e9d-6873468fef4d",
	"isProcessed": true,
	"connectionId": "GqDhdigmpk46yfihcFu3xjNUdxYitcZgfnyJ3U4t3AXf"
}"

Example:

import 'package:AriesFlutterMobileAgent/AriesAgent.dart';

bool response = await await AriesFlutterMobileAgent.sendProof(
    message.messageId,
    message.messages,
);

Returns Success true

Error Below is a list of errors anticipated: Sample

  1. Common invalid structure {"code":"113","message":"Common invalid structure."}]

Socket Methods

We are using socket for communication between app and mediator agent.

socketInit() -> void


Example:

import 'package:AriesFlutterMobileAgent/AriesAgent.dart';

await AriesFlutterMobileAgent.socketInit();

About

ARNIMA Flutter SDK for Aries Agent

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published