accountmgr

package
v2.3.6 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package accountmgr is package for account

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"
)
View Source
const ParamSeparator = ":"

ParamSeparator the separator splitting the params

View Source
const ReqIDPrefix = "ReqID:"

ReqIDPrefix used for constructing request id keys.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountManager

type AccountManager struct {
	// 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

func (*AccountManager) GetMethod

func (g *AccountManager) GetMethod(methodName string) common.ContractFunc

GetMethod comment at next version

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 added in v2.3.0

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

ChargeGasVmForMultiAccount comment at next version

func (*AccountManagerRuntime) FrozenAccount

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

FrozenAccount comment at next version

func (*AccountManagerRuntime) GetAccountStatus

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

GetAccountStatus comment at next version

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 comment at next version

func (*AccountManagerRuntime) RechargeGas

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

RechargeGas comment at next version

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 comment at next version

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 comment at next version

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