atomic

package
v0.0.0-...-772481a Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: ISC Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFeePerKB

func GetFeePerKB() (useFee, replayFee btcutil.Amount, err error)

func Refund

func Refund(contractHex string, contractTransaction string, wif *btcutil.WIF) (*refundCmd, error)

Types

type AuditContractCmd

type AuditContractCmd struct {
	// contains filtered or unexported fields
}

type AuditedContract

type AuditedContract struct {
	Asset   string `json:"contract_asset"`
	Address string `json:"contract_address"`

	Value               float64       `json:"contract_value"`
	ValueAsset          string        `json:"value_asset"`
	Unit                string        `json:"unit"`
	RecipientAddress    string        `json:"recipient_address"`
	AuthorRefundAddress string        `json:"author_refund_address"`
	SecretHash          string        `json:"secret_hash"`
	LockTime            int64         `json:"lock_time"`
	LockTimeReachedIn   time.Duration `json:"lock_time_reached_in"`
	LockTimeExpired     bool          `json:"lock_time_expired"`
	// contains filtered or unexported fields
}

func AuditContract

func AuditContract(coinTicker string, contractHex string, contractTransaction string) (AuditedContract, error)

type Command

type Command struct {
	Command string
	Params  []string
}

type ExtractedSecret

type ExtractedSecret struct {
	Secret string `json:"secret"`
}

func ExtractSecret

func ExtractSecret(redemptionTransaction string, secretHash string) (extractedSecret ExtractedSecret, err error)

type InitiatedContract

type InitiatedContract struct {
	Coin                   string  `json:"coin"`
	Unit                   string  `json:"unit"`
	ContractAmount         float64 `json:"contract_amount"`
	ContractFee            float64 `json:"contract_fee"`
	ContractRefundFee      float64 `json:"contract_refund_fee"`
	CounterPartyAddress    string  `json:"counter_party_address"`
	ContractAddress        string  `json:"contract_address"`
	ContractHex            string  `json:"contract_hex"`
	ContractTransactionID  string  `json:"contract_transaction_id"`
	ContractTransactionHex string  `json:"contract_transaction_hex"`
	RefundTransactionID    string  `json:"refund_transaction_id"`
	RefundTransaction      string  `json:"refund_transaction"`
	Secret                 string  `json:"secret"`
	SecretHash             string  `json:"secret_hash"`
}

func Initiate

func Initiate(coinTicker string, participantAddr string, amount float64, WIFstring string) (contract InitiatedContract, err error)

type ParticipatedContract

type ParticipatedContract struct {
	Coin                   string  `json:"coin"`
	Unit                   string  `json:"unit"`
	ContractAmount         float64 `json:"contract_amount"`
	ContractFee            float64 `json:"contract_fee"`
	ContractRefundFee      float64 `json:"contract_refund_fee"`
	CounterPartyAddress    string  `json:"counter_party_address"`
	ContractAddress        string  `json:"contract_address"`
	ContractHex            string  `json:"contract_hex"`
	ContractTransactionID  string  `json:"contract_transaction_id"`
	ContractTransactionHex string  `json:"contract_transaction_hex"`
	RefundTransactionID    string  `json:"refund_transaction_id"`
	RefundTransaction      string  `json:"refund_transaction"`
}

func Participate

func Participate(coinTicker string, participantAddr string, WIFstring string, amount float64, secretHash string) (contract ParticipatedContract, err error)

type Redemption

type Redemption struct {
	Coin            string  `json:"coin"`
	Unit            string  `json:"unit"`
	Fee             float64 `json:"fee"`
	TransactionHash string  `json:"transaction_hash"`
	TransactionHex  string  `json:"transaction_hex"`
}

func Redeem

func Redeem(coinTicker string, contractHex string, contractTransaction string, secretHex string, WIFstring string) (redemption Redemption, err error)

coinTicker should be the coin the participant wants to redeem from the counter party

Jump to

Keyboard shortcuts

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