Help us shape the future of Go! Take the 2026 Go Developer Survey

client

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 33 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(ctx context.Context) (*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
	Changeset
)

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(ctx context.Context, workflowID [32]byte, donFamily string) (*TxOutput, error)

func (*WorkflowRegistryV2Client) AllowlistRequest

func (wrc *WorkflowRegistryV2Client) AllowlistRequest(ctx context.Context, requestDigest [32]byte, duration time.Duration) (*TxOutput, 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(ctx context.Context, workflowIDs [][32]byte) (*TxOutput, error)

func (*WorkflowRegistryV2Client) CanLinkOwner

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

func (*WorkflowRegistryV2Client) CanUnlinkOwner

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

func (*WorkflowRegistryV2Client) CheckUserDonLimit added in v1.0.6

func (wrc *WorkflowRegistryV2Client) CheckUserDonLimit(
	ctx context.Context,
	owner common.Address,
	donFamily string,
	pending uint32,
) error

func (*WorkflowRegistryV2Client) DeleteWorkflow

func (wrc *WorkflowRegistryV2Client) DeleteWorkflow(ctx context.Context, workflowID [32]byte) (*TxOutput, error)

func (*WorkflowRegistryV2Client) GetLinkedOwners

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

func (*WorkflowRegistryV2Client) GetMaxWorkflowsPerDON

func (wrc *WorkflowRegistryV2Client) GetMaxWorkflowsPerDON(ctx context.Context, donFamily [32]byte) (uint32, error)

func (*WorkflowRegistryV2Client) GetMaxWorkflowsPerUserDON

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

func (*WorkflowRegistryV2Client) GetMaxWorkflowsPerUserDONByFamily added in v1.0.6

func (wrc *WorkflowRegistryV2Client) GetMaxWorkflowsPerUserDONByFamily(ctx context.Context, user common.Address, donFamily string) (uint32, error)

func (*WorkflowRegistryV2Client) GetWorkflow

func (*WorkflowRegistryV2Client) GetWorkflowListByOwner added in v1.0.6

func (*WorkflowRegistryV2Client) GetWorkflowListByOwnerAndName

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

func (*WorkflowRegistryV2Client) IsAllowedSigner

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

func (*WorkflowRegistryV2Client) IsOwnerLinked

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

func (*WorkflowRegistryV2Client) IsRequestAllowlisted

func (wrc *WorkflowRegistryV2Client) IsRequestAllowlisted(ctx context.Context, 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(ctx context.Context, validityTimestamp *big.Int, proof [32]byte, signature []byte) (*TxOutput, error)

func (*WorkflowRegistryV2Client) SetDONOverride

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

func (*WorkflowRegistryV2Client) SetDefaults

func (wrc *WorkflowRegistryV2Client) SetDefaults(ctx context.Context, maxPerDON, maxPerUserDON uint32) error

func (*WorkflowRegistryV2Client) SetDonLimit

func (wrc *WorkflowRegistryV2Client) SetDonLimit(ctx context.Context, donFamily string, limit uint32, userDefaultLimit uint32) error

func (*WorkflowRegistryV2Client) SetUserDONOverride

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

func (*WorkflowRegistryV2Client) TotalLinkedOwners

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

func (*WorkflowRegistryV2Client) TypeAndVersion

func (wrc *WorkflowRegistryV2Client) TypeAndVersion(ctx context.Context) (string, error)

func (*WorkflowRegistryV2Client) UnlinkOwner

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

func (*WorkflowRegistryV2Client) UpdateAllowedSigners

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

func (*WorkflowRegistryV2Client) UpsertWorkflow

Jump to

Keyboard shortcuts

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