Skip to content

feat: [BBND-1376] Support external wallets in the SDK#1415

Merged
rubenbermejo3 merged 21 commits intodevelopfrom
feat/BBND-1376_AdaptAdapters
Mar 10, 2026
Merged

feat: [BBND-1376] Support external wallets in the SDK#1415
rubenbermejo3 merged 21 commits intodevelopfrom
feat/BBND-1376_AdaptAdapters

Conversation

@rubenbermejo3
Copy link

Description:
This PR implements support for external wallets in the SDK, allowing external systems to construct transactions without executing them, enabling custom signing and submission workflows.

  • Add EXTERNAL_HEDERA and EXTERNAL_EVM wallet types to SupportedWallets enum
  • Add SerializedTransactionData and TransactionMetadata interfaces for external transaction handling
  • Create ExternalHederaTransactionAdapter and ExternalEVMTransactionAdapter for transaction serialization
  • Add ExternalWalletSettings interface with validStartOffsetMinutes configuration
  • Update TransactionService with isExternalWallet() method and handler registration
  • Modify all command responses to include optional serializedTransactionData field
  • Update all command handlers to handle external wallet conditional logic
  • Add union types to public API methods returning TransactionResult | SerializedTransactionData
  • Update ConnectCommandHandler to support external wallet settings configuration
  • Register external adapters in dependency injection container
  • Export new types and interfaces in public API

Related issue(s):

Fixes #BBND-1376

Notes for reviewer:

  • External wallets return serialized transaction bytes instead of executing transactions
  • EXTERNAL_HEDERA provides native Hedera transaction bytes
  • EXTERNAL_EVM provides EVM-compatible RLP encoded transactions
  • All existing functionality remains unchanged for regular wallet types
  • Includes proper error handling and validation for external wallet operations

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@rubenbermejo3 rubenbermejo3 self-assigned this Mar 2, 2026
@rubenbermejo3 rubenbermejo3 requested review from a team as code owners March 2, 2026 09:56
@swirlds-automation
Copy link

swirlds-automation commented Mar 2, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@rubenbermejo3 rubenbermejo3 marked this pull request as draft March 2, 2026 10:07
@rubenbermejo3 rubenbermejo3 force-pushed the feat/BBND-1376_AdaptAdapters branch from 40df3bb to fb20d21 Compare March 2, 2026 10:32
Signed-off-by: rbermejo <ruben@io.builders>
@rubenbermejo3 rubenbermejo3 force-pushed the feat/BBND-1376_AdaptAdapters branch from fb20d21 to ce9a592 Compare March 2, 2026 10:39
@rubenbermejo3 rubenbermejo3 marked this pull request as ready for review March 2, 2026 12:06
rubenbermejo3 and others added 15 commits March 2, 2026 15:04
Signed-off-by: rbermejo <ruben@io.builders>
Signed-off-by: Ruben <ruben@io.builders>
Signed-off-by: Ruben <ruben@io.builders>
Signed-off-by: Ruben <ruben@io.builders>
Signed-off-by: adrian <adrian@io.builders>
Signed-off-by: Ruben <ruben@io.builders>
…pression

Signed-off-by: adrian <adrian@io.builders>
Signed-off-by: Ruben <ruben@io.builders>
…te handling

Signed-off-by: adrian <adrian@io.builders>
…lude proxy address handling

Signed-off-by: adrian <adrian@io.builders>
Signed-off-by: Ruben <ruben@io.builders>
…transaction data without affecting the rest of methods (retro-compability)

Signed-off-by: Ruben <ruben@io.builders>
Signed-off-by: Ruben <ruben@io.builders>
…ptAdapters

Signed-off-by: Ruben <ruben@io.builders>
Signed-off-by: Ruben <ruben@io.builders>
Signed-off-by: Ruben <ruben@io.builders>
Signed-off-by: Ruben <ruben@io.builders>
Signed-off-by: Ruben <ruben@io.builders>
@ruben-martinez-iob
Copy link

Severidad Descripción
Baja Los build* usan throw new Error(...) (plain). El port-in usa exclusivamente errores tipados (BaseError). EmptyResponse (ErrorCode 30008) ya existe para este caso. Ver detalle debajo.

Detalle: reemplazar build* con error no tipado

Archivos afectados (39 ocurrencias totales):

Archivo Ocurrencias
packages/sdk/src/port/in/StableCoin.ts 22
packages/sdk/src/port/in/Role.ts 10
packages/sdk/src/port/in/CustomFees.ts 3
packages/sdk/src/port/in/Management.ts 3
packages/sdk/src/port/in/ReserveDataFeed.ts 1

Cambio a aplicar en cada archivo:

// 1. Añadir import (relativo desde packages/sdk/src/port/in/)
import { EmptyResponse } from '../../app/service/error/EmptyResponse.js';

// 2. Sustituir todas las guardas (patrón: replace_all)
// Antes
if (!response.serializedTransactionData) throw new Error("Expected serialized transaction data but none was returned");
// Después
if (!response.serializedTransactionData) throw new EmptyResponse('buildXxx');

Referencia: mismo patrón usado en TransactionService.ts:350:

if (!res.id) throw new EmptyResponse(className);

Signed-off-by: Ruben <ruben@io.builders>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@rubenbermejo3 rubenbermejo3 merged commit acf8861 into develop Mar 10, 2026
18 of 20 checks passed
@rubenbermejo3 rubenbermejo3 deleted the feat/BBND-1376_AdaptAdapters branch March 10, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants