Documentation ¶
Index ¶
- Constants
- type DispatchTx
- type OTX
- type Pg
- func (pg *Pg) AcquireNonce(ctx context.Context, tx pgx.Tx, publicKey string) (uint64, error)
- func (pg *Pg) ActivateKeyPair(ctx context.Context, tx pgx.Tx, publicKey string) error
- func (s *Pg) Bootstrap() error
- func (pg *Pg) CheckKeypair(ctx context.Context, tx pgx.Tx, publicKey string) (bool, error)
- func (pg *Pg) GetOTXByAccount(ctx context.Context, tx pgx.Tx, trackingID string, limit int) ([]OTX, error)
- func (pg *Pg) GetOTXByAccountNext(ctx context.Context, tx pgx.Tx, trackingID string, cursor int, limit int) ([]OTX, error)
- func (pg *Pg) GetOTXByAccountPrevious(ctx context.Context, tx pgx.Tx, trackingID string, cursor int, limit int) ([]OTX, error)
- func (pg *Pg) GetOTXByTrackingID(ctx context.Context, tx pgx.Tx, trackingID string) (OTX, error)
- func (pg *Pg) GetOTXByTxHash(ctx context.Context, tx pgx.Tx, txHash string) (OTX, error)
- func (pg *Pg) InsertDispatchTx(ctx context.Context, tx pgx.Tx, dispatchTx DispatchTx) error
- func (pg *Pg) InsertKeyPair(ctx context.Context, tx pgx.Tx, keypair keypair.Key) error
- func (pg *Pg) InsertOTX(ctx context.Context, tx pgx.Tx, otx OTX) (uint64, error)
- func (pg *Pg) LoadMasterSignerKey(ctx context.Context, tx pgx.Tx) (keypair.Key, error)
- func (pg *Pg) LoadPrivateKey(ctx context.Context, tx pgx.Tx, publicKey string) (keypair.Key, error)
- func (pg *Pg) PeekNonce(ctx context.Context, tx pgx.Tx, publicKey string) (uint64, error)
- func (s *Pg) Pool() *pgxpool.Pool
- func (pg *Pg) SetAccountNonce(ctx context.Context, tx pgx.Tx, publicKey string, nonce uint64) error
- func (pg *Pg) UpdateDispatchTxStatus(ctx context.Context, tx pgx.Tx, dispatchTx DispatchTx) error
- type PgOpts
- type Queries
- type Store
Constants ¶
View Source
const ( PENDING string = "PENDING" IN_NETWORK string = "IN_NETWORK" SUCCESS string = "SUCCESS" REVERTED string = "REVERTED" LOW_NONCE string = "LOW_NONCE" NO_GAS string = "NO_GAS" LOW_GAS_PRICE string = "LOW_GAS_PRICE" REPLACEMENT_UNDERPRICED string = "REPLACEMENT_UNDERPRICED" NETWORK_ERROR string = "NETWORK_ERROR" EXTERNAL_DISPATCH string = "EXTERNAL_DISPATCH" UNKNOWN_RPC_ERROR string = "UNKNOWN_ERROR" )
View Source
const ( GAS_REFILL string = "REFILL_GAS" ACCOUNT_REGISTER string = "ACCOUNT_REGISTER" GAS_TRANSFER string = "GAS_TRANSFER" TOKEN_TRANSFER string = "TOKEN_TRANSFER" TOKEN_APPROVE string = "TOKEN_APPROVE" POOL_SWAP string = "POOL_SWAP" POOL_DEPSOIT string = "POOL_DESPOSIT" OTHER_MANUAL string = "OTHER_MANUAL" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DispatchTx ¶
type OTX ¶
type OTX struct { ID uint64 `db:"id" json:"id"` TrackingID string `db:"tracking_id" json:"trackingId"` OTXType string `db:"otx_type" json:"otxType"` SignerAccount string `db:"public_key" json:"signerAccount"` RawTx string `db:"raw_tx" json:"rawTx"` TxHash string `db:"tx_hash" json:"txHash"` Nonce uint64 `db:"nonce" json:"nonce"` Replaced bool `db:"replaced" json:"replaced"` CreatedAt time.Time `db:"created_at" json:"createdAt"` UpdatedAt time.Time `db:"updated_at" json:"updatedAt"` DispatchStatus string `db:"status" json:"status"` }
type Pg ¶
type Pg struct {
// contains filtered or unexported fields
}
func (*Pg) AcquireNonce ¶
func (*Pg) ActivateKeyPair ¶
func (*Pg) CheckKeypair ¶
func (*Pg) GetOTXByAccount ¶
func (*Pg) GetOTXByAccountNext ¶
func (*Pg) GetOTXByAccountPrevious ¶
func (*Pg) GetOTXByTrackingID ¶
func (*Pg) GetOTXByTxHash ¶
func (*Pg) InsertDispatchTx ¶
func (pg *Pg) InsertDispatchTx(ctx context.Context, tx pgx.Tx, dispatchTx DispatchTx) error
func (*Pg) InsertKeyPair ¶
func (*Pg) LoadMasterSignerKey ¶
func (*Pg) LoadPrivateKey ¶
func (*Pg) SetAccountNonce ¶
func (*Pg) UpdateDispatchTxStatus ¶
func (pg *Pg) UpdateDispatchTxStatus(ctx context.Context, tx pgx.Tx, dispatchTx DispatchTx) error
type Queries ¶
type Queries struct { InsertKeyPair string `query:"insert-keypair"` ActivateKeyPair string `query:"activate-keypair"` LoadKey string `query:"load-key"` CheckKeypair string `query:"check-keypair"` LoadMasterKey string `query:"load-master-key"` BootstrapMasterKey string `query:"bootstrap-master-key"` PeekNonce string `query:"peek-nonce"` AcquireNonce string `query:"acquire-nonce"` SetAcccountNonce string `query:"set-account-nonce"` InsertOTX string `query:"insert-otx"` GetOTXByTxHash string `query:"get-otx-by-tx-hash"` GetOTXByTrackingID string `query:"get-otx-by-tracking-id"` GetOTXByAccount string `query:"get-otx-by-account"` GetOTXByAccountNext string `query:"get-otx-by-account-next"` GetOTXByAccountPrevious string `query:"get-otx-by-account-previous"` InsertDispatchTx string `query:"insert-dispatch-tx"` UpdateDispatchTxStatus string `query:"update-dispatch-tx-status"` }
type Store ¶
type Store interface { Pool() *pgxpool.Pool Bootstrap() error // Keys InsertKeyPair(context.Context, pgx.Tx, keypair.Key) error ActivateKeyPair(context.Context, pgx.Tx, string) error CheckKeypair(context.Context, pgx.Tx, string) (bool, error) LoadPrivateKey(context.Context, pgx.Tx, string) (keypair.Key, error) LoadMasterSignerKey(context.Context, pgx.Tx) (keypair.Key, error) // Nonce PeekNonce(context.Context, pgx.Tx, string) (uint64, error) AcquireNonce(context.Context, pgx.Tx, string) (uint64, error) SetAccountNonce(context.Context, pgx.Tx, string, uint64) error // OTX InsertOTX(context.Context, pgx.Tx, OTX) (uint64, error) GetOTXByTxHash(context.Context, pgx.Tx, string) (OTX, error) GetOTXByTrackingID(context.Context, pgx.Tx, string) (OTX, error) GetOTXByAccount(context.Context, pgx.Tx, string, int) ([]OTX, error) GetOTXByAccountNext(context.Context, pgx.Tx, string, int, int) ([]OTX, error) GetOTXByAccountPrevious(context.Context, pgx.Tx, string, int, int) ([]OTX, error) // Dispatch InsertDispatchTx(context.Context, pgx.Tx, DispatchTx) error UpdateDispatchTxStatus(context.Context, pgx.Tx, DispatchTx) error }
func NewPgStore ¶
Click to show internal directories.
Click to hide internal directories.