Versions in this module Expand all Collapse all v1 v1.58.0 Jul 31, 2024 Changes in this version + const AccessDenied + const BeginningOfSetWithdrawalCredentials + const CalculatingHint + const ClaimsContextKey + const Day + const GROUP_ADDON + const GROUP_API + const GROUP_MOBILE + const InvalidClient + const InvalidGrant + const InvalidRequest + const InvalidScope + const JsonBodyKey + const JsonBodyNakedKey + const LongTime + const MobileAuthorizedKey + const Month + const ServerError + const TemporarilyUnavailable + const UnauthorizedClient + const UnsupportedGrantType + const Week + const Year + var Config *types.Config + var ENS_ETH_REGEXP = regexp.MustCompile(`^.{3,}\.eth$`) + var Erc1155TransferSingleEventHash = common.HexToHash("0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62") + var Erc20TransferEventHash = common.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef") + var ErrInvalidSpecification = errors.New("specification must be a struct pointer") + var ErrRateLimit = errors.New("## RATE LIMIT ##") + var HashLikeRegex = regexp.MustCompile(`^[0-9a-fA-F]{0,96}$`) + var ProductsGroups = map[string]string + var ProductsMapV1ToV2 = map[string]string + var ProductsMapV2ToV1 = map[string]string + var Rates map[string]int = map[string]int + var StripeDynamicRatesLive = []*string + var StripeDynamicRatesTest = []*string + var StripeRatesLive map[string]string = map[string]string + var StripeRatesTest map[string]string = map[string]string + func AccessSecretVersion(name string) (*string, error) + func AddBigInts(a, b []byte) []byte + func AddSyncStats(validators []uint64, ...) types.SyncCommitteesStats + func AddressToWithdrawalCredentials(address []byte) ([]byte, error) + func AuthorizedAPIMiddleware(next http.Handler) http.Handler + func BitAtVector(b []byte, i int) bool + func BitAtVectorReversed(b []byte, i int) bool + func CORSMiddleware(next http.Handler) http.Handler + func ClToCurrency(valIf interface{}, currency string) decimal.Decimal + func ClToCurrencyGwei(valIf interface{}, currency string) decimal.Decimal + func ClToMainCurrency(valIf interface{}) decimal.Decimal + func CmdPrompt(label string) string + func CopyButton(clipboardText interface{}) string + func CopyButtonText(clipboardText interface{}) string + func CreateAccessToken(userID, appID, deviceID uint64, pkg, theme string) (string, int, error) + func DayOfSlot(slot uint64) uint64 + func DayToTime(day int64) time.Time + func DerefString(str *string) string + func EffectiveProductId(productId string) string + func EffectiveProductName(productId string) string + func ElToCurrency(valIf interface{}, currency string) decimal.Decimal + func ElToMainCurrency(valIf interface{}) decimal.Decimal + func ElementExists(arr []string, el string) bool + func EpochOfSlot(slot uint64) uint64 + func EpochToTime(epoch uint64) time.Time + func EpochsPerDay() uint64 + func Eth1BlockReward(blockNumber uint64, difficulty []byte) *big.Int + func Eth1TotalReward(block *types.Eth1BlockIndexed) *big.Int + func EthBytesToFloat(b []byte) float64 + func FirstEpochOfSyncPeriod(syncPeriod uint64) uint64 + func FixAddressCasing(add string) string + func ForkVersionAtEpoch(epoch uint64) *types.ForkVersion + func FormatAddCommas(n uint64) template.HTML + func FormatAddCommasFormatted(num float64, precision uint) template.HTML + func FormatAddress(address []byte, token []byte, name string, verified bool, isContract bool, ...) template.HTML + func FormatAddressAll(address []byte, name string, isContract bool, link string, digitsLimit int, ...) template.HTML + func FormatAddressAsLink(address []byte, name string, isContract bool) template.HTML + func FormatAddressAsTokenLink(token, address []byte, name string, verified bool, isContract bool) template.HTML + func FormatAddressEthBalance(balance *types.Eth1AddressBalance) template.HTML + func FormatAddressLong(address string) template.HTML + func FormatAddressToWithdrawalCredentials(address []byte, addCopyButton bool) template.HTML + func FormatAddressWithLimits(address []byte, name string, isContract bool, link string, digitsLimit int, ...) template.HTML + func FormatAddressWithLimitsInAddressPageTable(mainAddress []byte, txAddress []byte, name string, isContract bool, ...) template.HTML + func FormatAmount(amount *big.Int, unit string, digits int) template.HTML + func FormatAmountFormatted(amount *big.Int, unit string, digits int, maxPreCommaDigitsBeforeTrim int, ...) template.HTML + func FormatAttestationInclusionEffectiveness(eff float64) template.HTML + func FormatAttestationInclusionSlot(blockSlot uint64) template.HTML + func FormatAttestationStatus(status uint64) template.HTML + func FormatAttestationStatusShort(status uint64) template.HTML + func FormatAttestorAssignmentKey(AttesterSlot, CommitteeIndex, MemberIndex uint64) string + func FormatBalance(balanceInt uint64, currency string) template.HTML + func FormatBalanceChange(balance *int64, currency string) template.HTML + func FormatBalanceChangeFormatted(balance *int64, currencyName string, details *itypes.ValidatorEpochIncome) template.HTML + func FormatBalanceGwei(balance *int64, currency string) template.HTML + func FormatBalanceShort(balanceInt uint64, currency string) template.HTML + func FormatBalanceSql(balanceInt sql.NullInt64, currency string) template.HTML + func FormatBigAmount(amount *hexutil.Big, unit string, digits int) template.HTML + func FormatBigNumberAddCommasFormated(val hexutil.Big, precision uint) template.HTML + func FormatBitlist(b []byte) template.HTML + func FormatBlobVersionedHash(h []byte) template.HTML + func FormatBlockHash(hash []byte) template.HTML + func FormatBlockNumber(number uint64) template.HTML + func FormatBlockRoot(blockRoot []byte) template.HTML + func FormatBlockSlot(blockSlot uint64) template.HTML + func FormatBlockStatus(status, slot uint64) template.HTML + func FormatBlockStatusShort(status, slot uint64) template.HTML + func FormatBlockUsage(gasUsage uint64, gasLimit uint64) template.HTML + func FormatBuilder(pubkey []byte) template.HTML + func FormatBytes(b []byte, addCopyToClipboard bool, link string) template.HTML + func FormatBytesAmount(amount []byte, unit string, digits int) template.HTML + func FormatClCurrency(value interface{}, targetCurrency string, digitsAfterComma int, ...) template.HTML + func FormatClCurrencyString(value interface{}, targetCurrency string, digitsAfterComma int, ...) string + func FormatCount(count uint64, finalized bool, shortenCalcHint bool) template.HTML + func FormatCurrentBalance(balanceInt uint64, currency string) template.HTML + func FormatDepositAmount(balanceInt uint64, currency string) template.HTML + func FormatDifficulty(number *big.Int) string + func FormatETH(num string) string + func FormatEffectiveBalance(balanceInt uint64, currency string) template.HTML + func FormatElCurrency(value interface{}, targetCurrency string, digitsAfterComma int, ...) template.HTML + func FormatElCurrencyString(value interface{}, targetCurrency string, digitsAfterComma int, ...) string + func FormatEligibleBalance(balanceInt uint64, currency string) template.HTML + func FormatEpoch(epoch uint64) template.HTML + func FormatErc20Decimals(balance []byte, metadata *types.ERC20Metadata) decimal.Decimal + func FormatEth1Address(addr []byte) template.HTML + func FormatEth1AddressFull(addr common.Address) template.HTML + func FormatEth1AddressStringLowerCase(addr []byte) template.HTML + func FormatEth1Block(block uint64) template.HTML + func FormatEth1BlockHash(block []byte) template.HTML + func FormatEth1TxHash(hash []byte) template.HTML + func FormatEth1TxStatus(status uint64) template.HTML + func FormatEtherValue(currency string, ethPrice decimal.Decimal, currentPrice template.HTML) template.HTML + func FormatEthstoreComparison(pool string, val float64) template.HTML + func FormatFloat(num float64, precision int) string + func FormatFloatWithDigits(num float64, min, max int) template.HTML + func FormatFloatWithDigitsString(num float64, min, max int) string + func FormatGlobalParticipationRate(e uint64, r float64, currency string) template.HTML + func FormatGraffiti(graffiti []byte) template.HTML + func FormatGraffitiAsLink(graffiti []byte) template.HTML + func FormatGraffitiString(graffiti string) string + func FormatHash(hash []byte, trunc_opt ...bool) template.HTML + func FormatHashLong(hash common.Hash) template.HTML + func FormatHashRaw(hash []byte, trunc_opt ...bool) string + func FormatHashWithCopy(hash []byte) template.HTML + func FormatHashrate(h float64) template.HTML + func FormatInOutSelf(address, from, to []byte) template.HTML + func FormatInclusionDelay(inclusionSlot uint64, delay int64) template.HTML + func FormatIncome(balance interface{}, currency string, includeCurrency bool) template.HTML + func FormatIncomeClEl(income types.ClEl, currency string) template.HTML + func FormatIncomeClElInt64(income types.ClElInt64, currency string) template.HTML + func FormatIncomeSql(balanceInt sql.NullInt64, currency string) template.HTML + func FormatMachineName(machineName string) template.HTML + func FormatMessageToHtml(message string) template.HTML + func FormatMethod(method string) template.HTML + func FormatNotificationChannel(ch types.NotificationChannel) template.HTML + func FormatNumber(number interface{}) string + func FormatParticipation(v float64) template.HTML + func FormatPercentage(percentage float64) string + func FormatPercentageColoredEmoji(percentage float64) template.HTML + func FormatPercentageWithGPrecision(percentage float64, precision int) string + func FormatPercentageWithPrecision(percentage float64, precision int) string + func FormatPoolPerformance(val float64) template.HTML + func FormatPricedValue(val interface{}, valueCurrency, targetCurrency string) template.HTML + func FormatPublicKey(validator []byte) template.HTML + func FormatRPL(num string) string + func FormatSlashedValidator(validator uint64) template.HTML + func FormatSlashedValidatorInt64(validator int64) template.HTML + func FormatSlashedValidatorWithName(validator uint64, name string) template.HTML + func FormatSlashedValidators(validators []uint64) template.HTML + func FormatSlashedValidatorsWithName(validators []uint64, nameMap map[uint64]string) template.HTML + func FormatSlotToTimestamp(blockSlot uint64) template.HTML + func FormatSqlInt64(i sql.NullInt64) template.HTML + func FormatSyncParticipationStatus(status, blockSlot uint64) template.HTML + func FormatSyncParticipations(participants uint64) template.HTML + func FormatThousandsEnglish(number string) string + func FormatTimestamp(ts int64) template.HTML + func FormatTokenBalance(balance *types.Eth1AddressBalance) template.HTML + func FormatTokenIcon(icon []byte, size int) template.HTML + func FormatTokenName(balance *types.Eth1AddressBalance) template.HTML + func FormatTokenSymbol(symbol string) string + func FormatTokenSymbolTitle(symbol string) string + func FormatTokenValue(balance *types.Eth1AddressBalance, fullAmountTooltip bool) template.HTML + func FormatTracePath(callType string, tracePath []int64, success bool, method string) template.HTML + func FormatTransactionHash(hash []byte, successful bool) template.HTML + func FormatTransactionType(txnType uint8) string + func FormatTsWithoutTooltip(ts int64) template.HTML + func FormatTxHash(hash string) template.HTML + func FormatValidator(validator uint64) template.HTML + func FormatValidatorInt64(validator int64) template.HTML + func FormatValidatorName(name string) template.HTML + func FormatValidatorStatus(status string) template.HTML + func FormatValidatorTag(tag string) template.HTML + func FormatValidatorTags(tags []string) template.HTML + func FormatValidatorWithName(validator interface{}, name string) template.HTML + func FormatWithdawalCredentials(hash []byte, addCopyButton bool) template.HTML + func FormatWithdrawalShort(slot uint64, amount uint64) template.HTML + func FormatYesNo(yes bool) template.HTML + func GWeiBytesToEther(gwei []byte) decimal.Decimal + func GWeiToEther(gwei *big.Int) decimal.Decimal + func GenerateQRCodeForAddress(address []byte) (string, string, error) + func GenerateRandomAPIKey() (string, error) + func GenerateRandomBytesSecure(n int) ([]byte, error) + func GetCurrentFuncName() string + func GetEtherscanAPIBaseUrl(provideDefault bool) string + func GetFirstAndLastEpochForDay(day uint64) (firstEpoch uint64, lastEpoch uint64) + func GetFlash(w http.ResponseWriter, r *http.Request, name string) (string, error) + func GetFlashes(w http.ResponseWriter, r *http.Request, name string) []interface + func GetLastBalanceInfoSlotForDay(day uint64) uint64 + func GetMaxAllowedDayRangeValidatorStats(validatorAmount int) int + func GetNetwork() string + func GetParentFuncName() string + func GetPurchaseGroup(priceId string) string + func GetRemainingScheduledSyncDuties(validatorCount int, stats types.SyncCommitteesStats, ...) uint64 + func GetSigningDomain() ([]byte, error) + func GetTemplateFuncs() template.FuncMap + func GetTimeToNextWithdrawal(distance uint64) time.Time + func Glob(dir string, ext string) ([]string, error) + func GraffitiToString(graffiti []byte) string + func HandleRecaptcha(w http.ResponseWriter, r *http.Request, errorRoute string) error + func HasProblematicUtfCharacters(s string) bool + func HashAndEncode(input string) string + func HttpReq(ctx context.Context, method, url string, params, result interface{}) error + func IfToDec(valIf interface{}) decimal.Decimal + func IncludeHTML(path string) template.HTML + func IncludeSvg(name string) template.HTML + func InitSessionStore(secret string) + func Int64Max(x, y int64) int64 + func Int64Min(x, y int64) int64 + func IsApiRequest(r *http.Request) bool + func IsEth1Address(s string) bool + func IsEth1Tx(s string) bool + func IsHash(s string) bool + func IsPoSBlock0(number uint64, ts int64) bool + func IsValidEmail(s string) bool + func IsValidEnsDomain(text string) bool + func IsValidEth1Address(s string) bool + func IsValidEth1Tx(s string) bool + func IsValidUrl(s string) bool + func IsValidWithdrawalCredentials(s string) bool + func KFormatterEthPrice(price uint64) template.HTML + func LogError(err error, errorMsg interface{}, callerSkip int, ...) + func LogFatal(err error, errorMsg interface{}, callerSkip int, ...) + func LogWarn(err error, errorMsg interface{}, callerSkip int, ...) + func MapProductV1ToV2(product string) string + func MapProductV2ToV1(product string) string + func MustParseHex(hexString string) []byte + func PriceIdToProductId(priceId string) string + func ProcessSecrets(cfg interface{}) error + func ProductIsEligibleForAddons(productId string) bool + func RandomString(length int) string + func ReadConfig(cfg *types.Config, path string) error + func RemoveRoundBracketsIncludingContent(input string) string + func ReverseSlice[S ~[]E, E any](s S) + func ReverseString(s string) string + func RoundDecimals(f float64, n int) float64 + func SendOAuthErrorResponse(j *json.Encoder, route, errString, description string) + func SendOAuthResponse(j *json.Encoder, route, accessToken, refreshToken string, expiresIn int) + func SetFlash(w http.ResponseWriter, r *http.Request, name string, value string) + func SliceContains(list []string, target string) bool + func SlotToTime(slot uint64) time.Time + func SlotsPerSyncCommittee() uint64 + func SortedUniqueUint64(arr []uint64) []uint64 + func SqlRowsToJSON(rows *sql.Rows) ([]interface{}, error) + func StripPrefix(hexStr string) string + func SyncPeriodOfEpoch(epoch uint64) uint64 + func TimeToDay(timestamp uint64) uint64 + func TimeToEpoch(ts time.Time) int64 + func TimeToFirstSlotOfEpoch(timestamp uint64) uint64 + func TimeToSlot(timestamp uint64) uint64 + func TimeToSyncPeriod(t time.Time) uint64 + func ToBase64(input []byte) string + func TrLang(lang string, key string) template.HTML + func TryFetchContractMetadata(address []byte) (*types.ContractMetadata, error) + func UniqueStrings(s []string) []string + func ValidateReCAPTCHA(recaptchaResponse string) (bool, error) + func VerifyBlsToExecutionChangeSignature(op *capella.SignedBLSToExecutionChange) error + func VerifyVoluntaryExitSignature(op *phase0.SignedVoluntaryExit, forkVersion, pubkeyBytes []byte) error + func VersionedBlobHash(commitment []byte) common.Hash + func WaitForCtrlC() + func WeekOfSlot(slot uint64) uint64 + func WeiBytesToEther(wei []byte) decimal.Decimal + func WeiToEther(wei *big.Int) decimal.Decimal + func WithdrawalCredentialsToAddress(credentials []byte) ([]byte, error) + type CustomClaims struct + AppID uint64 + DeviceID uint64 + Package string + Theme string + UserID uint64 + func GetAuthorizationClaims(r *http.Request) *CustomClaims + func UnsafeGetClaims(tokenString string) (*CustomClaims, error) + func ValidateAccessTokenGetClaims(tokenString string) (*CustomClaims, error) + type CustomSession struct + ContextFn func() context.Context + SCS *scs.SessionManager + func (cs *CustomSession) AddFlash(value string) + func (cs *CustomSession) DeleteValue(key string) + func (cs *CustomSession) Flashes(vars ...string) []interface{} + func (cs *CustomSession) GetValue(key string) interface{} + func (cs *CustomSession) Save(r *http.Request, w http.ResponseWriter) error + func (cs *CustomSession) SetValue(key string, value interface{}) + func (cs *CustomSession) Values() map[interface{}]interface{} + type CustomSessionStore struct + SCS *scs.SessionManager + var SessionStore *CustomSessionStore + func (css *CustomSessionStore) Get(r *http.Request, name string) (*CustomSession, error) + type Decoder interface + Decode func(value string) error + type HttpReqHttpError struct + Body []byte + StatusCode int + Url string + func (err *HttpReqHttpError) Error() string + type OAuthErrorResponse struct + Description string + Error string + type OAuthResponse struct + AccessToken string + ExpiresIn int + RefreshToken string + TokenType string + type Setter interface + Set func(value string) error