# 4.4 documentList(sent/received)

# Use cases

Get the sent document's list of an acccount.

Get the received document's list of an acccount.

# Tools

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

# Functions and APIs

  • Network queryChain.

# Step by step sequence

  1. Generate the wallet;
  2. Execute the Network queryChain function to get the sent document's list;
  3. Execute the Network queryChain 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 sentDocsURL = '${wallet.networkInfo.lcdUrl}/docs/${wallet.bech32Address}/sent';

final sentDocs = await Network.queryChain(sentDocsURL);

final receivedDocsURL = '${wallet.networkInfo.lcdUrl}/docs/${wallet.bech32Address}/received';

final receivedDocs = await Network.queryChain(receivedDocsURL);
1
2
3
4
5
6
7
8
9

# 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