# 4.4 documentList(sent/received)

# Use cases

Get the document's list sent from an acccount.

Get the document's list received from an acccount.

# Tools

The Commercio SDK, our own open source tool to format transactions to Commercio.network

# Functions and APIs

  • DocsHelper getSendDocuments;
  • DocsHelper getReceivedDocuments.

# Step by step sequence

  1. Generate the wallet;
  2. Execute the DocsHelper getSendDocuments function to get the sent document's list;
  3. Execute DocsHelper getReceivedDocuments function to get the received document's list.

# Code Examples

Here's an example of the implemetation in all the available languages.

# Dart

final wallet = Wallet.derive(mnemonic, networkInfo);

final sentDocs = await DocsHelper.getSendDocuments(
  "did:com:1z6ezqssnqqc6un3henna0flr05aukcwcr5ge6t",
  wallet,
);

final receivedDocs = await DocsHelper.getReceivedDocuments(
  "did:com:1z6ezqssnqqc6un3henna0flr05aukcwcr5ge6t",
  wallet,
);
1
2
3
4
5
6
7
8
9
10
11

# Kotlin

val wallet = Wallet.derive(mnemonic = mnemonic, networkInfo = networkInfo)

val sentDocsURL = "${wallet.networkInfo.lcdUrl}/docs/${wallet.bech32Address}/sent"

val sentDocs = Network.queryChain<List<Objects>>(url = sentDocsURL)

val receivedDocsURL = "${wallet.networkInfo.lcdUrl}/docs/${wallet.bech32Address}/received"

val receivedDocs = Network.queryChain<List<Objects>>(url = receivedDocsURL)
1
2
3
4
5
6
7
8
9

# C#

var wallet = commercio.sacco.lib.Wallet.derive(mnemonic, networkInfo);

var sentDocsURL = $"{wallet.networkInfo.lcdUrl}/docs/{wallet.bech32Address}/sent";

var sentDocs = commercio.sdk.Network.queryChain(sentDocsURL);

var receivedDocsURL = $"{wallet.networkInfo.lcdUrl}/docs/{wallet.bech32Address}/received";

var receivedDocs = commercio.sdk.Network.queryChain(receivedDocsURL);
1
2
3
4
5
6
7
8
9