पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv2.3.3

archethic_wallet_client

Archethic वॉलेट RPC API के साथ बातचीत करने के लिए एक क्लाइंट Dart लाइब्रेरी।

AndroidiOSmacOSWindowsLinux
30-दिन डाउनलोड
277
लाइक
2
Pub अंक
150

पैकेज इंस्टॉल करें

flutter pub add archethic_wallet_client

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

archethic_wallet_client एक Dart प per है जो Archethic वॉलेट RPC API के साथ बिना किसी दिक्कत के बातचीत करने में सक्षम बनाता है। यह विकासकर्ताओं को क्रिप्टोग्राफिक कुंजियों को प्रबंधित करने, लेनदेन के हस्ताक्षर करने और कई प्लेटफॉर्मों पर वॉलेट राज्य को जांचने के लिए उपकरण प्रदान करता है। Web3 एप्लिकेशन के लिए डिज़ाइन किया गया, यह Archethic ब्लॉकचेन पर सुरक्षित, डिसेंट्रलाइज्ड पहचान और संपत्ति प्रबंधन का समर्थन करता है। यह पुस्तकालय Android, iOS, macOS, Windows और Linux के साथ संगत है, जिससे यह क्रॉस-प्लेटफॉर्म ब्लॉकचेन एप्लिकेशन के लिए आदर्श है। स्पष्ट दस्तावेज़ीकरण और Flutter के pub पैकेज मैनेजर के माध्यम से एकीकरण के साथ, यह आधुनिक क्रिप्टो-नेटिव प्रोजेक्ट्स में वॉलेट संचालन को सरल बनाता है।

उपयोग

  • फ्लटर ऐप्स में वॉलेट कार्यक्षमता को एकीकृत करना
  • Archethic ब्लॉकचेन पर डिजिटल संपत्ति का प्रबंधन करें
  • ब्लॉकचेन पहचान के माध्यम से उपयोगकर्ता प्रमाणीकरण सक्षम करना
  • सुरक्षित लेनदेन साइनिंग के साथ डिसेंट्रलाइज्ड एप्लिकेशन बनाना
  • Archethic वॉलेट RPC एंडपॉइंट्स से कनेक्ट कर रहे हैं

मुख्य विशेषताएँ

  • प्लेटफॉर्म समर्थन (Android, iOS, macOS, Windows, Linux)
  • सुरक्षित की प्रबंधन और लेनदेन साइनिंग
  • Archethic वॉलेट के साथ RPC API एकीकरण
  • pub के माध्यम से सरल फ्लटर पैकेज स्थापना
  • निर्मित त्रुटि संहार और प्रतिक्रिया विश्लेषण

इनके लिए उपयुक्त

  • Flutter विकासकर्मी वेब3 एप्लिकेशन बना रहे हैं
  • Archethic का उपयोग करके ब्लॉकचेन एप्लिकेशन निर्माता
  • मोबाइल और डेस्कटॉप ऐप में सुरक्षित वॉलेट इंटरैक्शन की आवश्यकता वाली टीमें
  • डिसेंट्रलाइज्ड आईडेंटिटी समाधानों को एकीकृत करने वाले विकासकर्मी
  • Archethic वॉलेट के साथ विश्वसनीय RPC संचार की आवश्यकता वाले प्रोजेक्ट

विचार योग्य बातें

  • Archethic ब्लॉकचेन अवधारणाओं को समझने की आवश्यकता है
  • स्थिर RPC एंडपॉइंट उपलब्धता पर निर्भर
  • Archethic पारिस्थितिकी तंत्र की सुविधाओं तक सीमित
  • निजी कुंजी भंडारण के लिए अतिरिक्त सुरक्षा उपायों की आवश्यकता हो सकती है
  • गैर-Archethic ब्लॉकचेन वातावरण के लिए अनुपयुक्त

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

A client library to interact with ArchethicWallet RPC API.

What is ArchethicWallet RPC

Check AEIP-4 to know more.

Usage

Add dependency

$ flutter pub add archethic-wallet-client

Setup Deeplink

If your application is intended to work on Android or iOS, you must setup a Deeplink endpoint on your application.

This is required to get DeeplinkRPC to work.

Android

A queries element must be added to your manifest as a child of the root element.

    <queries>
        <!-- AEWallet deeplink support -->
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data
                android:scheme="aewallet"
                android:host="archethic.tech" />
        </intent>
    </queries>

Add a meta-data tag and intent filter to AndroidManifest.xml inside the activity tag with the ".MainActivity" name:

<!-- AEWallet deeplink support -->
<meta-data
    android:name="flutter_deeplinking_enabled"
    android:value="true" />
<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <!-- Replace `flutterdappexample` by your custom deeplink scheme -->
    <!-- Replace `dapp.example` by your custom deeplink host -->
    <!-- These will be used to compose the replyUrl when sending RPCs -->
    <data
        android:scheme="flutterdappexample"  
        android:host="dapp.example" />
</intent-filter>
iOS

Add LSApplicationQueriesSchemes entries in your Info.plist file.

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>aewallet</string>
</array>

Add two new keys to Info.plist in the ios/Runner directory:

<key>FlutterDeepLinkingEnabled</key>
<true/>
<key>CFBundleURLTypes</key>
<array>
    <dict>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <!-- Replace `flutterdappexample` by your custom deeplink scheme -->
    <!-- Replace `dapp.example` by your custom deeplink host -->
    <!-- These will be used to compose the replyUrl when sending RPCs -->
    <key>CFBundleURLName</key>
    <string>dapp.example</string>
    <key>CFBundleURLSchemes</key>
    <array>
    <string>flutterdappexample</string>
    </array>
    </dict>
</array>

Other Native setups

MacOS

Add:

<key>com.apple.security.network.client</key>
<true/>

to macos/Runner/DebugProfile.entitlements and macos/Runner/Release.entitlements.

Client setup

Instanciate a client
import 'package:archethic-wallet-client/archethic-wallet-client.dart';

// 1. Instanciate a Client
final _aewalletClient = ArchethicDAppClient.auto(
  origin: const RequestOrigin(        // Sets Dapp identity informations. Might be displayed to the user.
    name: 'FlutterDappExample',
  ),
  replyBaseUrl: 'flutterdappexample://dapp.example',    // Deeplink Dapp endpoint
);
[Deeplink only] Listen to deeplink responses

Handle incoming deeplinks in the onGenerateRoute method :

// 2. Listens to deeplink responses
class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Dapp Demo',
      home: MyHome(),
      onGenerateRoute: (settings) {
        if ((_aewalletClient as DeeplinkArchethicDappClient)
            .handleRoute(settings.name)) return;

        //... do everything else needed by your application
        return null;
      },
    );
  }
}
Emit requests
final response = await _aewalletClient.sendTransaction(
    transactionJsonData,
);

response.when(
    failure: (failure) {
        log(
            'Transaction failed',
            error: failure,
        );
    },
    success: (result) {
        log(
            'Transaction succeed : ${json.encode(result)}',
        );
    },
);

RPC Methods

There are two kinds of methods :

  • one time call
  • subscriptions.

Subscriptions won't be available on Deeplink channel because of technical limitations.

get_endpoint

Gets the endpoint URL used on AEWallet.

Request
// no payload in request
Success Response
{
  "endpointUrl": String // Endpoint URL
}

refresh_current_account

Request the wallet to refresh current account info

Request
// no payload in request
Success Response
// no response

get_accounts

Gets the accounts available on AEWallet.

Request
// No payload
Success Response
{
  "accounts": [
    {
      "shortName": String,      // Account name
      "serviceName": String     // Service name
      "genesisAddress": String, // Genesis address
    }
  ]
}

send_transaction

Signs and sends a transaction.

Request
{
  "type": String,                 // Type of transaction
  "version": Number,              // Version of the transaction (used for backward compatiblity)
  "data": Object,                 // Transaction data zone (identity, keychain, smart contract, etc.)
  "generateEncryptedSeedSC": bool // (Optional) : if true, add a encrypted (by storage nonce public key) seed in the transaction's ownerships to allow nodes to manage smart contract
}
Success Response
{
  "transactionAddress": String,  // Sent transaction address.
  "nbConfirmations": Number,     // Number of received confirmations.
  "maxConfirmations": Number,    // Max number of confirmations.
}

add_service

Add a service in the keychain

Request
{
  "name": String,                 // Name of the service
}
Success Response
{
  "transactionAddress": String,  // Transaction address.
  "nbConfirmations": Number,     // Number of received confirmations.
  "maxConfirmations": Number,    // Max number of confirmations.
}

remove_service

Remove a service from the keychain

Request
{
  "name": String,                 // Name of the service
}
Success Response
{
  "transactionAddress": String,  // Transaction address.
  "nbConfirmations": Number,     // Number of received confirmations.
  "maxConfirmations": Number,    // Max number of confirmations.
}

get_services_from_keychain

Gets keychain's services from the keychain connected to AEWallet.

Request
// No payload
Success Response
{
  "services": [
    {
      "derivationPath": String, // Derivation path
      "curve": String, // Curve
      "hashAlgo": String // Hash Algo
    }
  ]
}

keychain_derive_keypair

Derive a keypair for the given service at the index given and get the public key

Request
{
  "serviceName": String,  // Service name to identify the derivation path to use
  "index": Number,        // Chain index to derive (optional - default to 0)
  "pathSuffix": String    // Additional information to add to a service derivation path (optional - default to empty)
}
Success Response
{
  "publicKey": String     // Public key of the service at the index given
}

keychain_derive_address

Derive an address for the given service at the index given

Request
{
  "serviceName": String,  // Service name to identify the derivation path to use
  "index": Number,        // Chain index to derive (optional - default to 0)
  "pathSuffix": String    // Additional information to add to a service derivation path (optional - default to empty)
}
Success Response
{
  "address": String     // Address derived
}

get_current_account

Gets the current account selected on AEWallet.

Request
// No payload
Success Response
{
  "shortName": String,      // Account name
  "serviceName": String     // Service name
  "genesisAddress": String, // Genesis address
}

sign_transactions

Signs many transactions.

Request
{
  "serviceName": String,              // Service name to use to sign the tx
  "pathSuffix": String,               // Additional information to add to a service derivation path (optional)
  "description": String {             // Readable description to explain the purpose of signing transactions (locale + description)
    "en": "Readable description in English",
    "fr": "Description lisible en français",
  },
  "transactions": [
    {
      "type": String,                 // Type of transaction
      "version": Number,              // Version of the transaction (used for backward compatiblity)
      "data": Object                  // Transaction data zone (identity, keychain, smart contract, etc.)
    }
  ]
}
Success Response
{
  "signedTxs": [
    {
      "address": String,              // Address: hash of the new generated public key for the given transaction
      "previousPublicKey": String,    // Previous generated public key matching the previous signature
      "previousSignature": String,    // Signature from the previous public key
      "originSignature": String       // Signature from the device which originated the transaction (used in the Proof of work)
    }
  ]
}

sign_payloads

Signs many payloads.

Request
{
  "serviceName": String,              // Service name to use to sign the payload
  "pathSuffix": String,               // Additional information to add to a service derivation path (optional)
  "description": String {             // Readable description to explain the purpose of signing payloads (locale + description)
    "en": "Readable description in English",
    "fr": "Description lisible en français",
  },
  "payloads": [
    {
      "payload": String,              // Payload to sign
      "isHexa": boolean               // Precise if the payload if in hexadecimal format
    }
  ]
}
Success Response
{
  "signedPayloads": [
    {
      "signedPayload": String,        // Signed payload
    }
  ]
}

encrypt_payloads

Encrypt many payloads with account public key.

Request
{
  "serviceName": String,              // Service name to use to encrypt the payload
  "pathSuffix": String,               // Additional information to add to a service derivation path (optional)
  "payloads": [
    {
      "payload": String,              // Payload to encrypt
      "isHexa": boolean               // Precise if the payload if in hexadecimal format
    }
  ]
}
Success Response
{
  "encryptedPayloads": [
    {
      "encryptedPayload": String,        // Encrypted payload
    }
  ]
}

decrypt_payloads

Decrypt many payloads with account private key.

Request
{
  "serviceName": String,              // Service name to use to decrypt the payload
  "pathSuffix": String,               // Additional information to add to a service derivation path (optional)
    "description": String {             // Readable description to explain the purpose of decrypting payloads (locale + description)
    "en": "Readable description in English",
    "fr": "Description lisible en français",
  },
  "payloads": [
    {
      "payload": String,              // Payload to decrypt
      "isHexa": boolean               // Precise if the payload if in hexadecimal format
    }
  ]
}
Success Response
{
  "decryptedPayloads": [
    {
      "decryptedPayload": String,        // Decrypted payload
    }
  ]
}

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 9 आइटम

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट