# Request Did PowerUp Helper

Request Did PowerUp Helper allows to easily create a Did PowerUp request.

# Provided Operations

  1. Creates a RequestDidPowerUpHelper from the given wallet, pairwiseDid, amount and privateKey.

    static Future<RequestDidPowerUp> fromWallet(
      Wallet wallet,
      String pairwiseDid,
      List<StdCoin> amount,
      RSAPrivateKey privateKey,
    ) async
    
    1
    2
    3
    4
    5
    6

# Usage examples

final networkInfo = NetworkInfo(
  bech32Hrp: 'did:com:',
  lcdUrl: 'http://localhost:1317',
);

final mnemonic = ['will', 'hard', ..., 'man'];
final wallet = Wallet.derive(mnemonic, networkInfo);
final walletPariwaised = Wallet.derive(
  mnemonic, networkInfo, lastDerivationPathSegment: '1',
);

final amount = [
  StdCoin(
    denom: 'ucommercio',
    amount: '100',
  )
];

final rsaKey = RSAKeyParser.parseKeyFromPem(
  """
  -----BEGIN PRIVATE KEY-----
  MIIEvQ...
  -----END PRIVATE KEY-----
  """
);
final rsaPrivateKey = RSAPrivateKey(rsaKey);

try {
  // --- Create Did PowerUp request
  final requestDidPowerUp = await RequestDidPowerUpHelper.fromWallet(
    wallet,
    walletPariwaised.bech32Address,
    amount,
    rsaPrivateKey,
  );
} catch (error) {
  throw error;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38