store

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SCHEMA string

Functions

This section is empty.

Types

type AccountPlan

type AccountPlan struct {
	AccountPriceAsset  string
	AccountPriceAmount decimal.Decimal
	TransactionMinimum decimal.Decimal
}

type Asset

type Asset struct {
	AssetId   string
	MixinId   string
	AssetKey  string
	Symbol    string
	Name      string
	Decimals  uint32
	Chain     byte
	CreatedAt time.Time
}

type Key

type Key struct {
	Public    string
	Curve     byte
	RequestId string
	Role      byte
	Extra     string
	Flags     byte
	Holder    sql.NullString
	CreatedAt time.Time
	UpdatedAt time.Time
}

type NetworkInfo

type NetworkInfo struct {
	RequestId string
	Chain     byte
	Fee       uint64
	Height    uint64
	Hash      string
	CreatedAt time.Time
}

type SQLite3Store

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

func OpenSQLite3ReadOnlyStore

func OpenSQLite3ReadOnlyStore(path string) (*SQLite3Store, error)

func OpenSQLite3Store

func OpenSQLite3Store(path string) (*SQLite3Store, error)

func (*SQLite3Store) AssignSignerAndObserverToHolder

func (s *SQLite3Store) AssignSignerAndObserverToHolder(ctx context.Context, req *common.Request, maturity time.Duration, observerPref string) (string, string, error)

func (*SQLite3Store) Close

func (s *SQLite3Store) Close() error

func (*SQLite3Store) CloseAccountBySignatureRequestsWithRequest added in v0.8.0

func (s *SQLite3Store) CloseAccountBySignatureRequestsWithRequest(ctx context.Context, requests []*SignatureRequest, transactionHash string, req *common.Request) error

func (*SQLite3Store) CloseAccountByTransactionWithRequest added in v0.8.0

func (s *SQLite3Store) CloseAccountByTransactionWithRequest(ctx context.Context, trx *Transaction, utxos []*bitcoin.Input) error

func (*SQLite3Store) CountSpareKeys

func (s *SQLite3Store) CountSpareKeys(ctx context.Context, curve, flags byte, role int) (int, error)

func (*SQLite3Store) CountUnfinishedTransactionsByHolder added in v0.8.0

func (s *SQLite3Store) CountUnfinishedTransactionsByHolder(ctx context.Context, holder string) (int, error)

func (*SQLite3Store) FailRequest added in v0.3.0

func (s *SQLite3Store) FailRequest(ctx context.Context, id string) error

func (*SQLite3Store) FinishSignatureRequest

func (s *SQLite3Store) FinishSignatureRequest(ctx context.Context, req *common.Request) error

func (*SQLite3Store) FinishTransactionSignaturesWithRequest

func (s *SQLite3Store) FinishTransactionSignaturesWithRequest(ctx context.Context, transactionHash, psbt string, req *common.Request, num int64) error

func (*SQLite3Store) ListAllBitcoinUTXOsForHolder

func (s *SQLite3Store) ListAllBitcoinUTXOsForHolder(ctx context.Context, holder string) ([]*bitcoin.Input, error)

func (*SQLite3Store) ListAllSignaturesForTransaction

func (s *SQLite3Store) ListAllSignaturesForTransaction(ctx context.Context, transactionHash string, state int) (map[int]*SignatureRequest, error)

func (*SQLite3Store) ReadAccountPlan

func (s *SQLite3Store) ReadAccountPlan(ctx context.Context, chain byte) (*AccountPlan, error)

func (*SQLite3Store) ReadAssetMeta

func (s *SQLite3Store) ReadAssetMeta(ctx context.Context, id string) (*Asset, error)

func (*SQLite3Store) ReadBitcoinUTXO

func (s *SQLite3Store) ReadBitcoinUTXO(ctx context.Context, transactionHash string, index int) (*bitcoin.Input, string, error)

func (*SQLite3Store) ReadKey

func (s *SQLite3Store) ReadKey(ctx context.Context, public string) (*Key, error)

func (*SQLite3Store) ReadLatestNetworkInfo

func (s *SQLite3Store) ReadLatestNetworkInfo(ctx context.Context, chain byte) (*NetworkInfo, error)

func (*SQLite3Store) ReadLatestRequest

func (s *SQLite3Store) ReadLatestRequest(ctx context.Context) (*common.Request, error)

func (*SQLite3Store) ReadNetworkInfo

func (s *SQLite3Store) ReadNetworkInfo(ctx context.Context, id string) (*NetworkInfo, error)

func (*SQLite3Store) ReadPendingRequest

func (s *SQLite3Store) ReadPendingRequest(ctx context.Context) (*common.Request, error)

func (*SQLite3Store) ReadProperty

func (s *SQLite3Store) ReadProperty(ctx context.Context, k string) (string, error)

func (*SQLite3Store) ReadRequest

func (s *SQLite3Store) ReadRequest(ctx context.Context, id string) (*common.Request, error)

func (*SQLite3Store) ReadSafe

func (s *SQLite3Store) ReadSafe(ctx context.Context, holder string) (*Safe, error)

func (*SQLite3Store) ReadSafeByAddress

func (s *SQLite3Store) ReadSafeByAddress(ctx context.Context, addr string) (*Safe, error)

func (*SQLite3Store) ReadSafeProposal

func (s *SQLite3Store) ReadSafeProposal(ctx context.Context, requestId string) (*SafeProposal, error)

func (*SQLite3Store) ReadSafeProposalByAddress

func (s *SQLite3Store) ReadSafeProposalByAddress(ctx context.Context, addr string) (*SafeProposal, error)

func (*SQLite3Store) ReadSignatureRequest

func (s *SQLite3Store) ReadSignatureRequest(ctx context.Context, id string) (*SignatureRequest, error)

func (*SQLite3Store) ReadSignatureRequestByTransactionIndex

func (s *SQLite3Store) ReadSignatureRequestByTransactionIndex(ctx context.Context, transactionHash string, index int) (*SignatureRequest, error)

func (*SQLite3Store) ReadTerminate added in v0.8.0

func (s *SQLite3Store) ReadTerminate(ctx context.Context) (bool, error)

func (*SQLite3Store) ReadTransaction

func (s *SQLite3Store) ReadTransaction(ctx context.Context, hash string) (*Transaction, error)

func (*SQLite3Store) ReadTransactionByRequestId

func (s *SQLite3Store) ReadTransactionByRequestId(ctx context.Context, requestId string) (*Transaction, error)

func (*SQLite3Store) RevokeTransactionWithRequest

func (s *SQLite3Store) RevokeTransactionWithRequest(ctx context.Context, trx *Transaction, safe *Safe, req *common.Request) error

func (*SQLite3Store) WriteAccountPlanFromRequest

func (s *SQLite3Store) WriteAccountPlanFromRequest(ctx context.Context, chain byte, assetId string, amount, minimum decimal.Decimal, req *common.Request) error

func (*SQLite3Store) WriteAssetMeta

func (s *SQLite3Store) WriteAssetMeta(ctx context.Context, asset *Asset) error

func (*SQLite3Store) WriteBitcoinOutputFromRequest

func (s *SQLite3Store) WriteBitcoinOutputFromRequest(ctx context.Context, receiver string, utxo *bitcoin.Input, req *common.Request, chain byte) error

func (*SQLite3Store) WriteKeyFromRequest

func (s *SQLite3Store) WriteKeyFromRequest(ctx context.Context, req *common.Request, role int, extra []byte, flags byte) error

func (*SQLite3Store) WriteNetworkInfoFromRequest

func (s *SQLite3Store) WriteNetworkInfoFromRequest(ctx context.Context, info *NetworkInfo) error

func (*SQLite3Store) WriteProperty

func (s *SQLite3Store) WriteProperty(ctx context.Context, k, v string) error

func (*SQLite3Store) WriteRequestIfNotExist

func (s *SQLite3Store) WriteRequestIfNotExist(ctx context.Context, req *common.Request) error

func (*SQLite3Store) WriteSafeProposalWithRequest

func (s *SQLite3Store) WriteSafeProposalWithRequest(ctx context.Context, sp *SafeProposal) error

func (*SQLite3Store) WriteSafeWithRequest

func (s *SQLite3Store) WriteSafeWithRequest(ctx context.Context, safe *Safe) error

func (*SQLite3Store) WriteSignatureRequestsWithRequest

func (s *SQLite3Store) WriteSignatureRequestsWithRequest(ctx context.Context, requests []*SignatureRequest, transactionHash string, req *common.Request) error

func (*SQLite3Store) WriteTerminate added in v0.8.0

func (s *SQLite3Store) WriteTerminate(ctx context.Context) error

func (*SQLite3Store) WriteTransactionWithRequest

func (s *SQLite3Store) WriteTransactionWithRequest(ctx context.Context, trx *Transaction, utxos []*bitcoin.Input) error

type Safe

type Safe struct {
	Holder    string
	Chain     byte
	Signer    string
	Observer  string
	Timelock  time.Duration
	Path      string
	Address   string
	Extra     []byte
	Receivers []string
	Threshold byte
	RequestId string
	State     byte
	CreatedAt time.Time
	UpdatedAt time.Time
}

type SafeProposal

type SafeProposal struct {
	RequestId string
	Chain     byte
	Holder    string
	Signer    string
	Observer  string
	Timelock  time.Duration
	Path      string
	Address   string
	Extra     []byte
	Receivers []string
	Threshold byte
	CreatedAt time.Time
	UpdatedAt time.Time
}

type SignatureRequest

type SignatureRequest struct {
	RequestId       string
	TransactionHash string
	InputIndex      int
	Signer          string
	Curve           byte
	Message         string
	Signature       sql.NullString
	State           int
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

type Transaction

type Transaction struct {
	TransactionHash string
	RawTransaction  string
	Holder          string
	Chain           byte
	State           int
	Data            string
	RequestId       string
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

Jump to

Keyboard shortcuts

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