Versions in this module Expand all Collapse all v1 v1.0.1 Dec 31, 2020 v1.0.0 Dec 24, 2020 Changes in this version + const AESKeySize + const AbiJson + const BLSPublicKeySize + const Base58Version + const BeaconBlockHeighMilestoneForMinTxFeesOnTokenRequirement + const BeaconChainDataBaseID + const BeaconChainDatabaseDirectory + const BeaconChainKey + const BeaconRole + const BigIntSize + const BlsConsensus + const BriPublicKeySize + const BridgeConsensus + const BridgeRequestAcceptedStatus + const BridgeRequestNotFoundStatus + const BridgeRequestProcessingStatus + const BridgeRequestRejectedStatus + const BridgeShardID + const CheckSumLen + const CommitteeRole + const DateOutputFormat + const EmptyString + const EthAddrStr + const ExitByLogging + const ExitByOs + const ExitCodeForceUpdate + const ExitCodeUnknow + const HashSize + const HexEmptyRoot + const IncKeyType + const IncPubKeyB58Size + const Int32Size + const MaxHashStringSize + const MaxShardNumber + const MinTxFeesOnTokenRequirement + const NodeModeAuto + const NodeModeBeacon + const NodeModeRelay + const NodeModeShard + const PDEContributionAcceptedStatus + const PDEContributionMatchedChainStatus + const PDEContributionMatchedNReturnedChainStatus + const PDEContributionMatchedNReturnedStatus + const PDEContributionRefundChainStatus + const PDEContributionRefundStatus + const PDEContributionWaitingChainStatus + const PDEContributionWaitingStatus + const PDECrossPoolTradeAcceptedChainStatus + const PDECrossPoolTradeAcceptedStatus + const PDECrossPoolTradeFeeRefundChainStatus + const PDECrossPoolTradeRefundStatus + const PDECrossPoolTradeSellingTokenRefundChainStatus + const PDEFeeWithdrawalAcceptedChainStatus + const PDEFeeWithdrawalAcceptedStatus + const PDEFeeWithdrawalRejectedChainStatus + const PDEFeeWithdrawalRejectedStatus + const PDENotFoundStatus + const PDETradeAcceptedChainStatus + const PDETradeAcceptedStatus + const PDETradeRefundChainStatus + const PDETradeRefundStatus + const PDEWithdrawalAcceptedChainStatus + const PDEWithdrawalAcceptedStatus + const PDEWithdrawalOnFeeAcceptedChainStatus + const PDEWithdrawalOnPoolPairAcceptedChainStatus + const PDEWithdrawalRejectedChainStatus + const PDEWithdrawalRejectedStatus + const PDEWithdrawalWithPRVFeeRejectedChainStatus + const PRVIDStr + const PaymentAddressSize + const PendingRole + const PortalBNBIDStr + const PortalBTCIDStr + const PortalCustodianDepositAcceptedChainStatus + const PortalCustodianDepositAcceptedStatus + const PortalCustodianDepositRefundChainStatus + const PortalCustodianDepositRefundStatus + const PortalCustodianWithdrawReqAcceptedStatus + const PortalCustodianWithdrawReqRejectStatus + const PortalCustodianWithdrawRequestAcceptedStatus + const PortalCustodianWithdrawRequestRejectedStatus + const PortalExchangeRatesAcceptedChainStatus + const PortalExchangeRatesAcceptedStatus + const PortalExchangeRatesRejectedChainStatus + const PortalExchangeRatesRejectedStatus + const PortalExpiredPortingReqFailedStatus + const PortalExpiredPortingReqSuccessStatus + const PortalExpiredWaitingPortingReqFailedChainStatus + const PortalExpiredWaitingPortingReqSuccessChainStatus + const PortalLiquidateCustodianFailedChainStatus + const PortalLiquidateCustodianFailedStatus + const PortalLiquidateCustodianSuccessChainStatus + const PortalLiquidateCustodianSuccessStatus + const PortalLiquidateTPExchangeRatesFailedChainStatus + const PortalLiquidateTPExchangeRatesSuccessChainStatus + const PortalLiquidationCustodianDepositRejectedChainStatus + const PortalLiquidationCustodianDepositRejectedStatus + const PortalLiquidationCustodianDepositSuccessChainStatus + const PortalLiquidationCustodianDepositSuccessStatus + const PortalLiquidationTPExchangeRatesFailedStatus + const PortalLiquidationTPExchangeRatesSuccessStatus + const PortalPickMoreCustodianRedeemFailedChainStatus + const PortalPickMoreCustodianRedeemSuccessChainStatus + const PortalPortingReqExpiredStatus + const PortalPortingReqLiquidatedStatus + const PortalPortingReqSuccessStatus + const PortalPortingReqWaitingStatus + const PortalPortingRequestAcceptedChainStatus + const PortalPortingRequestRejectedChainStatus + const PortalPortingTxRequestAcceptedStatus + const PortalPortingTxRequestRejectedStatus + const PortalRedeemLiquidateExchangeRatesRejectedChainStatus + const PortalRedeemLiquidateExchangeRatesRejectedStatus + const PortalRedeemLiquidateExchangeRatesSuccessChainStatus + const PortalRedeemLiquidateExchangeRatesSuccessStatus + const PortalRedeemReqCancelledByLiquidationChainStatus + const PortalRedeemReqCancelledByLiquidationStatus + const PortalRedeemReqLiquidatedStatus + const PortalRedeemReqMatchedStatus + const PortalRedeemReqSuccessStatus + const PortalRedeemReqWaitingStatus + const PortalRedeemRequestAcceptedChainStatus + const PortalRedeemRequestRejectedChainStatus + const PortalRedeemRequestTxAcceptedStatus + const PortalRedeemRequestTxRejectedStatus + const PortalReqMatchingRedeemAcceptedChainStatus + const PortalReqMatchingRedeemAcceptedStatus + const PortalReqMatchingRedeemRejectedChainStatus + const PortalReqMatchingRedeemRejectedStatus + const PortalReqPTokenAcceptedStatus + const PortalReqPTokenRejectedStatus + const PortalReqPTokensAcceptedChainStatus + const PortalReqPTokensRejectedChainStatus + const PortalReqUnlockCollateralAcceptedChainStatus + const PortalReqUnlockCollateralAcceptedStatus + const PortalReqUnlockCollateralRejectedChainStatus + const PortalReqUnlockCollateralRejectedStatus + const PortalReqWithdrawRewardAcceptedChainStatus + const PortalReqWithdrawRewardAcceptedStatus + const PortalReqWithdrawRewardRejectedChainStatus + const PortalReqWithdrawRewardRejectedStatus + const PortalTopUpWaitingPortingRejectedChainStatus + const PortalTopUpWaitingPortingRejectedStatus + const PortalTopUpWaitingPortingSuccessChainStatus + const PortalTopUpWaitingPortingSuccessStatus + const PrivateKeySize + const ProposerRole + const PublicKeySize + const REPLACE_IN + const REPLACE_OUT + const ReceivingKeySize + const RelayingHeaderConsideringChainStatus + const RelayingHeaderRejectedChainStatus + const ShardChainDatabaseDirectory + const ShardChainKey + const ShardRole + const SigNoPrivacySize + const SigPrivacySize + const SigPubKeySize + const SyncingRole + const TIMESLOT + const TransmissionKeySize + const TxCustomTokenPrivacyType + const TxNormalType + const TxReturnStakingType + const TxRewardType + const Uint32Size + const Uint64Size + const ValidatorRole + const WaitingRole + const ZeroByte + var CipherTextIsEmptyErr = errors.New("ciphertext is empty") + var EmptyRoot = HexToHash(HexEmptyRoot) + var InvalidAESKeyErr = errors.New("aes key is invalid") + var InvalidHashSizeErr = errors.New("invalid hash size") + var InvalidMaxHashSizeErr = errors.New("invalid max hash size") + var MaxBlockSize = uint64(2000) + var MaxTxSize = uint64(100) + var MinAmountPortalPToken = map[string]uint64 + var NilHashErr = errors.New("input hash is nil") + var PRVCoinID = Hash + var PRVCoinName = "PRV" + var PlainTextIsEmptyErr = errors.New("plaintext is empty") + var PortalSupportedIncTokenIDs = []string + func AddPaddingBigInt(numInt *big.Int, fixedSize int) []byte + func AppDataDir(appName string, roaming bool) string + func AppendSliceString(arrayStrings ...[][]string) [][]string + func AssertAndConvertStrToNumber(numStr interface{}) (uint64, error) + func BoolToByte(value bool) byte + func BytesToInt(bytesArr []byte) int + func BytesToInt32(b []byte) (int32, error) + func BytesToUint32(b []byte) (uint32, error) + func BytesToUint64(b []byte) (uint64, error) + func CalculateTimeSlot(time int64) int64 + func CheckError(errs ...error) error + func CleanAndExpandPath(path string, defaultHomeDir string) string + func CompareStringArray(src []string, dst []string) bool + func CompressDatabase(src string, dst string) error + func CopyBytes(b []byte) (copiedBytes []byte) + func DecompressDatabaseBackup(src string, dst string) error + func FromHex(s string) []byte + func GZipFromBytes(src []byte) ([]byte, error) + func GZipToBytes(src []byte) ([]byte, error) + func GetENV(key, fallback string) string + func GetShardChainKey(shardID byte) string + func GetShardIDFromLastByte(b byte) byte + func GetValidStaker(committees []string, stakers []string) []string + func HashB(b []byte) []byte + func Hex2Bytes(str string) []byte + func IndexOfByte(item byte, array []byte) int + func IndexOfHash(item Hash, list []Hash) int + func IndexOfStr(item string, list []string) int + func IndexOfStrInHashMap(v string, m map[Hash]string) int + func IndexOfUint64(target uint64, arr []uint64) int + func Int32ToBytes(value int32) []byte + func Int64ToBytes(value int64) []byte + func IntToBytes(n int) []byte + func InterfaceSlice(slice interface{}) []interface + func IsPortalExchangeRateToken(tokenIDStr string) bool + func IsPortalToken(tokenIDStr string) bool + func RandBigIntMaxRange(max *big.Int) (*big.Int, error) + func RandInt() int + func RandInt64() int64 + func Render(data []byte) string + func SliceExists(slice interface{}, item interface{}) (bool, error) + func Uint32ToBytes(value uint32) []byte + func Uint64ToBytes(value uint64) []byte + type AES struct + Key []byte + func (aesObj *AES) Decrypt(ciphertext []byte) ([]byte, error) + func (aesObj *AES) Encrypt(plaintext []byte) ([]byte, error) + type BlockInterface interface + GetConsensusType func() string + GetCurrentEpoch func() uint64 + GetHeight func() uint64 + GetInstructions func() [][]string + GetPrevHash func() Hash + GetProduceTime func() int64 + GetProducer func() string + GetProposeTime func() int64 + GetProposer func() string + GetRound func() int + GetRoundKey func() string + GetValidationField func() string + GetVersion func() int + Hash func() *Hash + type BlockPoolInterface interface + GetHeight func() uint64 + GetPrevHash func() Hash + GetRound func() int + GetShardID func() int + Hash func() *Hash + type ChainInterface interface + GetShardID func() int + type ErrorSaver struct + func (s *ErrorSaver) Get() error + func (s *ErrorSaver) Save(errs ...error) error + type Hash [HashSize]byte + func BytesToHash(b []byte) Hash + func HashArrayInterface(target interface{}) (Hash, error) + func HashArrayOfHashArray(target []Hash) Hash + func HashH(b []byte) Hash + func HexToHash(s string) Hash + func Keccak256Hash(data ...[]byte) (h Hash) + func (h Hash) Bytes() []byte + func (hashObj *Hash) Cmp(target *Hash) (int, error) + func (hashObj *Hash) Decode(dst *Hash, src string) error + func (hashObj *Hash) Format(f fmt.State, c rune) + func (hashObj *Hash) GetBytes() []byte + func (hashObj *Hash) IsEqual(target *Hash) bool + func (hashObj *Hash) SetBytes(newHash []byte) error + func (hashObj *Hash) UnmarshalJSON(data []byte) error + func (hashObj Hash) MarshalText() ([]byte, error) + func (hashObj Hash) NewHash(newHash []byte) (*Hash, error) + func (hashObj Hash) NewHashFromStr(hash string) (*Hash, error) + func (hashObj Hash) String() string + func (hashObj Hash) UnmarshalText(text []byte) error + type SimpleAddr struct + Addr string + Net string + func ParseListener(addr string, netType string) (*SimpleAddr, error) + func ParseListeners(addrs []string, netType string) ([]SimpleAddr, error) + func (a SimpleAddr) Network() string + func (a SimpleAddr) String() string + type StorageSize float64 + func (s StorageSize) String() string + func (s StorageSize) TerminalString() string