signAndExecuteSignableTransaction method

Future<SuiExecuteTransactionResponse> signAndExecuteSignableTransaction({
  1. required SignableTransaction transaction,
  2. SuiTransactionBlockResponseOptions? options,
  3. ExecuteTransaction requestType = ExecuteTransaction.WaitForLocalExecution,
})

Implementation

Future<SuiExecuteTransactionResponse> signAndExecuteSignableTransaction({
  required SignableTransaction transaction,
  SuiTransactionBlockResponseOptions? options,
  ExecuteTransaction requestType = ExecuteTransaction.WaitForLocalExecution
}) async {
  switch (transaction.kind) {
    case UnserializedSignableTransaction.bytes:
      return await signAndExecuteTransaction(
        transaction: Uint8List.fromList(transaction.data),
        options: options,
        requestType: requestType
      );
    case UnserializedSignableTransaction.moveCall:
      return executeMoveCall(
        transaction.data,
        options: options,
        requestType: requestType
      );
    case UnserializedSignableTransaction.transferSui:
      return transferSui(
        transaction.data,
        options: options,
        requestType: requestType
      );
    case UnserializedSignableTransaction.transferObject:
      return transferObject(
        transaction.data,
        options: options,
        requestType: requestType
      );
    case UnserializedSignableTransaction.pay:
      return pay(
        transaction.data,
        options: options,
        requestType: requestType
      );
    case UnserializedSignableTransaction.paySui:
      return paySui(
        transaction.data,
        options: options,
        requestType: requestType
      );
    case UnserializedSignableTransaction.payAllSui:
      return payAllSui(
        transaction.data,
        options: options,
        requestType: requestType
      );
    case UnserializedSignableTransaction.publish:
      return publish(
        transaction.data,
        options: options,
        requestType: requestType
      );
    case UnserializedSignableTransaction.addStake:
      return addStake(
          transaction.data,
          options: options,
          requestType: requestType
      );
    case UnserializedSignableTransaction.withdrawStake:
      return withdrawStake(
          transaction.data,
          options: options,
          requestType: requestType
      );
    case UnserializedSignableTransaction.splitCoin:
      return splitCoin(
          transaction.data,
          options: options,
          requestType: requestType
      );
    case UnserializedSignableTransaction.splitCoinEqual:
      return splitCoinEqual(
          transaction.data,
          options: options,
          requestType: requestType
      );
    default:
      throw ArgumentError(
        'Error, unknown transaction kind: "${transaction.kind}"'
      );
  }
}