Skip to content

Commit 642bb25

Browse files
authored
ui: list placeholder
1 parent 0ed61ad commit 642bb25

15 files changed

+306
-221
lines changed

BDKSwiftExampleWallet.xcodeproj/project.pbxproj

+12
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
AE6715FD2A9AC056005C193F /* PriceServiceError.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6715FC2A9AC056005C193F /* PriceServiceError.swift */; };
3434
AE6715FF2A9AC066005C193F /* FeeServiceError.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6715FE2A9AC066005C193F /* FeeServiceError.swift */; };
3535
AE6716012A9AC089005C193F /* KeyServiceError.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6716002A9AC089005C193F /* KeyServiceError.swift */; };
36+
AE6F34D62AA6BF450087E700 /* TransactionDetails+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6F34D52AA6BF450087E700 /* TransactionDetails+Extensions.swift */; };
37+
AE6F34D82AA6C1800087E700 /* Network+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6F34D72AA6C1800087E700 /* Network+Extensions.swift */; };
38+
AE6F34DA2AA6C1E00087E700 /* Balance+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6F34D92AA6C1E00087E700 /* Balance+Extensions.swift */; };
3639
AE79538E2A2D59F000CCB277 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE79538D2A2D59F000CCB277 /* Constants.swift */; };
3740
AE7953902A2D5B4400CCB277 /* BDKSwiftExampleWalletError.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE79538F2A2D5B4400CCB277 /* BDKSwiftExampleWalletError.swift */; };
3841
AE7D5A0E2A7EE62200EAC8CE /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = AE7D5A0D2A7EE62200EAC8CE /* KeychainAccess */; };
@@ -93,6 +96,9 @@
9396
AE6715FC2A9AC056005C193F /* PriceServiceError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PriceServiceError.swift; sourceTree = "<group>"; };
9497
AE6715FE2A9AC066005C193F /* FeeServiceError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeeServiceError.swift; sourceTree = "<group>"; };
9598
AE6716002A9AC089005C193F /* KeyServiceError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyServiceError.swift; sourceTree = "<group>"; };
99+
AE6F34D52AA6BF450087E700 /* TransactionDetails+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TransactionDetails+Extensions.swift"; sourceTree = "<group>"; };
100+
AE6F34D72AA6C1800087E700 /* Network+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Network+Extensions.swift"; sourceTree = "<group>"; };
101+
AE6F34D92AA6C1E00087E700 /* Balance+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Balance+Extensions.swift"; sourceTree = "<group>"; };
96102
AE79538D2A2D59F000CCB277 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
97103
AE79538F2A2D5B4400CCB277 /* BDKSwiftExampleWalletError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BDKSwiftExampleWalletError.swift; sourceTree = "<group>"; };
98104
AE7E68952A59A37300368D82 /* BDKSwiftExampleWalletInt+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BDKSwiftExampleWalletInt+Extensions.swift"; sourceTree = "<group>"; };
@@ -161,6 +167,9 @@
161167
AE18E9372A9528200019D2A4 /* Bundle+Extensions.swift */,
162168
A73F7A352A3B778E00B87FC6 /* Int+Extensions.swift */,
163169
AE7F67062A744CE200CED561 /* Double+Extensions.swift */,
170+
AE6F34D52AA6BF450087E700 /* TransactionDetails+Extensions.swift */,
171+
AE6F34D72AA6C1800087E700 /* Network+Extensions.swift */,
172+
AE6F34D92AA6C1E00087E700 /* Balance+Extensions.swift */,
164173
);
165174
path = Extensions;
166175
sourceTree = "<group>";
@@ -474,12 +483,14 @@
474483
AE1C34242A424456008F807A /* ReceiveView.swift in Sources */,
475484
AEB130C92A44E4850087785B /* TransactionDetailsView.swift in Sources */,
476485
AE6715FD2A9AC056005C193F /* PriceServiceError.swift in Sources */,
486+
AE6F34D82AA6C1800087E700 /* Network+Extensions.swift in Sources */,
477487
AE1390C72A7DB0AF0098127A /* KeyService.swift in Sources */,
478488
AED4CC0A2A1D297600CE1831 /* BDKService.swift in Sources */,
479489
AED4CC102A1D522100CE1831 /* WalletView.swift in Sources */,
480490
AE7F67092A7451AA00CED561 /* Price.swift in Sources */,
481491
AE7F67072A744CE200CED561 /* Double+Extensions.swift in Sources */,
482492
A73F7A362A3B778E00B87FC6 /* Int+Extensions.swift in Sources */,
493+
AE6F34DA2AA6C1E00087E700 /* Balance+Extensions.swift in Sources */,
483494
AED4CC0C2A1D3A9400CE1831 /* OnboardingView.swift in Sources */,
484495
AE6716012A9AC089005C193F /* KeyServiceError.swift in Sources */,
485496
AE0C30FB2A804B95008F1EAE /* WalletViewModel.swift in Sources */,
@@ -490,6 +501,7 @@
490501
AE0C30F92A804B65008F1EAE /* OnboardingViewModel.swift in Sources */,
491502
AE3902A42A3B4CD900BEC318 /* TabHomeView.swift in Sources */,
492503
AE0C30FD2A804BC1008F1EAE /* ReceiveViewModel.swift in Sources */,
504+
AE6F34D62AA6BF450087E700 /* TransactionDetails+Extensions.swift in Sources */,
493505
);
494506
runOnlyForDeploymentPostprocessing = 0;
495507
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// Balance+Extensions.swift
3+
// BDKSwiftExampleWallet
4+
//
5+
// Created by Matthew Ramsden on 9/4/23.
6+
//
7+
8+
import BitcoinDevKit
9+
import Foundation
10+
11+
#if DEBUG
12+
let mockBalance = Balance(
13+
immature: 0,
14+
trustedPending: 0,
15+
untrustedPending: 0,
16+
confirmed: 21_418_468,
17+
spendable: 21_418_468,
18+
total: 21_418_468
19+
)
20+
let mockBalanceZero = Balance(
21+
immature: 0,
22+
trustedPending: 0,
23+
untrustedPending: 0,
24+
confirmed: 21_418_468,
25+
spendable: 0,
26+
total: 0
27+
)
28+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// Network+Extensions.swift
3+
// BDKSwiftExampleWallet
4+
//
5+
// Created by Matthew Ramsden on 9/4/23.
6+
//
7+
8+
import BitcoinDevKit
9+
import Foundation
10+
11+
#if DEBUG
12+
let mockKeyClientNetwork = Network.regtest
13+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
//
2+
// TransactionDetails+Extensions.swift
3+
// BDKSwiftExampleWallet
4+
//
5+
// Created by Matthew Ramsden on 9/4/23.
6+
//
7+
8+
import BitcoinDevKit
9+
import Foundation
10+
11+
// Needed for placeholder view
12+
let mockTransactionDetail = TransactionDetails(
13+
transaction: nil,
14+
fee: Optional(2820),
15+
received: 100_000,
16+
sent: 0,
17+
txid: "cdcc4d287e4780d25c577d4f5726c7d585625170559f0b294da20b55ffa2b009",
18+
confirmationTime: Optional(
19+
BlockTime(height: 178497, timestamp: 1_687_465_081)
20+
)
21+
)
22+
23+
#if DEBUG
24+
let mockTransactionDetails =
25+
[
26+
TransactionDetails(
27+
transaction: nil,
28+
fee: Optional(2820),
29+
received: 10_000_000,
30+
sent: 0,
31+
txid: "cdcc4d287e4780d25c577d4f5726c7d585625170559f0b294da20b55ffa2b009",
32+
confirmationTime: Optional(
33+
BitcoinDevKit.BlockTime(height: 178497, timestamp: 1_687_465_081)
34+
)
35+
),
36+
TransactionDetails(
37+
transaction: nil,
38+
fee: Optional(2820),
39+
received: 100000,
40+
sent: 0,
41+
txid: "1cd378b13f6c9ed506ef6c24337da7a36950b0b4611af070d6636ccc408f3130",
42+
confirmationTime: Optional(
43+
BitcoinDevKit.BlockTime(height: 357327, timestamp: 1_693_053_486)
44+
)
45+
),
46+
TransactionDetails(
47+
transaction: nil,
48+
fee: Optional(2820),
49+
received: 100000,
50+
sent: 0,
51+
txid: "4da9ebbb7438c5a27ee6a219d2c7568c33b4ccc0d49d9d43960227de7c7beb34",
52+
confirmationTime: Optional(
53+
BitcoinDevKit.BlockTime(height: 213729, timestamp: 1_688_565_953)
54+
)
55+
),
56+
TransactionDetails(
57+
transaction: nil,
58+
fee: Optional(141),
59+
received: 6250,
60+
sent: 0,
61+
txid: "68a1262ddbf1ce0b840b0f06429a8df04a4474e275a8707ec3e2a432b7178f44",
62+
confirmationTime: Optional(
63+
BitcoinDevKit.BlockTime(height: 269233, timestamp: 1_690_301_719)
64+
)
65+
),
66+
TransactionDetails(
67+
transaction: nil,
68+
fee: Optional(141),
69+
received: 74859,
70+
sent: 100000,
71+
txid: "6d65a5e57df85221b2c4c882e69de36ac775e57c044ffe19721a456597701459",
72+
confirmationTime: Optional(
73+
BitcoinDevKit.BlockTime(height: 269189, timestamp: 1_690_300_353)
74+
)
75+
),
76+
TransactionDetails(
77+
transaction: nil,
78+
fee: Optional(2820),
79+
received: 10_000_000,
80+
sent: 0,
81+
txid: "cddb6950ac9ac03fde059019389cc5be1f399852d5ce073a3d4d1fbb544d5f62",
82+
confirmationTime: Optional(
83+
BitcoinDevKit.BlockTime(height: 172976, timestamp: 1_687_292_803)
84+
)
85+
),
86+
TransactionDetails(
87+
transaction: nil,
88+
fee: Optional(2820),
89+
received: 1_000_000,
90+
sent: 0,
91+
txid: "320959113997ee8d9b3766d3022183e206d75646f018010b5bc87b816978257d",
92+
confirmationTime: Optional(
93+
BitcoinDevKit.BlockTime(height: 172962, timestamp: 1_687_292_372)
94+
)
95+
),
96+
TransactionDetails(
97+
transaction: nil,
98+
fee: Optional(2820),
99+
received: 100000,
100+
sent: 0,
101+
txid: "47b7b72f297c260c243ae0a7474554c709b8ea3a7090c8353e0828a9107e2cb3",
102+
confirmationTime: Optional(
103+
BitcoinDevKit.BlockTime(height: 172955, timestamp: 1_687_292_152)
104+
)
105+
),
106+
TransactionDetails(
107+
transaction: nil,
108+
fee: Optional(141),
109+
received: 50000,
110+
sent: 0,
111+
txid: "d639021c55ba7d4c2d7a15b9bda74eb7d7de3fac8c7395e6c6cbb1ff5d6541b7",
112+
confirmationTime: Optional(
113+
BitcoinDevKit.BlockTime(height: 269162, timestamp: 1_690_299_514)
114+
)
115+
),
116+
TransactionDetails(
117+
transaction: nil,
118+
fee: Optional(2820),
119+
received: 100000,
120+
sent: 0,
121+
txid: "bd83e380361e3adacea03088bc0843a6c3ec87601edaa197141fc512cd343dc2",
122+
confirmationTime: Optional(
123+
BitcoinDevKit.BlockTime(height: 173003, timestamp: 1_687_293_647)
124+
)
125+
),
126+
TransactionDetails(
127+
transaction: nil,
128+
fee: Optional(141),
129+
received: 87359,
130+
sent: 100000,
131+
txid: "2ad94edbd9b4f2794d731ec660b0f1076ed287cfee198333f7035d5861f6abe8",
132+
confirmationTime: Optional(
133+
BitcoinDevKit.BlockTime(height: 269197, timestamp: 1_690_300_599)
134+
)
135+
),
136+
]
137+
let mockTransactionDetailsZero: [TransactionDetails] = []
138+
#endif

BDKSwiftExampleWallet/Model/Price.swift

+23
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,26 @@ struct ExchangeRates: Codable {
5252
case uSDJPY = "USDJPY"
5353
}
5454
}
55+
56+
#if DEBUG
57+
let currentPriceMock = Price(
58+
time: 1_693_079_705,
59+
usd: 26030,
60+
eur: 24508,
61+
gbp: 22486,
62+
cad: 35314,
63+
chf: 23088,
64+
aud: 40657,
65+
jpy: 3_816_606
66+
)
67+
let currentPriceMockZero = Price(
68+
time: 1_693_079_705,
69+
usd: 0,
70+
eur: 24508,
71+
gbp: 22486,
72+
cad: 35314,
73+
chf: 23088,
74+
aud: 40657,
75+
jpy: 3_816_606
76+
)
77+
#endif

BDKSwiftExampleWallet/Model/RecommendedFees.swift

+10
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ struct RecommendedFees: Codable, Equatable {
1414
let economyFee: Int
1515
let minimumFee: Int
1616
}
17+
18+
#if DEBUG
19+
let currentFeesMock = RecommendedFees(
20+
fastestFee: 10,
21+
halfHourFee: 8,
22+
hourFee: 6,
23+
economyFee: 4,
24+
minimumFee: 2
25+
)
26+
#endif

BDKSwiftExampleWallet/Resources/Localizable.xcstrings

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
22
"sourceLanguage" : "en",
33
"strings" : {
4-
"" : {
5-
6-
},
74
"- %llu sats" : {
85
"localizations" : {
96
"fr" : {

0 commit comments

Comments
 (0)