accountmgr

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AccountPrefix comment at next version
	AccountPrefix = "__account_prefix__"
	// FrozenPrefix comment at next version
	FrozenPrefix = "__frozen_account__"
	// AddressKey comment at next version
	AddressKey = "address_key"
	// BatchRecharge comment at next version
	BatchRecharge = "batch_recharge"
	// RechargeKey comment at next version
	RechargeKey = "recharge_key"
	// RechargeAmountKey comment at next version
	RechargeAmountKey = "recharge_amount_key"
	// ChargePublicKey comment at next version
	ChargePublicKey = "charge_public_key"
	// ChargeGasAmount comment at next version
	ChargeGasAmount = "charge_gas_amount"
	// Success comment at next version
	Success = "success"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountManager

type AccountManager struct {
	common.BaseContract
	// contains filtered or unexported fields
}

AccountManager comment at next version

func NewAccountManager

func NewAccountManager(log protocol.Logger) *AccountManager

NewAccountManager comment at next version @param log @return *AccountManager

type AccountManagerRuntime

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

AccountManagerRuntime comment at next version

func (*AccountManagerRuntime) ChargeGasVm

func (g *AccountManagerRuntime) ChargeGasVm(txSimContext protocol.TxSimContext,
	params map[string][]byte) ([]byte, error)

ChargeGasVm charge gas for vm and must set config auth multi sign

func (*AccountManagerRuntime) ChargeGasVmForMultiAccount

func (g *AccountManagerRuntime) ChargeGasVmForMultiAccount(
	txSimContext protocol.TxSimContext,
	params map[string][]byte) ([]byte, error)

ChargeGasVmForMultiAccount ? @param txSimContext @param params @return []byte @return error

func (*AccountManagerRuntime) FrozenAccount

func (g *AccountManagerRuntime) FrozenAccount(txSimContext protocol.TxSimContext,
	params map[string][]byte) ([]byte, error)

FrozenAccount 冻结账号 @param txSimContext @param params @return []byte @return error

func (*AccountManagerRuntime) GetAccountStatus

func (g *AccountManagerRuntime) GetAccountStatus(txSimContext protocol.TxSimContext,
	params map[string][]byte) ([]byte, error)

GetAccountStatus 获得账号的状态 @param txSimContext @param params @return []byte @return error

func (*AccountManagerRuntime) GetAdmin

func (g *AccountManagerRuntime) GetAdmin(txSimContext protocol.TxSimContext,
	params map[string][]byte) ([]byte, error)

GetAdmin comment at next version

func (*AccountManagerRuntime) GetBalance

func (g *AccountManagerRuntime) GetBalance(txSimContext protocol.TxSimContext,
	params map[string][]byte) ([]byte, error)

GetBalance 获得Gas余额 @param txSimContext @param params @return []byte @return error

func (*AccountManagerRuntime) RechargeGas

func (g *AccountManagerRuntime) RechargeGas(txSimContext protocol.TxSimContext,
	params map[string][]byte) ([]byte, error)

RechargeGas Gas 充值 @param txSimContext @param params @return []byte @return error

func (*AccountManagerRuntime) RefundGas

func (g *AccountManagerRuntime) RefundGas(txSimContext protocol.TxSimContext,
	params map[string][]byte) ([]byte, error)

RefundGas refund gas for sdk

func (*AccountManagerRuntime) RefundGasVm

func (g *AccountManagerRuntime) RefundGasVm(txSimContext protocol.TxSimContext,
	params map[string][]byte) ([]byte, error)

RefundGasVm ? @param txSimContext @param params @return []byte @return error

func (*AccountManagerRuntime) SetAdmin

func (g *AccountManagerRuntime) SetAdmin(txSimContext protocol.TxSimContext,
	params map[string][]byte) ([]byte, error)

SetAdmin recommend to use chain config contract method set account manager admin replace to current set admin Deprecated

func (*AccountManagerRuntime) UnFrozenAccount

func (g *AccountManagerRuntime) UnFrozenAccount(txSimContext protocol.TxSimContext,
	params map[string][]byte) ([]byte, error)

UnFrozenAccount 解冻账号 @param txSimContext @param params @return []byte @return error

type AccountMgr

type AccountMgr interface {
	/**
	 * @Description: 设置gas管理员
	 * @param publicKey
	 * @return bool
	 * @return error
	 */
	SetAdmin(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)

	/**
	 * @Description: 查询gas管理员
	 * @param publicKey
	 * @return []byte
	 * @return error
	 */
	GetAdmin(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)

	/**
	 * @Description: 充值gas
	 * @param publicKey
	 * @param gas
	 * @return bool
	 * @return error
	 */
	RechargeGas(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)

	/**
	 * @Description: 扣款for vm
	 * @param publicKey
	 * @param gas
	 * @return bool
	 * @return error
	 */
	ChargeGasVm(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)

	/**
	 * @Description: 多用户扣款for vm
	 * @param publicKey
	 * @param gas
	 * @return bool
	 * @return error
	 */
	ChargeGasVmForMultiAccount(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)

	/**
	 * @Description: 退还多扣的gas for vm
	 * @param: publicKey 发起交易的账户公钥
	 * @param: gas  退还gas数量
	 * @return bool  是否退还成功
	 * @return error
	 */
	RefundGasVm(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)

	/**
	 * @Description: 查询gas余额
	 * @param publicKey
	 * @return uint64
	 * @return error
	 */
	GetBalance(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)

	/**
	 * @Description: 退款for sdk
	 * @param publicKey
	 * @param gasUsed
	 * @return bool
	 * @return error
	 */
	RefundGas(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)

	/**
	 * @Description: 冻结指定账户
	 * @param publicKey
	 * @return bool
	 * @return error
	 */
	FrozenAccount(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)

	/**
	 * @Description: 解冻指定账号
	 * @param txSimContext
	 * @param params
	 * @return []byte
	 * @return error
	 */
	UnFrozenAccount(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)

	/**
	 * @Description: 获取账户冻结状态
	 * @param publicKey
	 * @return bool
	 * @return error
	 */
	GetAccountStatus(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
}

AccountMgr comment at next version

Jump to

Keyboard shortcuts

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