-
Notifications
You must be signed in to change notification settings - Fork 3
/
destinations.go
35 lines (30 loc) · 1.26 KB
/
destinations.go
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
package dpp
import (
"time"
"github.com/libsv/go-bt/v2"
"github.com/libsv/go-bt/v2/bscript"
)
// Output message used in BIP270.
// See https://github.com/moneybutton/bips/blob/master/bip-0270.mediawiki#output
type Output struct {
// Amount is the number of satoshis to be paid.
Amount uint64 `json:"amount" example:"100000"`
// Script is a locking script where payment should be sent, formatted as a hexadecimal string.
LockingScript *bscript.Script `json:"script" swaggertype:"primitive,string" example:"76a91455b61be43392125d127f1780fb038437cd67ef9c88ac"`
// Description, an optional description such as "tip" or "sales tax". Maximum length is 100 chars.
Description string `json:"description" example:"paymentReference 123456"`
}
// PaymentDestinations contains the supported destinations
// by this DPP server.
type PaymentDestinations struct {
Outputs []Output `json:"outputs"`
}
// Destinations message containing outputs and their fees.
type Destinations struct {
AncestryRequired bool `json:"ancestryRequired"`
Network string `json:"network"`
Outputs []Output `json:"outputs"`
Fees *bt.FeeQuote `json:"fees"`
CreatedAt time.Time `json:"createdAt"`
ExpiresAt time.Time `json:"expiresAt"`
}