Documentation ¶
Index ¶
- Variables
- type Database
- func (d *Database) Close() error
- func (d *Database) ConfirmDeposit(address string) error
- func (d *Database) GetDeposit(address string) (*Deposit, error)
- func (d *Database) GetMint(paymentID string) (*Mint, error)
- func (d *Database) GetProof(hash string) (*Proof, error)
- func (d *Database) GetProofs() ([]Proof, error)
- func (d *Database) NewMint(paymentID, ethAddress string) error
- func (d *Database) NewProof(moneroHeight uint64, ethereumHeight int64, proofHash, proofSignature string) error
- func (d *Database) RegisterDeposit(address, paymentID string) error
- func (d *Database) SetMintState(paymentID string, state MintState) error
- func (d *Database) SetMintTx(paymentID string, txHash string) error
- type Deposit
- type Mint
- type MintState
- type Proof
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Pending is the initial state of a mint // when we are waiting for the monero deposit to confirm Pending = MintState("PENDING") // Processing is the secondary state of a mint // when the monero deposit has confirmed, and when // we've broadcasted the wXMR mint transaction Processing = MintState("PROCESSING") // Confirmed is the third and last state of a mint // when the monero deposit has confirmed, and // the wXMR mint transaction has confirmed Confirmed = MintState("CONFIRMED") )
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database wraps a backend db
func (*Database) ConfirmDeposit ¶
func (*Database) NewProof ¶
func (d *Database) NewProof( moneroHeight uint64, ethereumHeight int64, proofHash, proofSignature string, ) error
NewProof stores a new proof in the database
func (*Database) RegisterDeposit ¶
RegisterDeposit is used to register a new deposit address
func (*Database) SetMintState ¶
type Deposit ¶
type Deposit struct { gorm.Model Address string `gorm:"unique"` PaymentID string `gorm:"unique"` Confirmed bool }
Deposit represents an integrated address that can be used to deposit XMR into the reserve minting wXMR
type Mint ¶
type Mint struct { gorm.Model PaymentID string `gorm:"unique"` EthAddress string MintTransaction string State MintState }
Mint represents a given minting event
Click to show internal directories.
Click to hide internal directories.