order

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicCheckError

type BasicCheckError struct {
	Reason string
}

func (BasicCheckError) Error

func (e BasicCheckError) Error() string

type BridgeType

type BridgeType string
const (
	PACTUS_POLYGON BridgeType = "PACTUS_POLYGON" //nolint
	POLYGON_PACTUS BridgeType = "POLYGON_PACTUS" //nolint
)

type Order

type Order struct {
	// * unique ID on Wrapto system.
	ID string `bson:"id"`

	// * transaction or contract call that user made on source network.
	TxHash string `bson:"tx_hash"`

	// * address of receiver account on destination network.
	Receiver string `bson:"receiver"`

	// * address of sender on source network (account that made bridge transaction).
	Sender string `bson:"sender"`

	// * amount of PAC to be bridged, **including fee**.
	CreatedAt time.Time `bson:"created_at"`

	// * status of order on Wrapto system.
	Status Status `bson:"status"`

	// * once status got COMPLETE, this will be filled with destination network transaction hash made by wrapto.
	DestNetworkTxHash string `bson:"destination_tx_hash"`

	// * will be filled if order failed.
	Reason string `bson:"reason"`

	// * type of bridge.
	BridgeType BridgeType `bson:"bridge_type"`
	// contains filtered or unexported fields
}

func NewOrder

func NewOrder(txHash, sender, receiver string, amt amount.Amount, t BridgeType) (*Order, error)

func (*Order) Amount

func (o *Order) Amount() amount.Amount

func (*Order) Fee

func (o *Order) Fee() amount.Amount

func (*Order) OriginalAmount

func (o *Order) OriginalAmount() amount.Amount

type Status

type Status string
const (
	PENDING  Status = "PENDING"
	COMPLETE Status = "COMPLETE"
	FAILED   Status = "FAILED"
)

Jump to

Keyboard shortcuts

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