Documentation ¶
Index ¶
- Constants
- func Accept(opts AcceptOpts) (string, []byte, error)
- func Complete(opts CompleteOpts) (string, []byte, error)
- func Fail(opts FailOpts) (string, []byte, error)
- func FailV1(opts FailOpts) (string, []byte, error)
- func Request(opts RequestOpts) ([]byte, error)
- func ValidateCompletePset(opts ValidateCompletePsetOpts) error
- type AcceptOpts
- type CompleteOpts
- type FailOpts
- type RequestOpts
- type UnblindedInput
- type ValidateCompletePsetOpts
Constants ¶
View Source
const ( ErrCodeInvalidSwapRequest = iota ErrCodeRejectedSwapRequest ErrCodeFailedToComplete ErrCodeInvalidTransaction ErrCodeBadPricingSwapRequest ErrCodeAborted ErrCodeFailedToBroadcast )
Variables ¶
This section is empty.
Functions ¶
func Accept ¶
func Accept(opts AcceptOpts) (string, []byte, error)
Accept takes a AcceptOpts and returns the id of the SwapAccept entity and its serialized version
func Complete ¶
func Complete(opts CompleteOpts) (string, []byte, error)
Complete takes a CompleteOpts and returns the id of the SwapComplete entity and its serialized version
func Request ¶
func Request(opts RequestOpts) ([]byte, error)
Request takes a RequestOpts struct and returns a serialized protobuf message.
func ValidateCompletePset ¶
func ValidateCompletePset(opts ValidateCompletePsetOpts) error
ValidateCompletePset takes a VerifyCompeltePsetOpts and returns whether the final signed pset matches the original SwapRequest message
Types ¶
type AcceptOpts ¶
type AcceptOpts struct { Message []byte Transaction string InputBlindingKeys map[string][]byte OutputBlindingKeys map[string][]byte UnblindedInputs []UnblindedInput }
AcceptOpts is the struct given to Accept method
type CompleteOpts ¶
CompleteOpts is the struct given to the Complete method
type RequestOpts ¶
type RequestOpts struct { Id string AssetToSend string AmountToSend uint64 AssetToReceive string AmountToReceive uint64 Transaction string InputBlindingKeys map[string][]byte OutputBlindingKeys map[string][]byte UnblindedInputs []UnblindedInput // Fee asset and amount are not (de)serialized, they're used only to check // that the amounts of the swap request match those of the PSETv2 tx. FeeAsset string FeeAmount uint64 }
RequestOpts is the struct to be given to the Request method
type UnblindedInput ¶ added in v1.0.0
type ValidateCompletePsetOpts ¶
type ValidateCompletePsetOpts struct { PsetBase64 string InputBlindingKeys map[string][]byte OutputBlindingKeys map[string][]byte SwapRequest *tdexv1.SwapRequest }
ValidateCompletePsetOpts is the struct given to the ValidateCompletePset method
Click to show internal directories.
Click to hide internal directories.