requestDidPowerUp static method

Future<TransactionResult> requestDidPowerUp(
  1. Wallet senderWallet,
  2. String pairwiseDid,
  3. List<StdCoin> amount,
  4. CommercioRSAPrivateKey privateKey, {
  5. StdFee? fee,
  6. BroadcastingMode? mode,
})

Creates a new transaction to request a Did PowerUp of the given amount from the senderWallet wallet for the given pairwiseDid address. Signs everything that needs to be signed with the private key contained inside the given wallet and the privateKey. Optionally fee and broadcasting mode parameters can be specified.

Implementation

static Future<TransactionResult> requestDidPowerUp(
  Wallet senderWallet,
  String pairwiseDid,
  List<StdCoin> amount,
  CommercioRSAPrivateKey privateKey, {
  StdFee? fee,
  BroadcastingMode? mode,
}) async {
  // Build the RequestDidPowerUp
  final requestDidPowerUp = await RequestDidPowerUpHelper.fromWallet(
    wallet: senderWallet,
    pairwiseDid: pairwiseDid,
    amount: amount,
    privateKey: privateKey,
  );

  // Build the message and send the tx
  final msg = MsgRequestDidPowerUp(
    requestDidPowerUp: requestDidPowerUp,
  );

  return TxHelper.createSignAndSendTx(
    [msg],
    senderWallet,
    fee: fee,
    mode: mode,
  );
}