 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- func ConvertBlockchainType(blockchain commonv1.Blockchain) (wconstants.BlockchainType, error)
- func ConvertBlockchainTypeToPb(blockchain wconstants.BlockchainType) commonv1.Blockchain
- func ConvertTransferStatusToPb(status constants.TransferStatus) transferv1.Status
- func ConvertTransferTransactionStatusToPb(txStatus TransferTransactionsStatus) transferv1.TransferTransactionStatus
- func ConvertTransferTransactionTypeToPb(txType TransferTransactionType) transferv1.TransferTransactionType
- func TransferTransactionSystemTypes() []string
- type Asset
- type BlockchainBlock
- type Client
- type ColdWallet
- type HotWallet
- type LastProcessedBlock
- type NotificationError
- type NullRiverJobState
- type Owner
- type ProcessedBlock
- type ProcessingError
- type ProcessingWallet
- type PrometheusMetricType
- type RiverClient
- type RiverClientQueue
- type RiverJob
- type RiverJobState
- type RiverLeader
- type RiverQueue
- type Setting
- type Transfer
- type TransferTransaction
- type TransferTransactionType
- type TransferTransactionsStatus
- type Webhook
- type WebhookEventStatus
- type WebhookKind
- type WebhookStatus
- type WebhookView
Constants ¶
      View Source
      
  
const DefaultWalletTTL = time.Minute * 20
    Variables ¶
      View Source
      
  
var ( ErrNoRowsInResultSet = NewProcessingError("no rows in result set") ErrBlockNotFound = NewProcessingError("block not found") ErrTransactionType NotificationError = errors.New("define transaction type") ErrSendWebhook NotificationError = errors.New("send webhook") ErrBlockProcessingTimeout NotificationError = errors.New("block processing timeout") ErrWithdrawalNotFound NotificationError = errors.New("withdrawal not found") ErrWalletCast = errors.New("wallet type cast error") ErrWalletNotFound = errors.New("wallet not found") ErrOwnerNotFound = errors.New("owner not found") ErrClientNotFound = errors.New("client not found") ErrBlockchainUndefined = errors.New("blockchain undefined") )
Functions ¶
func ConvertBlockchainType ¶
func ConvertBlockchainType(blockchain commonv1.Blockchain) (wconstants.BlockchainType, error)
ConvertBlockchainType converts commonv1.Blockchain to wconstants.BlockchainType.
func ConvertBlockchainTypeToPb ¶
func ConvertBlockchainTypeToPb(blockchain wconstants.BlockchainType) commonv1.Blockchain
ConvertBlockchainTypeToPb
func ConvertTransferStatusToPb ¶
func ConvertTransferStatusToPb(status constants.TransferStatus) transferv1.Status
ConvertTransferStatusToPb converts a TransferStatus to a TransferStatus protobuf message
func ConvertTransferTransactionStatusToPb ¶
func ConvertTransferTransactionStatusToPb(txStatus TransferTransactionsStatus) transferv1.TransferTransactionStatus
func ConvertTransferTransactionTypeToPb ¶
func ConvertTransferTransactionTypeToPb(txType TransferTransactionType) transferv1.TransferTransactionType
func TransferTransactionSystemTypes ¶
func TransferTransactionSystemTypes() []string
Types ¶
type BlockchainBlock ¶
type BlockchainBlock struct {
	Blockchain wconstants.BlockchainType
	Number     uint64
}
    type Client ¶
type Client struct {
	ID          uuid.UUID          `db:"id" json:"id"`
	SecretKey   string             `db:"secret_key" json:"secret_key"`
	CallbackUrl string             `db:"callback_url" json:"callback_url"`
	CreatedAt   pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
}
    type ColdWallet ¶
type ColdWallet struct {
	ID         uuid.UUID                 `db:"id" json:"id"`
	Blockchain wconstants.BlockchainType `db:"blockchain" json:"blockchain" validate:"required"`
	Address    string                    `db:"address" json:"address" validate:"required"`
	OwnerID    uuid.UUID                 `db:"owner_id" json:"owner_id" validate:"required,uuid4"`
	IsActive   bool                      `db:"is_active" json:"is_active"`
	IsDirty    bool                      `db:"is_dirty" json:"is_dirty"`
	CreatedAt  pgtype.Timestamptz        `db:"created_at" json:"created_at"`
	UpdatedAt  pgtype.Timestamptz        `db:"updated_at" json:"updated_at"`
}
    type HotWallet ¶
type HotWallet struct {
	ID               uuid.UUID                 `db:"id" json:"id"`
	Blockchain       wconstants.BlockchainType `db:"blockchain" json:"blockchain" validate:"required"`
	Address          string                    `db:"address" json:"address" validate:"required"`
	OwnerID          uuid.UUID                 `db:"owner_id" json:"owner_id" validate:"required,uuid4"`
	ExternalWalletID string                    `db:"external_wallet_id" json:"external_wallet_id" validate:"required"`
	Sequence         int32                     `db:"sequence" json:"sequence"`
	IsActivated      bool                      `db:"is_activated" json:"is_activated"`
	IsActive         bool                      `db:"is_active" json:"is_active"`
	IsDirty          bool                      `db:"is_dirty" json:"is_dirty"`
	CreatedAt        pgtype.Timestamptz        `db:"created_at" json:"created_at"`
	UpdatedAt        pgtype.Timestamptz        `db:"updated_at" json:"updated_at"`
}
    type LastProcessedBlock ¶
type LastProcessedBlock struct {
	Blockchain       wconstants.BlockchainType
	StartBlockNumber uint64
	EndBlockNumber   uint64
}
    type NotificationError ¶
type NotificationError error
type NullRiverJobState ¶
type NullRiverJobState struct {
	RiverJobState RiverJobState `json:"river_job_state"`
	Valid         bool          `json:"valid"` // Valid is true if RiverJobState is not NULL
}
    func (*NullRiverJobState) Scan ¶
func (ns *NullRiverJobState) Scan(value interface{}) error
Scan implements the Scanner interface.
type Owner ¶
type Owner struct {
	ID           uuid.UUID          `db:"id" json:"id"`
	ExternalID   string             `db:"external_id" json:"external_id" validate:"required"`
	ClientID     uuid.UUID          `db:"client_id" json:"client_id" validate:"required,uuid4"`
	Mnemonic     string             `db:"mnemonic" json:"mnemonic" validate:"required"`
	PassPhrase   pgtype.Text        `db:"pass_phrase" json:"pass_phrase"`
	OtpSecret    pgtype.Text        `db:"otp_secret" json:"otp_secret" validate:"required"`
	OtpConfirmed bool               `db:"otp_confirmed" json:"otp_confirmed"`
	CreatedAt    pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	OtpData      pgtype.Text        `db:"otp_data" json:"otp_data"`
}
    type ProcessedBlock ¶
type ProcessedBlock struct {
	Blockchain wconstants.BlockchainType `db:"blockchain" json:"blockchain"`
	Number     int64                     `db:"number" json:"number"`
	CreatedAt  pgtype.Timestamptz        `db:"created_at" json:"created_at"`
	UpdatedAt  pgtype.Timestamptz        `db:"updated_at" json:"updated_at"`
}
    type ProcessingError ¶
type ProcessingError string
func NewProcessingError ¶
func NewProcessingError(str string) ProcessingError
func (ProcessingError) Contains ¶
func (p ProcessingError) Contains(err error) bool
func (ProcessingError) Error ¶
func (p ProcessingError) Error() string
type ProcessingWallet ¶
type ProcessingWallet struct {
	ID         uuid.UUID                 `db:"id" json:"id"`
	Blockchain wconstants.BlockchainType `db:"blockchain" json:"blockchain" validate:"required"`
	Address    string                    `db:"address" json:"address" validate:"required"`
	OwnerID    uuid.UUID                 `db:"owner_id" json:"owner_id" validate:"required,uuid4"`
	Sequence   int32                     `db:"sequence" json:"sequence"`
	IsActive   bool                      `db:"is_active" json:"is_active"`
	IsDirty    bool                      `db:"is_dirty" json:"is_dirty"`
	CreatedAt  pgtype.Timestamptz        `db:"created_at" json:"created_at"`
	UpdatedAt  pgtype.Timestamptz        `db:"updated_at" json:"updated_at"`
}
    type PrometheusMetricType ¶
type PrometheusMetricType int
const ErrorPrometheusMetricType PrometheusMetricType = iota
    type RiverClient ¶
type RiverClient struct {
	ID        string             `db:"id" json:"id"`
	CreatedAt pgtype.Timestamptz `db:"created_at" json:"created_at"`
	Metadata  []byte             `db:"metadata" json:"metadata"`
	PausedAt  pgtype.Timestamptz `db:"paused_at" json:"paused_at"`
	UpdatedAt pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
}
    type RiverClientQueue ¶
type RiverClientQueue struct {
	RiverClientID    string             `db:"river_client_id" json:"river_client_id"`
	Name             string             `db:"name" json:"name"`
	CreatedAt        pgtype.Timestamptz `db:"created_at" json:"created_at"`
	MaxWorkers       int64              `db:"max_workers" json:"max_workers"`
	Metadata         []byte             `db:"metadata" json:"metadata"`
	NumJobsCompleted int64              `db:"num_jobs_completed" json:"num_jobs_completed"`
	NumJobsRunning   int64              `db:"num_jobs_running" json:"num_jobs_running"`
	UpdatedAt        pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
}
    type RiverJob ¶
type RiverJob struct {
	ID           int64              `db:"id" json:"id"`
	State        RiverJobState      `db:"state" json:"state"`
	Attempt      int16              `db:"attempt" json:"attempt"`
	MaxAttempts  int16              `db:"max_attempts" json:"max_attempts"`
	AttemptedAt  pgtype.Timestamptz `db:"attempted_at" json:"attempted_at"`
	CreatedAt    pgtype.Timestamptz `db:"created_at" json:"created_at"`
	FinalizedAt  pgtype.Timestamptz `db:"finalized_at" json:"finalized_at"`
	ScheduledAt  pgtype.Timestamptz `db:"scheduled_at" json:"scheduled_at"`
	Priority     int16              `db:"priority" json:"priority"`
	Args         []byte             `db:"args" json:"args"`
	AttemptedBy  []string           `db:"attempted_by" json:"attempted_by"`
	Errors       [][]byte           `db:"errors" json:"errors"`
	Kind         string             `db:"kind" json:"kind"`
	Metadata     []byte             `db:"metadata" json:"metadata"`
	Queue        string             `db:"queue" json:"queue"`
	Tags         []string           `db:"tags" json:"tags"`
	UniqueKey    []byte             `db:"unique_key" json:"unique_key"`
	UniqueStates pgtype.Bits        `db:"unique_states" json:"unique_states"`
}
    type RiverJobState ¶
type RiverJobState string
const ( RiverJobStateAvailable RiverJobState = "available" RiverJobStateCancelled RiverJobState = "cancelled" RiverJobStateCompleted RiverJobState = "completed" RiverJobStateDiscarded RiverJobState = "discarded" RiverJobStatePending RiverJobState = "pending" RiverJobStateRetryable RiverJobState = "retryable" RiverJobStateRunning RiverJobState = "running" RiverJobStateScheduled RiverJobState = "scheduled" )
func AllRiverJobStateValues ¶
func AllRiverJobStateValues() []RiverJobState
func (*RiverJobState) Scan ¶
func (e *RiverJobState) Scan(src interface{}) error
func (RiverJobState) Valid ¶
func (e RiverJobState) Valid() bool
type RiverLeader ¶
type RiverLeader struct {
	ElectedAt pgtype.Timestamptz `db:"elected_at" json:"elected_at"`
	ExpiresAt pgtype.Timestamptz `db:"expires_at" json:"expires_at"`
	LeaderID  string             `db:"leader_id" json:"leader_id"`
	Name      string             `db:"name" json:"name"`
}
    type RiverQueue ¶
type RiverQueue struct {
	Name      string             `db:"name" json:"name"`
	CreatedAt pgtype.Timestamptz `db:"created_at" json:"created_at"`
	Metadata  []byte             `db:"metadata" json:"metadata"`
	PausedAt  pgtype.Timestamptz `db:"paused_at" json:"paused_at"`
	UpdatedAt pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
}
    type Setting ¶
type Setting struct {
	ID        uuid.UUID          `db:"id" json:"id"`
	ModelID   uuid.NullUUID      `db:"model_id" json:"model_id"`
	ModelType pgtype.Text        `db:"model_type" json:"model_type"`
	Name      string             `db:"name" json:"name"`
	Value     string             `db:"value" json:"value"`
	CreatedAt pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
}
    type Transfer ¶
type Transfer struct {
	ID               uuid.UUID                 `db:"id" json:"id"`
	Status           constants.TransferStatus  `db:"status" json:"status"`
	ClientID         uuid.UUID                 `db:"client_id" json:"client_id"`
	OwnerID          uuid.UUID                 `db:"owner_id" json:"owner_id"`
	RequestID        string                    `db:"request_id" json:"request_id"`
	Blockchain       wconstants.BlockchainType `db:"blockchain" json:"blockchain"`
	FromAddresses    []string                  `db:"from_addresses" json:"from_addresses"`
	ToAddresses      []string                  `db:"to_addresses" json:"to_addresses"`
	WalletFromType   constants.WalletType      `db:"wallet_from_type" json:"wallet_from_type"`
	AssetIdentifier  string                    `db:"asset_identifier" json:"asset_identifier"`
	Kind             pgtype.Text               `db:"kind" json:"kind"`
	WholeAmount      bool                      `db:"whole_amount" json:"whole_amount"`
	Amount           decimal.NullDecimal       `db:"amount" json:"amount"`
	Fee              decimal.NullDecimal       `db:"fee" json:"fee"`
	FeeMax           decimal.NullDecimal       `db:"fee_max" json:"fee_max"`
	TxHash           pgtype.Text               `db:"tx_hash" json:"tx_hash"`
	CreatedAt        pgtype.Timestamptz        `db:"created_at" json:"created_at"`
	UpdatedAt        pgtype.Timestamptz        `db:"updated_at" json:"updated_at"`
	StateData        map[string]any            `db:"state_data" json:"state_data"`
	WorkflowSnapshot workflow.Snapshot         `db:"workflow_snapshot" json:"workflow_snapshot"`
}
    func (Transfer) GetFromAddress ¶
GetFromAddress returns the first from address
func (Transfer) GetToAddress ¶
GetToAddress returns the first to address
type TransferTransaction ¶
type TransferTransaction struct {
	ID                uuid.UUID                  `db:"id" json:"id"`
	TransferID        uuid.UUID                  `db:"transfer_id" json:"transfer_id"`
	TxHash            string                     `db:"tx_hash" json:"tx_hash"`
	BandwidthAmount   decimal.Decimal            `db:"bandwidth_amount" json:"bandwidth_amount"`
	EnergyAmount      decimal.Decimal            `db:"energy_amount" json:"energy_amount"`
	NativeTokenAmount decimal.Decimal            `db:"native_token_amount" json:"native_token_amount"`
	NativeTokenFee    decimal.Decimal            `db:"native_token_fee" json:"native_token_fee"`
	TxType            TransferTransactionType    `db:"tx_type" json:"tx_type"`
	Status            TransferTransactionsStatus `db:"status" json:"status"`
	Step              string                     `db:"step" json:"step"`
	CreatedAt         pgtype.Timestamptz         `db:"created_at" json:"created_at"`
	UpdatedAt         pgtype.Timestamptz         `db:"updated_at" json:"updated_at"`
}
    func (*TransferTransaction) ToPb ¶
func (tt *TransferTransaction) ToPb() *transferv1.TransferTransaction
type TransferTransactionType ¶
type TransferTransactionType string
const ( TransferTransactionTypeDelegateResources TransferTransactionType = "resource_delegation" TransferTransactionTypeReclaimResources TransferTransactionType = "resource_reclaim" TransferTransactionTypeSendBurnBaseAsset TransferTransactionType = "send_burn_base_asset" TransferTransactionTypeAccountActivation TransferTransactionType = "account_activation" TransferTransactionTypeTransfer TransferTransactionType = "transfer" )
func (TransferTransactionType) String ¶
func (t TransferTransactionType) String() string
type TransferTransactionsStatus ¶
type TransferTransactionsStatus string
const ( TransferTransactionsStatusPending TransferTransactionsStatus = "pending" TransferTransactionsStatusUnconfirmed TransferTransactionsStatus = "unconfirmed" TransferTransactionsStatusConfirmed TransferTransactionsStatus = "confirmed" TransferTransactionsStatusFailed TransferTransactionsStatus = "failed" )
func (TransferTransactionsStatus) String ¶
func (tts TransferTransactionsStatus) String() string
type Webhook ¶
type Webhook struct {
	ID        uuid.UUID          `db:"id" json:"id"`
	Kind      WebhookKind        `db:"kind" json:"kind"`
	Status    WebhookStatus      `db:"status" json:"status"`
	Attempts  int32              `db:"attempts" json:"attempts"`
	Payload   []byte             `db:"payload" json:"payload"`
	ClientID  uuid.UUID          `db:"client_id" json:"client_id"`
	Response  pgtype.Text        `db:"response" json:"response"`
	CreatedAt pgtype.Timestamptz `db:"created_at" json:"created_at"`
	SentAt    pgtype.Timestamptz `db:"sent_at" json:"sent_at"`
	UpdatedAt pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
}
    type WebhookEventStatus ¶
type WebhookEventStatus string
const ( WebhookEventStatusWaitingConfirmations WebhookEventStatus = "waiting_confirmations" WebhookEventStatusInMempool WebhookEventStatus = "in_mempool" WebhookEventStatusCompleted WebhookEventStatus = "completed" WebhookEventStatusFailed WebhookEventStatus = "failed" )
func (*WebhookEventStatus) Scan ¶
func (w *WebhookEventStatus) Scan(src interface{}) error
Scan implements the sql.Scanner interface
func (WebhookEventStatus) String ¶
func (w WebhookEventStatus) String() string
String returns the webhook event status as a string
type WebhookKind ¶
type WebhookKind string
const ( WebhookKindTransfer WebhookKind = "transfer" WebhookKindDeposit WebhookKind = "deposit" WebhookKindTransferStatus WebhookKind = "transfer_status" )
func (*WebhookKind) Scan ¶
func (w *WebhookKind) Scan(src interface{}) error
Scan implements the sql.Scanner interface
func (WebhookKind) String ¶
func (w WebhookKind) String() string
String returns the webhook kind as a string
type WebhookStatus ¶
type WebhookStatus string
const ( WebhookStatusNew WebhookStatus = "new" WebhookStatusSent WebhookStatus = "sent" )
func (*WebhookStatus) Scan ¶
func (w *WebhookStatus) Scan(src interface{}) error
Scan implements the sql.Scanner interface
func (WebhookStatus) String ¶
func (w WebhookStatus) String() string
String returns the webhook status as a string
type WebhookView ¶
type WebhookView struct {
	ID          uuid.UUID          `db:"id" json:"id"`
	Kind        WebhookKind        `db:"kind" json:"kind"`
	Status      WebhookStatus      `db:"status" json:"status"`
	Attempts    int32              `db:"attempts" json:"attempts"`
	Payload     []byte             `db:"payload" json:"payload"`
	ClientID    uuid.UUID          `db:"client_id" json:"client_id"`
	Response    pgtype.Text        `db:"response" json:"response"`
	CreatedAt   pgtype.Timestamptz `db:"created_at" json:"created_at"`
	SentAt      pgtype.Timestamptz `db:"sent_at" json:"sent_at"`
	UpdatedAt   pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	CallbackUrl string             `db:"callback_url" json:"callback_url"`
	SecretKey   string             `db:"secret_key" json:"secret_key"`
}
     Click to show internal directories. 
   Click to hide internal directories.