Documentation
¶
Index ¶
- func InitSchema(db *sql.DB) error
- func IsDuplicateError(err error) bool
- func Migrate(db *sql.DB, dir migrate.MigrationDirection, max int) error
- type Action
- type Blockchain
- type DB
- func (m *DB) DeleteSignatureRequest(ctx context.Context, request SignatureRequest) error
- func (m *DB) GetEthereumDeposit(ctx context.Context, id string) (EthereumDeposit, error)
- func (m *DB) GetEthereumSignature(ctx context.Context, action Action, depositID string) (EthereumSignature, error)
- func (m *DB) GetLastLedgerCloseTime(ctx context.Context) (time.Time, error)
- func (m *DB) GetLastLedgerSequence(ctx context.Context) (uint32, error)
- func (m *DB) GetOutgoingStellarTransaction(ctx context.Context, action Action, depositID string) (OutgoingStellarTransaction, error)
- func (m *DB) GetSignatureRequests(ctx context.Context) ([]SignatureRequest, error)
- func (m *DB) GetStellarDeposit(ctx context.Context, id string) (StellarDeposit, error)
- func (m *DB) HistoryStellarTransactionExists(ctx context.Context, memoHash string) (bool, error)
- func (m *DB) InsertEthereumDeposit(ctx context.Context, deposit EthereumDeposit) error
- func (m *DB) InsertHistoryStellarTransaction(ctx context.Context, tx HistoryStellarTransaction) error
- func (m *DB) InsertSignatureRequest(ctx context.Context, request SignatureRequest) error
- func (m *DB) InsertStellarDeposit(ctx context.Context, deposit StellarDeposit) error
- func (m *DB) UpdateLastLedgerCloseTime(ctx context.Context, closeTime time.Time) error
- func (m *DB) UpdateLastLedgerSequence(ctx context.Context, ledgerSequence uint32) error
- func (m *DB) UpsertEthereumSignature(ctx context.Context, newSig EthereumSignature) error
- func (m *DB) UpsertOutgoingStellarTransaction(ctx context.Context, newtx OutgoingStellarTransaction) error
- type EthereumDeposit
- type EthereumSignature
- type HistoryStellarTransaction
- type OutgoingStellarTransaction
- type SignatureRequest
- type StellarDeposit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitSchema ¶
func IsDuplicateError ¶
Types ¶
type Blockchain ¶
type Blockchain string
const ( Stellar Blockchain = "stellar" Ethereum Blockchain = "ethereum" )
type DB ¶
type DB struct {
Session db.SessionInterface
}
func (*DB) DeleteSignatureRequest ¶
func (m *DB) DeleteSignatureRequest(ctx context.Context, request SignatureRequest) error
func (*DB) GetEthereumDeposit ¶
func (*DB) GetEthereumSignature ¶
func (*DB) GetLastLedgerCloseTime ¶
func (*DB) GetLastLedgerSequence ¶
func (*DB) GetOutgoingStellarTransaction ¶
func (*DB) GetSignatureRequests ¶
func (m *DB) GetSignatureRequests(ctx context.Context) ([]SignatureRequest, error)
func (*DB) GetStellarDeposit ¶
func (*DB) HistoryStellarTransactionExists ¶
func (*DB) InsertEthereumDeposit ¶
func (m *DB) InsertEthereumDeposit(ctx context.Context, deposit EthereumDeposit) error
func (*DB) InsertHistoryStellarTransaction ¶
func (m *DB) InsertHistoryStellarTransaction(ctx context.Context, tx HistoryStellarTransaction) error
func (*DB) InsertSignatureRequest ¶
func (m *DB) InsertSignatureRequest(ctx context.Context, request SignatureRequest) error
func (*DB) InsertStellarDeposit ¶
func (m *DB) InsertStellarDeposit(ctx context.Context, deposit StellarDeposit) error
func (*DB) UpdateLastLedgerCloseTime ¶
func (*DB) UpdateLastLedgerSequence ¶
func (*DB) UpsertEthereumSignature ¶
func (m *DB) UpsertEthereumSignature(ctx context.Context, newSig EthereumSignature) error
func (*DB) UpsertOutgoingStellarTransaction ¶
func (m *DB) UpsertOutgoingStellarTransaction(ctx context.Context, newtx OutgoingStellarTransaction) error
type EthereumDeposit ¶
type EthereumDeposit struct { // ID is the globally unique id for this deposit ID string `db:"id"` // Token is the address (0x0 in the case that eth was deposited) // of the tokens which were deposited to the bridge Token string `db:"token"` // Sender is the address of the account which deposited the tokens Sender string `db:"sender"` // Destination is the intended recipient of the bridge transfer Destination string `db:"destination"` // Amount is the amount of tokens which were deposited to the bridge // contract Amount string `db:"amount"` // Hash is the hash of the transaction containing the deposit Hash string `db:"hash"` // LogIndex is the log index within the ethereum block of the deposit event // emitted by the bridge contract LogIndex uint `db:"log_index"` // BlockNumber is the sequence number of the block containing the deposit // transaction BlockNumber uint64 `db:"block_number"` // BlockTime is the unix timestamp of the deposit BlockTime int64 `db:"block_time"` }
type EthereumSignature ¶
type EthereumSignature struct { Address string `db:"address"` Token string `db:"token"` Amount string `db:"amount"` Signature string `db:"signature"` Expiration int64 `db:"expiration"` Action Action `db:"requested_action"` DepositID string `db:"deposit_id"` }
EthereumSignature represents a signature for a withdrawal / refund against the bridge ethereum smart contract
type HistoryStellarTransaction ¶
type HistoryStellarTransaction struct { Hash string `db:"hash"` Envelope string `db:"envelope"` // MemoHash represents: // - Ethereum deposit ID in case of withdrawals in Ethereum->Stellar flow // - Stellar transaction hash in case of refunds in Stellar->Ethereum flow MemoHash string `db:"memo_hash"` }
type SignatureRequest ¶
type SignatureRequest struct { DepositChain Blockchain `db:"deposit_chain"` Action Action `db:"requested_action"` DepositID string `db:"deposit_id"` }
type StellarDeposit ¶
type StellarDeposit struct { // ID is the globally unique id for this deposit // and is equal to deposit transaction hash ID string `db:"id"` // Asset is the string encoding of the Stellar assets // which were deposited to the bridge Asset string `db:"asset"` // Sender is the address of the account which deposited the tokens Sender string `db:"sender"` // Destination is the intended recipient of the bridge transfer Destination string `db:"destination"` // Amount is the amount of tokens which were deposited to the bridge // contract Amount string `db:"amount"` // LedgerTime is the unix timestamp of the deposit LedgerTime int64 `db:"ledger_time"` }
Click to show internal directories.
Click to hide internal directories.