events

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CUSTODIAL_NETWORK_NAME               = "Custodial.Network"
	SCALAR_NETWORK_NAME                  = "Scalar.Network"
	EVENT_BTC_SIGNATURE_REQUESTED        = "Btc.SignatureRequested"
	EVENT_BTC_PSBT_SIGN_REQUEST          = "Btc.PsbtSignRequest"
	EVENT_CUSTODIAL_SIGNATURES_CONFIRMED = "Custodial.SignaturesConfirmed"
	EVENT_ELECTRS_VAULT_TRANSACTION      = "Electrs.VaultTransaction"
	EVENT_SCALAR_TOKEN_SENT              = "Scalar.TokenSent"
	EVENT_SCALAR_DEST_CALL_APPROVED      = "Scalar.ContractCallApproved"
	EVENT_SCALAR_BATCHCOMMAND_SIGNED     = "Scalar.BatchCommandSigned"
	EVENT_SCALAR_COMMAND_EXECUTED        = "Scalar.CommandExecuted"
	EVENT_SCALAR_CREATE_PSBT_REQUEST     = "Scalar.CreatePsbtRequest"
	EVENT_EVM_CONTRACT_CALL_APPROVED     = "ContractCallApproved"
	EVENT_EVM_CONTRACT_CALL              = "ContractCall"
	EVENT_EVM_CONTRACT_CALL_WITH_TOKEN   = "ContractCallWithToken"
	EVENT_EVM_TOKEN_SENT                 = "TokenSent"
	EVENT_EVM_COMMAND_EXECUTED           = "Executed"
	EVENT_EVM_TOKEN_DEPLOYED             = "TokenDeployed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Channels

type Channels []chan<- *EventEnvelope

type ConfirmTxsRequest

type ConfirmTxsRequest struct {
	ChainName string
	TxHashs   map[string]string //Map txHash to DestinationChain, user for validate destination chain
}

type EventBus

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

Store array of channels by destination chain

func GetEventBus

func GetEventBus(config *config.EventBusConfig) *EventBus

func NewEventBus

func NewEventBus(config *config.EventBusConfig) *EventBus

Todo: Add some event bus config For example: - Event buffer size - Event receiver buffer size

func (*EventBus) BroadcastEvent

func (eb *EventBus) BroadcastEvent(event *EventEnvelope)

func (*EventBus) Subscribe

func (eb *EventBus) Subscribe(destinationChain string) <-chan *EventEnvelope

type EventEnvelope

type EventEnvelope struct {
	DestinationChain string      // The source chain of the event
	EventType        string      // The name of the event in format "ComponentName.EventName"
	MessageID        string      // The message id of the event used add RelayData'id
	CommandIDs       []string    // The command ids
	Data             interface{} // The actual event data
}

type SignatureRequest

type SignatureRequest struct {
	ExecuteParams *types.ExecuteParams
	Base64Psbt    string
}

Jump to

Keyboard shortcuts

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