htlc

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckExistenceReceivedExpiredByHash added in v0.3.0

type CheckExistenceReceivedExpiredByHash struct {
	// TMSID identifies the TMS to use to perform the token operation
	TMSID token.TMSID
	// Wallet is the identifier of the wallet that owns the tokens to reclaim
	Wallet string
	// Hash is the hash the lookup should refer to
	Hash []byte
	// Exists if true, enforce that a token exists, false otherwiese
	Exists bool
}

CheckExistenceReceivedExpiredByHash contains the input information to reclaim tokens

type CheckExistenceReceivedExpiredByHashView added in v0.3.0

type CheckExistenceReceivedExpiredByHashView struct {
	*CheckExistenceReceivedExpiredByHash
}

CheckExistenceReceivedExpiredByHashView is the view of a party who wants to reclaim all previously locked tokens with an expired timeout

func (*CheckExistenceReceivedExpiredByHashView) Call added in v0.3.0

func (r *CheckExistenceReceivedExpiredByHashView) Call(context view.Context) (interface{}, error)

type CheckExistenceReceivedExpiredByHashViewFactory added in v0.3.0

type CheckExistenceReceivedExpiredByHashViewFactory struct{}

func (*CheckExistenceReceivedExpiredByHashViewFactory) NewView added in v0.3.0

type Claim

type Claim struct {
	// TMSID identifies the TMS to use to perform the token operation
	TMSID token.TMSID
	// Wallet is the identifier of the wallet to use
	Wallet string
	// PreImage of the hash encoded in the htlc script in the token to be claimed
	PreImage []byte
}

Claim contains the input information to claim a token

type ClaimView

type ClaimView struct {
	*Claim
}

func (*ClaimView) Call

func (r *ClaimView) Call(context view.Context) (res interface{}, err error)

type ClaimViewFactory

type ClaimViewFactory struct{}

func (*ClaimViewFactory) NewView

func (p *ClaimViewFactory) NewView(in []byte) (view.View, error)

type FastExchange

type FastExchange struct {
	// Recipient is the identity of the recipient's FSC node
	Recipient view.Identity
	// TMSID identifies the TMS to use to perform the token operation
	TMSID1 token.TMSID
	// Type of tokens to transfer
	Type1 string
	// Amount to transfer
	Amount1 uint64

	TMSID2  token.TMSID
	Type2   string
	Amount2 uint64

	// ReclamationDeadline is the time after which we can reclaim the funds in case they were not transferred
	ReclamationDeadline time.Duration
}

FastExchange contains the input information to fast exchange tokens

type FastExchangeInitiatorView

type FastExchangeInitiatorView struct {
	*FastExchange
}

FastExchangeInitiatorView is the view of a party who wants to perform an exchange with a single view

func (*FastExchangeInitiatorView) Call

func (v *FastExchangeInitiatorView) Call(context view.Context) (interface{}, error)

type FastExchangeInitiatorViewFactory

type FastExchangeInitiatorViewFactory struct{}

func (*FastExchangeInitiatorViewFactory) NewView

func (f *FastExchangeInitiatorViewFactory) NewView(in []byte) (view.View, error)

type FastExchangeResponderView

type FastExchangeResponderView struct{}

func (*FastExchangeResponderView) Call

func (v *FastExchangeResponderView) Call(context view.Context) (interface{}, error)

type Lock

type Lock struct {
	// TMSID identifies the TMS to use to perform the token operation
	TMSID token.TMSID
	// ReclamationDeadline is the time after which we can reclaim the funds in case they were not transferred
	ReclamationDeadline time.Duration
	// Wallet is the identifier of the wallet that owns the tokens to transfer
	Wallet string
	// Type of tokens to transfer
	Type string
	// Amount to transfer
	Amount uint64
	// Recipient is the identity of the recipient's FSC node
	Recipient view.Identity
	// Hash is the hash to use in the script, if nil, a fresh one is generated
	Hash []byte
	// HashFunc is the hash function to use in the script
	HashFunc crypto.Hash
}

Lock contains the input information to lock a token

type LockAcceptView

type LockAcceptView struct {
}

func (*LockAcceptView) Call

func (h *LockAcceptView) Call(context view.Context) (interface{}, error)

type LockInfo

type LockInfo struct {
	TxID     string
	PreImage []byte
	Hash     []byte
}

type LockView

type LockView struct {
	*Lock
}

func (*LockView) Call

func (hv *LockView) Call(context view.Context) (res interface{}, err error)

type LockViewFactory

type LockViewFactory struct{}

func (*LockViewFactory) NewView

func (p *LockViewFactory) NewView(in []byte) (view.View, error)

type ReclaimAll

type ReclaimAll struct {
	// TMSID identifies the TMS to use to perform the token operation
	TMSID token.TMSID
	// Wallet is the identifier of the wallet that owns the tokens to reclaim
	Wallet string
}

ReclaimAll contains the input information to reclaim tokens

type ReclaimAllView

type ReclaimAllView struct {
	*ReclaimAll
}

ReclaimAllView is the view of a party who wants to reclaim all previously locked tokens with an expired timeout

func (*ReclaimAllView) Call

func (r *ReclaimAllView) Call(context view.Context) (interface{}, error)

type ReclaimAllViewFactory

type ReclaimAllViewFactory struct{}

func (*ReclaimAllViewFactory) NewView

func (p *ReclaimAllViewFactory) NewView(in []byte) (view.View, error)

type ReclaimByHash added in v0.3.0

type ReclaimByHash struct {
	// TMSID identifies the TMS to use to perform the token operation
	TMSID token.TMSID
	// Wallet is the identifier of the wallet that owns the tokens to reclaim
	Wallet string
	// Hash is the hash the reclaim should refer to
	Hash []byte
}

ReclaimByHash contains the input information to reclaim tokens

type ReclaimByHashView added in v0.3.0

type ReclaimByHashView struct {
	*ReclaimByHash
}

ReclaimByHashView is the view of a party who wants to reclaim all previously locked tokens with an expired timeout

func (*ReclaimByHashView) Call added in v0.3.0

func (r *ReclaimByHashView) Call(context view.Context) (interface{}, error)

type ReclaimByHashViewFactory added in v0.3.0

type ReclaimByHashViewFactory struct{}

func (*ReclaimByHashViewFactory) NewView added in v0.3.0

func (p *ReclaimByHashViewFactory) NewView(in []byte) (view.View, error)

type Scan

type Scan struct {
	// TMSID identifies the TMS to use to perform the token operation
	TMSID token.TMSID
	// Timeout of the scan
	Timeout time.Duration
	// Hash is the hash to use in the scan
	Hash []byte
	// HashFunc is the hash function to use in the scan
	HashFunc crypto.Hash
	// StartingTransactionID  is the transaction id from which to start the scan.
	// If empty, the scan starts from the genesis block
	StartingTransactionID string
}

Scan contains the input information for a scan of a matching preimage

type ScanView

type ScanView struct {
	*Scan
}

func (*ScanView) Call

func (s *ScanView) Call(context view.Context) (interface{}, error)

type ScanViewFactory

type ScanViewFactory struct {
}

func (*ScanViewFactory) NewView

func (s *ScanViewFactory) NewView(in []byte) (view.View, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL