split

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateHash added in v0.1.0

func CalculateHash(params *HashParams) ([]byte, error)

Calculate the hash of the split requires abi.encodePacked non standard packed mode https://docs.soliditylang.org/en/latest/abi-spec.html#non-standard-packed-mode

func ParseRecipients

func ParseRecipients(accounts []string, percentageAllocations []uint32) (recipients []string, allocations []uint32, err error)

Types

type Client

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

func NewClient

func NewClient(log logrus.FieldLogger, config *Config) (*Client, error)

func (*Client) Create

func (c *Client) Create(ctx context.Context, node *execution.Node, contractABI *ethcoder.ABI, from, privateKey string, gasLimit uint64, params *CreateSplitParams) (*string, error)

func (*Client) DistributeETH

func (c *Client) DistributeETH(ctx context.Context, node *execution.Node, contractABI *ethcoder.ABI, from, privateKey string, gasLimit uint64, params *DistributeETHParams) error

func (*Client) GetController

func (c *Client) GetController(ctx context.Context, node *execution.Node, contractABI *ethcoder.ABI) (*string, error)

func (*Client) GetETHBalance

func (c *Client) GetETHBalance(ctx context.Context, node *execution.Node, contractABI *ethcoder.ABI, address string) (*big.Int, error)

func (*Client) GetHash

func (c *Client) GetHash(ctx context.Context, node *execution.Node, contractABI *ethcoder.ABI) (*[32]uint8, error)

func (*Client) Update

func (c *Client) Update(ctx context.Context, node *execution.Node, contractABI *ethcoder.ABI, from, privateKey string, gasLimit uint64, params *UpdateSplitParams) (*string, error)

func (*Client) Withdraw

func (c *Client) Withdraw(ctx context.Context, node *execution.Node, contractABI *ethcoder.ABI, from, privateKey string, gasLimit uint64, params *WithdrawParams) error

type Config

type Config struct {
	ContractAddress string  `yaml:"contractAddress,omitempty"`
	SplitAddress    *string `yaml:"splitAddress"`
}

func (*Config) Validate

func (c *Config) Validate() error

type CreateSplitParams

type CreateSplitParams struct {
	Controller            string
	Accounts              []string
	PercentageAllocations []uint32
	DistributorFee        uint32
	// contains filtered or unexported fields
}

type DistributeETHParams

type DistributeETHParams struct {
	Accounts              []string
	PercentageAllocations []uint32
	DistributorFee        uint32
	DistributorAddress    string
	// contains filtered or unexported fields
}

type HashParams

type HashParams struct {
	Accounts              []string
	PercentageAllocations []uint32
	DistributorFee        uint32
}

type UpdateSplitParams

type UpdateSplitParams struct {
	Accounts              []string
	PercentageAllocations []uint32
	DistributorFee        uint32
	// contains filtered or unexported fields
}

type WithdrawParams

type WithdrawParams struct {
	Address     string
	WithdrawETH bool
	Tokens      []string
}

Jump to

Keyboard shortcuts

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