contracts

package
v0.0.0-...-9f84b30 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DiscoveryNode = common.Utf8ToHex("discovery-node")
	ContentNode   = common.Utf8ToHex("content-node")
)

valid service types

View Source
var (
	RegistryKey               = common.Utf8ToHex("Registry")
	GovernanceKey             = common.Utf8ToHex("Governance")
	StakingKey                = common.Utf8ToHex("StakingProxy")
	ServiceProviderFactoryKey = common.Utf8ToHex("ServiceProviderFactory")
	ClaimsManagerKey          = common.Utf8ToHex("ClaimsManagerProxy")
	DelegateManagerKey        = common.Utf8ToHex("DelegateManager")
	AudiusTokenKey            = common.Utf8ToHex("Token")
	RewardsManagerKey         = common.Utf8ToHex("EthRewardsManagerProxy")
)

contract keys

Functions

func AudioToWei

func AudioToWei(audio *big.Int) *big.Int

func ServiceTypeToString

func ServiceTypeToString(serviceType [32]byte) (string, error)

func StringToServiceType

func StringToServiceType(s string) ([32]byte, error)

func WeiToAudio

func WeiToAudio(wei *big.Int) *big.Int

Types

type AudiusContracts

type AudiusContracts struct {

	/** contract addresses */
	RegistryAddress               *geth.Address
	GovernanceAddress             *geth.Address
	StakingAddress                *geth.Address
	ServiceProviderFactoryAddress *geth.Address
	ClaimsManagerAddress          *geth.Address
	DelegateManagerAddress        *geth.Address
	AudioTokenAddress             *geth.Address
	RewardsManagerAddress         *geth.Address
	ServiceTypeManagerAddress     *geth.Address

	/** contract instances */
	Registry               *gen.Registry
	Governance             *gen.Governance
	Staking                *gen.Staking
	ServiceProviderFactory *gen.ServiceProviderFactory
	ClaimsManager          *gen.ClaimsManager
	DelegateManager        *gen.DelegateManager
	AudioToken             *gen.AudiusToken
	RewardsManager         *gen.EthRewardsManager
	ServiceTypeManager     *gen.ServiceTypeManager
	// contains filtered or unexported fields
}

manager struct so contracts get loaded lazily upon usage and don't spam rpcs for contracts a developer may not need

func NewAudiusContracts

func NewAudiusContracts(rpc *ethclient.Client, registryAddress string) (*AudiusContracts, error)

instantiates audius contract manager so that contracts can be initialized lazily

func NewAudiusContractsInit

func NewAudiusContractsInit(rpc *ethclient.Client, registryAddress string) (*AudiusContracts, error)

instantiates audius contract manager and eagerly gathers contract instances as well

func (*AudiusContracts) GetAllRegisteredNodes

func (ac *AudiusContracts) GetAllRegisteredNodes(ctx context.Context) ([]*Node, error)

func (*AudiusContracts) GetAllRegisteredNodesForType

func (ac *AudiusContracts) GetAllRegisteredNodesForType(ctx context.Context, nodeType [32]byte) ([]*Node, error)

func (*AudiusContracts) GetAudioTokenContract

func (ac *AudiusContracts) GetAudioTokenContract() (*gen.AudiusToken, error)

func (*AudiusContracts) GetClaimsManagerContract

func (ac *AudiusContracts) GetClaimsManagerContract() (*gen.ClaimsManager, error)

func (*AudiusContracts) GetDelegateManagerContract

func (ac *AudiusContracts) GetDelegateManagerContract() (*gen.DelegateManager, error)

func (*AudiusContracts) GetGovernanceContract

func (ac *AudiusContracts) GetGovernanceContract() (*gen.Governance, error)

func (*AudiusContracts) GetRegisteredNode

func (ac *AudiusContracts) GetRegisteredNode(ctx context.Context, id *big.Int, nodeType [32]byte) (*Node, error)

func (*AudiusContracts) GetRewardsManagerContract

func (ac *AudiusContracts) GetRewardsManagerContract() (*gen.EthRewardsManager, error)

func (*AudiusContracts) GetServiceProviderFactoryContract

func (ac *AudiusContracts) GetServiceProviderFactoryContract() (*gen.ServiceProviderFactory, error)

func (*AudiusContracts) GetServiceTypeManagerContract

func (ac *AudiusContracts) GetServiceTypeManagerContract() (*gen.ServiceTypeManager, error)

func (*AudiusContracts) GetStakingContract

func (ac *AudiusContracts) GetStakingContract() (*gen.Staking, error)

type Node

type Node struct {
	Id                  *big.Int
	Owner               geth.Address
	Endpoint            string
	Type                [32]byte
	BlockNumber         *big.Int
	DelegateOwnerWallet geth.Address
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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