Skip to content

Commit

Permalink
chore: 📝 Update RPC methods list
Browse files Browse the repository at this point in the history
  • Loading branch information
redDwarf03 committed Aug 14, 2024
1 parent c03d7d2 commit 1744102
Showing 1 changed file with 73 additions and 9 deletions.
82 changes: 73 additions & 9 deletions docs/participate/wallet/dapps-communication.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
}
]
}
Expand Down Expand Up @@ -157,6 +158,7 @@ Signs and sends a transaction.
}
```


## add_service

Add a service in the keychain
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
}
```

Expand All @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 1744102

Please sign in to comment.