sign

suspend fun sign(preImageTx: PreImageTx, groupId: String): Result<String>

Sign a transaction using MPC.

This method takes the PreImageTx from preImageHash and performs:

  1. Extract data_hash from preSigningOutput

  2. Load MPC credentials from storage using groupId

  3. Presign and sign using MPC

  4. Compile the signed transaction using signingInputData and WalletCore

The returned signed transaction can then be broadcast using sendTransaction.

Usage from Flutter:

final preImageTx = await sdk.blockchainService.preImageHash(tx, from, fee);
final signedTx = await sdk.blockchainService.sign(preImageTx, groupId);
final broadcast = await sdk.blockchainService.sendTransaction(network, signedTx);

Return

Result containing the signed transaction hex string

Parameters

preImageTx

The PreImageTx from preImageHash

groupId

The MPC group ID for credential lookup