# Commercio Doc Receipt Helper

Allows to easily create a CommercioDocReceipt and perform common related operations.

# Provide Operations

  1. Creates a CommercioDoc from the given wallet, recipient, txHash, documentId and optionally proof.

    static CommercioDocReceipt fromWallet({
       Wallet wallet,
       String recipient,
       String txHash,
       String documentId,
      String proof = "",
    })
    
    1
    2
    3
    4
    5
    6
    7

# Usage examples

...
final docId = Uuid().v4();
final commercioDoc = CommercioDocHelper.fromWallet(...

final response = await DocsHelper.shareDocumentsList(
  [commercioDoc],
  senderWallet,
);
String txHash = response.hash;
...

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

final senderDid = senderWallet.bech32Address;
final recipientMnemonic = ['mad', 'accuse', ..., 'eternal'];
final recipientWallet = Wallet.derive(recipientMnemonic, networkInfo);

final receipt = CommercioDocReceiptHelper.fromWallet(
  wallet: recipientWallet,
  recipient: senderDid,
  txHash: txHash,
  documentId: docId,
);
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