# RequestDidPowerUpHelper
RequestDidPowerUpHelper
allows to easily create a RequestDidPowerUp
object.
# Provided Operations
fromWallet
, creates aRequestDidPowerUp
from the givenwallet
,pairwiseDid
,amount
andprivateKey
.static Future<RequestDidPowerUp> fromWallet({ required Wallet wallet, required String pairwiseDid, required List<StdCoin> amount, required CommercioRSAPrivateKey privateKey, http.Client? client, })
1
2
3
4
5
6
7
# Usage examples
final wallet = Wallet.derive(mnemonic, networkInfo);
final pairwaiseWallet = Wallet.derive(
mnemonic,
networkInfo,
lastDerivationPathSegment: '1',
);
final amount = [
StdCoin(
denom: 'uccc',
amount: '10',
)
];
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: wallet,
pairwiseDid: pairwaiseWallet.bech32Address,
amount: amount,
privateKey: 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
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