Documentation
¶
Index ¶
- type AdminControl
- func (ac *AdminControl) Destroy(option *types.ContractMethodSendOption, contractAddr types.Address) (types.Hash, error)
- func (ac *AdminControl) GetAdmin(option *types.ContractMethodCallOption, contractAddr types.Address) (types.Address, error)
- func (ac *AdminControl) SetAdmin(option *types.ContractMethodSendOption, contractAddr types.Address, ...) (types.Hash, error)
- type Sponsor
- func (s *Sponsor) AddPrivilegeByAdmin(option *types.ContractMethodSendOption, contractAddr types.Address, ...) (types.Hash, error)
- func (s *Sponsor) GetSponsorForCollateral(option *types.ContractMethodCallOption, contractAddr types.Address) (address types.Address, err error)
- func (s *Sponsor) GetSponsorForGas(option *types.ContractMethodCallOption, contractAddr types.Address) (address types.Address, err error)
- func (s *Sponsor) GetSponsoredBalanceForCollateral(option *types.ContractMethodCallOption, contractAddr types.Address) (*big.Int, error)
- func (s *Sponsor) GetSponsoredBalanceForGas(option *types.ContractMethodCallOption, contractAddr types.Address) (*big.Int, error)
- func (s *Sponsor) GetSponsoredGasFeeUpperBound(option *types.ContractMethodCallOption, contractAddr types.Address) (*big.Int, error)
- func (s *Sponsor) IsAllWhitelisted(option *types.ContractMethodCallOption, contractAddr types.Address) (bool, error)
- func (s *Sponsor) IsWhitelisted(option *types.ContractMethodCallOption, contractAddr types.Address, ...) (bool, error)
- func (s *Sponsor) RemovePrivilegeByAdmin(option *types.ContractMethodSendOption, contractAddr types.Address, ...) (types.Hash, error)
- func (s *Sponsor) SetSponsorForCollateral(option *types.ContractMethodSendOption, contractAddr types.Address) (types.Hash, error)
- func (s *Sponsor) SetSponsorForGas(option *types.ContractMethodSendOption, contractAddr types.Address, ...) (types.Hash, error)
- type Staking
- func (s *Staking) Deposit(option *types.ContractMethodSendOption, amount *big.Int) (types.Hash, error)
- func (ac *Staking) GetLockedStakingBalance(option *types.ContractMethodCallOption, user types.Address, ...) (*big.Int, error)
- func (ac *Staking) GetStakingBalance(option *types.ContractMethodCallOption, user types.Address) (*big.Int, error)
- func (ac *Staking) GetVotePower(option *types.ContractMethodCallOption, user types.Address, ...) (*big.Int, error)
- func (s *Staking) VoteLock(option *types.ContractMethodSendOption, amount *big.Int, ...) (types.Hash, error)
- func (s *Staking) Withdraw(option *types.ContractMethodSendOption, amount *big.Int) (types.Hash, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminControl ¶
AdminControl contract
func NewAdminControl ¶
func NewAdminControl(client sdk.ClientOperator) (ac AdminControl, err error)
NewAdminControl gets the AdminControl contract object
func (*AdminControl) Destroy ¶
func (ac *AdminControl) Destroy(option *types.ContractMethodSendOption, contractAddr types.Address) (types.Hash, error)
Destroy destroies contract `contractAddr`.
func (*AdminControl) GetAdmin ¶
func (ac *AdminControl) GetAdmin(option *types.ContractMethodCallOption, contractAddr types.Address) (types.Address, error)
GetAdmin returns admin of specific contract
type Sponsor ¶
Sponsor represents SponsorWhitelistControl contract
func NewSponsor ¶
func NewSponsor(client sdk.ClientOperator) (s Sponsor, err error)
NewSponsor gets the SponsorWhitelistControl contract object
func (*Sponsor) AddPrivilegeByAdmin ¶
func (s *Sponsor) AddPrivilegeByAdmin(option *types.ContractMethodSendOption, contractAddr types.Address, userAddresses []types.Address) (types.Hash, error)
AddPrivilegeByAdmin for admin adds user to whitelist
func (*Sponsor) GetSponsorForCollateral ¶
func (s *Sponsor) GetSponsorForCollateral(option *types.ContractMethodCallOption, contractAddr types.Address) (address types.Address, err error)
GetSponsorForCollateral gets collateral sponsor address
func (*Sponsor) GetSponsorForGas ¶
func (s *Sponsor) GetSponsorForGas(option *types.ContractMethodCallOption, contractAddr types.Address) (address types.Address, err error)
GetSponsorForGas gets gas sponsor address of specific contract
func (*Sponsor) GetSponsoredBalanceForCollateral ¶
func (s *Sponsor) GetSponsoredBalanceForCollateral(option *types.ContractMethodCallOption, contractAddr types.Address) (*big.Int, error)
GetSponsoredBalanceForCollateral gets current Sponsored Balance for collateral
func (*Sponsor) GetSponsoredBalanceForGas ¶
func (s *Sponsor) GetSponsoredBalanceForGas(option *types.ContractMethodCallOption, contractAddr types.Address) (*big.Int, error)
GetSponsoredBalanceForGas gets current Sponsored Balance for gas
func (*Sponsor) GetSponsoredGasFeeUpperBound ¶
func (s *Sponsor) GetSponsoredGasFeeUpperBound(option *types.ContractMethodCallOption, contractAddr types.Address) (*big.Int, error)
GetSponsoredGasFeeUpperBound gets current Sponsored Gas fee upper bound
func (*Sponsor) IsAllWhitelisted ¶
func (s *Sponsor) IsAllWhitelisted(option *types.ContractMethodCallOption, contractAddr types.Address) (bool, error)
IsAllWhitelisted checks if all users are in a contract's whitelist
func (*Sponsor) IsWhitelisted ¶
func (s *Sponsor) IsWhitelisted(option *types.ContractMethodCallOption, contractAddr types.Address, userAddr types.Address) (bool, error)
IsWhitelisted checks if a user is in a contract's whitelist
func (*Sponsor) RemovePrivilegeByAdmin ¶
func (s *Sponsor) RemovePrivilegeByAdmin(option *types.ContractMethodSendOption, contractAddr types.Address, userAddresses []types.Address) (types.Hash, error)
RemovePrivilegeByAdmin for admin removes user from whitelist
func (*Sponsor) SetSponsorForCollateral ¶
func (s *Sponsor) SetSponsorForCollateral(option *types.ContractMethodSendOption, contractAddr types.Address) (types.Hash, error)
SetSponsorForCollateral for someone sponsor the storage collateral for contract `contractAddr`, it is payable
func (*Sponsor) SetSponsorForGas ¶
func (s *Sponsor) SetSponsorForGas(option *types.ContractMethodSendOption, contractAddr types.Address, upperBound *big.Int) (types.Hash, error)
SetSponsorForGas for someone sponsor the gas cost for contract `contractAddr` with an `upper_bound` for a single transaction, it is payable
type Staking ¶
Staking contract
func NewStaking ¶
func NewStaking(client sdk.ClientOperator) (s Staking, err error)
NewStaking gets the Staking contract object
func (*Staking) Deposit ¶
func (s *Staking) Deposit(option *types.ContractMethodSendOption, amount *big.Int) (types.Hash, error)
Deposit `amount` cfx in this contract
func (*Staking) GetLockedStakingBalance ¶
func (ac *Staking) GetLockedStakingBalance(option *types.ContractMethodCallOption, user types.Address, blockNumber *big.Int) (*big.Int, error)
GetLockedStakingBalance returns user's locked staking balance at given blockNumber Note: if the blockNumber is less than the current block number, function will return current locked staking balance.
func (*Staking) GetStakingBalance ¶
func (ac *Staking) GetStakingBalance(option *types.ContractMethodCallOption, user types.Address) (*big.Int, error)
GetStakingBalance returns user's staking balance
func (*Staking) GetVotePower ¶
func (ac *Staking) GetVotePower(option *types.ContractMethodCallOption, user types.Address, blockNumber *big.Int) (*big.Int, error)
GetVotePower returns user's vote power staking balance at given blockNumber