@@ -16,12 +16,20 @@ public struct QuoteData: MessageData {
1616 /// The amount of payout currency that Alice will receive
1717 public let payout : QuoteDetails
1818
19- /// Object that describes how to pay the PFI, and how to get paid by the PFI (e.g. BTC address, payment link)
20- public let paymentInstructions : PaymentInstructions ?
21-
2219 public func kind( ) -> MessageKind {
2320 return . quote
2421 }
22+
23+ /// Default Initializer
24+ public init (
25+ expiresAt: Date ,
26+ payin: QuoteDetails ,
27+ payout: QuoteDetails
28+ ) {
29+ self . expiresAt = expiresAt
30+ self . payin = payin
31+ self . payout = payout
32+ }
2533}
2634
2735/// Details about a quoted amount
@@ -38,19 +46,21 @@ public struct QuoteDetails: Codable, Equatable {
3846 /// The amount paid in fees
3947 public let fee : String ?
4048
41- }
42-
43- /// Instructions about how one can pay or be paid by the PFI
44- ///
45- /// [Specification Reference](https://github.com/TBD54566975/tbdex/tree/main/specs/protocol#paymentinstructions)
46- public struct PaymentInstructions : Codable , Equatable {
47-
48- /// Link or Instruction describing how to pay the PFI.
49- public let payin : PaymentInstruction ?
50-
51- /// Link or Instruction describing how to get paid by the PFI
52- public let payout : PaymentInstruction ?
53-
49+ /// Object that describes how to pay the PFI, and how to get paid by the PFI (e.g. BTC address, payment link)
50+ public let paymentInstruction : PaymentInstruction ?
51+
52+ /// Default Initializer
53+ public init (
54+ currencyCode: String ,
55+ amount: String ,
56+ fee: String ? = nil ,
57+ paymentInstruction: PaymentInstruction ? = nil
58+ ) {
59+ self . currencyCode = currencyCode
60+ self . amount = amount
61+ self . fee = fee
62+ self . paymentInstruction = paymentInstruction
63+ }
5464}
5565
5666/// Instruction about how to pay or be paid by the PFI
@@ -64,4 +74,12 @@ public struct PaymentInstruction: Codable, Equatable {
6474 /// Instruction on how Alice can pay PFI, or how Alice can be paid by the PFI
6575 public let instruction : String ?
6676
77+ /// Default Initializer
78+ public init (
79+ link: String ? = nil ,
80+ instruction: String ? = nil
81+ ) {
82+ self . link = link
83+ self . instruction = instruction
84+ }
6785}
0 commit comments