-
Notifications
You must be signed in to change notification settings - Fork 24
/
list_transactions.cs
43 lines (30 loc) · 1.11 KB
/
list_transactions.cs
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
39
40
41
42
// This is tested separetely, not tested with uniffi test-framework
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using uniffi.lwk;
class Program
{
static void Main(string[] args)
{
Network network = Network.Testnet();
Console.WriteLine(network);
Mnemonic mnemonic = new Mnemonic("abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about");
Console.WriteLine(mnemonic);
ElectrumClient client = network.DefaultElectrumClient();
client.Ping();
Signer signer = new Signer(mnemonic, network);
WolletDescriptor desc = signer.WpkhSlip77Descriptor();
Console.WriteLine(desc);
Wollet wollet = new Wollet(network, desc, null);
Update update = client.FullScan(wollet)!;
wollet.ApplyUpdate(update);
List<WalletTx> txList = wollet.Transactions();
Console.WriteLine("Transactions {0}:", txList.Count);
foreach (WalletTx tx in txList) {
Console.WriteLine(tx.Txid());
}
}
}