From 1744102541211c262938860d9c311776cbc086c5 Mon Sep 17 00:00:00 2001 From: redDwarf03 Date: Wed, 14 Aug 2024 07:54:50 +0200 Subject: [PATCH] chore: :memo: Update RPC methods list --- .../participate/wallet/dapps-communication.md | 82 +++++++++++++++++-- 1 file changed, 73 insertions(+), 9 deletions(-) diff --git a/docs/participate/wallet/dapps-communication.md b/docs/participate/wallet/dapps-communication.md index f226c6c14..eddd1a89a 100644 --- a/docs/participate/wallet/dapps-communication.md +++ b/docs/participate/wallet/dapps-communication.md @@ -108,9 +108,10 @@ Request the wallet to refresh current account info // no response ``` + ## get_accounts -Gets the accounts avalaible on AEWallet. +Gets the accounts available on AEWallet. ### Request @@ -124,9 +125,9 @@ Gets the accounts avalaible on AEWallet. { "accounts": [ { - "shortName": String, // Account name - "serviceName": String, // Service name - "genesisAddress": String, // Genesis address + "shortName": String, // Account name + "serviceName": String // Service name + "genesisAddress": String, // Genesis address } ] } @@ -157,6 +158,7 @@ Signs and sends a transaction. } ``` + ## add_service Add a service in the keychain @@ -179,6 +181,28 @@ Add a service in the keychain } ``` +## remove_service + +Remove a service from the keychain + +### Request + +```typescript +{ + "name": String, // Name of the service +} +``` + +### Success Response + +```typescript +{ + "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. @@ -216,7 +240,7 @@ Derive a keypair for the given service at the index given and get the public key "pathSuffix": String // Additional information to add to a service derivation path (optional - default to empty) } ``` - + ### Success Response ```typescript @@ -225,6 +249,7 @@ Derive a keypair for the given service at the index given and get the public key } ``` + ## keychain_derive_address Derive an address for the given service at the index given @@ -238,7 +263,7 @@ Derive an address for the given service at the index given "pathSuffix": String // Additional information to add to a service derivation path (optional - default to empty) } ``` - + ### Success Response ```typescript @@ -261,9 +286,9 @@ Gets the current account selected on AEWallet. ```typescript { - "shortName": String, // Account name - "serviceName": String, // Service name - "genesisAddress": String, // Genesis address + "shortName": String, // Account name + "serviceName": String // Service name + "genesisAddress": String, // Genesis address } ``` @@ -277,6 +302,10 @@ Signs many transactions. { "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 @@ -302,6 +331,41 @@ Signs many transactions. } ``` +## sign_payloads + +Signs many payloads. + +### Request + +```typescript +{ + "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 + +```typescript +{ + "signedPayloads": [ + { + "signedPayload": String, // Signed payload + } + ] +} +``` + # In conclusion The communication protocol developed by Archethic allows an easy and secure interaction between dApps and the blockchain by delegating the communication to the user’s wallet. The integration methods proposed are simple and efficient, especially thanks to the “Archethic Wallet Client” (AWC) communication library which facilitates the use of the API. Developers can focus on developing their application without having to manage communication with the wallet and the blockchain. This cross-platform solution is therefore a wise choice for developers who want to write dApps that are compatible with different platforms. Finally, the availability of interfaces in the “libjs” library also facilitates integration for developers of applications written in JavaScript.