Documentation
¶
Index ¶
- Constants
- func CreateChainEnumSQL() string
- func CreateSwapOutcomeEnumSQL() string
- func CreateSwapStatusEnumSQL() string
- func DropChainEnumSQL() string
- func DropSwapOutcomeEnumSQL() string
- func DropSwapStatusEnumSQL() string
- func RegisterPreimageSerializer()
- type Chain
- type PreimageSerializer
- type SwapIn
- type SwapOut
- type SwapOutcome
- type SwapStatus
Constants ¶
View Source
const TableNameSwapIn = "swap_ins"
View Source
const TableNameSwapOut = "swap_outs"
Variables ¶
This section is empty.
Functions ¶
func CreateChainEnumSQL ¶
func CreateChainEnumSQL() string
func CreateSwapOutcomeEnumSQL ¶
func CreateSwapOutcomeEnumSQL() string
func CreateSwapStatusEnumSQL ¶
func CreateSwapStatusEnumSQL() string
func DropChainEnumSQL ¶
func DropChainEnumSQL() string
func DropSwapOutcomeEnumSQL ¶
func DropSwapOutcomeEnumSQL() string
func DropSwapStatusEnumSQL ¶
func DropSwapStatusEnumSQL() string
func RegisterPreimageSerializer ¶
func RegisterPreimageSerializer()
Types ¶
type PreimageSerializer ¶
type PreimageSerializer struct{}
PreimageSerializer handles serialization/deserialization of *lntypes.Preimage
type SwapIn ¶
type SwapIn struct { ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true;<-:create" json:"id"` SwapID string `gorm:"column:swap_id;type:text;not null" json:"swap_id"` AmountSats int64 `gorm:"column:amount_sats;type:bigint;not null" json:"amount_sats"` Status SwapStatus `gorm:"column:status;type:swap_status;not null" json:"status"` Outcome *SwapOutcome `gorm:"column:outcome;type:swap_outcome" json:"outcome"` SourceChain Chain `gorm:"column:source_chain;type:chain_enum;not null" json:"source_chain"` ClaimAddress string `gorm:"column:claim_address;type:text" json:"claim_address"` TimeoutBlockHeight int64 `gorm:"column:timeout_block_height;type:bigint" json:"timeout_block_height"` RefundAddress string `gorm:"column:refund_address;type:text" json:"refund_address"` RefundTxID string `gorm:"column:refund_tx_id;type:text" json:"refund_tx_id"` RefundPrivatekey string `gorm:"column:refund_privatekey;type:text;not null" json:"refund_privatekey"` RedeemScript string `gorm:"column:redeem_script;type:text" json:"redeem_script"` PaymentRequest string `gorm:"column:payment_request;type:text;not null" json:"payment_request"` PreImage *lntypes.Preimage `gorm:"column:pre_image;type:text;serializer:preimage" json:"pre_image"` OnChainFeeSats int64 `gorm:"column:on_chain_fee_sats;type:bigint;not null" json:"on_chain_fee_sats"` ServiceFeeSats int64 `gorm:"column:service_fee_sats;type:bigint;not null" json:"service_fee_sats"` CreatedAt time.Time `gorm:"column:created_at;type:timestamp with time zone;<-:create" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp with time zone;<-:update" json:"updated_at"` RefundRequestedAt time.Time `gorm:"column:refund_requested_at;type:timestamp with time zone" json:"refund_requested_at"` LockTxID string `gorm:"column:lock_tx_id;type:text" json:"lock_tx_id"` RefundAmount int64 `gorm:"column:refund_amount;type:bigint" json:"refund_amount"` }
SwapIn mapped from table <swap_ins>
type SwapOut ¶
type SwapOut struct { ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true;<-:create" json:"id"` SwapID string `gorm:"column:swap_id;type:text;not null" json:"swap_id"` Status SwapStatus `gorm:"column:status;type:swap_status;not null" json:"status"` AmountSats int64 `gorm:"column:amount_sats;type:bigint;not null" json:"amount_sats"` DestinationAddress string `gorm:"column:destination_address;type:text;not null" json:"destination_address"` ServiceFeeSats int64 `gorm:"column:service_fee_sats;type:bigint;not null" json:"service_fee_sats"` OnchainFeeSats int64 `gorm:"column:onchain_fee_sats;type:bigint" json:"onchain_fee_sats"` OffchainFeeSats int64 `gorm:"column:offchain_fee_sats;type:bigint" json:"offchain_fee_sats"` DestinationChain Chain `gorm:"column:destination_chain;type:chain_enum;not null" json:"destination_chain"` ClaimPrivateKey string `gorm:"column:claim_private_key;type:text;not null" json:"claim_private_key"` PaymentRequest string `gorm:"column:payment_request;type:text;not null" json:"payment_request"` Description string `gorm:"column:description;type:text" json:"description"` MaxRoutingFeeRatio float64 `gorm:"column:max_routing_fee_ratio;type:numeric;not null" json:"max_routing_fee_ratio"` Outcome *SwapOutcome `gorm:"column:outcome;type:swap_outcome" json:"outcome"` PreImage *lntypes.Preimage `gorm:"column:pre_image;type:text;serializer:preimage" json:"pre_image"` TimeoutBlockHeight int64 `gorm:"column:timeout_block_height;type:bigint" json:"timeout_block_height"` TxID string `gorm:"column:tx_id;type:text" json:"tx_id"` }
SwapOut mapped from table <swap_outs>
type SwapOutcome ¶
type SwapOutcome string
const ( OutcomeFailed SwapOutcome = "FAILED" OutcomeSuccess SwapOutcome = "SUCCESS" OutcomeRefunded SwapOutcome = "REFUNDED" OutcomeExpired SwapOutcome = "EXPIRED" )
func (*SwapOutcome) Scan ¶
func (o *SwapOutcome) Scan(value interface{}) error
func (SwapOutcome) String ¶
func (o SwapOutcome) String() string
type SwapStatus ¶
type SwapStatus string
const ( // happy path StatusCreated SwapStatus = "CREATED" StatusInvoicePaymentIntentReceived SwapStatus = "INVOICE_PAYMENT_INTENT_RECEIVED" StatusContractFundedUnconfirmed SwapStatus = "CONTRACT_FUNDED_UNCONFIRMED" StatusContractFunded SwapStatus = "CONTRACT_FUNDED" StatusInvoicePaid SwapStatus = "INVOICE_PAID" StatusContractClaimedUnconfirmed SwapStatus = "CONTRACT_CLAIMED_UNCONFIRMED" StatusDone SwapStatus = "DONE" // if it expires after CONTRACT_FUNDED StatusContractRefundedUnconfirmed SwapStatus = "CONTRACT_REFUNDED_UNCONFIRMED" StatusContractExpired SwapStatus = "CONTRACT_EXPIRED" )
func (*SwapStatus) Scan ¶
func (s *SwapStatus) Scan(value interface{}) error
func (SwapStatus) String ¶
func (s SwapStatus) String() string
Click to show internal directories.
Click to hide internal directories.