archethic-foundation / archethic-foundation/libjs

[WalletRPC] Implement encrypt & decrypt methods

Open
#227 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
19
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Following WalletRPC methods are missing in wallet client.

## encrypt_payloads

Encrypt many payloads with account public key.

### Request

```typescript
{
"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

```typescript
{
"encryptedPayloads": [
{
"encryptedPayload": String, // Encrypted payload
}
]
}
```

## decrypt_payloads

Decrypt many payloads with account private key.

### Request

```typescript
{
"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

```typescript
{
"decryptedPayloads": [
{
"decryptedPayload": String, // Decrypted payload
}
]
}
```

### Additional context

_No response_

### Epic

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the WalletRPC client and its existing RPC method implementations, then compare their request and response handling with the encrypt_payloads and decrypt_payloads schemas in this issue. Done means both methods support the listed fields and return the corresponding encryptedPayloads or decryptedPayloads results, with coverage added where the project’s existing tests belong.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, cryptography
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.