sign method

Sign a transaction with all the wallet’s signers, in the order specified by every signer’s SignerOrdering

Note that it can’t be guaranteed that every signers will follow the options, but the “software signers” (WIF keys and xprv) defined in this library will.

Implementation

Future<PartiallySignedTransaction> sign(
    {required PartiallySignedTransaction psbt,
    bridge.SignOptions? signOptions}) async {
  try {
    final sbt = await loaderApi.signStaticMethodApi(
        signOptions: signOptions,
        psbtStr: psbt.psbtBase64,
        walletId: _wallet);
    if (sbt == null) {
      throw SignerException(message: "Unable to sign transaction");
    }
    return PartiallySignedTransaction(psbtBase64: sbt);
  } on bridge.Error catch (e) {
    throw handleBdkException(e);
  }
}