metadata

package
v0.0.0-...-7ece11e Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 27 Imported by: 10

Documentation

Index

Constants

View Source
const (
	InvalidMeta                  = metadataCommon.InvalidMeta
	IssuingRequestMeta           = metadataCommon.IssuingRequestMeta
	IssuingResponseMeta          = metadataCommon.IssuingResponseMeta
	ContractingRequestMeta       = metadataCommon.ContractingRequestMeta
	IssuingETHRequestMeta        = metadataCommon.IssuingETHRequestMeta
	IssuingETHResponseMeta       = metadataCommon.IssuingETHResponseMeta
	ShardBlockReward             = metadataCommon.ShardBlockReward
	ShardBlockSalaryResponseMeta = metadataCommon.ShardBlockSalaryResponseMeta
	BeaconRewardRequestMeta      = metadataCommon.BeaconRewardRequestMeta
	BeaconSalaryResponseMeta     = metadataCommon.BeaconSalaryResponseMeta
	ReturnStakingMeta            = metadataCommon.ReturnStakingMeta
	MintDelegationRewardMeta     = metadataCommon.MintDelegationRewardMeta
	ReturnBeaconStakingMeta      = metadataCommon.ReturnBeaconStakingMeta
	IncDAORewardRequestMeta      = metadataCommon.IncDAORewardRequestMeta
	WithDrawRewardRequestMeta    = metadataCommon.WithDrawRewardRequestMeta
	WithDrawRewardResponseMeta   = metadataCommon.WithDrawRewardResponseMeta

	WithdrawDelegationRewardRequestMeta = metadataCommon.WithdrawDelegationRewardRequestMeta
	// staking
	ShardStakingMeta    = metadataCommon.ShardStakingMeta
	StopAutoStakingMeta = metadataCommon.StopAutoStakingMeta
	BeaconStakingMeta   = metadataCommon.BeaconStakingMeta
	UnStakingMeta       = metadataCommon.UnStakingMeta
	AddStakingMeta      = metadataCommon.AddStakingMeta
	ReDelegateMeta      = metadataCommon.ReDelegateMeta
	// Incognito -> Ethereum bridge
	BeaconSwapConfirmMeta = metadataCommon.BeaconSwapConfirmMeta
	BridgeSwapConfirmMeta = metadataCommon.BridgeSwapConfirmMeta
	BurningRequestMeta    = metadataCommon.BurningRequestMeta
	BurningRequestMetaV2  = metadataCommon.BurningRequestMetaV2
	BurningConfirmMeta    = metadataCommon.BurningConfirmMeta
	BurningConfirmMetaV2  = metadataCommon.BurningConfirmMetaV2
	// pde
	PDEContributionMeta                   = metadataCommon.PDEContributionMeta
	PDETradeRequestMeta                   = metadataCommon.PDETradeRequestMeta
	PDETradeResponseMeta                  = metadataCommon.PDETradeResponseMeta
	PDEWithdrawalRequestMeta              = metadataCommon.PDEWithdrawalRequestMeta
	PDEWithdrawalResponseMeta             = metadataCommon.PDEWithdrawalResponseMeta
	PDEContributionResponseMeta           = metadataCommon.PDEContributionResponseMeta
	PDEPRVRequiredContributionRequestMeta = metadataCommon.PDEPRVRequiredContributionRequestMeta
	PDECrossPoolTradeRequestMeta          = metadataCommon.PDECrossPoolTradeRequestMeta
	PDECrossPoolTradeResponseMeta         = metadataCommon.PDECrossPoolTradeResponseMeta
	PDEFeeWithdrawalRequestMeta           = metadataCommon.PDEFeeWithdrawalRequestMeta
	PDEFeeWithdrawalResponseMeta          = metadataCommon.PDEFeeWithdrawalResponseMeta
	PDETradingFeesDistributionMeta        = metadataCommon.PDETradingFeesDistributionMeta
	// pDEX v3
	Pdexv3TradeRequestMeta          = metadataCommon.Pdexv3TradeRequestMeta
	Pdexv3TradeResponseMeta         = metadataCommon.Pdexv3TradeResponseMeta
	Pdexv3AddOrderRequestMeta       = metadataCommon.Pdexv3AddOrderRequestMeta
	Pdexv3AddOrderResponseMeta      = metadataCommon.Pdexv3AddOrderResponseMeta
	Pdexv3WithdrawOrderRequestMeta  = metadataCommon.Pdexv3WithdrawOrderRequestMeta
	Pdexv3WithdrawOrderResponseMeta = metadataCommon.Pdexv3WithdrawOrderResponseMeta
	// portal
	PortalCustodianDepositMeta                  = metadataCommon.PortalCustodianDepositMeta
	PortalRequestPortingMeta                    = metadataCommon.PortalRequestPortingMeta
	PortalUserRequestPTokenMeta                 = metadataCommon.PortalUserRequestPTokenMeta
	PortalCustodianDepositResponseMeta          = metadataCommon.PortalCustodianDepositResponseMeta
	PortalUserRequestPTokenResponseMeta         = metadataCommon.PortalUserRequestPTokenResponseMeta
	PortalExchangeRatesMeta                     = metadataCommon.PortalExchangeRatesMeta
	PortalRedeemRequestMeta                     = metadataCommon.PortalRedeemRequestMeta
	PortalRedeemRequestResponseMeta             = metadataCommon.PortalRedeemRequestResponseMeta
	PortalRequestUnlockCollateralMeta           = metadataCommon.PortalRequestUnlockCollateralMeta
	PortalCustodianWithdrawRequestMeta          = metadataCommon.PortalCustodianWithdrawRequestMeta
	PortalCustodianWithdrawResponseMeta         = metadataCommon.PortalCustodianWithdrawResponseMeta
	PortalLiquidateCustodianMeta                = metadataCommon.PortalLiquidateCustodianMeta
	PortalLiquidateCustodianResponseMeta        = metadataCommon.PortalLiquidateCustodianResponseMeta
	PortalLiquidateTPExchangeRatesMeta          = metadataCommon.PortalLiquidateTPExchangeRatesMeta
	PortalExpiredWaitingPortingReqMeta          = metadataCommon.PortalExpiredWaitingPortingReqMeta
	PortalRewardMeta                            = metadataCommon.PortalRewardMeta
	PortalRequestWithdrawRewardMeta             = metadataCommon.PortalRequestWithdrawRewardMeta
	PortalRequestWithdrawRewardResponseMeta     = metadataCommon.PortalRequestWithdrawRewardResponseMeta
	PortalRedeemFromLiquidationPoolMeta         = metadataCommon.PortalRedeemFromLiquidationPoolMeta
	PortalRedeemFromLiquidationPoolResponseMeta = metadataCommon.PortalRedeemFromLiquidationPoolResponseMeta
	PortalCustodianTopupMeta                    = metadataCommon.PortalCustodianTopupMeta
	PortalCustodianTopupResponseMeta            = metadataCommon.PortalCustodianTopupResponseMeta
	PortalTotalRewardCustodianMeta              = metadataCommon.PortalTotalRewardCustodianMeta
	PortalPortingResponseMeta                   = metadataCommon.PortalPortingResponseMeta
	PortalReqMatchingRedeemMeta                 = metadataCommon.PortalReqMatchingRedeemMeta
	PortalPickMoreCustodianForRedeemMeta        = metadataCommon.PortalPickMoreCustodianForRedeemMeta
	PortalCustodianTopupMetaV2                  = metadataCommon.PortalCustodianTopupMetaV2
	PortalCustodianTopupResponseMetaV2          = metadataCommon.PortalCustodianTopupResponseMetaV2
	// Portal v3
	PortalCustodianDepositMetaV3                  = metadataCommon.PortalCustodianDepositMetaV3
	PortalCustodianWithdrawRequestMetaV3          = metadataCommon.PortalCustodianWithdrawRequestMetaV3
	PortalRewardMetaV3                            = metadataCommon.PortalRewardMetaV3
	PortalRequestUnlockCollateralMetaV3           = metadataCommon.PortalRequestUnlockCollateralMetaV3
	PortalLiquidateCustodianMetaV3                = metadataCommon.PortalLiquidateCustodianMetaV3
	PortalLiquidateByRatesMetaV3                  = metadataCommon.PortalLiquidateByRatesMetaV3
	PortalRedeemFromLiquidationPoolMetaV3         = metadataCommon.PortalRedeemFromLiquidationPoolMetaV3
	PortalRedeemFromLiquidationPoolResponseMetaV3 = metadataCommon.PortalRedeemFromLiquidationPoolResponseMetaV3
	PortalCustodianTopupMetaV3                    = metadataCommon.PortalCustodianTopupMetaV3
	PortalTopUpWaitingPortingRequestMetaV3        = metadataCommon.PortalTopUpWaitingPortingRequestMetaV3
	PortalRequestPortingMetaV3                    = metadataCommon.PortalRequestPortingMetaV3
	PortalRedeemRequestMetaV3                     = metadataCommon.PortalRedeemRequestMetaV3
	PortalUnlockOverRateCollateralsMeta           = metadataCommon.PortalUnlockOverRateCollateralsMeta
	// Incognito => Ethereum's SC for portal
	PortalCustodianWithdrawConfirmMetaV3         = metadataCommon.PortalCustodianWithdrawConfirmMetaV3
	PortalRedeemFromLiquidationPoolConfirmMetaV3 = metadataCommon.PortalRedeemFromLiquidationPoolConfirmMetaV3
	PortalLiquidateRunAwayCustodianConfirmMetaV3 = metadataCommon.PortalLiquidateRunAwayCustodianConfirmMetaV3
	// Note: don't use this metadata type for others
	PortalResetPortalDBMeta = metadataCommon.PortalResetPortalDBMeta
	// relaying
	RelayingBNBHeaderMeta                 = metadataCommon.RelayingBNBHeaderMeta
	RelayingBTCHeaderMeta                 = metadataCommon.RelayingBTCHeaderMeta
	PortalTopUpWaitingPortingRequestMeta  = metadataCommon.PortalTopUpWaitingPortingRequestMeta
	PortalTopUpWaitingPortingResponseMeta = metadataCommon.PortalTopUpWaitingPortingResponseMeta
	// incognito mode for smart contract
	BurningForDepositToSCRequestMeta   = metadataCommon.BurningForDepositToSCRequestMeta
	BurningForDepositToSCRequestMetaV2 = metadataCommon.BurningForDepositToSCRequestMetaV2
	BurningConfirmForDepositToSCMeta   = metadataCommon.BurningConfirmForDepositToSCMeta
	BurningConfirmForDepositToSCMetaV2 = metadataCommon.BurningConfirmForDepositToSCMetaV2
	InitTokenRequestMeta               = metadataCommon.InitTokenRequestMeta
	InitTokenResponseMeta              = metadataCommon.InitTokenResponseMeta
	// incognito mode for bsc
	IssuingBSCRequestMeta                = metadataCommon.IssuingBSCRequestMeta
	IssuingBSCResponseMeta               = metadataCommon.IssuingBSCResponseMeta
	BurningPBSCRequestMeta               = metadataCommon.BurningPBSCRequestMeta
	BurningBSCConfirmMeta                = metadataCommon.BurningBSCConfirmMeta
	AllShards                            = metadataCommon.AllShards
	BeaconOnly                           = metadataCommon.BeaconOnly
	StopAutoStakingAmount                = metadataCommon.StopAutoStakingAmount
	ReDelegateFee                        = metadataCommon.ReDelegateFee
	EVMConfirmationBlocks                = metadataCommon.EVMConfirmationBlocks
	PLGConfirmationBlocks                = metadataCommon.PLGConfirmationBlocks
	FantomConfirmationBlocks             = metadataCommon.FantomConfirmationBlocks
	NoAction                             = metadataCommon.NoAction
	MetaRequestBeaconMintTxs             = metadataCommon.MetaRequestBeaconMintTxs
	MetaRequestShardMintTxs              = metadataCommon.MetaRequestShardMintTxs
	BurningPBSCForDepositToSCRequestMeta = metadataCommon.BurningPBSCForDepositToSCRequestMeta
	BurningPBSCConfirmForDepositToSCMeta = metadataCommon.BurningPBSCConfirmForDepositToSCMeta

	IssuingPRVERC20RequestMeta  = metadataCommon.IssuingPRVERC20RequestMeta
	IssuingPRVERC20ResponseMeta = metadataCommon.IssuingPRVERC20ResponseMeta
	IssuingPRVBEP20RequestMeta  = metadataCommon.IssuingPRVBEP20RequestMeta
	IssuingPRVBEP20ResponseMeta = metadataCommon.IssuingPRVBEP20ResponseMeta
	BurningPRVERC20RequestMeta  = metadataCommon.BurningPRVERC20RequestMeta
	BurningPRVERC20ConfirmMeta  = metadataCommon.BurningPRVERC20ConfirmMeta
	BurningPRVBEP20RequestMeta  = metadataCommon.BurningPRVBEP20RequestMeta
	BurningPRVBEP20ConfirmMeta  = metadataCommon.BurningPRVBEP20ConfirmMeta

	IssuingPLGRequestMeta  = metadataCommon.IssuingPLGRequestMeta
	IssuingPLGResponseMeta = metadataCommon.IssuingPLGResponseMeta
	BurningPLGRequestMeta  = metadataCommon.BurningPLGRequestMeta
	BurningPLGConfirmMeta  = metadataCommon.BurningPLGConfirmMeta

	BurningPLGForDepositToSCRequestMeta = metadataCommon.BurningPLGForDepositToSCRequestMeta
	BurningPLGConfirmForDepositToSCMeta = metadataCommon.BurningPLGConfirmForDepositToSCMeta

	IssuingFantomRequestMeta  = metadataCommon.IssuingFantomRequestMeta
	IssuingFantomResponseMeta = metadataCommon.IssuingFantomResponseMeta
	BurningFantomRequestMeta  = metadataCommon.BurningFantomRequestMeta
	BurningFantomConfirmMeta  = metadataCommon.BurningFantomConfirmMeta

	BurningFantomForDepositToSCRequestMeta = metadataCommon.BurningFantomForDepositToSCRequestMeta
	BurningFantomConfirmForDepositToSCMeta = metadataCommon.BurningFantomConfirmForDepositToSCMeta

	BurnForCallRequestMeta      = metadataCommon.BurnForCallRequestMeta
	BurnForCallResponseMeta     = metadataCommon.BurnForCallResponseMeta
	BurnForCallConfirmMeta      = metadataCommon.BurnForCallConfirmMeta
	IssuingReshieldResponseMeta = metadataCommon.IssuingReshieldResponseMeta

	IssuingAuroraRequestMeta  = metadataCommon.IssuingAuroraRequestMeta
	IssuingAuroraResponseMeta = metadataCommon.IssuingAuroraResponseMeta
	BurningAuroraRequestMeta  = metadataCommon.BurningAuroraRequestMeta
	BurningAuroraConfirmMeta  = metadataCommon.BurningAuroraConfirmMeta

	IssuingAvaxRequestMeta  = metadataCommon.IssuingAvaxRequestMeta
	IssuingAvaxResponseMeta = metadataCommon.IssuingAvaxResponseMeta
	BurningAvaxRequestMeta  = metadataCommon.BurningAvaxRequestMeta
	BurningAvaxConfirmMeta  = metadataCommon.BurningAvaxConfirmMeta

	BurningAuroraForDepositToSCRequestMeta = metadataCommon.BurningAuroraForDepositToSCRequestMeta
	BurningAuroraConfirmForDepositToSCMeta = metadataCommon.BurningAuroraConfirmForDepositToSCMeta

	BurningAvaxForDepositToSCRequestMeta = metadataCommon.BurningAvaxForDepositToSCRequestMeta
	BurningAvaxConfirmForDepositToSCMeta = metadataCommon.BurningAvaxConfirmForDepositToSCMeta

	IssuingNearRequestMeta  = metadataCommon.IssuingNearRequestMeta
	IssuingNearResponseMeta = metadataCommon.IssuingNearResponseMeta
	BurningNearRequestMeta  = metadataCommon.BurningNearRequestMeta
	BurningNearConfirmMeta  = metadataCommon.BurningNearConfirmMeta

	BurningPRVRequestMeta        = metadataCommon.BurningPRVRequestMeta
	BurningPRVRequestConfirmMeta = metadataCommon.BurningPRVRequestConfirmMeta
)

export package constants

View Source
const (
	UnexpectedError                                            = metadataCommon.UnexpectedError
	IssuingEvmRequestDecodeInstructionError                    = metadataCommon.IssuingEvmRequestDecodeInstructionError
	IssuingEvmRequestUnmarshalJsonError                        = metadataCommon.IssuingEvmRequestUnmarshalJsonError
	IssuingEvmRequestNewIssuingEVMRequestFromMapError          = metadataCommon.IssuingEvmRequestNewIssuingEVMRequestFromMapError
	IssuingEvmRequestValidateTxWithBlockChainError             = metadataCommon.IssuingEvmRequestValidateTxWithBlockChainError
	IssuingEvmRequestValidateSanityDataError                   = metadataCommon.IssuingEvmRequestValidateSanityDataError
	IssuingEvmRequestBuildReqActionsError                      = metadataCommon.IssuingEvmRequestBuildReqActionsError
	IssuingEvmRequestVerifyProofAndParseReceipt                = metadataCommon.IssuingEvmRequestVerifyProofAndParseReceipt
	IssuingRequestDecodeInstructionError                       = metadataCommon.IssuingRequestDecodeInstructionError
	IssuingRequestUnmarshalJsonError                           = metadataCommon.IssuingRequestUnmarshalJsonError
	IssuingRequestNewIssuingRequestFromMapEror                 = metadataCommon.IssuingRequestNewIssuingRequestFromMapEror
	IssuingRequestValidateTxWithBlockChainError                = metadataCommon.IssuingRequestValidateTxWithBlockChainError
	IssuingRequestValidateSanityDataError                      = metadataCommon.IssuingRequestValidateSanityDataError
	IssuingRequestBuildReqActionsError                         = metadataCommon.IssuingRequestBuildReqActionsError
	IssuingRequestVerifyProofAndParseReceipt                   = metadataCommon.IssuingRequestVerifyProofAndParseReceipt
	BeaconBlockRewardNewBeaconBlockRewardInfoFromStrError      = metadataCommon.BeaconBlockRewardNewBeaconBlockRewardInfoFromStrError
	BeaconBlockRewardBuildInstructionForBeaconBlockRewardError = metadataCommon.BeaconBlockRewardBuildInstructionForBeaconBlockRewardError
	StopAutoStakingRequestNotInCommitteeListError              = metadataCommon.StopAutoStakingRequestNotInCommitteeListError
	StopAutoStakingRequestGetStakingTransactionError           = metadataCommon.StopAutoStakingRequestGetStakingTransactionError
	StopAutoStakingRequestStakingTransactionNotFoundError      = metadataCommon.StopAutoStakingRequestStakingTransactionNotFoundError
	StopAutoStakingRequestInvalidTransactionSenderError        = metadataCommon.StopAutoStakingRequestInvalidTransactionSenderError

	StopAutoStakingRequestNoAutoStakingAvaiableError = metadataCommon.StopAutoStakingRequestNoAutoStakingAvaiableError
	StopAutoStakingRequestTypeAssertionError         = metadataCommon.StopAutoStakingRequestTypeAssertionError
	StopAutoStakingRequestAlreadyStopError           = metadataCommon.StopAutoStakingRequestAlreadyStopError
	WrongIncognitoDAOPaymentAddressError             = metadataCommon.WrongIncognitoDAOPaymentAddressError
	ConsensusMetadataTypeAssertionError              = metadataCommon.ConsensusMetadataTypeAssertionError
	ConsensusMetadataInvalidTransactionSenderError   = metadataCommon.StopAutoStakingRequestInvalidTransactionSenderError
	AddStakingRequestNotInCommitteeListError         = metadataCommon.AddStakingNotInCommitteeListError
	AddStakingCommitteeNotFoundError                 = metadataCommon.AddStakingCommitteeNotFoundError
	ReDelegateRequestNotInCommitteeListError         = metadataCommon.ReDelegateNotInCommitteeListError
	ReDelegateCommitteeNotFoundError                 = metadataCommon.ReDelegateCommitteeNotFoundError
	ReDelegateInvalidTxError                         = metadataCommon.ReDelegateInvalidTxError
	// pde
	PDEWithdrawalRequestFromMapError    = metadataCommon.PDEWithdrawalRequestFromMapError
	CouldNotGetExchangeRateError        = metadataCommon.CouldNotGetExchangeRateError
	RejectInvalidFee                    = metadataCommon.RejectInvalidFee
	PDEFeeWithdrawalRequestFromMapError = metadataCommon.PDEFeeWithdrawalRequestFromMapError
	// portal
	PortalRequestPTokenParamError                = metadataCommon.PortalRequestPTokenParamError
	PortalRedeemRequestParamError                = metadataCommon.PortalRedeemRequestParamError
	PortalRedeemLiquidateExchangeRatesParamError = metadataCommon.PortalRedeemLiquidateExchangeRatesParamError
	// Unstake
	UnStakingRequestNotInCommitteeListError         = metadataCommon.UnStakingRequestNotInCommitteeListError
	UnStakingRequestGetStakerInfoError              = metadataCommon.UnStakingRequestGetStakerInfoError
	UnStakingRequestNotFoundStakerInfoError         = metadataCommon.UnStakingRequestNotFoundStakerInfoError
	UnStakingRequestStakingTransactionNotFoundError = metadataCommon.UnStakingRequestStakingTransactionNotFoundError
	UnStakingRequestInvalidTransactionSenderError   = metadataCommon.UnStakingRequestInvalidTransactionSenderError
	UnStakingRequestNoAutoStakingAvaiableError      = metadataCommon.UnStakingRequestNoAutoStakingAvaiableError
	UnStakingRequestTypeAssertionError              = metadataCommon.UnStakingRequestTypeAssertionError
	UnStakingRequestAlreadyStopError                = metadataCommon.UnStakingRequestAlreadyStopError
	UnStakingRequestInvalidFormatRequestKey         = metadataCommon.UnStakingRequestInvalidFormatRequestKey
	UnstakingRequestAlreadyUnstake                  = metadataCommon.UnstakingRequestAlreadyUnstake
	// eth utils
	VerifyProofAndParseReceiptError = metadataCommon.VerifyProofAndParseReceiptError
	// init privacy custom token
	InitTokenRequestDecodeInstructionError           = metadataCommon.InitTokenRequestDecodeInstructionError
	InitTokenRequestUnmarshalJsonError               = metadataCommon.InitTokenRequestUnmarshalJsonError
	InitTokenRequestNewInitPTokenRequestFromMapError = metadataCommon.InitTokenRequestNewInitPTokenRequestFromMapError
	InitTokenRequestValidateTxWithBlockChainError    = metadataCommon.InitTokenRequestValidateTxWithBlockChainError
	InitTokenRequestValidateSanityDataError          = metadataCommon.InitTokenRequestValidateSanityDataError
	InitTokenRequestBuildReqActionsError             = metadataCommon.InitTokenRequestBuildReqActionsError
	InitTokenResponseValidateSanityDataError         = metadataCommon.InitTokenResponseValidateSanityDataError
	// portal v3
	PortalCustodianDepositV3ValidateWithBCError     = metadataCommon.PortalCustodianDepositV3ValidateWithBCError
	PortalCustodianDepositV3ValidateSanityDataError = metadataCommon.PortalCustodianDepositV3ValidateSanityDataError
	NewPortalCustodianDepositV3MetaFromMapError     = metadataCommon.NewPortalCustodianDepositV3MetaFromMapError
	PortalUnlockOverRateCollateralsError            = metadataCommon.PortalUnlockOverRateCollateralsError
)

export error codes

Variables

View Source
var AcceptedWithdrawRewardRequestVersion = metadataCommon.AcceptedWithdrawRewardRequestVersion
View Source
var AssertPaymentAddressAndTxVersion = metadataCommon.AssertPaymentAddressAndTxVersion

export functions

View Source
var ConvertNativeTokenToPrivacyToken = metadataCommon.ConvertNativeTokenToPrivacyToken
View Source
var ConvertPrivacyTokenToNativeToken = metadataCommon.ConvertPrivacyTokenToNativeToken
View Source
var GenTokenIDFromRequest = metadataCommon.GenTokenIDFromRequest
View Source
var HasBridgeInstructions = metadataCommon.HasBridgeInstructions
View Source
var HasPortalInstructions = metadataCommon.HasPortalInstructions
View Source
var IsAvailableMetaInTxType = metadataCommon.IsAvailableMetaInTxType
View Source
var IsPortalMetaTypeV3 = metadataCommon.IsPortalMetaTypeV3
View Source
var IsPortalRelayingMetaType = metadataCommon.IsPortalRelayingMetaType
View Source
var Logger = MetadataLogger{}
View Source
var NewMetadataBaseWithSignature = metadataCommon.NewMetadataBaseWithSignature
View Source
var NewMetadataTxError = metadataCommon.NewMetadataTxError
View Source
var ValidatePortalExternalAddress = metadataCommon.ValidatePortalExternalAddress

Functions

func BuildInstForBeaconReward

func BuildInstForBeaconReward(reward map[common.Hash]uint64, payToPublicKey []byte) ([]string, error)

func BuildInstForIncDAOReward

func BuildInstForIncDAOReward(reward map[common.Hash]uint64, incDAOAddress string) ([]string, error)

func ParseInfoFromLogMap

func ParseInfoFromLogMap(logMap map[string]interface{}) (string, string, uint64, error)

ParseInfoFromLogMap parse info from log map Returns Custodian address string external TokenIDStr amount: for eth: unit is nanoETH

func UpdatePortalBridgeTokenInfo

func UpdatePortalBridgeTokenInfo(tokenInfos map[common.Hash]UpdatingInfo, tokenID string, amount uint64, isDeduct bool) error

Types

type AccumulatedValues

type AccumulatedValues = metadataCommon.AccumulatedValues

type AddStakingMetadata

type AddStakingMetadata struct {
	MetadataBaseWithSignature
	CommitteePublicKey string
	AddStakingAmount   uint64
}

func NewAddStakingMetadata

func NewAddStakingMetadata(committeePublicKey string, addStakingAmount uint64) (*AddStakingMetadata, error)

func (*AddStakingMetadata) CalculateSize

func (addStakingMetadata *AddStakingMetadata) CalculateSize() uint64

func (AddStakingMetadata) GetType

func (addStakingMetadata AddStakingMetadata) GetType() int

func (*AddStakingMetadata) Hash

func (meta *AddStakingMetadata) Hash() *common.Hash

func (*AddStakingMetadata) HashWithoutSig

func (meta *AddStakingMetadata) HashWithoutSig() *common.Hash

func (*AddStakingMetadata) ValidateMetadataByItself

func (addStakingMetadata *AddStakingMetadata) ValidateMetadataByItself() bool

func (AddStakingMetadata) ValidateSanityData

func (addStakingMetadata AddStakingMetadata) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

Have only one receiver Have only one amount corresponding to receiver Receiver Is Burning Address

func (AddStakingMetadata) ValidateTxWithBlockChain

func (addStakingMetadata AddStakingMetadata) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

ValidateTxWithBlockChain Validate Condition to Request Stop AutoStaking With Blockchain - Requested Committee Publickey is in candidate, pending validator, - Requested Committee Publickey is in staking tx list, - Requester (sender of tx) must be address, which create staking transaction for current requested committee public key - Not yet requested to stop auto-restaking

type BeaconBlockSalaryInfo

type BeaconBlockSalaryInfo struct {
	BeaconSalary      uint64
	PayToAddress      *privacy.PaymentAddress
	BeaconBlockHeight uint64
	InfoHash          *common.Hash
}

type BeaconBlockSalaryRes

type BeaconBlockSalaryRes struct {
	MetadataBase
	BeaconBlockHeight uint64
	ProducerAddress   *privacy.PaymentAddress
	InfoHash          *common.Hash
}

func (BeaconBlockSalaryRes) CheckTransactionFee

func (sbsRes BeaconBlockSalaryRes) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (BeaconBlockSalaryRes) Hash

func (sbsRes BeaconBlockSalaryRes) Hash() *common.Hash

func (BeaconBlockSalaryRes) ValidateMetadataByItself

func (sbsRes BeaconBlockSalaryRes) ValidateMetadataByItself() bool

func (BeaconBlockSalaryRes) ValidateSanityData

func (sbsRes BeaconBlockSalaryRes) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (BeaconBlockSalaryRes) ValidateTxWithBlockChain

func (sbsRes BeaconBlockSalaryRes) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type BeaconRewardInfo

type BeaconRewardInfo struct {
	BeaconReward   map[common.Hash]uint64
	PayToPublicKey string
}

func NewBeaconBlockRewardInfoFromStr

func NewBeaconBlockRewardInfoFromStr(inst string) (*BeaconRewardInfo, error)

type BeaconViewRetriever

type BeaconViewRetriever = metadataCommon.BeaconViewRetriever

type BlockRewardAcceptInstruction

type BlockRewardAcceptInstruction struct {
	BeaconSalary uint64
}

type ChainRetriever

type ChainRetriever = metadataCommon.ChainRetriever

type ContractingReqAction

type ContractingReqAction struct {
	Meta    ContractingRequest `json:"meta"`
	TxReqID common.Hash        `json:"txReqId"`
}

type ContractingRequest

type ContractingRequest struct {
	BurnerAddress privacy.PaymentAddress
	BurnedAmount  uint64 // must be equal to vout value
	TokenID       common.Hash
	MetadataBase
}

whoever can send this type of tx

func NewContractingRequest

func NewContractingRequest(
	burnerAddress privacy.PaymentAddress,
	burnedAmount uint64,
	tokenID common.Hash,
	metaType int,
) (*ContractingRequest, error)

func (*ContractingRequest) BuildReqActions

func (cReq *ContractingRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*ContractingRequest) CalculateSize

func (cReq *ContractingRequest) CalculateSize() uint64

func (ContractingRequest) Hash

func (cReq ContractingRequest) Hash() *common.Hash

func (ContractingRequest) ValidateMetadataByItself

func (cReq ContractingRequest) ValidateMetadataByItself() bool

func (ContractingRequest) ValidateSanityData

func (cReq ContractingRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (ContractingRequest) ValidateTxWithBlockChain

func (cReq ContractingRequest) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type CustodianWithdrawRequestStatus

type CustodianWithdrawRequestStatus struct {
	PaymentAddress                string
	Amount                        uint64
	Status                        int
	RemainCustodianFreeCollateral uint64
}

func NewCustodianWithdrawRequestStatus

func NewCustodianWithdrawRequestStatus(paymentAddress string, amount uint64, status int, remainCustodianFreeCollateral uint64) *CustodianWithdrawRequestStatus

type CustodianWithdrawRequestStatusV3

type CustodianWithdrawRequestStatusV3 struct {
	CustodianIncAddress      string
	CustodianExternalAddress string
	ExternalTokenID          string // collateral token ID
	Amount                   *big.Int
	TxReqID                  common.Hash
	Status                   int
}

func NewCustodianWithdrawRequestStatusV3

func NewCustodianWithdrawRequestStatusV3(
	cusIncAddress string,
	cusExternalAddress string,
	externalTokenID string,
	amount *big.Int,
	txReqID common.Hash,
	status int) *CustodianWithdrawRequestStatusV3

type ExchangeRateInfo

type ExchangeRateInfo struct {
	PTokenID string
	Rate     uint64
}

type ExchangeRatesRequestStatus

type ExchangeRatesRequestStatus struct {
	//Status        byte 		// dont need this field
	SenderAddress string
	Rates         []*ExchangeRateInfo
}

func NewExchangeRatesRequestStatus

func NewExchangeRatesRequestStatus(senderAddress string, rates []*ExchangeRateInfo) *ExchangeRatesRequestStatus

type ExternalFeeInfo

type ExternalFeeInfo struct {
	NetworkFee    uint
	RBFReqIncTxID string
}

type IncDAORewardInfo

type IncDAORewardInfo struct {
	IncDAOReward map[common.Hash]uint64
}

func NewIncDAORewardInfoFromStr

func NewIncDAORewardInfoFromStr(inst string) (*IncDAORewardInfo, error)

type InitTokenAcceptedInst

type InitTokenAcceptedInst struct {
	OTAStr        string      `json:"OTAStr"`
	TxRandomStr   string      `json:"TxRandomStr"`
	Amount        uint64      `json:"Amount"`
	TokenID       common.Hash `json:"TokenID"`
	TokenName     string      `json:"TokenName"`
	TokenSymbol   string      `json:"TokenSymbol"`
	TokenType     int         `json:"TokenType"`
	ShardID       byte        `json:"ShardID"`
	RequestedTxID common.Hash `json:"txReqID"`
}

func ParseInitTokenInstAcceptedContent

func ParseInitTokenInstAcceptedContent(instContentStr string) (*InitTokenAcceptedInst, error)

type InitTokenReqAction

type InitTokenReqAction struct {
	Meta    InitTokenRequest `json:"meta"`
	TxReqID common.Hash      `json:"txReqID"`
	TokenID common.Hash      `json:"tokenID"`
}

func ParseInitTokenInstContent

func ParseInitTokenInstContent(instContentStr string) (*InitTokenReqAction, error)

type InitTokenRequest

type InitTokenRequest struct {
	OTAStr      string
	TxRandomStr string
	Amount      uint64
	TokenName   string
	TokenSymbol string
	MetadataBase
}

func NewInitTokenRequest

func NewInitTokenRequest(otaStr string, txRandomStr string, amount uint64, tokenName, tokenSymbol string, metaType int) (*InitTokenRequest, error)

func (*InitTokenRequest) BuildReqActions

func (iReq *InitTokenRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

BuildReqActions builds an request action content from the shard chain to the beacon chain.

func (*InitTokenRequest) CalculateSize

func (iReq *InitTokenRequest) CalculateSize() uint64

CalculateSize returns the size of the request.

func (*InitTokenRequest) GetOTADeclarations

func (iReq *InitTokenRequest) GetOTADeclarations() []OTADeclaration

func (InitTokenRequest) Hash

func (iReq InitTokenRequest) Hash() *common.Hash

Hash returns the hash of all components in the request.

func (InitTokenRequest) ValidateMetadataByItself

func (iReq InitTokenRequest) ValidateMetadataByItself() bool

func (InitTokenRequest) ValidateSanityData

func (iReq InitTokenRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

ValidateSanityData performs the following verifications:

  1. Check transaction type and tx version
  2. Check the addressV2 is valid
  3. Check if the amount is not 0
  4. Check tokenName and tokenSymbol

func (InitTokenRequest) ValidateTxWithBlockChain

func (iReq InitTokenRequest) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type InitTokenResponse

type InitTokenResponse struct {
	MetadataBase
	RequestedTxID common.Hash
}

func NewInitTokenResponse

func NewInitTokenResponse(requestedTxID common.Hash, metaType int) *InitTokenResponse

func (*InitTokenResponse) CalculateSize

func (iRes *InitTokenResponse) CalculateSize() uint64

func (InitTokenResponse) CheckTransactionFee

func (iRes InitTokenResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (InitTokenResponse) Hash

func (iRes InitTokenResponse) Hash() *common.Hash

func (InitTokenResponse) ValidateMetadataByItself

func (iRes InitTokenResponse) ValidateMetadataByItself() bool

func (InitTokenResponse) ValidateSanityData

func (iRes InitTokenResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

ValidateSanityData performs the following verification:

  1. Check transaction type

func (InitTokenResponse) ValidateTxWithBlockChain

func (iRes InitTokenResponse) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

func (InitTokenResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes InitTokenResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData,
	shardID byte,
	tx Transaction,
	chainRetriever ChainRetriever,
	ac *AccumulatedValues,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
) (bool, error)

VerifyMinerCreatedTxBeforeGettingInBlock validates if the response is a reply to an instruction from the beacon chain. The response is valid for a specific instruction if

  1. the instruction has a valid metadata type
  2. the requested txIDs match
  3. the tokenID has not been accumulated (i.e, not seen in the current block)
  4. the minted public key and the one in the instruction match
  5. the minted tx random and the one in the instruction match
  6. the minted amount and the requested amount match
  7. the minted and requested tokens match

It returns false if no instruction from the beacon satisfies the above conditions.

TODO: reviewers should double-check if the above conditions are sufficient

type IssuingAcceptedInst

type IssuingAcceptedInst struct {
	ShardID         byte                   `json:"shardId"`
	DepositedAmount uint64                 `json:"issuingAmount"`
	ReceiverAddr    privacy.PaymentAddress `json:"receiverAddrStr"`
	IncTokenID      common.Hash            `json:"incTokenId"`
	IncTokenName    string                 `json:"incTokenName"`
	TxReqID         common.Hash            `json:"txReqId"`
}

func ParseIssuingInstAcceptedContent

func ParseIssuingInstAcceptedContent(instAcceptedContentStr string) (*IssuingAcceptedInst, error)

type IssuingReqAction

type IssuingReqAction struct {
	Meta    IssuingRequest `json:"meta"`
	TxReqID common.Hash    `json:"txReqId"`
}

func ParseIssuingInstContent

func ParseIssuingInstContent(instContentStr string) (*IssuingReqAction, error)

type IssuingRequest

type IssuingRequest struct {
	ReceiverAddress privacy.PaymentAddress
	DepositedAmount uint64
	TokenID         common.Hash
	TokenName       string
	MetadataBaseWithSignature
}

only centralized website can send this type of tx

func NewIssuingRequest

func NewIssuingRequest(
	receiverAddress privacy.PaymentAddress,
	depositedAmount uint64,
	tokenID common.Hash,
	tokenName string,
	metaType int,
) (*IssuingRequest, error)

func (*IssuingRequest) BuildReqActions

func (iReq *IssuingRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*IssuingRequest) CalculateSize

func (iReq *IssuingRequest) CalculateSize() uint64

func (IssuingRequest) Hash

func (iReq IssuingRequest) Hash() *common.Hash

func (IssuingRequest) HashWithoutSig

func (iReq IssuingRequest) HashWithoutSig() *common.Hash

func (IssuingRequest) ValidateMetadataByItself

func (iReq IssuingRequest) ValidateMetadataByItself() bool

func (IssuingRequest) ValidateSanityData

func (iReq IssuingRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (IssuingRequest) ValidateTxWithBlockChain

func (iReq IssuingRequest) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type IssuingResAction

type IssuingResAction struct {
	IncTokenID *common.Hash `json:"incTokenID"`
}

type IssuingResponse

type IssuingResponse struct {
	MetadataBase
	RequestedTxID common.Hash
	SharedRandom  []byte `json:"SharedRandom,omitempty"`
}

func NewIssuingResponse

func NewIssuingResponse(requestedTxID common.Hash, metaType int) *IssuingResponse

func (*IssuingResponse) CalculateSize

func (iRes *IssuingResponse) CalculateSize() uint64

func (IssuingResponse) CheckTransactionFee

func (iRes IssuingResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (IssuingResponse) Hash

func (iRes IssuingResponse) Hash() *common.Hash

func (*IssuingResponse) SetSharedRandom

func (iRes *IssuingResponse) SetSharedRandom(r []byte)

func (IssuingResponse) ValidateMetadataByItself

func (iRes IssuingResponse) ValidateMetadataByItself() bool

func (IssuingResponse) ValidateSanityData

func (iRes IssuingResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (IssuingResponse) ValidateTxWithBlockChain

func (iRes IssuingResponse) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

func (IssuingResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes IssuingResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type LiquidateTopPercentileExchangeRatesDetail

type LiquidateTopPercentileExchangeRatesDetail struct {
	TPKey                    int
	TPValue                  uint64
	HoldAmountFreeCollateral uint64
	HoldAmountPubToken       uint64
}

type LiquidateTopPercentileExchangeRatesStatus

type LiquidateTopPercentileExchangeRatesStatus struct {
	CustodianAddress string
	Status           byte
	Rates            map[string]LiquidateTopPercentileExchangeRatesDetail //ptoken | detail
}

func NewLiquidateTopPercentileExchangeRatesStatus

func NewLiquidateTopPercentileExchangeRatesStatus(custodianAddress string, status byte, rates map[string]LiquidateTopPercentileExchangeRatesDetail) *LiquidateTopPercentileExchangeRatesStatus

type LiquidationByRatesDetailV3

type LiquidationByRatesDetailV3 struct {
	Ratio                            uint64 // ratio between total locked collaterals and holding public tokens when liquidation occurs
	LiquidatedPubTokenAmount         uint64
	LiquidatedCollateralAmount       uint64            // PRV collateral
	LiquidatedTokenCollateralsAmount map[string]uint64 // externalTokenID: amount
}

Liquidation by exchange rates v3

type LiquidationCustodianDepositStatus

type LiquidationCustodianDepositStatus struct {
	TxReqID                common.Hash
	IncogAddressStr        string
	PTokenId               string
	DepositAmount          uint64
	FreeCollateralSelected bool
	Status                 byte
}

func NewLiquidationCustodianDepositStatus

func NewLiquidationCustodianDepositStatus(txReqID common.Hash, incogAddressStr string, PTokenId string, depositAmount uint64, freeCollateralSelected bool, status byte) *LiquidationCustodianDepositStatus

type LiquidationCustodianDepositStatusV2

type LiquidationCustodianDepositStatusV2 struct {
	TxReqID              common.Hash
	IncogAddressStr      string
	PTokenId             string
	DepositAmount        uint64
	FreeCollateralAmount uint64
	Status               byte
}

func NewLiquidationCustodianDepositStatusV2

func NewLiquidationCustodianDepositStatusV2(txReqID common.Hash, incogAddressStr string, PTokenId string, depositAmount uint64, freeCollateralAmount uint64, status byte) *LiquidationCustodianDepositStatusV2

type LiquidationCustodianDepositStatusV3

type LiquidationCustodianDepositStatusV3 struct {
	IncogAddressStr           string
	PortalTokenID             string
	CollateralTokenID         string
	DepositAmount             uint64
	FreeTokenCollateralAmount uint64 // topup from free token collaterals
	UniqExternalTxID          []byte
	TxReqID                   common.Hash
	Status                    byte
}

func NewLiquidationCustodianDepositStatus3

func NewLiquidationCustodianDepositStatus3(
	incognitoAddrStr string,
	portalTokenID string,
	collateralTokenID string,
	depositAmount uint64,
	freeTokenCollateralAmount uint64,
	uniqExternalTokenID []byte,
	txReqID common.Hash,
	status byte) *LiquidationCustodianDepositStatusV3

type MempoolRetriever

type MempoolRetriever = metadataCommon.MempoolRetriever

type Metadata

type Metadata = metadataCommon.Metadata

export interfaces

func NewIssuingRequestFromMap

func NewIssuingRequestFromMap(data map[string]interface{}) (Metadata, error)

func NewIssuingRequestFromMapV2

func NewIssuingRequestFromMapV2(data map[string]interface{}) (Metadata, error)

func NewWithDrawRewardRequestFromRPC

func NewWithDrawRewardRequestFromRPC(data map[string]interface{}) (Metadata, error)

func NewWithdrawDelegationRewardRequestFromRPC

func NewWithdrawDelegationRewardRequestFromRPC(data map[string]interface{}) (Metadata, error)

func ParseMetadata

func ParseMetadata(meta interface{}) (Metadata, error)

type MetadataBase

type MetadataBase = metadataCommon.MetadataBase

type MetadataLogger

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

wrap logger

func (*MetadataLogger) Init

func (ml *MetadataLogger) Init(inst common.Logger)

type MintData

type MintData = metadataCommon.MintData

type MintDelegationRewardMetadata

type MintDelegationRewardMetadata struct {
	MetadataBase
	TxID            string
	ReceiverAddress privacy.PaymentAddress
	RewardAmount    uint64
	SharedRandom    []byte `json:"SharedRandom,omitempty"`
}

func NewMintDelegationReward

func NewMintDelegationReward(
	txID string,
	receiverAddr privacy.PaymentAddress,
	rewardAmount uint64,
	metaType int,
) *MintDelegationRewardMetadata

func (MintDelegationRewardMetadata) CheckTransactionFee

func (sbsRes MintDelegationRewardMetadata) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, stateDB *statedb.StateDB) bool

func (MintDelegationRewardMetadata) Hash

func (sbsRes MintDelegationRewardMetadata) Hash() *common.Hash

func (*MintDelegationRewardMetadata) SetSharedRandom

func (sbsRes *MintDelegationRewardMetadata) SetSharedRandom(r []byte)

func (MintDelegationRewardMetadata) ValidateMetadataByItself

func (sbsRes MintDelegationRewardMetadata) ValidateMetadataByItself() bool

func (MintDelegationRewardMetadata) ValidateSanityData

func (sbsRes MintDelegationRewardMetadata) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

pk: 32, tk: 32

func (MintDelegationRewardMetadata) ValidateTxWithBlockChain

func (sbsRes MintDelegationRewardMetadata) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type OTADeclaration

type OTADeclaration = metadataCommon.OTADeclaration

export structs

type PDEContribution

type PDEContribution struct {
	PDEContributionPairID string
	ContributorAddressStr string
	ContributedAmount     uint64 // must be equal to vout value
	TokenIDStr            string
	MetadataBase
}

PDEContribution - privacy dex contribution

func NewPDEContribution

func NewPDEContribution(
	pdeContributionPairID string,
	contributorAddressStr string,
	contributedAmount uint64,
	tokenIDStr string,
	metaType int,
) (*PDEContribution, error)

func (*PDEContribution) BuildReqActions

func (pc *PDEContribution) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PDEContribution) CalculateSize

func (pc *PDEContribution) CalculateSize() uint64

func (PDEContribution) Hash

func (pc PDEContribution) Hash() *common.Hash

func (PDEContribution) ValidateMetadataByItself

func (pc PDEContribution) ValidateMetadataByItself() bool

func (PDEContribution) ValidateSanityData

func (pc PDEContribution) ValidateSanityData(
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	beaconHeight uint64,
	tx Transaction,
) (bool, bool, error)

func (PDEContribution) ValidateTxWithBlockChain

func (pc PDEContribution) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type PDEContributionAction

type PDEContributionAction struct {
	Meta    PDEContribution
	TxReqID common.Hash
	ShardID byte
}

type PDEContributionResponse

type PDEContributionResponse struct {
	MetadataBase
	ContributionStatus string
	RequestedTxID      common.Hash
	TokenIDStr         string
	SharedRandom       []byte `json:"SharedRandom,omitempty"`
}

func NewPDEContributionResponse

func NewPDEContributionResponse(
	contributionStatus string,
	requestedTxID common.Hash,
	tokenIDStr string,
	metaType int,
) *PDEContributionResponse

func (*PDEContributionResponse) CalculateSize

func (iRes *PDEContributionResponse) CalculateSize() uint64

func (PDEContributionResponse) CheckTransactionFee

func (iRes PDEContributionResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PDEContributionResponse) Hash

func (iRes PDEContributionResponse) Hash() *common.Hash

func (*PDEContributionResponse) SetSharedRandom

func (iRes *PDEContributionResponse) SetSharedRandom(r []byte)

func (PDEContributionResponse) ValidateMetadataByItself

func (iRes PDEContributionResponse) ValidateMetadataByItself() bool

func (PDEContributionResponse) ValidateSanityData

func (iRes PDEContributionResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PDEContributionResponse) ValidateTxWithBlockChain

func (iRes PDEContributionResponse) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

func (PDEContributionResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PDEContributionResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type PDEContributionStatus

type PDEContributionStatus struct {
	Status             byte
	TokenID1Str        string
	Contributed1Amount uint64
	Returned1Amount    uint64
	TokenID2Str        string
	Contributed2Amount uint64
	Returned2Amount    uint64
}

type PDECrossPoolTradeAcceptedContent

type PDECrossPoolTradeAcceptedContent struct {
	TraderAddressStr         string
	TxRandomStr              string `json:"TxRandomStr,omitempty"`
	TokenIDToBuyStr          string
	ReceiveAmount            uint64
	Token1IDStr              string
	Token2IDStr              string
	Token1PoolValueOperation TokenPoolValueOperation
	Token2PoolValueOperation TokenPoolValueOperation
	ShardID                  byte
	RequestedTxID            common.Hash
	AddingFee                uint64
}

type PDECrossPoolTradeRequest

type PDECrossPoolTradeRequest struct {
	TokenIDToBuyStr     string
	TokenIDToSellStr    string
	SellAmount          uint64 // must be equal to vout value
	MinAcceptableAmount uint64
	TradingFee          uint64
	TraderAddressStr    string
	TxRandomStr         string `json:"TxRandomStr,omitempty"`
	SubTraderAddressStr string `json:"SubTraderAddressStr,omitempty"`
	SubTxRandomStr      string `json:"SubTxRandomStr,omitempty"`
	MetadataBase
}

TODO: Update error type to correct one PDECrossPoolTradeRequest - privacy dex cross pool trade

func NewPDECrossPoolTradeRequest

func NewPDECrossPoolTradeRequest(
	tokenIDToBuyStr string,
	tokenIDToSellStr string,
	sellAmount uint64,
	minAcceptableAmount uint64,
	tradingFee uint64,
	traderAddressStr string,
	txRandomStr string,
	subTraderAddressStr string,
	subTxRandomStr string,
	metaType int,
) (*PDECrossPoolTradeRequest, error)

func (*PDECrossPoolTradeRequest) BuildReqActions

func (pc *PDECrossPoolTradeRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PDECrossPoolTradeRequest) CalculateSize

func (pc *PDECrossPoolTradeRequest) CalculateSize() uint64

func (*PDECrossPoolTradeRequest) GetOTADeclarations

func (pc *PDECrossPoolTradeRequest) GetOTADeclarations() []OTADeclaration

func (PDECrossPoolTradeRequest) Hash

func (PDECrossPoolTradeRequest) ValidateMetadataByItself

func (pc PDECrossPoolTradeRequest) ValidateMetadataByItself() bool

func (PDECrossPoolTradeRequest) ValidateSanityData

func (pc PDECrossPoolTradeRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PDECrossPoolTradeRequest) ValidateTxWithBlockChain

func (pc PDECrossPoolTradeRequest) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type PDECrossPoolTradeRequestAction

type PDECrossPoolTradeRequestAction struct {
	Meta    PDECrossPoolTradeRequest
	TxReqID common.Hash
	ShardID byte
}

type PDECrossPoolTradeResponse

type PDECrossPoolTradeResponse struct {
	MetadataBase
	TradeStatus   string
	RequestedTxID common.Hash
}

func NewPDECrossPoolTradeResponse

func NewPDECrossPoolTradeResponse(
	tradeStatus string,
	requestedTxID common.Hash,
	metaType int,
) *PDECrossPoolTradeResponse

func (*PDECrossPoolTradeResponse) CalculateSize

func (iRes *PDECrossPoolTradeResponse) CalculateSize() uint64

func (PDECrossPoolTradeResponse) CheckTransactionFee

func (iRes PDECrossPoolTradeResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PDECrossPoolTradeResponse) Hash

func (iRes PDECrossPoolTradeResponse) Hash() *common.Hash

func (PDECrossPoolTradeResponse) ValidateMetadataByItself

func (iRes PDECrossPoolTradeResponse) ValidateMetadataByItself() bool

func (PDECrossPoolTradeResponse) ValidateSanityData

func (iRes PDECrossPoolTradeResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PDECrossPoolTradeResponse) ValidateTxWithBlockChain

func (iRes PDECrossPoolTradeResponse) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

func (PDECrossPoolTradeResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PDECrossPoolTradeResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type PDEFeeWithdrawalRequest

type PDEFeeWithdrawalRequest struct {
	WithdrawerAddressStr  string
	WithdrawalToken1IDStr string
	WithdrawalToken2IDStr string
	WithdrawalFeeAmt      uint64
	MetadataBaseWithSignature
}

PDEFeeWithdrawalRequest - privacy dex withdrawal request

func NewPDEFeeWithdrawalRequest

func NewPDEFeeWithdrawalRequest(
	withdrawerAddressStr string,
	withdrawalToken1IDStr string,
	withdrawalToken2IDStr string,
	withdrawalFeeAmt uint64,
	metaType int,
) (*PDEFeeWithdrawalRequest, error)

func (*PDEFeeWithdrawalRequest) BuildReqActions

func (pc *PDEFeeWithdrawalRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PDEFeeWithdrawalRequest) CalculateSize

func (pc *PDEFeeWithdrawalRequest) CalculateSize() uint64

func (PDEFeeWithdrawalRequest) Hash

func (pc PDEFeeWithdrawalRequest) Hash() *common.Hash

func (PDEFeeWithdrawalRequest) HashWithoutSig

func (pc PDEFeeWithdrawalRequest) HashWithoutSig() *common.Hash

func (PDEFeeWithdrawalRequest) ValidateMetadataByItself

func (pc PDEFeeWithdrawalRequest) ValidateMetadataByItself() bool

func (PDEFeeWithdrawalRequest) ValidateSanityData

func (pc PDEFeeWithdrawalRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PDEFeeWithdrawalRequest) ValidateTxWithBlockChain

func (pc PDEFeeWithdrawalRequest) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type PDEFeeWithdrawalRequestAction

type PDEFeeWithdrawalRequestAction struct {
	Meta    PDEFeeWithdrawalRequest
	TxReqID common.Hash
	ShardID byte
}

type PDEFeeWithdrawalResponse

type PDEFeeWithdrawalResponse struct {
	MetadataBase
	RequestedTxID common.Hash
	SharedRandom  []byte `json:"SharedRandom,omitempty"`
}

func NewPDEFeeWithdrawalResponse

func NewPDEFeeWithdrawalResponse(
	requestedTxID common.Hash,
	metaType int,
) *PDEFeeWithdrawalResponse

func (*PDEFeeWithdrawalResponse) CalculateSize

func (iRes *PDEFeeWithdrawalResponse) CalculateSize() uint64

func (PDEFeeWithdrawalResponse) CheckTransactionFee

func (iRes PDEFeeWithdrawalResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PDEFeeWithdrawalResponse) Hash

func (iRes PDEFeeWithdrawalResponse) Hash() *common.Hash

func (*PDEFeeWithdrawalResponse) SetSharedRandom

func (iRes *PDEFeeWithdrawalResponse) SetSharedRandom(r []byte)

func (PDEFeeWithdrawalResponse) ValidateMetadataByItself

func (iRes PDEFeeWithdrawalResponse) ValidateMetadataByItself() bool

func (PDEFeeWithdrawalResponse) ValidateSanityData

func (iRes PDEFeeWithdrawalResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PDEFeeWithdrawalResponse) ValidateTxWithBlockChain

func (iRes PDEFeeWithdrawalResponse) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

func (PDEFeeWithdrawalResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PDEFeeWithdrawalResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type PDEMatchedContribution

type PDEMatchedContribution struct {
	PDEContributionPairID string
	ContributorAddressStr string
	ContributedAmount     uint64
	TokenIDStr            string
	TxReqID               common.Hash
}

type PDEMatchedNReturnedContribution

type PDEMatchedNReturnedContribution struct {
	PDEContributionPairID      string
	ContributorAddressStr      string
	ActualContributedAmount    uint64
	ReturnedContributedAmount  uint64
	TokenIDStr                 string
	ShardID                    byte
	TxReqID                    common.Hash
	ActualWaitingContribAmount uint64
}

type PDERefundContribution

type PDERefundContribution struct {
	PDEContributionPairID string
	ContributorAddressStr string
	ContributedAmount     uint64
	TokenIDStr            string
	TxReqID               common.Hash
	ShardID               byte
}

type PDERefundCrossPoolTrade

type PDERefundCrossPoolTrade struct {
	TraderAddressStr string
	TxRandomStr      string `json:"TxRandomStr,omitempty"`
	TokenIDStr       string
	Amount           uint64
	ShardID          byte
	TxReqID          common.Hash
}

type PDETradeAcceptedContent

type PDETradeAcceptedContent struct {
	TraderAddressStr         string
	TxRandomStr              string `json:"TxRandomStr,omitempty"`
	TokenIDToBuyStr          string
	ReceiveAmount            uint64
	Token1IDStr              string
	Token2IDStr              string
	Token1PoolValueOperation TokenPoolValueOperation
	Token2PoolValueOperation TokenPoolValueOperation
	ShardID                  byte
	RequestedTxID            common.Hash
}

type PDETradeRequest

type PDETradeRequest struct {
	TokenIDToBuyStr     string
	TokenIDToSellStr    string
	SellAmount          uint64 // must be equal to vout value
	MinAcceptableAmount uint64
	TradingFee          uint64
	TraderAddressStr    string
	TxRandomStr         string `json:"TxRandomStr,omitempty"`
	MetadataBase
}

PDETradeRequest - privacy dex trade

func NewPDETradeRequest

func NewPDETradeRequest(
	tokenIDToBuyStr string,
	tokenIDToSellStr string,
	sellAmount uint64,
	minAcceptableAmount uint64,
	tradingFee uint64,
	traderAddressStr string,
	txRandomStr string,
	metaType int,
) (*PDETradeRequest, error)

func (*PDETradeRequest) BuildReqActions

func (pc *PDETradeRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PDETradeRequest) CalculateSize

func (pc *PDETradeRequest) CalculateSize() uint64

func (*PDETradeRequest) GetOTADeclarations

func (pc *PDETradeRequest) GetOTADeclarations() []OTADeclaration

func (PDETradeRequest) Hash

func (pc PDETradeRequest) Hash() *common.Hash

func (PDETradeRequest) ValidateMetadataByItself

func (pc PDETradeRequest) ValidateMetadataByItself() bool

func (PDETradeRequest) ValidateSanityData

func (pc PDETradeRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PDETradeRequest) ValidateTxWithBlockChain

func (pc PDETradeRequest) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type PDETradeRequestAction

type PDETradeRequestAction struct {
	Meta    PDETradeRequest
	TxReqID common.Hash
	ShardID byte
}

type PDETradeResponse

type PDETradeResponse struct {
	MetadataBase
	TradeStatus   string
	RequestedTxID common.Hash
}

func NewPDETradeResponse

func NewPDETradeResponse(
	tradeStatus string,
	requestedTxID common.Hash,
	metaType int,
) *PDETradeResponse

func (*PDETradeResponse) CalculateSize

func (iRes *PDETradeResponse) CalculateSize() uint64

func (PDETradeResponse) CheckTransactionFee

func (iRes PDETradeResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PDETradeResponse) Hash

func (iRes PDETradeResponse) Hash() *common.Hash

func (PDETradeResponse) ValidateMetadataByItself

func (iRes PDETradeResponse) ValidateMetadataByItself() bool

func (PDETradeResponse) ValidateSanityData

func (iRes PDETradeResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PDETradeResponse) ValidateTxWithBlockChain

func (iRes PDETradeResponse) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

func (PDETradeResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PDETradeResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type PDEWaitingContribution

type PDEWaitingContribution struct {
	PDEContributionPairID string
	ContributorAddressStr string
	ContributedAmount     uint64
	TokenIDStr            string
	TxReqID               common.Hash
}

type PDEWithdrawalAcceptedContent

type PDEWithdrawalAcceptedContent struct {
	WithdrawalTokenIDStr string
	WithdrawerAddressStr string
	DeductingPoolValue   uint64
	DeductingShares      uint64
	PairToken1IDStr      string
	PairToken2IDStr      string
	TxReqID              common.Hash
	ShardID              byte
}

type PDEWithdrawalRequest

type PDEWithdrawalRequest struct {
	WithdrawerAddressStr  string
	WithdrawalToken1IDStr string
	WithdrawalToken2IDStr string
	WithdrawalShareAmt    uint64
	MetadataBaseWithSignature
}

PDEWithdrawalRequest - privacy dex withdrawal request

func NewPDEWithdrawalRequest

func NewPDEWithdrawalRequest(
	withdrawerAddressStr string,
	withdrawalToken1IDStr string,
	withdrawalToken2IDStr string,
	withdrawalShareAmt uint64,
	metaType int,
) (*PDEWithdrawalRequest, error)

func (*PDEWithdrawalRequest) BuildReqActions

func (pc *PDEWithdrawalRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PDEWithdrawalRequest) CalculateSize

func (pc *PDEWithdrawalRequest) CalculateSize() uint64

func (PDEWithdrawalRequest) Hash

func (pc PDEWithdrawalRequest) Hash() *common.Hash

func (PDEWithdrawalRequest) HashWithoutSig

func (pc PDEWithdrawalRequest) HashWithoutSig() *common.Hash

func (PDEWithdrawalRequest) ValidateMetadataByItself

func (pc PDEWithdrawalRequest) ValidateMetadataByItself() bool

func (PDEWithdrawalRequest) ValidateSanityData

func (pc PDEWithdrawalRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PDEWithdrawalRequest) ValidateTxWithBlockChain

func (pc PDEWithdrawalRequest) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type PDEWithdrawalRequestAction

type PDEWithdrawalRequestAction struct {
	Meta    PDEWithdrawalRequest
	TxReqID common.Hash
	ShardID byte
}

type PDEWithdrawalResponse

type PDEWithdrawalResponse struct {
	MetadataBase
	RequestedTxID common.Hash
	TokenIDStr    string
	SharedRandom  []byte `json:"SharedRandom,omitempty"`
}

func NewPDEWithdrawalResponse

func NewPDEWithdrawalResponse(
	tokenIDStr string,
	requestedTxID common.Hash,
	metaType int,
) *PDEWithdrawalResponse

func (*PDEWithdrawalResponse) CalculateSize

func (iRes *PDEWithdrawalResponse) CalculateSize() uint64

func (PDEWithdrawalResponse) CheckTransactionFee

func (iRes PDEWithdrawalResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PDEWithdrawalResponse) Hash

func (iRes PDEWithdrawalResponse) Hash() *common.Hash

func (*PDEWithdrawalResponse) SetSharedRandom

func (iRes *PDEWithdrawalResponse) SetSharedRandom(r []byte)

func (PDEWithdrawalResponse) ValidateMetadataByItself

func (iRes PDEWithdrawalResponse) ValidateMetadataByItself() bool

func (PDEWithdrawalResponse) ValidateSanityData

func (iRes PDEWithdrawalResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PDEWithdrawalResponse) ValidateTxWithBlockChain

func (iRes PDEWithdrawalResponse) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

func (PDEWithdrawalResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PDEWithdrawalResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type PortalConvertVaultRequest

type PortalConvertVaultRequest struct {
	MetadataBase
	TokenID      string // pTokenID in incognito chain
	ConvertProof string
}

@@NOTE: This tx is created when migration centralized bridge to portal v4 PortalConvertVaultRequest metadata - create normal tx with this metadata

func NewPortalConvertVaultRequest

func NewPortalConvertVaultRequest(
	metaType int,
	tokenID string,
	convertingProof string) (*PortalConvertVaultRequest, error)

func (*PortalConvertVaultRequest) BuildReqActions

func (convertVaultReq *PortalConvertVaultRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalConvertVaultRequest) CalculateSize

func (convertVaultReq *PortalConvertVaultRequest) CalculateSize() uint64

func (PortalConvertVaultRequest) Hash

func (convertVaultReq PortalConvertVaultRequest) Hash() *common.Hash

func (PortalConvertVaultRequest) ValidateMetadataByItself

func (convertVaultReq PortalConvertVaultRequest) ValidateMetadataByItself() bool

func (PortalConvertVaultRequest) ValidateSanityData

func (convertVaultReq PortalConvertVaultRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PortalConvertVaultRequest) ValidateTxWithBlockChain

func (convertVaultReq PortalConvertVaultRequest) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalConvertVaultRequestAction

type PortalConvertVaultRequestAction struct {
	Meta    PortalConvertVaultRequest
	TxReqID common.Hash
	ShardID byte
}

PortalConvertVaultRequestAction - shard validator creates instruction that contain this action content

type PortalConvertVaultRequestContent

type PortalConvertVaultRequestContent struct {
	TokenID          string // pTokenID in incognito chain
	ConvertProofHash string
	ConvertingUTXO   []*statedb.UTXO
	ConvertingAmount uint64
	TxReqID          common.Hash
	ShardID          byte
}

PortalConvertVaultRequestContent - Beacon builds a new instruction with this content after receiving a instruction from shard It will be appended to beaconBlock both accepted and rejected status

type PortalConvertVaultRequestStatus

type PortalConvertVaultRequestStatus struct {
	Status           byte
	TokenID          string // pTokenID in incognito chain
	ConvertProofHash string
	ConvertingUTXO   []*statedb.UTXO
	ConvertingAmount uint64
	TxReqID          common.Hash
	ErrorMsg         string
}

PortalConvertVaultRequestStatus - Beacon tracks status of request converting vault into db

type PortalCustodianDeposit

type PortalCustodianDeposit struct {
	MetadataBase
	IncogAddressStr string
	RemoteAddresses map[string]string // tokenID: remote address
	DepositedAmount uint64
}

PortalCustodianDeposit - portal custodian deposit collateral (PRV) metadata - custodian deposit - create normal tx with this metadata

func NewPortalCustodianDeposit

func NewPortalCustodianDeposit(metaType int, incognitoAddrStr string, remoteAddrs map[string]string, amount uint64) (*PortalCustodianDeposit, error)

func (*PortalCustodianDeposit) BuildReqActions

func (custodianDeposit *PortalCustodianDeposit) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalCustodianDeposit) CalculateSize

func (custodianDeposit *PortalCustodianDeposit) CalculateSize() uint64

func (PortalCustodianDeposit) Hash

func (custodianDeposit PortalCustodianDeposit) Hash() *common.Hash

func (*PortalCustodianDeposit) UnmarshalJSON

func (object *PortalCustodianDeposit) UnmarshalJSON(data []byte) error

func (PortalCustodianDeposit) ValidateMetadataByItself

func (custodianDeposit PortalCustodianDeposit) ValidateMetadataByItself() bool

func (PortalCustodianDeposit) ValidateSanityData

func (custodianDeposit PortalCustodianDeposit) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalCustodianDeposit) ValidateTxWithBlockChain

func (custodianDeposit PortalCustodianDeposit) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalCustodianDepositAction

type PortalCustodianDepositAction struct {
	Meta    PortalCustodianDeposit
	TxReqID common.Hash
	ShardID byte
}

PortalCustodianDepositAction - shard validator creates instruction that contain this action content

type PortalCustodianDepositActionV3

type PortalCustodianDepositActionV3 struct {
	Meta    PortalCustodianDepositV3
	TxReqID common.Hash
	ShardID byte
}

PortalCustodianDepositActionV3 - shard validator creates instruction that contain this action content it will be append to ShardToBeaconBlock

type PortalCustodianDepositContent

type PortalCustodianDepositContent struct {
	IncogAddressStr string
	RemoteAddresses map[string]string // tokenID: remote address
	DepositedAmount uint64
	TxReqID         common.Hash
	ShardID         byte
}

PortalCustodianDepositContent - Beacon builds a new instruction with this content after receiving a instruction from shard It will be appended to beaconBlock both accepted and refund status

type PortalCustodianDepositContentV3

type PortalCustodianDepositContentV3 struct {
	IncAddressStr    string
	RemoteAddresses  map[string]string // tokenID: remote address
	DepositAmount    uint64
	ExternalTokenID  string // collateral TokenID
	UniqExternalTxID []byte
	TxReqID          common.Hash
	ShardID          byte
}

PortalCustodianDepositContentV3 - Beacon builds a new instruction with this content after receiving a instruction from shard It will be appended to beaconBlock both accepted and refund status

type PortalCustodianDepositResponse

type PortalCustodianDepositResponse struct {
	MetadataBase
	DepositStatus    string
	ReqTxID          common.Hash
	CustodianAddrStr string
	SharedRandom     []byte `json:"SharedRandom,omitempty"`
}

func NewPortalCustodianDepositResponse

func NewPortalCustodianDepositResponse(
	depositStatus string,
	reqTxID common.Hash,
	custodianAddressStr string,
	metaType int,
) *PortalCustodianDepositResponse

func (*PortalCustodianDepositResponse) CalculateSize

func (iRes *PortalCustodianDepositResponse) CalculateSize() uint64

func (PortalCustodianDepositResponse) CheckTransactionFee

func (iRes PortalCustodianDepositResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalCustodianDepositResponse) Hash

func (*PortalCustodianDepositResponse) SetSharedRandom

func (iRes *PortalCustodianDepositResponse) SetSharedRandom(r []byte)

func (PortalCustodianDepositResponse) ValidateMetadataByItself

func (iRes PortalCustodianDepositResponse) ValidateMetadataByItself() bool

func (PortalCustodianDepositResponse) ValidateSanityData

func (iRes PortalCustodianDepositResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PortalCustodianDepositResponse) ValidateTxWithBlockChain

func (iRes PortalCustodianDepositResponse) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalCustodianDepositResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalCustodianDepositResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

todo:

type PortalCustodianDepositStatus

type PortalCustodianDepositStatus struct {
	Status          byte
	IncogAddressStr string
	RemoteAddresses map[string]string // tokenID: remote address
	DepositedAmount uint64
}

PortalCustodianDepositStatus - Beacon tracks status of custodian deposit tx into db

type PortalCustodianDepositStatusV3

type PortalCustodianDepositStatusV3 struct {
	Status           byte
	IncAddressStr    string
	RemoteAddresses  map[string]string // tokenID: remote address
	DepositAmount    uint64
	ExternalTokenID  string // collateral TokenID
	UniqExternalTxID []byte
}

PortalCustodianDepositStatus - Beacon tracks status of custodian deposit tx into db

type PortalCustodianDepositV3

type PortalCustodianDepositV3 struct {
	MetadataBase
	RemoteAddresses map[string]string // tokenID: remote address

	// ETH proof
	BlockHash eCommon.Hash
	TxIndex   uint
	ProofStrs []string
}

PortalCustodianDepositV3 - portal custodian deposit collaterals on SC (ETH/ERC20) metadata - custodian deposit - create normal tx with this metadata

func NewPortalCustodianDepositV3

func NewPortalCustodianDepositV3(
	metaType int,
	remoteAddrs map[string]string,
	blockHash eCommon.Hash,
	txIndex uint,
	proofStrs []string) (*PortalCustodianDepositV3, error)

func NewPortalCustodianDepositV3FromMap

func NewPortalCustodianDepositV3FromMap(
	data map[string]interface{},
	chainRetriever ChainRetriever,
	beaconHeight uint64,
) (*PortalCustodianDepositV3, error)

func (*PortalCustodianDepositV3) BuildReqActions

func (custodianDeposit *PortalCustodianDepositV3) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalCustodianDepositV3) CalculateSize

func (custodianDeposit *PortalCustodianDepositV3) CalculateSize() uint64

func (PortalCustodianDepositV3) Hash

func (custodianDeposit PortalCustodianDepositV3) Hash() *common.Hash

func (PortalCustodianDepositV3) ValidateMetadataByItself

func (custodianDeposit PortalCustodianDepositV3) ValidateMetadataByItself() bool

func (PortalCustodianDepositV3) ValidateSanityData

func (custodianDeposit PortalCustodianDepositV3) ValidateSanityData(
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalCustodianDepositV3) ValidateTxWithBlockChain

func (custodianDeposit PortalCustodianDepositV3) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalCustodianWithdrawRequest

type PortalCustodianWithdrawRequest struct {
	MetadataBase
	PaymentAddress string
	Amount         uint64
}

func NewPortalCustodianWithdrawRequest

func NewPortalCustodianWithdrawRequest(metaType int, paymentAddress string, amount uint64) (*PortalCustodianWithdrawRequest, error)

func (*PortalCustodianWithdrawRequest) BuildReqActions

func (withdrawReq *PortalCustodianWithdrawRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalCustodianWithdrawRequest) CalculateSize

func (withdrawReq *PortalCustodianWithdrawRequest) CalculateSize() uint64

func (PortalCustodianWithdrawRequest) Hash

func (withdrawReq PortalCustodianWithdrawRequest) Hash() *common.Hash

func (PortalCustodianWithdrawRequest) ValidateMetadataByItself

func (withdrawReq PortalCustodianWithdrawRequest) ValidateMetadataByItself() bool

func (PortalCustodianWithdrawRequest) ValidateSanityData

func (withdrawReq PortalCustodianWithdrawRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PortalCustodianWithdrawRequest) ValidateTxWithBlockChain

func (withdrawReq PortalCustodianWithdrawRequest) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalCustodianWithdrawRequestAction

type PortalCustodianWithdrawRequestAction struct {
	Meta    PortalCustodianWithdrawRequest
	TxReqID common.Hash
	ShardID byte
}

type PortalCustodianWithdrawRequestActionV3

type PortalCustodianWithdrawRequestActionV3 struct {
	Meta    PortalCustodianWithdrawRequestV3
	TxReqID common.Hash
	ShardID byte
}

type PortalCustodianWithdrawRequestContent

type PortalCustodianWithdrawRequestContent struct {
	PaymentAddress       string
	Amount               uint64
	RemainFreeCollateral uint64
	TxReqID              common.Hash
	ShardID              byte
}

type PortalCustodianWithdrawRequestContentV3

type PortalCustodianWithdrawRequestContentV3 struct {
	CustodianIncAddress      string
	CustodianExternalAddress string
	ExternalTokenID          string // collateral token ID
	Amount                   *big.Int
	TxReqID                  common.Hash
	ShardID                  byte
}

type PortalCustodianWithdrawRequestV3

type PortalCustodianWithdrawRequestV3 struct {
	MetadataBase
	CustodianIncAddress      string
	CustodianExternalAddress string // there is no 0x prefix
	ExternalTokenID          string // collateral token ID, there is no 0x prefix
	Amount                   uint64
}

func NewPortalCustodianWithdrawRequestV3

func NewPortalCustodianWithdrawRequestV3(
	metaType int,
	cusIncAddress string,
	cusExternalAddress string,
	externalTokenID string,
	amount uint64) (*PortalCustodianWithdrawRequestV3, error)

func (*PortalCustodianWithdrawRequestV3) BuildReqActions

func (req *PortalCustodianWithdrawRequestV3) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalCustodianWithdrawRequestV3) CalculateSize

func (req *PortalCustodianWithdrawRequestV3) CalculateSize() uint64

func (PortalCustodianWithdrawRequestV3) Hash

func (PortalCustodianWithdrawRequestV3) ValidateMetadataByItself

func (req PortalCustodianWithdrawRequestV3) ValidateMetadataByItself() bool

func (PortalCustodianWithdrawRequestV3) ValidateSanityData

func (req PortalCustodianWithdrawRequestV3) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PortalCustodianWithdrawRequestV3) ValidateTxWithBlockChain

func (req PortalCustodianWithdrawRequestV3) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalCustodianWithdrawResponse

type PortalCustodianWithdrawResponse struct {
	MetadataBase
	RequestStatus  string
	ReqTxID        common.Hash
	PaymentAddress string
	Amount         uint64
	SharedRandom   []byte `json:"SharedRandom,omitempty"`
}

func NewPortalCustodianWithdrawResponse

func NewPortalCustodianWithdrawResponse(
	requestStatus string,
	reqTxId common.Hash,
	paymentAddress string,
	amount uint64,
	metaType int,
) *PortalCustodianWithdrawResponse

func (*PortalCustodianWithdrawResponse) CalculateSize

func (responseMeta *PortalCustodianWithdrawResponse) CalculateSize() uint64

func (PortalCustodianWithdrawResponse) CheckTransactionFee

func (responseMeta PortalCustodianWithdrawResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalCustodianWithdrawResponse) Hash

func (responseMeta PortalCustodianWithdrawResponse) Hash() *common.Hash

func (*PortalCustodianWithdrawResponse) SetSharedRandom

func (responseMeta *PortalCustodianWithdrawResponse) SetSharedRandom(r []byte)

func (PortalCustodianWithdrawResponse) ValidateMetadataByItself

func (responseMeta PortalCustodianWithdrawResponse) ValidateMetadataByItself() bool

func (PortalCustodianWithdrawResponse) ValidateSanityData

func (responseMeta PortalCustodianWithdrawResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PortalCustodianWithdrawResponse) ValidateTxWithBlockChain

func (responseMeta PortalCustodianWithdrawResponse) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalCustodianWithdrawResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (responseMeta PortalCustodianWithdrawResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type PortalExchangeRates

type PortalExchangeRates struct {
	MetadataBaseWithSignature
	SenderAddress string
	Rates         []*ExchangeRateInfo //amount * 10^6 (USDT)
}

func NewPortalExchangeRates

func NewPortalExchangeRates(metaType int, senderAddress string, currency []*ExchangeRateInfo) (*PortalExchangeRates, error)

func (*PortalExchangeRates) BuildReqActions

func (portalExchangeRates *PortalExchangeRates) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalExchangeRates) CalculateSize

func (portalExchangeRates *PortalExchangeRates) CalculateSize() uint64

func (PortalExchangeRates) Hash

func (portalExchangeRates PortalExchangeRates) Hash() *common.Hash

func (PortalExchangeRates) HashWithoutSig

func (portalExchangeRates PortalExchangeRates) HashWithoutSig() *common.Hash

func (PortalExchangeRates) ValidateMetadataByItself

func (portalExchangeRates PortalExchangeRates) ValidateMetadataByItself() bool

func (PortalExchangeRates) ValidateSanityData

func (portalExchangeRates PortalExchangeRates) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalExchangeRates) ValidateTxWithBlockChain

func (portalExchangeRates PortalExchangeRates) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalExchangeRatesAction

type PortalExchangeRatesAction struct {
	Meta     PortalExchangeRates
	TxReqID  common.Hash
	LockTime int64
	ShardID  byte
}

type PortalExchangeRatesContent

type PortalExchangeRatesContent struct {
	SenderAddress string
	Rates         []*ExchangeRateInfo
	TxReqID       common.Hash
	LockTime      int64
}

type PortalExpiredWaitingPortingReq

type PortalExpiredWaitingPortingReq struct {
	MetadataBase
	UniquePortingID      string
	ExpiredByLiquidation bool
}

PortalRedeemRequest - portal user redeem requests to get public token by burning ptoken metadata - redeem request - create normal tx with this metadata

func NewPortalExpiredWaitingPortingReq

func NewPortalExpiredWaitingPortingReq(
	metaType int,
	uniquePortingID string,
	expiredByLiquidation bool,
) (*PortalExpiredWaitingPortingReq, error)

func (*PortalExpiredWaitingPortingReq) CalculateSize

func (expiredPortingReq *PortalExpiredWaitingPortingReq) CalculateSize() uint64

func (PortalExpiredWaitingPortingReq) Hash

func (expiredPortingReq PortalExpiredWaitingPortingReq) Hash() *common.Hash

func (PortalExpiredWaitingPortingReq) ValidateMetadataByItself

func (expiredPortingReq PortalExpiredWaitingPortingReq) ValidateMetadataByItself() bool

func (PortalExpiredWaitingPortingReq) ValidateSanityData

func (expiredPortingReq PortalExpiredWaitingPortingReq) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalExpiredWaitingPortingReq) ValidateTxWithBlockChain

func (expiredPortingReq PortalExpiredWaitingPortingReq) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalExpiredWaitingPortingReqContent

type PortalExpiredWaitingPortingReqContent struct {
	MetadataBase
	UniquePortingID      string
	ExpiredByLiquidation bool
	ShardID              byte
}

PortalExpiredWaitingPortingReqContent - Beacon builds a new instruction with this content after detecting user haven't sent public token to custodian It will be appended to beaconBlock

type PortalExpiredWaitingPortingReqStatus

type PortalExpiredWaitingPortingReqStatus struct {
	Status               byte
	UniquePortingID      string
	ShardID              byte
	ExpiredByLiquidation bool
	ExpiredBeaconHeight  uint64
}

PortalExpiredWaitingPortingReqStatus - Beacon tracks status of custodian liquidation into db

type PortalFeeRefundResponse

type PortalFeeRefundResponse struct {
	MetadataBase
	PortingRequestStatus string
	ReqTxID              common.Hash
	SharedRandom         []byte `json:"SharedRandom,omitempty"`
}

func NewPortalFeeRefundResponse

func NewPortalFeeRefundResponse(
	portingRequestStatus string,
	reqTxID common.Hash,
	metaType int,
) *PortalFeeRefundResponse

func (*PortalFeeRefundResponse) CalculateSize

func (iRes *PortalFeeRefundResponse) CalculateSize() uint64

func (PortalFeeRefundResponse) CheckTransactionFee

func (iRes PortalFeeRefundResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalFeeRefundResponse) Hash

func (iRes PortalFeeRefundResponse) Hash() *common.Hash

func (*PortalFeeRefundResponse) SetSharedRandom

func (iRes *PortalFeeRefundResponse) SetSharedRandom(r []byte)

func (PortalFeeRefundResponse) ValidateMetadataByItself

func (iRes PortalFeeRefundResponse) ValidateMetadataByItself() bool

func (PortalFeeRefundResponse) ValidateSanityData

func (iRes PortalFeeRefundResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalFeeRefundResponse) ValidateTxWithBlockChain

func (iRes PortalFeeRefundResponse) ValidateTxWithBlockChain(txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB) (bool, error)

func (PortalFeeRefundResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalFeeRefundResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type PortalLiquidateCustodian

type PortalLiquidateCustodian struct {
	MetadataBase
	UniqueRedeemID           string
	TokenID                  string // pTokenID in incognito chain
	RedeemPubTokenAmount     uint64
	MintedCollateralAmount   uint64 // minted PRV amount for sending back to users
	RedeemerIncAddressStr    string
	CustodianIncAddressStr   string
	LiquidatedByExchangeRate bool
}

PortalRedeemRequest - portal user redeem requests to get public token by burning ptoken metadata - redeem request - create normal tx with this metadata

func NewPortalLiquidateCustodian

func NewPortalLiquidateCustodian(
	metaType int,
	uniqueRedeemID string,
	tokenID string,
	redeemAmount uint64,
	mintedCollateralAmount uint64,
	redeemerIncAddressStr string,
	custodianIncAddressStr string,
	liquidatedByExchangeRate bool) (*PortalLiquidateCustodian, error)

func (*PortalLiquidateCustodian) CalculateSize

func (liqCustodian *PortalLiquidateCustodian) CalculateSize() uint64

func (PortalLiquidateCustodian) Hash

func (liqCustodian PortalLiquidateCustodian) Hash() *common.Hash

func (PortalLiquidateCustodian) ValidateMetadataByItself

func (liqCustodian PortalLiquidateCustodian) ValidateMetadataByItself() bool

func (PortalLiquidateCustodian) ValidateSanityData

func (liqCustodian PortalLiquidateCustodian) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalLiquidateCustodian) ValidateTxWithBlockChain

func (liqCustodian PortalLiquidateCustodian) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalLiquidateCustodianContent

type PortalLiquidateCustodianContent struct {
	MetadataBase
	UniqueRedeemID                 string
	TokenID                        string // pTokenID in incognito chain
	RedeemPubTokenAmount           uint64
	LiquidatedCollateralAmount     uint64 // minted PRV amount for sending back to users
	RemainUnlockAmountForCustodian uint64
	RedeemerIncAddressStr          string
	CustodianIncAddressStr         string
	LiquidatedByExchangeRate       bool
	ShardID                        byte

	RemainUnlockAmountsForCustodian map[string]uint64
	LiquidatedCollateralAmounts     map[string]uint64 // minted PRV amount for sending back to users
}

PortalLiquidateCustodianContent - Beacon builds a new instruction with this content after detecting custodians run away It will be appended to beaconBlock

type PortalLiquidateCustodianResponse

type PortalLiquidateCustodianResponse struct {
	MetadataBase
	UniqueRedeemID         string
	MintedCollateralAmount uint64 // minted PRV amount for sending back to users
	RedeemerIncAddressStr  string
	CustodianIncAddressStr string
	SharedRandom           []byte `json:"SharedRandom,omitempty"`
}

func NewPortalLiquidateCustodianResponse

func NewPortalLiquidateCustodianResponse(
	uniqueRedeemID string,
	mintedAmount uint64,
	redeemerIncAddressStr string,
	custodianIncAddressStr string,
	metaType int,
) *PortalLiquidateCustodianResponse

func (*PortalLiquidateCustodianResponse) CalculateSize

func (iRes *PortalLiquidateCustodianResponse) CalculateSize() uint64

func (PortalLiquidateCustodianResponse) CheckTransactionFee

func (iRes PortalLiquidateCustodianResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalLiquidateCustodianResponse) Hash

func (*PortalLiquidateCustodianResponse) SetSharedRandom

func (iRes *PortalLiquidateCustodianResponse) SetSharedRandom(r []byte)

func (PortalLiquidateCustodianResponse) ValidateMetadataByItself

func (iRes PortalLiquidateCustodianResponse) ValidateMetadataByItself() bool

func (PortalLiquidateCustodianResponse) ValidateSanityData

func (iRes PortalLiquidateCustodianResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalLiquidateCustodianResponse) ValidateTxWithBlockChain

func (iRes PortalLiquidateCustodianResponse) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalLiquidateCustodianResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalLiquidateCustodianResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type PortalLiquidateCustodianStatus

type PortalLiquidateCustodianStatus struct {
	Status                         byte
	UniqueRedeemID                 string
	TokenID                        string // pTokenID in incognito chain
	RedeemPubTokenAmount           uint64
	LiquidatedCollateralAmount     uint64 // minted PRV amount for sending back to users
	RemainUnlockAmountForCustodian uint64
	RedeemerIncAddressStr          string
	CustodianIncAddressStr         string
	LiquidatedByExchangeRate       bool
	ShardID                        byte
	LiquidatedBeaconHeight         uint64

	RemainUnlockAmountsForCustodian map[string]uint64
	LiquidatedCollateralAmounts     map[string]uint64 // minted PRV amount for sending back to users
}

PortalLiquidateCustodianStatus - Beacon tracks status of custodian liquidation into db

type PortalLiquidateTopPercentileExchangeRatesContent

type PortalLiquidateTopPercentileExchangeRatesContent struct {
	CustodianAddress   string
	Status             string
	MetaType           int
	TP                 map[string]LiquidateTopPercentileExchangeRatesDetail
	RemainUnlockAmount map[string]uint64
}

type PortalLiquidationByRatesContentV3

type PortalLiquidationByRatesContentV3 struct {
	CustodianIncAddress     string
	Details                 map[string]LiquidationByRatesDetailV3 // portalTokenID: liquidation infos
	RemainUnlockCollaterals map[string]RemainUnlockCollateral
}

type PortalLiquidationByRatesStatusV3

type PortalLiquidationByRatesStatusV3 struct {
	CustodianIncAddress string
	Details             map[string]LiquidationByRatesDetailV3 // portalTokenID: liquidation infos
}

type PortalLiquidationCustodianDeposit

type PortalLiquidationCustodianDeposit struct {
	MetadataBase
	IncogAddressStr        string
	PTokenId               string
	DepositedAmount        uint64
	FreeCollateralSelected bool
}

func NewPortalLiquidationCustodianDeposit

func NewPortalLiquidationCustodianDeposit(metaType int, incognitoAddrStr string, pToken string, amount uint64, freeCollateralSelected bool) (*PortalLiquidationCustodianDeposit, error)

func (*PortalLiquidationCustodianDeposit) BuildReqActions

func (custodianDeposit *PortalLiquidationCustodianDeposit) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalLiquidationCustodianDeposit) CalculateSize

func (custodianDeposit *PortalLiquidationCustodianDeposit) CalculateSize() uint64

func (PortalLiquidationCustodianDeposit) Hash

func (custodianDeposit PortalLiquidationCustodianDeposit) Hash() *common.Hash

func (PortalLiquidationCustodianDeposit) ValidateMetadataByItself

func (custodianDeposit PortalLiquidationCustodianDeposit) ValidateMetadataByItself() bool

func (PortalLiquidationCustodianDeposit) ValidateSanityData

func (custodianDeposit PortalLiquidationCustodianDeposit) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalLiquidationCustodianDeposit) ValidateTxWithBlockChain

func (custodianDeposit PortalLiquidationCustodianDeposit) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalLiquidationCustodianDepositAction

type PortalLiquidationCustodianDepositAction struct {
	Meta    PortalLiquidationCustodianDeposit
	TxReqID common.Hash
	ShardID byte
}

type PortalLiquidationCustodianDepositActionV2

type PortalLiquidationCustodianDepositActionV2 struct {
	Meta    PortalLiquidationCustodianDepositV2
	TxReqID common.Hash
	ShardID byte
}

type PortalLiquidationCustodianDepositActionV3

type PortalLiquidationCustodianDepositActionV3 struct {
	Meta    PortalLiquidationCustodianDepositV3
	TxReqID common.Hash
	ShardID byte
}

type PortalLiquidationCustodianDepositContent

type PortalLiquidationCustodianDepositContent struct {
	IncogAddressStr        string
	PTokenId               string
	DepositedAmount        uint64
	FreeCollateralSelected bool
	TxReqID                common.Hash
	ShardID                byte
}

type PortalLiquidationCustodianDepositContentV2

type PortalLiquidationCustodianDepositContentV2 struct {
	IncogAddressStr      string
	PTokenId             string
	DepositedAmount      uint64
	FreeCollateralAmount uint64
	TxReqID              common.Hash
	ShardID              byte
}

type PortalLiquidationCustodianDepositContentV3

type PortalLiquidationCustodianDepositContentV3 struct {
	IncogAddressStr           string
	PortalTokenID             string
	CollateralTokenID         string
	DepositAmount             uint64
	FreeTokenCollateralAmount uint64 // topup from free token collaterals
	UniqExternalTxID          []byte
	TxReqID                   common.Hash
	ShardID                   byte
}

type PortalLiquidationCustodianDepositResponse

type PortalLiquidationCustodianDepositResponse struct {
	MetadataBase
	DepositStatus    string
	ReqTxID          common.Hash
	CustodianAddrStr string
	DepositedAmount  uint64
	SharedRandom     []byte `json:"SharedRandom,omitempty"`
}

func NewPortalLiquidationCustodianDepositResponse

func NewPortalLiquidationCustodianDepositResponse(
	depositStatus string,
	reqTxID common.Hash,
	custodianAddressStr string,
	depositedAmount uint64,
	metaType int,
) *PortalLiquidationCustodianDepositResponse

func (*PortalLiquidationCustodianDepositResponse) CalculateSize

func (iRes *PortalLiquidationCustodianDepositResponse) CalculateSize() uint64

func (PortalLiquidationCustodianDepositResponse) CheckTransactionFee

func (iRes PortalLiquidationCustodianDepositResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalLiquidationCustodianDepositResponse) Hash

func (*PortalLiquidationCustodianDepositResponse) SetSharedRandom

func (iRes *PortalLiquidationCustodianDepositResponse) SetSharedRandom(r []byte)

func (PortalLiquidationCustodianDepositResponse) ValidateMetadataByItself

func (iRes PortalLiquidationCustodianDepositResponse) ValidateMetadataByItself() bool

func (PortalLiquidationCustodianDepositResponse) ValidateSanityData

func (iRes PortalLiquidationCustodianDepositResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalLiquidationCustodianDepositResponse) ValidateTxWithBlockChain

func (iRes PortalLiquidationCustodianDepositResponse) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalLiquidationCustodianDepositResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalLiquidationCustodianDepositResponse) VerifyMinerCreatedTxBeforeGettingInBlock(
	mintData *MintData,
	shardID byte,
	tx Transaction,
	chainRetriever ChainRetriever,
	ac *AccumulatedValues,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
) (bool, error)

type PortalLiquidationCustodianDepositResponseV2

type PortalLiquidationCustodianDepositResponseV2 struct {
	MetadataBase
	DepositStatus    string
	ReqTxID          common.Hash
	CustodianAddrStr string
	DepositedAmount  uint64
	SharedRandom     []byte `json:"SharedRandom,omitempty"`
}

func NewPortalLiquidationCustodianDepositResponseV2

func NewPortalLiquidationCustodianDepositResponseV2(
	depositStatus string,
	reqTxID common.Hash,
	custodianAddressStr string,
	depositedAmount uint64,
	metaType int,
) *PortalLiquidationCustodianDepositResponseV2

func (*PortalLiquidationCustodianDepositResponseV2) CalculateSize

func (PortalLiquidationCustodianDepositResponseV2) CheckTransactionFee

func (iRes PortalLiquidationCustodianDepositResponseV2) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalLiquidationCustodianDepositResponseV2) Hash

func (*PortalLiquidationCustodianDepositResponseV2) SetSharedRandom

func (iRes *PortalLiquidationCustodianDepositResponseV2) SetSharedRandom(r []byte)

func (PortalLiquidationCustodianDepositResponseV2) ValidateMetadataByItself

func (iRes PortalLiquidationCustodianDepositResponseV2) ValidateMetadataByItself() bool

func (PortalLiquidationCustodianDepositResponseV2) ValidateSanityData

func (iRes PortalLiquidationCustodianDepositResponseV2) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalLiquidationCustodianDepositResponseV2) ValidateTxWithBlockChain

func (iRes PortalLiquidationCustodianDepositResponseV2) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalLiquidationCustodianDepositResponseV2) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalLiquidationCustodianDepositResponseV2) VerifyMinerCreatedTxBeforeGettingInBlock(
	mintData *MintData,
	shardID byte,
	tx Transaction,
	chainRetriever ChainRetriever,
	ac *AccumulatedValues,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
) (bool, error)

type PortalLiquidationCustodianDepositV2

type PortalLiquidationCustodianDepositV2 struct {
	MetadataBase
	IncogAddressStr      string
	PTokenId             string
	DepositedAmount      uint64
	FreeCollateralAmount uint64
}

func NewPortalLiquidationCustodianDepositV2

func NewPortalLiquidationCustodianDepositV2(metaType int, incognitoAddrStr string, pToken string, amount uint64, freeCollateralAmount uint64) (*PortalLiquidationCustodianDepositV2, error)

func (*PortalLiquidationCustodianDepositV2) BuildReqActions

func (custodianDeposit *PortalLiquidationCustodianDepositV2) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalLiquidationCustodianDepositV2) CalculateSize

func (custodianDeposit *PortalLiquidationCustodianDepositV2) CalculateSize() uint64

func (PortalLiquidationCustodianDepositV2) Hash

func (custodianDeposit PortalLiquidationCustodianDepositV2) Hash() *common.Hash

func (PortalLiquidationCustodianDepositV2) ValidateMetadataByItself

func (custodianDeposit PortalLiquidationCustodianDepositV2) ValidateMetadataByItself() bool

func (PortalLiquidationCustodianDepositV2) ValidateSanityData

func (custodianDeposit PortalLiquidationCustodianDepositV2) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalLiquidationCustodianDepositV2) ValidateTxWithBlockChain

func (custodianDeposit PortalLiquidationCustodianDepositV2) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalLiquidationCustodianDepositV3

type PortalLiquidationCustodianDepositV3 struct {
	MetadataBase
	IncogAddressStr           string
	PortalTokenID             string
	CollateralTokenID         string
	DepositAmount             uint64
	FreeTokenCollateralAmount uint64 // topup from free token collaterals

	// ETH proof
	BlockHash eCommon.Hash
	TxIndex   uint
	ProofStrs []string
}

PortalLiquidationCustodianDepositV3 - custodian topup more token collaterals (ETH, ERC20) through the smart contract's bond submit the deposit proof

func NewPortalLiquidationCustodianDepositV3

func NewPortalLiquidationCustodianDepositV3(
	metaType int,
	incognitoAddrStr string,
	portalTokenID string,
	collateralTokenID string,
	depositAmount uint64,
	freeTokenCollateralAmount uint64,
	blockHash eCommon.Hash,
	txIndex uint,
	proofStrs []string,
) (*PortalLiquidationCustodianDepositV3, error)

func (*PortalLiquidationCustodianDepositV3) BuildReqActions

func (req *PortalLiquidationCustodianDepositV3) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalLiquidationCustodianDepositV3) CalculateSize

func (req *PortalLiquidationCustodianDepositV3) CalculateSize() uint64

func (PortalLiquidationCustodianDepositV3) Hash

func (PortalLiquidationCustodianDepositV3) ValidateMetadataByItself

func (req PortalLiquidationCustodianDepositV3) ValidateMetadataByItself() bool

func (PortalLiquidationCustodianDepositV3) ValidateSanityData

func (req PortalLiquidationCustodianDepositV3) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalLiquidationCustodianDepositV3) ValidateTxWithBlockChain

func (req PortalLiquidationCustodianDepositV3) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalPortingRequestContent

type PortalPortingRequestContent struct {
	UniqueRegisterId string
	IncogAddressStr  string
	PTokenId         string
	RegisterAmount   uint64
	PortingFee       uint64
	Custodian        []*statedb.MatchingPortingCustodianDetail
	TxReqID          common.Hash
	ShardID          byte
	ShardHeight      uint64
}

type PortalRedeemFromLiquidationPoolActionV3

type PortalRedeemFromLiquidationPoolActionV3 struct {
	Meta    PortalRedeemFromLiquidationPoolV3
	TxReqID common.Hash
	ShardID byte
}

type PortalRedeemFromLiquidationPoolContentV3

type PortalRedeemFromLiquidationPoolContentV3 struct {
	TokenID                  string // portalTokenID in incognito chain
	RedeemAmount             uint64
	RedeemerIncAddressStr    string
	RedeemerExtAddressStr    string
	TxReqID                  common.Hash
	ShardID                  byte
	MintedPRVCollateral      uint64
	UnlockedTokenCollaterals map[string]uint64
}

type PortalRedeemFromLiquidationPoolResponseV3

type PortalRedeemFromLiquidationPoolResponseV3 struct {
	MetadataBase
	RequestStatus       string
	ReqTxID             common.Hash
	RequesterAddrStr    string
	ExternalAddress     string
	RedeemAmount        uint64
	MintedPRVCollateral uint64
	TokenID             string
	SharedRandom        []byte `json:"SharedRandom,omitempty"`
}

func NewPortalRedeemFromLiquidationPoolResponseV3

func NewPortalRedeemFromLiquidationPoolResponseV3(
	requestStatus string,
	reqTxID common.Hash,
	requesterAddressStr string,
	redeemAmount uint64,
	amount uint64,
	tokenID string,
	metaType int,
) *PortalRedeemFromLiquidationPoolResponseV3

func (*PortalRedeemFromLiquidationPoolResponseV3) CalculateSize

func (iRes *PortalRedeemFromLiquidationPoolResponseV3) CalculateSize() uint64

func (PortalRedeemFromLiquidationPoolResponseV3) CheckTransactionFee

func (iRes PortalRedeemFromLiquidationPoolResponseV3) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalRedeemFromLiquidationPoolResponseV3) Hash

func (*PortalRedeemFromLiquidationPoolResponseV3) SetSharedRandom

func (iRes *PortalRedeemFromLiquidationPoolResponseV3) SetSharedRandom(r []byte)

func (PortalRedeemFromLiquidationPoolResponseV3) ValidateMetadataByItself

func (iRes PortalRedeemFromLiquidationPoolResponseV3) ValidateMetadataByItself() bool

func (PortalRedeemFromLiquidationPoolResponseV3) ValidateSanityData

func (iRes PortalRedeemFromLiquidationPoolResponseV3) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalRedeemFromLiquidationPoolResponseV3) ValidateTxWithBlockChain

func (iRes PortalRedeemFromLiquidationPoolResponseV3) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalRedeemFromLiquidationPoolResponseV3) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalRedeemFromLiquidationPoolResponseV3) VerifyMinerCreatedTxBeforeGettingInBlock(
	mintData *MintData,
	shardID byte,
	tx Transaction,
	chainRetriever ChainRetriever,
	ac *AccumulatedValues,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
) (bool, error)

type PortalRedeemFromLiquidationPoolStatusV3

type PortalRedeemFromLiquidationPoolStatusV3 struct {
	TokenID                  string // portalTokenID in incognito chain
	RedeemAmount             uint64
	RedeemerIncAddressStr    string
	RedeemerExtAddressStr    string
	TxReqID                  common.Hash
	MintedPRVCollateral      uint64
	UnlockedTokenCollaterals map[string]uint64
	Status                   byte
}

type PortalRedeemFromLiquidationPoolV3

type PortalRedeemFromLiquidationPoolV3 struct {
	MetadataBase
	TokenID               string // portalTokenID in incognito chain
	RedeemAmount          uint64
	RedeemerIncAddressStr string
	RedeemerExtAddressStr string
}

func NewPortalRedeemFromLiquidationPoolV3

func NewPortalRedeemFromLiquidationPoolV3(
	metaType int,
	tokenID string,
	redeemAmount uint64,
	incAddressStr string,
	extAddressStr string,
) (*PortalRedeemFromLiquidationPoolV3, error)

func (*PortalRedeemFromLiquidationPoolV3) BuildReqActions

func (redeemReq *PortalRedeemFromLiquidationPoolV3) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalRedeemFromLiquidationPoolV3) CalculateSize

func (redeemReq *PortalRedeemFromLiquidationPoolV3) CalculateSize() uint64

func (PortalRedeemFromLiquidationPoolV3) Hash

func (redeemReq PortalRedeemFromLiquidationPoolV3) Hash() *common.Hash

func (PortalRedeemFromLiquidationPoolV3) ValidateMetadataByItself

func (redeemReq PortalRedeemFromLiquidationPoolV3) ValidateMetadataByItself() bool

func (PortalRedeemFromLiquidationPoolV3) ValidateSanityData

func (redeemReq PortalRedeemFromLiquidationPoolV3) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalRedeemFromLiquidationPoolV3) ValidateTxWithBlockChain

func (redeemReq PortalRedeemFromLiquidationPoolV3) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalRedeemLiquidateExchangeRates

type PortalRedeemLiquidateExchangeRates struct {
	MetadataBase
	TokenID               string // pTokenID in incognito chain
	RedeemAmount          uint64
	RedeemerIncAddressStr string
}

func NewPortalRedeemLiquidateExchangeRates

func NewPortalRedeemLiquidateExchangeRates(
	metaType int,
	tokenID string,
	redeemAmount uint64,
	incAddressStr string,
) (*PortalRedeemLiquidateExchangeRates, error)

func (*PortalRedeemLiquidateExchangeRates) BuildReqActions

func (redeemReq *PortalRedeemLiquidateExchangeRates) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalRedeemLiquidateExchangeRates) CalculateSize

func (redeemReq *PortalRedeemLiquidateExchangeRates) CalculateSize() uint64

func (PortalRedeemLiquidateExchangeRates) Hash

func (PortalRedeemLiquidateExchangeRates) ValidateMetadataByItself

func (redeemReq PortalRedeemLiquidateExchangeRates) ValidateMetadataByItself() bool

func (PortalRedeemLiquidateExchangeRates) ValidateSanityData

func (redeemReq PortalRedeemLiquidateExchangeRates) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalRedeemLiquidateExchangeRates) ValidateTxWithBlockChain

func (redeemReq PortalRedeemLiquidateExchangeRates) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalRedeemLiquidateExchangeRatesAction

type PortalRedeemLiquidateExchangeRatesAction struct {
	Meta    PortalRedeemLiquidateExchangeRates
	TxReqID common.Hash
	ShardID byte
}

type PortalRedeemLiquidateExchangeRatesContent

type PortalRedeemLiquidateExchangeRatesContent struct {
	TokenID               string // pTokenID in incognito chain
	RedeemAmount          uint64
	RedeemerIncAddressStr string
	TxReqID               common.Hash
	ShardID               byte
	TotalPTokenReceived   uint64
}

type PortalRedeemLiquidateExchangeRatesResponse

type PortalRedeemLiquidateExchangeRatesResponse struct {
	MetadataBase
	RequestStatus    string
	ReqTxID          common.Hash
	RequesterAddrStr string
	RedeemAmount     uint64
	Amount           uint64
	TokenID          string
	SharedRandom     []byte `json:"SharedRandom,omitempty"`
}

func NewPortalRedeemLiquidateExchangeRatesResponse

func NewPortalRedeemLiquidateExchangeRatesResponse(
	requestStatus string,
	reqTxID common.Hash,
	requesterAddressStr string,
	redeemAmount uint64,
	amount uint64,
	tokenID string,
	metaType int,
) *PortalRedeemLiquidateExchangeRatesResponse

func (*PortalRedeemLiquidateExchangeRatesResponse) CalculateSize

func (iRes *PortalRedeemLiquidateExchangeRatesResponse) CalculateSize() uint64

func (PortalRedeemLiquidateExchangeRatesResponse) CheckTransactionFee

func (iRes PortalRedeemLiquidateExchangeRatesResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalRedeemLiquidateExchangeRatesResponse) Hash

func (*PortalRedeemLiquidateExchangeRatesResponse) SetSharedRandom

func (iRes *PortalRedeemLiquidateExchangeRatesResponse) SetSharedRandom(r []byte)

func (PortalRedeemLiquidateExchangeRatesResponse) ValidateMetadataByItself

func (iRes PortalRedeemLiquidateExchangeRatesResponse) ValidateMetadataByItself() bool

func (PortalRedeemLiquidateExchangeRatesResponse) ValidateSanityData

func (iRes PortalRedeemLiquidateExchangeRatesResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalRedeemLiquidateExchangeRatesResponse) ValidateTxWithBlockChain

func (iRes PortalRedeemLiquidateExchangeRatesResponse) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalRedeemLiquidateExchangeRatesResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalRedeemLiquidateExchangeRatesResponse) VerifyMinerCreatedTxBeforeGettingInBlock(
	mintData *MintData,
	shardID byte,
	tx Transaction,
	chainRetriever ChainRetriever,
	ac *AccumulatedValues,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
) (bool, error)

type PortalRedeemRequest

type PortalRedeemRequest struct {
	MetadataBase
	UniqueRedeemID        string
	TokenID               string // pTokenID in incognito chain
	RedeemAmount          uint64
	RedeemerIncAddressStr string
	RemoteAddress         string // btc/bnb/etc address
	RedeemFee             uint64 // redeem fee in PRV, 0.01% redeemAmount in PRV
}

PortalRedeemRequest - portal user redeem requests to get public token by burning ptoken metadata - redeem request - create normal tx with this metadata

type PortalRedeemRequestAction

type PortalRedeemRequestAction struct {
	Meta    PortalRedeemRequest
	TxReqID common.Hash
	ShardID byte
}

PortalRedeemRequestAction - shard validator creates instruction that contain this action content

type PortalRedeemRequestActionV3

type PortalRedeemRequestActionV3 struct {
	Meta        PortalRedeemRequestV3
	TxReqID     common.Hash
	ShardID     byte
	ShardHeight uint64
}

PortalRedeemRequestAction - shard validator creates instruction that contain this action content

type PortalRedeemRequestContent

type PortalRedeemRequestContent struct {
	UniqueRedeemID          string
	TokenID                 string // pTokenID in incognito chain
	RedeemAmount            uint64
	RedeemerIncAddressStr   string
	RemoteAddress           string                                   // btc/bnb/etc address
	RedeemFee               uint64                                   // redeem fee in PRV, 0.01% redeemAmount in PRV
	MatchingCustodianDetail []*statedb.MatchingRedeemCustodianDetail // key: incAddressCustodian
	TxReqID                 common.Hash
	ShardID                 byte
	ShardHeight             uint64
	RedeemerExternalAddress string
}

PortalRedeemRequestContent - Beacon builds a new instruction with this content after receiving a instruction from shard It will be appended to beaconBlock both accepted and rejected status

type PortalRedeemRequestResponse

type PortalRedeemRequestResponse struct {
	MetadataBase
	RequestStatus    string
	ReqTxID          common.Hash
	RequesterAddrStr string
	Amount           uint64
	IncTokenID       string
	SharedRandom     []byte `json:"SharedRandom,omitempty"`
}

func NewPortalRedeemRequestResponse

func NewPortalRedeemRequestResponse(
	requestStatus string,
	reqTxID common.Hash,
	requesterAddressStr string,
	amount uint64,
	tokenID string,
	metaType int,
) *PortalRedeemRequestResponse

func (*PortalRedeemRequestResponse) CalculateSize

func (iRes *PortalRedeemRequestResponse) CalculateSize() uint64

func (PortalRedeemRequestResponse) CheckTransactionFee

func (iRes PortalRedeemRequestResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalRedeemRequestResponse) Hash

func (*PortalRedeemRequestResponse) SetSharedRandom

func (iRes *PortalRedeemRequestResponse) SetSharedRandom(r []byte)

func (PortalRedeemRequestResponse) ValidateMetadataByItself

func (iRes PortalRedeemRequestResponse) ValidateMetadataByItself() bool

func (PortalRedeemRequestResponse) ValidateSanityData

func (iRes PortalRedeemRequestResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalRedeemRequestResponse) ValidateTxWithBlockChain

func (iRes PortalRedeemRequestResponse) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalRedeemRequestResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalRedeemRequestResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type PortalRedeemRequestStatus

type PortalRedeemRequestStatus struct {
	Status                  byte
	UniqueRedeemID          string
	TokenID                 string // pTokenID in incognito chain
	RedeemAmount            uint64
	RedeemerIncAddressStr   string
	RemoteAddress           string                                   // btc/bnb/etc address
	RedeemFee               uint64                                   // redeem fee in PRV, 0.01% redeemAmount in PRV
	MatchingCustodianDetail []*statedb.MatchingRedeemCustodianDetail // key: incAddressCustodian
	TxReqID                 common.Hash
	ShardID                 byte
	ShardHeight             uint64
	BeaconHeight            uint64
	RedeemerExternalAddress string
}

PortalRedeemRequestStatus - Beacon tracks status of redeem request into db

type PortalRedeemRequestV3

type PortalRedeemRequestV3 struct {
	MetadataBase
	UniqueRedeemID          string
	TokenID                 string // pTokenID in incognito chain
	RedeemAmount            uint64
	RedeemerIncAddressStr   string
	RemoteAddress           string // btc/bnb/etc address
	RedeemFee               uint64 // redeem fee in PRV, 0.01% redeemAmount in PRV
	RedeemerExternalAddress string
}

PortalRedeemRequestV3 - portal user redeem requests to get public token by burning ptoken metadata - redeem request - create normal tx with this metadata

func NewPortalRedeemRequest

func NewPortalRedeemRequest(
	metaType int,
	uniqueRedeemID string,
	tokenID string,
	redeemAmount uint64,
	incAddressStr string,
	remoteAddr string,
	redeemFee uint64,
	redeemerExternalAddress string,
) (*PortalRedeemRequestV3, error)

func (*PortalRedeemRequestV3) BuildReqActions

func (redeemReq *PortalRedeemRequestV3) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalRedeemRequestV3) CalculateSize

func (redeemReq *PortalRedeemRequestV3) CalculateSize() uint64

func (PortalRedeemRequestV3) Hash

func (redeemReq PortalRedeemRequestV3) Hash() *common.Hash

func (PortalRedeemRequestV3) ValidateMetadataByItself

func (redeemReq PortalRedeemRequestV3) ValidateMetadataByItself() bool

func (PortalRedeemRequestV3) ValidateSanityData

func (redeemReq PortalRedeemRequestV3) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalRedeemRequestV3) ValidateTxWithBlockChain

func (redeemReq PortalRedeemRequestV3) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalReplacementFeeRequest

type PortalReplacementFeeRequest struct {
	MetadataBaseWithSignature
	TokenID string
	BatchID string
	Fee     uint
}

func NewPortalReplacementFeeRequest

func NewPortalReplacementFeeRequest(metaType int, tokenID, batchID string, fee uint) (*PortalReplacementFeeRequest, error)

func (*PortalReplacementFeeRequest) BuildReqActions

func (repl *PortalReplacementFeeRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalReplacementFeeRequest) CalculateSize

func (repl *PortalReplacementFeeRequest) CalculateSize() uint64

func (PortalReplacementFeeRequest) Hash

func (PortalReplacementFeeRequest) HashWithoutSig

func (repl PortalReplacementFeeRequest) HashWithoutSig() *common.Hash

func (PortalReplacementFeeRequest) ValidateMetadataByItself

func (repl PortalReplacementFeeRequest) ValidateMetadataByItself() bool

func (PortalReplacementFeeRequest) ValidateSanityData

func (repl PortalReplacementFeeRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PortalReplacementFeeRequest) ValidateTxWithBlockChain

func (repl PortalReplacementFeeRequest) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalReplacementFeeRequestAction

type PortalReplacementFeeRequestAction struct {
	Meta    PortalReplacementFeeRequest
	TxReqID common.Hash
	ShardID byte
}

type PortalReplacementFeeRequestContent

type PortalReplacementFeeRequestContent struct {
	TokenID       string
	BatchID       string
	Fee           uint
	ExternalRawTx string
	UTXOs         []*statedb.UTXO
	TxReqID       common.Hash
	ShardID       byte
}

type PortalReplacementFeeRequestStatus

type PortalReplacementFeeRequestStatus struct {
	TokenID       string
	BatchID       string
	Fee           uint
	TxHash        string
	ExternalRawTx string
	BeaconHeight  uint64
	Status        int
}

func NewPortalReplacementFeeRequestStatus

func NewPortalReplacementFeeRequestStatus(tokenID, batchID string, fee uint, externalRawTx string, status int) *PortalReplacementFeeRequestStatus

type PortalReqMatchingRedeem

type PortalReqMatchingRedeem struct {
	MetadataBaseWithSignature
	CustodianAddressStr string
	RedeemID            string
}

PortalReqMatchingRedeem - portal custodian request matching redeem requests metadata - request matching redeem requests - create normal tx with this metadata

func NewPortalReqMatchingRedeem

func NewPortalReqMatchingRedeem(metaType int, custodianAddrStr string, redeemID string) (*PortalReqMatchingRedeem, error)

func (*PortalReqMatchingRedeem) BuildReqActions

func (req *PortalReqMatchingRedeem) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalReqMatchingRedeem) CalculateSize

func (req *PortalReqMatchingRedeem) CalculateSize() uint64

func (PortalReqMatchingRedeem) Hash

func (req PortalReqMatchingRedeem) Hash() *common.Hash

func (PortalReqMatchingRedeem) HashWithoutSig

func (req PortalReqMatchingRedeem) HashWithoutSig() *common.Hash

func (PortalReqMatchingRedeem) ValidateMetadataByItself

func (req PortalReqMatchingRedeem) ValidateMetadataByItself() bool

func (PortalReqMatchingRedeem) ValidateSanityData

func (req PortalReqMatchingRedeem) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalReqMatchingRedeem) ValidateTxWithBlockChain

func (req PortalReqMatchingRedeem) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalReqMatchingRedeemAction

type PortalReqMatchingRedeemAction struct {
	Meta    PortalReqMatchingRedeem
	TxReqID common.Hash
	ShardID byte
}

PortalReqMatchingRedeemAction - shard validator creates instruction that contain this action content it will be append to ShardToBeaconBlock

type PortalReqMatchingRedeemContent

type PortalReqMatchingRedeemContent struct {
	CustodianAddressStr string
	RedeemID            string
	MatchingAmount      uint64
	IsFullCustodian     bool
	TxReqID             common.Hash
	ShardID             byte
}

PortalReqMatchingRedeemContent - Beacon builds a new instruction with this content after receiving a instruction from shard It will be appended to beaconBlock both accepted and rejected status

type PortalReqMatchingRedeemStatus

type PortalReqMatchingRedeemStatus struct {
	CustodianAddressStr string
	RedeemID            string
	MatchingAmount      uint64
	Status              byte
}

PortalReqMatchingRedeemStatus - Beacon tracks status of request matching redeem tx into db

type PortalRequestPTokens

type PortalRequestPTokens struct {
	MetadataBase
	UniquePortingID string
	TokenID         string // pTokenID in incognito chain
	IncogAddressStr string
	PortingAmount   uint64
	PortingProof    string
}

PortalRequestPTokens - portal user requests ptoken (after sending pubToken to custodians) metadata - user requests ptoken - create normal tx with this metadata

func NewPortalRequestPTokens

func NewPortalRequestPTokens(
	metaType int,
	uniquePortingID string,
	tokenID string,
	incogAddressStr string,
	portingAmount uint64,
	portingProof string) (*PortalRequestPTokens, error)

func (*PortalRequestPTokens) BuildReqActions

func (reqPToken *PortalRequestPTokens) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalRequestPTokens) CalculateSize

func (reqPToken *PortalRequestPTokens) CalculateSize() uint64

func (PortalRequestPTokens) Hash

func (reqPToken PortalRequestPTokens) Hash() *common.Hash

func (PortalRequestPTokens) ValidateMetadataByItself

func (reqPToken PortalRequestPTokens) ValidateMetadataByItself() bool

func (PortalRequestPTokens) ValidateSanityData

func (reqPToken PortalRequestPTokens) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalRequestPTokens) ValidateTxWithBlockChain

func (reqPToken PortalRequestPTokens) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalRequestPTokensAction

type PortalRequestPTokensAction struct {
	Meta    PortalRequestPTokens
	TxReqID common.Hash
	ShardID byte
}

PortalRequestPTokensAction - shard validator creates instruction that contain this action content

type PortalRequestPTokensContent

type PortalRequestPTokensContent struct {
	UniquePortingID string
	TokenID         string // pTokenID in incognito chain
	IncogAddressStr string
	PortingAmount   uint64
	PortingProof    string
	TxReqID         common.Hash
	ShardID         byte
}

PortalRequestPTokensContent - Beacon builds a new instruction with this content after receiving a instruction from shard It will be appended to beaconBlock both accepted and rejected status

type PortalRequestPTokensResponse

type PortalRequestPTokensResponse struct {
	MetadataBase
	RequestStatus    string
	ReqTxID          common.Hash
	RequesterAddrStr string
	Amount           uint64
	IncTokenID       string
	SharedRandom     []byte `json:"SharedRandom,omitempty"`
}

func NewPortalRequestPTokensResponse

func NewPortalRequestPTokensResponse(
	depositStatus string,
	reqTxID common.Hash,
	requesterAddressStr string,
	amount uint64,
	tokenID string,
	metaType int,
) *PortalRequestPTokensResponse

func (*PortalRequestPTokensResponse) CalculateSize

func (iRes *PortalRequestPTokensResponse) CalculateSize() uint64

func (PortalRequestPTokensResponse) CheckTransactionFee

func (iRes PortalRequestPTokensResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalRequestPTokensResponse) Hash

func (*PortalRequestPTokensResponse) SetSharedRandom

func (iRes *PortalRequestPTokensResponse) SetSharedRandom(r []byte)

func (PortalRequestPTokensResponse) ValidateMetadataByItself

func (iRes PortalRequestPTokensResponse) ValidateMetadataByItself() bool

func (PortalRequestPTokensResponse) ValidateSanityData

func (iRes PortalRequestPTokensResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalRequestPTokensResponse) ValidateTxWithBlockChain

func (iRes PortalRequestPTokensResponse) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalRequestPTokensResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalRequestPTokensResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type PortalRequestPTokensStatus

type PortalRequestPTokensStatus struct {
	Status          byte
	UniquePortingID string
	TokenID         string // pTokenID in incognito chain
	IncogAddressStr string
	PortingAmount   uint64
	PortingProof    string
	TxReqID         common.Hash
}

PortalRequestPTokensStatus - Beacon tracks status of request ptokens into db

type PortalRequestUnlockCollateral

type PortalRequestUnlockCollateral struct {
	MetadataBase
	UniqueRedeemID      string
	TokenID             string // pTokenID in incognito chain
	CustodianAddressStr string
	RedeemAmount        uint64
	RedeemProof         string
}

PortalRequestUnlockCollateral - portal custodian requests unlock collateral (after returning pubToken to user) metadata - custodian requests unlock collateral - create normal tx with this metadata

func NewPortalRequestUnlockCollateral

func NewPortalRequestUnlockCollateral(
	metaType int,
	uniqueRedeemID string,
	tokenID string,
	incogAddressStr string,
	redeemAmount uint64,
	redeemProof string) (*PortalRequestUnlockCollateral, error)

func (*PortalRequestUnlockCollateral) BuildReqActions

func (meta *PortalRequestUnlockCollateral) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalRequestUnlockCollateral) CalculateSize

func (meta *PortalRequestUnlockCollateral) CalculateSize() uint64

func (PortalRequestUnlockCollateral) Hash

func (PortalRequestUnlockCollateral) ValidateMetadataByItself

func (meta PortalRequestUnlockCollateral) ValidateMetadataByItself() bool

func (PortalRequestUnlockCollateral) ValidateSanityData

func (meta PortalRequestUnlockCollateral) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalRequestUnlockCollateral) ValidateTxWithBlockChain

func (meta PortalRequestUnlockCollateral) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalRequestUnlockCollateralAction

type PortalRequestUnlockCollateralAction struct {
	Meta    PortalRequestUnlockCollateral
	TxReqID common.Hash
	ShardID byte
}

PortalRequestUnlockCollateralAction - shard validator creates instruction that contain this action content

type PortalRequestUnlockCollateralContent

type PortalRequestUnlockCollateralContent struct {
	UniqueRedeemID      string
	TokenID             string // pTokenID in incognito chain
	CustodianAddressStr string
	RedeemAmount        uint64
	UnlockAmount        uint64 // prv
	RedeemProof         string
	TxReqID             common.Hash
	ShardID             byte
}

PortalRequestUnlockCollateralContent - Beacon builds a new instruction with this content after receiving a instruction from shard It will be appended to beaconBlock both accepted and rejected status

type PortalRequestUnlockCollateralStatus

type PortalRequestUnlockCollateralStatus struct {
	Status              byte
	UniqueRedeemID      string
	TokenID             string // pTokenID in incognito chain
	CustodianAddressStr string
	RedeemAmount        uint64
	UnlockAmount        uint64 // prv
	RedeemProof         string
	TxReqID             common.Hash
}

PortalRequestUnlockCollateralStatus - Beacon tracks status of request unlock collateral amount into db

type PortalRequestWithdrawReward

type PortalRequestWithdrawReward struct {
	MetadataBaseWithSignature
	CustodianAddressStr string
	TokenID             common.Hash
}

PortalRequestWithdrawReward - custodians request withdraw reward metadata - custodians request withdraw reward - create normal tx with this metadata

func NewPortalRequestWithdrawReward

func NewPortalRequestWithdrawReward(
	metaType int,
	incogAddressStr string,
	tokenID common.Hash) (*PortalRequestWithdrawReward, error)

func (*PortalRequestWithdrawReward) BuildReqActions

func (meta *PortalRequestWithdrawReward) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalRequestWithdrawReward) CalculateSize

func (meta *PortalRequestWithdrawReward) CalculateSize() uint64

func (PortalRequestWithdrawReward) Hash

func (PortalRequestWithdrawReward) HashWithoutSig

func (meta PortalRequestWithdrawReward) HashWithoutSig() *common.Hash

func (PortalRequestWithdrawReward) ValidateMetadataByItself

func (meta PortalRequestWithdrawReward) ValidateMetadataByItself() bool

func (PortalRequestWithdrawReward) ValidateSanityData

func (meta PortalRequestWithdrawReward) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalRequestWithdrawReward) ValidateTxWithBlockChain

func (meta PortalRequestWithdrawReward) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalRequestWithdrawRewardAction

type PortalRequestWithdrawRewardAction struct {
	Meta    PortalRequestWithdrawReward
	TxReqID common.Hash
	ShardID byte
}

PortalRequestWithdrawRewardAction - shard validator creates instruction that contain this action content

type PortalRequestWithdrawRewardContent

type PortalRequestWithdrawRewardContent struct {
	CustodianAddressStr string
	TokenID             common.Hash
	RewardAmount        uint64
	TxReqID             common.Hash
	ShardID             byte
}

PortalRequestWithdrawRewardContent - Beacon builds a new instruction with this content after receiving a instruction from shard It will be appended to beaconBlock both accepted and rejected status

type PortalRequestWithdrawRewardStatus

type PortalRequestWithdrawRewardStatus struct {
	Status              byte
	CustodianAddressStr string
	TokenID             common.Hash
	RewardAmount        uint64
	TxReqID             common.Hash
}

PortalRequestWithdrawRewardStatus - Beacon tracks status of request unlock collateral amount into db

type PortalRewardContent

type PortalRewardContent struct {
	BeaconHeight uint64
	Rewards      map[string]*statedb.PortalRewardInfo // custodian incognito address : reward infos
}

func NewPortalReward

func NewPortalReward(beaconHeight uint64, rewardInfos map[string]*statedb.PortalRewardInfo) *PortalRewardContent

type PortalShieldingRequest

type PortalShieldingRequest struct {
	MetadataBase
	TokenID         string // pTokenID in incognito chain
	IncogAddressStr string
	ShieldingProof  string
}

PortalShieldingRequest - portal user requests ptoken (after sending pubToken to multisig wallet) metadata - portal user sends shielding request - create normal tx with this metadata

func NewPortalShieldingRequest

func NewPortalShieldingRequest(
	metaType int,
	tokenID string,
	incogAddressStr string,
	shieldingProof string) (*PortalShieldingRequest, error)

func (*PortalShieldingRequest) BuildReqActions

func (shieldingReq *PortalShieldingRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalShieldingRequest) CalculateSize

func (shieldingReq *PortalShieldingRequest) CalculateSize() uint64

func (PortalShieldingRequest) Hash

func (shieldingReq PortalShieldingRequest) Hash() *common.Hash

func (PortalShieldingRequest) ValidateMetadataByItself

func (shieldingReq PortalShieldingRequest) ValidateMetadataByItself() bool

func (PortalShieldingRequest) ValidateSanityData

func (shieldingReq PortalShieldingRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PortalShieldingRequest) ValidateTxWithBlockChain

func (shieldingReq PortalShieldingRequest) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalShieldingRequestAction

type PortalShieldingRequestAction struct {
	Meta    PortalShieldingRequest
	TxReqID common.Hash
	ShardID byte
}

PortalShieldingRequestAction - shard validator creates instruction that contain this action content

type PortalShieldingRequestContent

type PortalShieldingRequestContent struct {
	TokenID         string // pTokenID in incognito chain
	IncogAddressStr string
	ProofHash       string
	ShieldingUTXO   []*statedb.UTXO
	MintingAmount   uint64
	TxReqID         common.Hash
	ExternalTxID    string
	ShardID         byte
}

PortalShieldingRequestContent - Beacon builds a new instruction with this content after receiving a instruction from shard It will be appended to beaconBlock both accepted and rejected status

type PortalShieldingRequestStatus

type PortalShieldingRequestStatus struct {
	Status          byte
	Error           string
	TokenID         string // pTokenID in incognito chain
	IncogAddressStr string
	ProofHash       string
	ShieldingUTXO   []*statedb.UTXO
	MintingAmount   uint64
	TxReqID         common.Hash
	ExternalTxID    string
}

PortalRequestPTokensStatus - Beacon tracks status of request ptokens into db

type PortalShieldingResponse

type PortalShieldingResponse struct {
	MetadataBase
	RequestStatus    string
	ReqTxID          common.Hash
	RequesterAddrStr string
	MintingAmount    uint64
	IncTokenID       string
	SharedRandom     []byte
}

func NewPortalShieldingResponse

func NewPortalShieldingResponse(
	depositStatus string,
	reqTxID common.Hash,
	requesterAddressStr string,
	amount uint64,
	tokenID string,
	metaType int,
) *PortalShieldingResponse

func (*PortalShieldingResponse) CalculateSize

func (iRes *PortalShieldingResponse) CalculateSize() uint64

func (PortalShieldingResponse) CheckTransactionFee

func (iRes PortalShieldingResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalShieldingResponse) Hash

func (iRes PortalShieldingResponse) Hash() *common.Hash

func (*PortalShieldingResponse) SetSharedRandom

func (iRes *PortalShieldingResponse) SetSharedRandom(r []byte)

func (PortalShieldingResponse) ValidateMetadataByItself

func (iRes PortalShieldingResponse) ValidateMetadataByItself() bool

func (PortalShieldingResponse) ValidateSanityData

func (iRes PortalShieldingResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalShieldingResponse) ValidateTxWithBlockChain

func (iRes PortalShieldingResponse) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalShieldingResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalShieldingResponse) VerifyMinerCreatedTxBeforeGettingInBlock(
	mintData *MintData,
	shardID byte,
	tx Transaction,
	chainRetriever ChainRetriever,
	ac *AccumulatedValues,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
) (bool, error)

type PortalSubmitConfirmedTxAction

type PortalSubmitConfirmedTxAction struct {
	Meta    PortalSubmitConfirmedTxRequest
	TxReqID common.Hash
	ShardID byte
}

type PortalSubmitConfirmedTxContent

type PortalSubmitConfirmedTxContent struct {
	TokenID      string
	UTXOs        []*statedb.UTXO
	BatchID      string
	TxReqID      common.Hash
	ExternalTxID string
	ExternalFee  uint64
	ShardID      byte
}

type PortalSubmitConfirmedTxRequest

type PortalSubmitConfirmedTxRequest struct {
	MetadataBase
	TokenID       string // pTokenID in incognito chain
	UnshieldProof string
	BatchID       string
}

func NewPortalSubmitConfirmedTxRequest

func NewPortalSubmitConfirmedTxRequest(metaType int, unshieldProof, tokenID, batchID string) (*PortalSubmitConfirmedTxRequest, error)

func (*PortalSubmitConfirmedTxRequest) BuildReqActions

func (r *PortalSubmitConfirmedTxRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalSubmitConfirmedTxRequest) CalculateSize

func (r *PortalSubmitConfirmedTxRequest) CalculateSize() uint64

func (PortalSubmitConfirmedTxRequest) Hash

func (PortalSubmitConfirmedTxRequest) ValidateMetadataByItself

func (r PortalSubmitConfirmedTxRequest) ValidateMetadataByItself() bool

func (PortalSubmitConfirmedTxRequest) ValidateSanityData

func (r PortalSubmitConfirmedTxRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PortalSubmitConfirmedTxRequest) ValidateTxWithBlockChain

func (r PortalSubmitConfirmedTxRequest) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalSubmitConfirmedTxStatus

type PortalSubmitConfirmedTxStatus struct {
	TokenID      string
	UTXOs        []*statedb.UTXO
	BatchID      string
	TxHash       string
	ExternalTxID string
	ExternalFee  uint64
	Status       int
}

func NewPortalSubmitConfirmedTxStatus

func NewPortalSubmitConfirmedTxStatus(tokenID, batchID, externalTxID, txID string, UTXOs []*statedb.UTXO, status int, externalFee uint64) *PortalSubmitConfirmedTxStatus

type PortalTopUpWaitingPortingRequest

type PortalTopUpWaitingPortingRequest struct {
	MetadataBase
	IncogAddressStr      string
	PortingID            string
	PTokenID             string
	DepositedAmount      uint64
	FreeCollateralAmount uint64
}

func NewPortalTopUpWaitingPortingRequest

func NewPortalTopUpWaitingPortingRequest(
	metaType int,
	portingID string,
	incogAddressStr string,
	pToken string,
	amount uint64,
	freeCollateralAmount uint64,
) (*PortalTopUpWaitingPortingRequest, error)

func (*PortalTopUpWaitingPortingRequest) BuildReqActions

func (p *PortalTopUpWaitingPortingRequest) BuildReqActions(
	tx Transaction,
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	shardHeight uint64,
) ([][]string, error)

func (*PortalTopUpWaitingPortingRequest) CalculateSize

func (p *PortalTopUpWaitingPortingRequest) CalculateSize() uint64

func (PortalTopUpWaitingPortingRequest) Hash

func (PortalTopUpWaitingPortingRequest) ValidateMetadataByItself

func (p PortalTopUpWaitingPortingRequest) ValidateMetadataByItself() bool

func (PortalTopUpWaitingPortingRequest) ValidateSanityData

func (p PortalTopUpWaitingPortingRequest) ValidateSanityData(
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	beaconHeight uint64,
	txr Transaction,
) (bool, bool, error)

func (PortalTopUpWaitingPortingRequest) ValidateTxWithBlockChain

func (p PortalTopUpWaitingPortingRequest) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalTopUpWaitingPortingRequestAction

type PortalTopUpWaitingPortingRequestAction struct {
	Meta    PortalTopUpWaitingPortingRequest
	TxReqID common.Hash
	ShardID byte
}

type PortalTopUpWaitingPortingRequestActionV3

type PortalTopUpWaitingPortingRequestActionV3 struct {
	Meta    PortalTopUpWaitingPortingRequestV3
	TxReqID common.Hash
	ShardID byte
}

type PortalTopUpWaitingPortingRequestContent

type PortalTopUpWaitingPortingRequestContent struct {
	IncogAddressStr      string
	PortingID            string
	PTokenID             string
	DepositedAmount      uint64
	FreeCollateralAmount uint64
	TxReqID              common.Hash
	ShardID              byte
}

type PortalTopUpWaitingPortingRequestContentV3

type PortalTopUpWaitingPortingRequestContentV3 struct {
	IncogAddressStr           string
	PortalTokenID             string
	CollateralTokenID         string
	DepositAmount             uint64
	FreeTokenCollateralAmount uint64 // topup from free token collaterals
	PortingID                 string
	UniqExternalTxID          []byte
	TxReqID                   common.Hash
	ShardID                   byte
}

type PortalTopUpWaitingPortingRequestStatus

type PortalTopUpWaitingPortingRequestStatus struct {
	TxReqID              common.Hash
	IncogAddressStr      string
	PortingID            string
	PTokenID             string
	DepositAmount        uint64
	FreeCollateralAmount uint64
	Status               byte
}

func NewPortalTopUpWaitingPortingRequestStatus

func NewPortalTopUpWaitingPortingRequestStatus(
	txReqID common.Hash,
	portingID string,
	incogAddressStr string,
	pTokenID string,
	depositAmount uint64,
	freeCollateralAmount uint64,
	status byte,
) *PortalTopUpWaitingPortingRequestStatus

type PortalTopUpWaitingPortingRequestStatusV3

type PortalTopUpWaitingPortingRequestStatusV3 struct {
	IncogAddressStr           string
	PortalTokenID             string
	CollateralTokenID         string
	DepositAmount             uint64
	FreeTokenCollateralAmount uint64 // topup from free token collaterals
	PortingID                 string
	UniqExternalTxID          []byte
	TxReqID                   common.Hash
	Status                    byte
}

func NewPortalTopUpWaitingPortingRequestStatusV3

func NewPortalTopUpWaitingPortingRequestStatusV3(
	incognitoAddrStr string,
	portalTokenID string,
	collateralTokenID string,
	depositAmount uint64,
	freeTokenCollateralAmount uint64,
	portingId string,
	uniqExternalTokenID []byte,
	txReqID common.Hash,
	status byte) *PortalTopUpWaitingPortingRequestStatusV3

type PortalTopUpWaitingPortingRequestV3

type PortalTopUpWaitingPortingRequestV3 struct {
	MetadataBase
	IncogAddressStr           string
	PortalTokenID             string
	CollateralTokenID         string
	DepositAmount             uint64
	FreeTokenCollateralAmount uint64 // topup from free token collaterals
	PortingID                 string

	// ETH proof
	BlockHash eCommon.Hash
	TxIndex   uint
	ProofStrs []string
}

PortalLiquidationCustodianDepositV3 - custodian topup more token collaterals (ETH, ERC20) through the smart contract's bond submit the deposit proof

func NewPortalTopUpWaitingPortingRequestV3

func NewPortalTopUpWaitingPortingRequestV3(
	metaType int,
	incognitoAddrStr string,
	portalTokenID string,
	collateralTokenID string,
	depositAmount uint64,
	freeTokenCollateralAmount uint64,
	portingID string,
	blockHash eCommon.Hash,
	txIndex uint,
	proofStrs []string,
) (*PortalTopUpWaitingPortingRequestV3, error)

func (*PortalTopUpWaitingPortingRequestV3) BuildReqActions

func (req *PortalTopUpWaitingPortingRequestV3) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalTopUpWaitingPortingRequestV3) CalculateSize

func (req *PortalTopUpWaitingPortingRequestV3) CalculateSize() uint64

func (PortalTopUpWaitingPortingRequestV3) Hash

func (PortalTopUpWaitingPortingRequestV3) ValidateMetadataByItself

func (req PortalTopUpWaitingPortingRequestV3) ValidateMetadataByItself() bool

func (PortalTopUpWaitingPortingRequestV3) ValidateSanityData

func (req PortalTopUpWaitingPortingRequestV3) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalTopUpWaitingPortingRequestV3) ValidateTxWithBlockChain

func (req PortalTopUpWaitingPortingRequestV3) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalTopUpWaitingPortingResponse

type PortalTopUpWaitingPortingResponse struct {
	MetadataBase
	DepositStatus string
	ReqTxID       common.Hash
	SharedRandom  []byte `json:"SharedRandom,omitempty"`
}

func NewPortalTopUpWaitingPortingResponse

func NewPortalTopUpWaitingPortingResponse(
	depositStatus string,
	reqTxID common.Hash,
	metaType int,
) *PortalTopUpWaitingPortingResponse

func (*PortalTopUpWaitingPortingResponse) CalculateSize

func (iRes *PortalTopUpWaitingPortingResponse) CalculateSize() uint64

func (PortalTopUpWaitingPortingResponse) CheckTransactionFee

func (iRes PortalTopUpWaitingPortingResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalTopUpWaitingPortingResponse) Hash

func (*PortalTopUpWaitingPortingResponse) SetSharedRandom

func (iRes *PortalTopUpWaitingPortingResponse) SetSharedRandom(r []byte)

func (PortalTopUpWaitingPortingResponse) ValidateMetadataByItself

func (iRes PortalTopUpWaitingPortingResponse) ValidateMetadataByItself() bool

func (PortalTopUpWaitingPortingResponse) ValidateSanityData

func (iRes PortalTopUpWaitingPortingResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalTopUpWaitingPortingResponse) ValidateTxWithBlockChain

func (iRes PortalTopUpWaitingPortingResponse) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalTopUpWaitingPortingResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalTopUpWaitingPortingResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type PortalTotalCustodianReward

type PortalTotalCustodianReward struct {
	Rewards map[string]uint64
}

func NewPortalTotalCustodianReward

func NewPortalTotalCustodianReward(rewards map[string]uint64) *PortalTotalCustodianReward

type PortalUnlockOverRateCollaterals

type PortalUnlockOverRateCollaterals struct {
	MetadataBase
	CustodianAddressStr string
	TokenID             string
}

func NewPortalUnlockOverRateCollaterals

func NewPortalUnlockOverRateCollaterals(metaType int, custodianAddr string, tokenID string) (*PortalUnlockOverRateCollaterals, error)

func (*PortalUnlockOverRateCollaterals) BuildReqActions

func (portalUnlockCs *PortalUnlockOverRateCollaterals) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalUnlockOverRateCollaterals) CalculateSize

func (portalUnlockCs *PortalUnlockOverRateCollaterals) CalculateSize() uint64

func (PortalUnlockOverRateCollaterals) Hash

func (portalUnlockCs PortalUnlockOverRateCollaterals) Hash() *common.Hash

func (PortalUnlockOverRateCollaterals) ValidateMetadataByItself

func (portalUnlockCs PortalUnlockOverRateCollaterals) ValidateMetadataByItself() bool

func (PortalUnlockOverRateCollaterals) ValidateSanityData

func (portalUnlockCs PortalUnlockOverRateCollaterals) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalUnlockOverRateCollaterals) ValidateTxWithBlockChain

func (portalUnlockCs PortalUnlockOverRateCollaterals) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalUnlockOverRateCollateralsAction

type PortalUnlockOverRateCollateralsAction struct {
	Meta    PortalUnlockOverRateCollaterals
	TxReqID common.Hash
	ShardID byte
}

type PortalUnlockOverRateCollateralsContent

type PortalUnlockOverRateCollateralsContent struct {
	CustodianAddressStr string
	TokenID             string
	TxReqID             common.Hash
	UnlockedAmounts     map[string]uint64
}

type PortalUnshieldRequest

type PortalUnshieldRequest struct {
	MetadataBase
	OTAPubKeyStr   string // OTA
	TxRandomStr    string
	RemoteAddress  string
	TokenID        string
	UnshieldAmount uint64
}

func NewPortalUnshieldRequest

func NewPortalUnshieldRequest(metaType int, otaPubKeyStr, txRandomStr string, tokenID, remoteAddress string, burnAmount uint64) (*PortalUnshieldRequest, error)

func (*PortalUnshieldRequest) BuildReqActions

func (uReq *PortalUnshieldRequest) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalUnshieldRequest) CalculateSize

func (uReq *PortalUnshieldRequest) CalculateSize() uint64

func (*PortalUnshieldRequest) GetOTADeclarations

func (uReq *PortalUnshieldRequest) GetOTADeclarations() []OTADeclaration

func (PortalUnshieldRequest) Hash

func (uReq PortalUnshieldRequest) Hash() *common.Hash

func (PortalUnshieldRequest) ValidateMetadataByItself

func (uReq PortalUnshieldRequest) ValidateMetadataByItself() bool

func (PortalUnshieldRequest) ValidateSanityData

func (uReq PortalUnshieldRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (PortalUnshieldRequest) ValidateTxWithBlockChain

func (uReq PortalUnshieldRequest) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalUnshieldRequestAction

type PortalUnshieldRequestAction struct {
	Meta    PortalUnshieldRequest
	TxReqID common.Hash
	ShardID byte
}

type PortalUnshieldRequestBatchContent

type PortalUnshieldRequestBatchContent struct {
	BatchID       string // Hash(beaconHeight || UnshieldIDs)
	RawExternalTx string
	TokenID       string
	UnshieldIDs   []string
	UTXOs         []*statedb.UTXO
	NetworkFee    uint
	BeaconHeight  uint64
}

type PortalUnshieldRequestBatchStatus

type PortalUnshieldRequestBatchStatus struct {
	BatchID       string // Hash(beaconHeight || UnshieldIDs)
	TokenID       string
	UnshieldIDs   []string
	UTXOs         []*statedb.UTXO
	RawExternalTx string
	NetworkFees   map[uint64]ExternalFeeInfo
	BeaconHeight  uint64
	Status        byte
}

type PortalUnshieldRequestContent

type PortalUnshieldRequestContent struct {
	OTAPubKeyStr   string
	TxRandomStr    string
	RemoteAddress  string
	TokenID        string
	UnshieldAmount uint64
	TxReqID        common.Hash
	ShardID        byte
}

type PortalUnshieldRequestStatus

type PortalUnshieldRequestStatus struct {
	OTAPubKeyStr   string
	TxRandomStr    string
	RemoteAddress  string
	TokenID        string
	UnshieldAmount uint64
	UnshieldID     string
	ExternalTxID   string
	ExternalFee    uint64
	Status         int
}

func NewPortalUnshieldRequestStatus

func NewPortalUnshieldRequestStatus(otaPubKeyStr, txRandomStr, tokenID, remoteAddress, unshieldID, externalTxID string, burnAmount, externalFee uint64, status int) *PortalUnshieldRequestStatus

type PortalUnshieldResponse

type PortalUnshieldResponse struct {
	MetadataBase
	RequestStatus  string
	ReqTxID        common.Hash
	OTAPubKeyStr   string
	TxRandomStr    string
	UnshieldAmount uint64
	IncTokenID     string
}

func NewPortalV4UnshieldResponse

func NewPortalV4UnshieldResponse(
	requestStatus string,
	reqTxID common.Hash,
	requesterAddressStr string,
	txRandomStr string,
	amount uint64,
	tokenID string,
	metaType int,
) *PortalUnshieldResponse

func (*PortalUnshieldResponse) CalculateSize

func (iRes *PortalUnshieldResponse) CalculateSize() uint64

func (PortalUnshieldResponse) CheckTransactionFee

func (iRes PortalUnshieldResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalUnshieldResponse) Hash

func (iRes PortalUnshieldResponse) Hash() *common.Hash

func (PortalUnshieldResponse) ValidateMetadataByItself

func (iRes PortalUnshieldResponse) ValidateMetadataByItself() bool

func (PortalUnshieldResponse) ValidateSanityData

func (iRes PortalUnshieldResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalUnshieldResponse) ValidateTxWithBlockChain

func (iRes PortalUnshieldResponse) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalUnshieldResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalUnshieldResponse) VerifyMinerCreatedTxBeforeGettingInBlock(
	mintData *MintData,
	shardID byte, tx Transaction,
	chainRetriever ChainRetriever,
	ac *AccumulatedValues,
	shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
) (bool, error)

type PortalUserRegister

type PortalUserRegister struct {
	MetadataBase
	UniqueRegisterId string //
	IncogAddressStr  string
	PTokenId         string
	RegisterAmount   uint64
	PortingFee       uint64
}

PortalUserRegister - User register porting public tokens

func NewPortalUserRegister

func NewPortalUserRegister(uniqueRegisterId string, incogAddressStr string, pTokenId string, registerAmount uint64, portingFee uint64, metaType int) (*PortalUserRegister, error)

func (*PortalUserRegister) BuildReqActions

func (portalUserRegister *PortalUserRegister) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*PortalUserRegister) CalculateSize

func (portalUserRegister *PortalUserRegister) CalculateSize() uint64

func (PortalUserRegister) Hash

func (portalUserRegister PortalUserRegister) Hash() *common.Hash

func (PortalUserRegister) ValidateMetadataByItself

func (portalUserRegister PortalUserRegister) ValidateMetadataByItself() bool

func (PortalUserRegister) ValidateSanityData

func (portalUserRegister PortalUserRegister) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalUserRegister) ValidateTxWithBlockChain

func (portalUserRegister PortalUserRegister) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type PortalUserRegisterAction

type PortalUserRegisterAction struct {
	Meta    PortalUserRegister
	TxReqID common.Hash
	ShardID byte
}

type PortalUserRegisterActionV3

type PortalUserRegisterActionV3 struct {
	Meta        PortalUserRegister
	TxReqID     common.Hash
	ShardID     byte
	ShardHeight uint64
}

type PortalWithdrawRewardResponse

type PortalWithdrawRewardResponse struct {
	MetadataBase
	CustodianAddressStr string
	TokenID             common.Hash
	RewardAmount        uint64
	TxReqID             common.Hash
	SharedRandom        []byte `json:"SharedRandom,omitempty"`
}

PortalRequestUnlockCollateral - portal custodian requests unlock collateral (after returning pubToken to user) metadata - custodian requests unlock collateral - create normal tx with this metadata

func NewPortalWithdrawRewardResponse

func NewPortalWithdrawRewardResponse(
	reqTxID common.Hash,
	custodianAddressStr string,
	tokenID common.Hash,
	rewardAmount uint64,
	metaType int,
) *PortalWithdrawRewardResponse

func (*PortalWithdrawRewardResponse) CalculateSize

func (iRes *PortalWithdrawRewardResponse) CalculateSize() uint64

func (PortalWithdrawRewardResponse) CheckTransactionFee

func (iRes PortalWithdrawRewardResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (PortalWithdrawRewardResponse) Hash

func (*PortalWithdrawRewardResponse) SetSharedRandom

func (iRes *PortalWithdrawRewardResponse) SetSharedRandom(r []byte)

func (PortalWithdrawRewardResponse) ValidateMetadataByItself

func (iRes PortalWithdrawRewardResponse) ValidateMetadataByItself() bool

func (PortalWithdrawRewardResponse) ValidateSanityData

func (iRes PortalWithdrawRewardResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, txr Transaction) (bool, bool, error)

func (PortalWithdrawRewardResponse) ValidateTxWithBlockChain

func (iRes PortalWithdrawRewardResponse) ValidateTxWithBlockChain(txr Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, db *statedb.StateDB) (bool, error)

func (PortalWithdrawRewardResponse) VerifyMinerCreatedTxBeforeGettingInBlock

func (iRes PortalWithdrawRewardResponse) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *MintData, shardID byte, tx Transaction, chainRetriever ChainRetriever, ac *AccumulatedValues, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever) (bool, error)

type PortingRequestStatus

type PortingRequestStatus struct {
	UniquePortingID string
	TxReqID         common.Hash
	TokenID         string
	PorterAddress   string
	Amount          uint64
	Custodians      []*statedb.MatchingPortingCustodianDetail
	PortingFee      uint64
	Status          int
	BeaconHeight    uint64
	ShardHeight     uint64
	ShardID         byte
}

func NewPortingRequestStatus

func NewPortingRequestStatus(
	uniquePortingID string,
	txReqID common.Hash,
	tokenID string,
	porterAddress string,
	amount uint64,
	custodians []*statedb.MatchingPortingCustodianDetail,
	portingFee uint64,
	status int,
	beaconHeight uint64,
	shardHeight uint64,
	shardID byte) *PortingRequestStatus

type ReDelegateMetadata

type ReDelegateMetadata struct {
	MetadataBaseWithSignature
	CommitteePublicKey string
	NewDelegate        string
	DelegateUID        string
}

func NewReDelegateMetadata

func NewReDelegateMetadata(committeePublicKey, newDelegate string, newDelegateUID string) (*ReDelegateMetadata, error)

func (*ReDelegateMetadata) CalculateSize

func (redelegateMetadata *ReDelegateMetadata) CalculateSize() uint64

func (ReDelegateMetadata) GetType

func (redelegateMetadata ReDelegateMetadata) GetType() int

func (*ReDelegateMetadata) Hash

func (meta *ReDelegateMetadata) Hash() *common.Hash

func (*ReDelegateMetadata) HashWithoutSig

func (meta *ReDelegateMetadata) HashWithoutSig() *common.Hash

func (*ReDelegateMetadata) ValidateMetadataByItself

func (redelegateMetadata *ReDelegateMetadata) ValidateMetadataByItself() bool

func (ReDelegateMetadata) ValidateSanityData

func (redelegateMetadata ReDelegateMetadata) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

Have only one receiver Have only one amount corresponding to receiver Receiver Is Burning Address

func (ReDelegateMetadata) ValidateTxWithBlockChain

func (redelegateMetadata ReDelegateMetadata) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type RedeemLiquidateExchangeRatesStatus

type RedeemLiquidateExchangeRatesStatus struct {
	TxReqID             common.Hash
	TokenID             string
	RedeemerAddress     string
	RedeemAmount        uint64
	Status              byte
	TotalPTokenReceived uint64
}

func NewRedeemLiquidateExchangeRatesStatus

func NewRedeemLiquidateExchangeRatesStatus(txReqID common.Hash, tokenID string, redeemerAddress string, redeemAmount uint64, status byte, totalPTokenReceived uint64) *RedeemLiquidateExchangeRatesStatus

type RelayingHeader

type RelayingHeader struct {
	MetadataBase
	IncogAddressStr string
	Header          string
	BlockHeight     uint64
}

RelayingHeader - relaying header chain metadata - create normal tx with this metadata

func NewRelayingHeader

func NewRelayingHeader(
	metaType int,
	incognitoAddrStr string,
	header string,
	blockHeight uint64,
) (*RelayingHeader, error)

func (*RelayingHeader) BuildReqActions

func (rh *RelayingHeader) BuildReqActions(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, shardHeight uint64) ([][]string, error)

func (*RelayingHeader) CalculateSize

func (rh *RelayingHeader) CalculateSize() uint64

func (RelayingHeader) Hash

func (rh RelayingHeader) Hash() *common.Hash

func (RelayingHeader) ValidateMetadataByItself

func (rh RelayingHeader) ValidateMetadataByItself() bool

func (RelayingHeader) ValidateSanityData

func (rh RelayingHeader) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (RelayingHeader) ValidateTxWithBlockChain

func (headerRelaying RelayingHeader) ValidateTxWithBlockChain(
	txr Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	db *statedb.StateDB,
) (bool, error)

type RelayingHeaderAction

type RelayingHeaderAction struct {
	Meta    RelayingHeader
	TxReqID common.Hash
	ShardID byte
}

RelayingHeaderAction - shard validator creates instruction that contain this action content

type RelayingHeaderContent

type RelayingHeaderContent struct {
	IncogAddressStr string
	Header          string
	BlockHeight     uint64
	TxReqID         common.Hash
}

RelayingHeaderContent - Beacon builds a new instruction with this content after receiving a instruction from shard It will be appended to beaconBlock both accepted and refund status

type RelayingHeaderStatus

type RelayingHeaderStatus struct {
	Status          byte
	IncogAddressStr string
	Header          string
	BlockHeight     uint64
}

RelayingHeaderStatus - Beacon tracks status of custodian deposit tx into db

type RemainUnlockCollateral

type RemainUnlockCollateral struct {
	PrvAmount    uint64
	TokenAmounts map[string]uint64
}

type ReturnBeaconStakingMetadata

type ReturnBeaconStakingMetadata struct {
	MetadataBase
	TxIDs         []string
	StakerAddress privacy.PaymentAddress
	SharedRandom  []byte `json:"SharedRandom,omitempty"`
}

func NewReturnBeaconStaking

func NewReturnBeaconStaking(txIDs []string, producerAddress privacy.PaymentAddress, metaType int) *ReturnBeaconStakingMetadata

func (ReturnBeaconStakingMetadata) CheckTransactionFee

func (sbsRes ReturnBeaconStakingMetadata) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, stateDB *statedb.StateDB) bool

func (ReturnBeaconStakingMetadata) Hash

func (sbsRes ReturnBeaconStakingMetadata) Hash() *common.Hash

func (*ReturnBeaconStakingMetadata) SetSharedRandom

func (sbsRes *ReturnBeaconStakingMetadata) SetSharedRandom(r []byte)

func (ReturnBeaconStakingMetadata) ValidateMetadataByItself

func (sbsRes ReturnBeaconStakingMetadata) ValidateMetadataByItself() bool

func (ReturnBeaconStakingMetadata) ValidateSanityData

func (sbsRes ReturnBeaconStakingMetadata) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

pk: 32, tk: 32

func (ReturnBeaconStakingMetadata) ValidateTxWithBlockChain

func (sbsRes ReturnBeaconStakingMetadata) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type ReturnStakingMetadata

type ReturnStakingMetadata struct {
	MetadataBase
	TxID          string
	StakerAddress privacy.PaymentAddress
	SharedRandom  []byte `json:"SharedRandom,omitempty"`
}

func NewReturnStaking

func NewReturnStaking(txID string, producerAddress privacy.PaymentAddress, metaType int) *ReturnStakingMetadata

func (ReturnStakingMetadata) CheckTransactionFee

func (sbsRes ReturnStakingMetadata) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, stateDB *statedb.StateDB) bool

func (ReturnStakingMetadata) Hash

func (sbsRes ReturnStakingMetadata) Hash() *common.Hash

func (*ReturnStakingMetadata) SetSharedRandom

func (sbsRes *ReturnStakingMetadata) SetSharedRandom(r []byte)

func (ReturnStakingMetadata) ValidateMetadataByItself

func (sbsRes ReturnStakingMetadata) ValidateMetadataByItself() bool

func (ReturnStakingMetadata) ValidateSanityData

func (sbsRes ReturnStakingMetadata) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

pk: 32, tk: 32

func (ReturnStakingMetadata) ValidateTxWithBlockChain

func (sbsRes ReturnStakingMetadata) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type ShardViewRetriever

type ShardViewRetriever = metadataCommon.ShardViewRetriever

type StakingMetadata

type StakingMetadata struct {
	MetadataBase
	FunderPaymentAddress         string
	RewardReceiverPaymentAddress string
	StakingAmountShard           uint64
	AutoReStaking                bool
	CommitteePublicKey           string
}

func NewStakingMetadata

func NewStakingMetadata(
	stakingType int,
	funderPaymentAddress string,
	rewardReceiverPaymentAddress string,

	stakingAmountShard uint64,
	committeePublicKey string,
	autoReStaking bool,
) (
	*StakingMetadata,
	error,
)

func (*StakingMetadata) CalculateSize

func (stakingMetadata *StakingMetadata) CalculateSize() uint64

func (StakingMetadata) GetBeaconStakeAmount

func (stakingMetadata StakingMetadata) GetBeaconStakeAmount() uint64

func (StakingMetadata) GetShardStateAmount

func (stakingMetadata StakingMetadata) GetShardStateAmount() uint64

func (StakingMetadata) GetType

func (stakingMetadata StakingMetadata) GetType() int

func (*StakingMetadata) Hash

func (meta *StakingMetadata) Hash() *common.Hash

func (*StakingMetadata) HashWithoutSig

func (meta *StakingMetadata) HashWithoutSig() *common.Hash

func (*StakingMetadata) ValidateMetadataByItself

func (sm *StakingMetadata) ValidateMetadataByItself() bool

+ no need to IsInBase58ShortFormat because error is already check below by FromString + what IsInBase58ShortFormat does is the same as FromString does but for an array

func (StakingMetadata) ValidateSanityData

func (stakingMetadata StakingMetadata) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

ValidateSanityData Have only one receiver Have only one amount corresponding to receiver Receiver Is Burning Address

func (StakingMetadata) ValidateTxWithBlockChain

func (stakingMetadata StakingMetadata) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type StopAutoStakingMetadata

type StopAutoStakingMetadata struct {
	MetadataBaseWithSignature
	CommitteePublicKey string
}

func NewStopAutoStakingMetadata

func NewStopAutoStakingMetadata(stopStakingType int, committeePublicKey string) (*StopAutoStakingMetadata, error)

func (*StopAutoStakingMetadata) CalculateSize

func (stopAutoStakingMetadata *StopAutoStakingMetadata) CalculateSize() uint64

func (StopAutoStakingMetadata) GetType

func (stopAutoStakingMetadata StopAutoStakingMetadata) GetType() int

func (*StopAutoStakingMetadata) Hash

func (meta *StopAutoStakingMetadata) Hash() *common.Hash

func (*StopAutoStakingMetadata) HashWithoutSig

func (meta *StopAutoStakingMetadata) HashWithoutSig() *common.Hash

func (*StopAutoStakingMetadata) ValidateMetadataByItself

func (stopAutoStakingMetadata *StopAutoStakingMetadata) ValidateMetadataByItself() bool

func (StopAutoStakingMetadata) ValidateSanityData

func (stopAutoStakingMetadata StopAutoStakingMetadata) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

Have only one receiver Have only one amount corresponding to receiver Receiver Is Burning Address

func (StopAutoStakingMetadata) ValidateTxWithBlockChain

func (stopAutoStakingMetadata StopAutoStakingMetadata) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

ValidateTxWithBlockChain Validate Condition to Request Stop AutoStaking With Blockchain - Requested Committee Publickey is in candidate, pending validator, - Requested Committee Publickey is in staking tx list, - Requester (sender of tx) must be address, which create staking transaction for current requested committee public key - Not yet requested to stop auto-restaking

type TokenPoolValueOperation

type TokenPoolValueOperation struct {
	Operator string
	Value    uint64
}

type Transaction

type Transaction = metadataCommon.Transaction

type TxDesc

type TxDesc = metadataCommon.TxDesc

type UnStakingMetadata

type UnStakingMetadata struct {
	MetadataBaseWithSignature
	CommitteePublicKey string
}

UnStakingMetadata : unstaking metadata

func NewUnStakingMetadata

func NewUnStakingMetadata(committeePublicKey string) (*UnStakingMetadata, error)

NewUnStakingMetadata : Constructor of UnStakingMetadata struct

func (*UnStakingMetadata) CalculateSize

func (unStakingMetadata *UnStakingMetadata) CalculateSize() uint64

CalculateSize :

func (UnStakingMetadata) GetType

func (unStakingMetadata UnStakingMetadata) GetType() int

GetType :

func (*UnStakingMetadata) Hash

func (meta *UnStakingMetadata) Hash() *common.Hash

func (*UnStakingMetadata) HashWithoutSig

func (meta *UnStakingMetadata) HashWithoutSig() *common.Hash

func (*UnStakingMetadata) ShouldSignMetaData

func (*UnStakingMetadata) ShouldSignMetaData() bool

func (*UnStakingMetadata) ValidateMetadataByItself

func (unStakingMetadata *UnStakingMetadata) ValidateMetadataByItself() bool

ValidateMetadataByItself Validate data format/type in unStakingMetadata

func (UnStakingMetadata) ValidateSanityData

func (unStakingMetadata UnStakingMetadata) ValidateSanityData(
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

ValidateSanityData :

func (UnStakingMetadata) ValidateTxWithBlockChain

func (unStakingMetadata UnStakingMetadata) ValidateTxWithBlockChain(tx Transaction,
	chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever,
	beaconViewRetriever BeaconViewRetriever,
	shardID byte,
	transactionStateDB *statedb.StateDB,
) (bool, error)

ValidateTxWithBlockChain Validate Condition to Request Unstake With Blockchain - Requested Committee Publickey is in candidate, pending validator, - Requested Committee Publickey is in staking tx list, - Requester (sender of tx) must be address, which create staking transaction for current requested committee public key

type UnlockOverRateCollateralsRequestStatus

type UnlockOverRateCollateralsRequestStatus struct {
	Status              byte
	CustodianAddressStr string
	TokenID             string
	UnlockedAmounts     map[string]uint64
}

func NewUnlockOverRateCollateralsRequestStatus

func NewUnlockOverRateCollateralsRequestStatus(status byte, custodianAddr string, tokenID string, unlockAmount map[string]uint64) *UnlockOverRateCollateralsRequestStatus

type UpdatingInfo

type UpdatingInfo struct {
	CountUpAmt      uint64
	DeductAmt       uint64
	TokenID         common.Hash
	ExternalTokenID []byte
	IsCentralized   bool
}

type ValidationEnviroment

type ValidationEnviroment = metadataCommon.ValidationEnviroment

type WithDrawRewardRequest

type WithDrawRewardRequest struct {
	MetadataBaseWithSignature
	PaymentAddress privacy.PaymentAddress
	TokenID        common.Hash
	Version        int
}

func NewWithDrawRewardRequest

func NewWithDrawRewardRequest(tokenIDStr string, paymentAddStr string, version float64, metaType int) (*WithDrawRewardRequest, error)

func (*WithDrawRewardRequest) CalculateSize

func (withDrawRewardRequest *WithDrawRewardRequest) CalculateSize() uint64

func (WithDrawRewardRequest) CheckTransactionFee

func (withDrawRewardRequest WithDrawRewardRequest) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, stateDB *statedb.StateDB) bool

func (WithDrawRewardRequest) GetType

func (withDrawRewardRequest WithDrawRewardRequest) GetType() int

func (WithDrawRewardRequest) Hash

func (withDrawRewardRequest WithDrawRewardRequest) Hash() *common.Hash

func (WithDrawRewardRequest) HashWithoutSig

func (withDrawRewardRequest WithDrawRewardRequest) HashWithoutSig() *common.Hash

func (*WithDrawRewardRequest) UnmarshalJSON

func (withdrawRequestMetadata *WithDrawRewardRequest) UnmarshalJSON(data []byte) error

func (WithDrawRewardRequest) ValidateMetadataByItself

func (withDrawRewardRequest WithDrawRewardRequest) ValidateMetadataByItself() bool

func (WithDrawRewardRequest) ValidateSanityData

func (withDrawRewardRequest WithDrawRewardRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (WithDrawRewardRequest) ValidateTxWithBlockChain

func (withDrawRewardRequest WithDrawRewardRequest) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type WithDrawRewardResponse

type WithDrawRewardResponse struct {
	MetadataBase
	TxRequest       *common.Hash
	TokenID         common.Hash
	RewardPublicKey []byte
	SharedRandom    []byte
	Version         int
}

func NewWithDrawRewardResponse

func NewWithDrawRewardResponse(metaRequest *WithDrawRewardRequest, reqID *common.Hash) (*WithDrawRewardResponse, error)

func (*WithDrawRewardResponse) CheckTransactionFee

func (withDrawRewardResponse *WithDrawRewardResponse) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, db *statedb.StateDB) bool

func (WithDrawRewardResponse) Hash

func (withDrawRewardResponse WithDrawRewardResponse) Hash() *common.Hash

func (*WithDrawRewardResponse) SetSharedRandom

func (withDrawRewardResponse *WithDrawRewardResponse) SetSharedRandom(r []byte)

func (WithDrawRewardResponse) ValidateMetadataByItself

func (withDrawRewardResponse WithDrawRewardResponse) ValidateMetadataByItself() bool

func (WithDrawRewardResponse) ValidateSanityData

func (withDrawRewardResponse WithDrawRewardResponse) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (*WithDrawRewardResponse) ValidateTxWithBlockChain

func (withDrawRewardResponse *WithDrawRewardResponse) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

type WithdrawDelegationRewardRequest

type WithdrawDelegationRewardRequest struct {
	MetadataBaseWithSignature
	PaymentAddress privacy.PaymentAddress
	Version        int
}

func NewWithdrawDelegationRewardRequest

func NewWithdrawDelegationRewardRequest(paymentAddStr string, version float64, metaType int) (*WithdrawDelegationRewardRequest, error)

func (*WithdrawDelegationRewardRequest) CalculateSize

func (withdrawDelegationRewardRequest *WithdrawDelegationRewardRequest) CalculateSize() uint64

func (WithdrawDelegationRewardRequest) CheckTransactionFee

func (withdrawDelegationRewardRequest WithdrawDelegationRewardRequest) CheckTransactionFee(tr Transaction, minFeePerKb uint64, minFeePerTx uint64, beaconHeight int64, stateDB *statedb.StateDB) bool

func (WithdrawDelegationRewardRequest) GetType

func (withdrawDelegationRewardRequest WithdrawDelegationRewardRequest) GetType() int

func (WithdrawDelegationRewardRequest) Hash

func (withdrawDelegationRewardRequest WithdrawDelegationRewardRequest) Hash() *common.Hash

func (WithdrawDelegationRewardRequest) HashWithoutSig

func (withdrawDelegationRewardRequest WithdrawDelegationRewardRequest) HashWithoutSig() *common.Hash

func (*WithdrawDelegationRewardRequest) UnmarshalJSON

func (withdrawRequestMetadata *WithdrawDelegationRewardRequest) UnmarshalJSON(data []byte) error

func (WithdrawDelegationRewardRequest) ValidateMetadataByItself

func (withdrawDelegationRewardRequest WithdrawDelegationRewardRequest) ValidateMetadataByItself() bool

func (WithdrawDelegationRewardRequest) ValidateSanityData

func (withdrawDelegationRewardRequest WithdrawDelegationRewardRequest) ValidateSanityData(chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, beaconHeight uint64, tx Transaction) (bool, bool, error)

func (WithdrawDelegationRewardRequest) ValidateTxWithBlockChain

func (withdrawDelegationRewardRequest WithdrawDelegationRewardRequest) ValidateTxWithBlockChain(tx Transaction, chainRetriever ChainRetriever, shardViewRetriever ShardViewRetriever, beaconViewRetriever BeaconViewRetriever, shardID byte, transactionStateDB *statedb.StateDB) (bool, error)

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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