client

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeCustomError

func DecodeCustomError(errStr string) string

func LoadContracts

func LoadContracts(l *zerolog.Logger, client *seth.Client) error

func NewEthClientFromEnv

func NewEthClientFromEnv(v *viper.Viper, l *zerolog.Logger, ethUrl string) (*seth.Client, error)

func NewSethClient

func NewSethClient(
	configFile string,
	rpc string,
	privateKeys []string,
	chainId uint64,
) (*seth.Client, error)

func NewSethClientWithSimulated

func NewSethClientWithSimulated(
	configFile string,
	rpc string,
	privateKeys []string,
	chainId uint64,
	backend *simulated.Backend,
) (*seth.Client, error)

Types

type Factory

type Factory interface {
	NewWorkflowRegistryV2Client() (*WorkflowRegistryV2Client, error)
	GetTxType() TxType
	GetSkipConfirmation() bool
}

func NewFactory

func NewFactory(logger *zerolog.Logger, viper *viper.Viper) Factory

type LedgerConfig

type LedgerConfig struct {
	DerivationPath string
	LedgerEnabled  bool
}

type RawTx

type RawTx struct {
	To       string
	Data     []byte
	Function string
	Args     []string
}

type RegisterWorkflowV2Parameters

type RegisterWorkflowV2Parameters struct {
	WorkflowName string   // required: user specified human readable workflow name label
	Tag          string   // required: User input tag for the workflow, e.g. "Por Workflow v2"
	WorkflowID   [32]byte // required: generated based on the workflow content and owner address
	Status       uint8    // required
	DonFamily    string   // required: DON family label

	BinaryURL  string // required: URL location for the workflow binary WASM file
	ConfigURL  string // optional: URL location for the workflow configuration file (default empty string)
	Attributes []byte // optional: 1 to pause workflow after registration, 0 to activate it (default is 0)
	KeepAlive  bool   // optional: whether to keep the other workflows of the same name and owner active after the new deploy (default is false)
}

type TxClient

type TxClient struct {
	Logger    *zerolog.Logger
	EthClient *seth.Client
	// contains filtered or unexported fields
}

type TxClientConfig

type TxClientConfig struct {
	TxType       TxType
	LedgerConfig *LedgerConfig
	SkipPrompt   bool
}

type TxOutput

type TxOutput struct {
	Type  TxType
	Hash  common.Hash
	RawTx RawTx
}

type TxType

type TxType int
const (
	Regular TxType = iota
	Raw
	Ledger
)

func (TxType) String

func (i TxType) String() string

type WorkflowRegistryV2Client

type WorkflowRegistryV2Client struct {
	TxClient
	ContractAddress common.Address
	Wr              workflowRegistryV2Contract
}

func NewWorkflowRegistryV2Client

func NewWorkflowRegistryV2Client(logger *zerolog.Logger, ethClient *seth.Client, address string, txcConfig TxClientConfig) *WorkflowRegistryV2Client

func (*WorkflowRegistryV2Client) ActivateWorkflow

func (wrc *WorkflowRegistryV2Client) ActivateWorkflow(workflowID [32]byte, donFamily string) (*TxOutput, error)

func (*WorkflowRegistryV2Client) AllowlistRequest

func (wrc *WorkflowRegistryV2Client) AllowlistRequest(requestDigest [32]byte, duration time.Duration) error

AllowlistRequest sends the request digest to the WorkflowRegistry allowlist with a default expiry of now + 10 minutes. `requestDigestHex` should be the hex string produced by utils.CalculateRequestDigest(...), with or without "0x".

func (*WorkflowRegistryV2Client) BatchPauseWorkflows

func (wrc *WorkflowRegistryV2Client) BatchPauseWorkflows(workflowIDs [][32]byte) (*TxOutput, error)

func (*WorkflowRegistryV2Client) CanLinkOwner

func (wrc *WorkflowRegistryV2Client) CanLinkOwner(owner common.Address, validityTimestamp *big.Int, proof [32]byte, signature []byte) error

func (*WorkflowRegistryV2Client) CanUnlinkOwner

func (wrc *WorkflowRegistryV2Client) CanUnlinkOwner(owner common.Address, validityTimestamp *big.Int, signature []byte) error

func (*WorkflowRegistryV2Client) DeleteWorkflow

func (wrc *WorkflowRegistryV2Client) DeleteWorkflow(workflowID [32]byte) (*TxOutput, error)

func (*WorkflowRegistryV2Client) GetLinkedOwners

func (wrc *WorkflowRegistryV2Client) GetLinkedOwners(start, batchSize *big.Int) ([]common.Address, error)

func (*WorkflowRegistryV2Client) GetMaxWorkflowsPerDON

func (wrc *WorkflowRegistryV2Client) GetMaxWorkflowsPerDON(donFamily [32]byte) (uint32, error)

func (*WorkflowRegistryV2Client) GetMaxWorkflowsPerUserDON

func (wrc *WorkflowRegistryV2Client) GetMaxWorkflowsPerUserDON(user common.Address, donFamily [32]byte) (uint32, error)

func (*WorkflowRegistryV2Client) GetWorkflow

func (*WorkflowRegistryV2Client) GetWorkflowListByOwnerAndName

func (wrc *WorkflowRegistryV2Client) GetWorkflowListByOwnerAndName(owner common.Address, workflowName string, start, limit *big.Int) ([]workflow_registry_v2_wrapper.WorkflowRegistryWorkflowMetadataView, error)

func (*WorkflowRegistryV2Client) IsAllowedSigner

func (wrc *WorkflowRegistryV2Client) IsAllowedSigner(signer common.Address) (bool, error)

func (*WorkflowRegistryV2Client) IsOwnerLinked

func (wrc *WorkflowRegistryV2Client) IsOwnerLinked(owner common.Address) (bool, error)

func (*WorkflowRegistryV2Client) IsRequestAllowlisted

func (wrc *WorkflowRegistryV2Client) IsRequestAllowlisted(owner common.Address, digest [32]byte) (bool, error)

IsRequestAllowlisted queries the registry to check if a given (owner, requestDigest) is allowlisted. requestDigestHex may include or omit the 0x prefix.

func (*WorkflowRegistryV2Client) LinkOwner

func (wrc *WorkflowRegistryV2Client) LinkOwner(validityTimestamp *big.Int, proof [32]byte, signature []byte) (*TxOutput, error)

func (*WorkflowRegistryV2Client) SetDONOverride

func (wrc *WorkflowRegistryV2Client) SetDONOverride(donFamily [32]byte, limit uint32, enabled bool) error

func (*WorkflowRegistryV2Client) SetDefaults

func (wrc *WorkflowRegistryV2Client) SetDefaults(maxPerDON, maxPerUserDON uint32) error

func (*WorkflowRegistryV2Client) SetDonLimit

func (wrc *WorkflowRegistryV2Client) SetDonLimit(donFamily string, limit uint32, userDefaultLimit uint32) error

func (*WorkflowRegistryV2Client) SetUserDONOverride

func (wrc *WorkflowRegistryV2Client) SetUserDONOverride(user common.Address, donFamily [32]byte, limit uint32, enabled bool) error

func (*WorkflowRegistryV2Client) TotalLinkedOwners

func (wrc *WorkflowRegistryV2Client) TotalLinkedOwners() (*big.Int, error)

func (*WorkflowRegistryV2Client) TypeAndVersion

func (wrc *WorkflowRegistryV2Client) TypeAndVersion() (string, error)

func (*WorkflowRegistryV2Client) UnlinkOwner

func (wrc *WorkflowRegistryV2Client) UnlinkOwner(owner common.Address, validityTimestamp *big.Int, signature []byte) (*TxOutput, error)

func (*WorkflowRegistryV2Client) UpdateAllowedSigners

func (wrc *WorkflowRegistryV2Client) UpdateAllowedSigners(signers []common.Address, allowed bool) error

func (*WorkflowRegistryV2Client) UpsertWorkflow

func (wrc *WorkflowRegistryV2Client) UpsertWorkflow(params RegisterWorkflowV2Parameters) (*TxOutput, error)

Jump to

Keyboard shortcuts

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