Documentation ¶
Index ¶
- Constants
- Variables
- func AccessSecretVersion(name string) (*string, error)
- func AddBigInts(a, b []byte) []byte
- func AddCopyButton(element template.HTML, copyContent string) template.HTML
- 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 CopyButton(clipboardText interface{}) string
- func CopyButtonText(clipboardText interface{}) string
- func CopyButtonWithTitle(clipboardText interface{}, title string) 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 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 ExchangeRateForCurrency(currency string) float64
- func FirstEpochOfSyncPeriod(syncPeriod uint64) uint64
- func FixAddressCasing(add string) string
- func ForkVersionAtEpoch(epoch uint64) *types.ForkVersion
- func FormatAddCommas(n uint64) template.HTML
- func FormatAddCommasFormated(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, urlFragment string, ...) template.HTML
- func FormatAddressAsLink(address []byte, name string, verified bool, 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 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 FormatBalanceChangeFormated(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 FormatBitvector(b []byte) template.HTML
- func FormatBlockHash(hash []byte) template.HTML
- func FormatBlockNumber(number uint64) template.HTML
- func FormatBlockReward(blockNumber int64) template.HTML
- func FormatBlockRoot(blockRoot []byte) template.HTML
- func FormatBlockSlot(blockSlot uint64) template.HTML
- func FormatBlockStatus(status uint64) template.HTML
- func FormatBlockStatusShort(status uint64) template.HTML
- func FormatBlockUsage(gasUsage uint64, gasLimit uint64) template.HTML
- func FormatBuilder(pubkey []byte) template.HTML
- func FormatBytesAmount(amount []byte, unit string, digits int) 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 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 FormatEth1AddressString(addr []byte) template.HTML
- func FormatEth1AddressStringLowerCase(addr []byte) template.HTML
- func FormatEth1AddressWithName(address []byte, name string) 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(symbol string, ethPrice *big.Float, currentPrice template.HTML) template.HTML
- func FormatEthstoreComparison(pool string, val float64) template.HTML
- func FormatExchangedAmount(balanceInt int64, currency string) template.HTML
- func FormatFloat(num float64, precision 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 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(balanceInt int64, currency string) template.HTML
- func FormatIncomeClElInt64(income types.ClElInt64, currency string) template.HTML
- func FormatIncomeNoCurrency(balanceInt int64, 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 FormatName(name string, trunc_opt ...bool) 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 FormatPercentageColored(percentage float64) template.HTML
- 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 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 FormatSlashedValidatorsInt64(validators []int64) 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 uint64) template.HTML
- func FormatThousandsEnglish(number string) string
- func FormatTime(t time.Time) template.HTML
- func FormatTimeFromNow(t time.Time) template.HTML
- func FormatTimestamp(ts int64) template.HTML
- func FormatTimestampTs(ts time.Time) template.HTML
- func FormatTimestampUInt64(ts uint64) 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 FormatTokenSymbolHTML(tmpl template.HTML) template.HTML
- func FormatTokenSymbolTitle(symbol string) string
- func FormatTokenValue(balance *types.Eth1AddressBalance) template.HTML
- func FormatTransactionHash(hash []byte) 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 FormatValidatorsInt64(validators []int64) 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 GenerateQRCodeForAddress(address []byte) (string, string, error)
- func GenerateRandomAPIKey() (string, error)
- func GenerateRandomBytesSecure(n int) ([]byte, error)
- func GetFlash(w http.ResponseWriter, r *http.Request, name string) (string, error)
- func GetFlashes(w http.ResponseWriter, r *http.Request, name string) []interface{}
- func GetNetwork() string
- func GetPurchaseGroup(priceId string) string
- func GetSigningDomain() ([]byte, error)
- func GetTemplateFuncs() template.FuncMap
- func GetTimeToNextWithdrawal(distance uint64) time.Time
- func Glob(dir string, ext string) ([]string, error)
- func GraffitiToSring(graffiti []byte) string
- func HashAndEncode(input string) string
- func HumanizeTime(then time.Time) string
- func IncludeHTML(path string) template.HTML
- func IncludeSvg(name string) template.HTML
- func InitSessionStore(secret string)
- func IsApiRequest(r *http.Request) bool
- func IsEth1Address(s string) bool
- func IsValidEmail(s 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, additionalInfos ...string)
- func LogFatal(err error, errorMsg interface{}, callerSkip int, additionalInfos ...string)
- func MustParseHex(hexString string) []byte
- func ProcessSecrets(cfg interface{}) error
- func RandomString(length int) string
- func ReadConfig(cfg *types.Config, path string) error
- func Reverse(s string) string
- func ReverseSlice[S ~[]E, E any](s S)
- 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 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 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 ValidateReCAPTCHA(recaptchaResponse string) (bool, error)
- func VerifyBlsToExecutionChangeSignature(op *capella.SignedBLSToExecutionChange) error
- func VerifyVoluntaryExitSignature(op *phase0.SignedVoluntaryExit, forkVersion, pubkeyBytes []byte) error
- func WaitForCtrlC()
- func WeekOfSlot(slot uint64) uint64
- func WeiToEther(wei *big.Int) *big.Float
- func WithdrawalCredentialsToAddress(credentials []byte) ([]byte, error)
- type CustomClaims
- type CustomSession
- 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
- type Decoder
- type OAuthErrorResponse
- type OAuthResponse
- type Setter
Constants ¶
const ( Day = 24 * time.Hour Week = 7 * Day Month = 30 * Day Year = 12 * Month LongTime = 37 * Year )
Seconds-based time units
const AccessDenied = "access_denied"
const ClaimsContextKey = "ClaimsKey"
UserIDKey Key for context access to get the validated userID
const GROUP_API = "api"
const GROUP_MOBILE = "mobile"
const InvalidClient = "invalid_client"
const InvalidGrant = "invalid_grant"
const InvalidRequest = "invalid_request"
const InvalidScope = "invalid_scope"
const JsonBodyKey = "JsonBodyKey"
const JsonBodyNakedKey = "JsonBodyNakedKey"
const MobileAuthorizedKey = "MobileAuthKey"
const ServerError = "server_error"
const UnsupportedGrantType = "unsupported_grant_type"
Variables ¶
var Config *types.Config
Config is the globally accessible configuration
var Erc1155TransferSingleEventHash = common.HexToHash("0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62")
var Erc20TransferEventHash = common.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")
var ErrInvalidSpecification = errors.New("specification must be a struct pointer")
ErrInvalidSpecification indicates that a specification is of the wrong type.
var ErrRateLimit = errors.New("## RATE LIMIT ##")
var HashLikeRegex = regexp.MustCompile(`^[0-9a-fA-F]{0,96}$`)
var Rates map[string]int = map[string]int{
"AT": 20,
"BE": 21,
"BG": 20,
"CY": 19,
"CZ": 21,
"DE": 19,
"DK": 25,
"EE": 20,
"EL": 24,
"ES": 21,
"FI": 24,
"FR": 20,
"GB": 20,
"HR": 25,
"HU": 27,
"IE": 23,
"IT": 22,
"LT": 21,
"LU": 17,
"LV": 21,
"MT": 18,
"NL": 21,
"PL": 23,
"PT": 23,
"RO": 19,
"SE": 25,
"SI": 22,
"SK": 20,
}
A map of the european tax rates according to https://ec.europa.eu/taxation_customs/sites/taxation/files/resources/documents/taxation/vat/how_vat_works/rates/vat_rates_en.pdf
var StripeDynamicRatesLive = []*string{
strToPointer("txr_1IBMDaBiORp9oTlKp8EWwp8j"),
strToPointer("txr_1IBMDYBiORp9oTlKdcfgMZX3"),
strToPointer("txr_1IBMDXBiORp9oTlKlZ1VbEqY"),
strToPointer("txr_1IBMDVBiORp9oTlKeV6FwBnA"),
strToPointer("txr_1IBMDUBiORp9oTlK6p8C6qK9"),
strToPointer("txr_1IBMDSBiORp9oTlKMj0KwTwm"),
strToPointer("txr_1IBMDQBiORp9oTlKDnYFmsv3"),
strToPointer("txr_1IBMDPBiORp9oTlKfaPyr9il"),
strToPointer("txr_1IBMDNBiORp9oTlKcZfiSttV"),
strToPointer("txr_1IBMDLBiORp9oTlKnKCLXOF8"),
strToPointer("txr_1IBMDJBiORp9oTlKtDR2w3uh"),
strToPointer("txr_1IBMDIBiORp9oTlKIlPuDNmy"),
strToPointer("txr_1IBMDHBiORp9oTlKgJaePWff"),
strToPointer("txr_1IBMDFBiORp9oTlK2JDAsvYn"),
strToPointer("txr_1IBMDEBiORp9oTlKfhwkiebt"),
strToPointer("txr_1IBMDDBiORp9oTlKtWxmZyAT"),
strToPointer("txr_1IBMDABiORp9oTlK25TCgczQ"),
strToPointer("txr_1IBMD8BiORp9oTlKsB9QPkUG"),
strToPointer("txr_1IBMD7BiORp9oTlKwtw2fxpe"),
strToPointer("txr_1IBMD6BiORp9oTlKMsgBKyMe"),
strToPointer("txr_1IBMD4BiORp9oTlKVIN2jYCU"),
strToPointer("txr_1IBMD3BiORp9oTlKU1vYxvH5"),
strToPointer("txr_1IBMD2BiORp9oTlKKLV4yE2z"),
strToPointer("txr_1IBMD0BiORp9oTlKHcW9KHQ7"),
strToPointer("txr_1IBMCzBiORp9oTlKFp9CLAND"),
strToPointer("txr_1IBMCxBiORp9oTlK0lc5PZgI"),
strToPointer("txr_1IBMCuBiORp9oTlKIQmX5NaZ"),
strToPointer("txr_1IBMBfBiORp9oTlKsxI0Css0"),
}
var StripeDynamicRatesTest = []*string{
strToPointer("txr_1HqcFcBiORp9oTlKnyNWVp4r"),
strToPointer("txr_1I9pNwBiORp9oTlKxTmOz7a1"),
strToPointer("txr_1I9pOKBiORp9oTlKfMcVou1L"),
strToPointer("txr_1I9pP0BiORp9oTlKy5CpfXQR"),
strToPointer("txr_1I9pPzBiORp9oTlKWnfxgOw1"),
strToPointer("txr_1HqdWaBiORp9oTlKkij8L6dU"),
strToPointer("txr_1I9pQsBiORp9oTlK4UTiJJTN"),
strToPointer("txr_1I9pR7BiORp9oTlKgaTRDucB"),
strToPointer("txr_1I9pRKBiORp9oTlKudk6Zbf5"),
strToPointer("txr_1I9pRYBiORp9oTlKlFCuCxDv"),
strToPointer("txr_1I9pRsBiORp9oTlKabg2US6z"),
strToPointer("txr_1I9pS5BiORp9oTlKK6b9bi1n"),
strToPointer("txr_1I9pSNBiORp9oTlKCO3Of9YI"),
strToPointer("txr_1I9pSdBiORp9oTlKsdb5E2eO"),
strToPointer("txr_1I9pSuBiORp9oTlKW7OdEDln"),
strToPointer("txr_1I9pTCBiORp9oTlK4LAH8ZAQ"),
strToPointer("txr_1I9pUOBiORp9oTlKrissM9GJ"),
strToPointer("txr_1I9pUgBiORp9oTlKCXqz67MM"),
strToPointer("txr_1I9pUzBiORp9oTlK8zsYnVgS"),
strToPointer("txr_1I9pVCBiORp9oTlKUGQ94mXO"),
strToPointer("txr_1I9pVPBiORp9oTlKDaogHVHn"),
strToPointer("txr_1I9pVeBiORp9oTlKbn6ZdXvh"),
strToPointer("txr_1I9pVvBiORp9oTlKJuyxDeDD"),
strToPointer("txr_1I9pW8BiORp9oTlKEiGKbdcq"),
strToPointer("txr_1I9pWNBiORp9oTlKRvGIm5mx"),
strToPointer("txr_1I9pWbBiORp9oTlKqGEvmQ0H"),
strToPointer("txr_1I9pWrBiORp9oTlKljnvpOqI"),
strToPointer("txr_1I9pX9BiORp9oTlKDtkJ8A09"),
}
var StripeRatesLive map[string]string = map[string]string{
"AT": "txr_1IBMDaBiORp9oTlKp8EWwp8j",
"BE": "txr_1IBMDXBiORp9oTlKlZ1VbEqY",
"BG": "txr_1IBMDVBiORp9oTlKeV6FwBnA",
"CY": "txr_1IBMDUBiORp9oTlK6p8C6qK9",
"CZ": "txr_1IBMDSBiORp9oTlKMj0KwTwm",
"DE": "txr_1IBMDYBiORp9oTlKdcfgMZX3",
"DK": "txr_1IBMDQBiORp9oTlKDnYFmsv3",
"EE": "txr_1IBMDPBiORp9oTlKfaPyr9il",
"EL": "txr_1IBMDNBiORp9oTlKcZfiSttV",
"ES": "txr_1IBMDLBiORp9oTlKnKCLXOF8",
"FI": "txr_1IBMDJBiORp9oTlKtDR2w3uh",
"FR": "txr_1IBMDIBiORp9oTlKIlPuDNmy",
"GB": "txr_1IBMDHBiORp9oTlKgJaePWff",
"HR": "txr_1IBMDFBiORp9oTlK2JDAsvYn",
"HU": "txr_1IBMDEBiORp9oTlKfhwkiebt",
"IE": "txr_1IBMDDBiORp9oTlKtWxmZyAT",
"IT": "txr_1IBMDABiORp9oTlK25TCgczQ",
"LT": "txr_1IBMD8BiORp9oTlKsB9QPkUG",
"LU": "txr_1IBMD7BiORp9oTlKwtw2fxpe",
"LV": "txr_1IBMD6BiORp9oTlKMsgBKyMe",
"MT": "txr_1IBMD4BiORp9oTlKVIN2jYCU",
"NL": "txr_1IBMD3BiORp9oTlKU1vYxvH5",
"PL": "txr_1IBMD2BiORp9oTlKKLV4yE2z",
"PT": "txr_1IBMD0BiORp9oTlKHcW9KHQ7",
"RO": "txr_1IBMCzBiORp9oTlKFp9CLAND",
"SE": "txr_1IBMCxBiORp9oTlK0lc5PZgI",
"SI": "txr_1IBMCuBiORp9oTlKIQmX5NaZ",
"SK": "txr_1IBMBfBiORp9oTlKsxI0Css0",
}
var StripeRatesTest map[string]string = map[string]string{
"AT": "txr_1HqcFcBiORp9oTlKnyNWVp4r",
"BE": "txr_1I9pNwBiORp9oTlKxTmOz7a1",
"BG": "txr_1I9pOKBiORp9oTlKfMcVou1L",
"CY": "txr_1I9pP0BiORp9oTlKy5CpfXQR",
"CZ": "txr_1I9pPzBiORp9oTlKWnfxgOw1",
"DE": "txr_1HqdWaBiORp9oTlKkij8L6dU",
"DK": "txr_1I9pQsBiORp9oTlK4UTiJJTN",
"EE": "txr_1I9pR7BiORp9oTlKgaTRDucB",
"EL": "txr_1I9pRKBiORp9oTlKudk6Zbf5",
"ES": "txr_1I9pRYBiORp9oTlKlFCuCxDv",
"FI": "txr_1I9pRsBiORp9oTlKabg2US6z",
"FR": "txr_1I9pS5BiORp9oTlKK6b9bi1n",
"GB": "txr_1I9pSNBiORp9oTlKCO3Of9YI",
"HR": "txr_1I9pSdBiORp9oTlKsdb5E2eO",
"HU": "txr_1I9pSuBiORp9oTlKW7OdEDln",
"IE": "txr_1I9pTCBiORp9oTlK4LAH8ZAQ",
"IT": "txr_1I9pUOBiORp9oTlKrissM9GJ",
"LT": "txr_1I9pUgBiORp9oTlKCXqz67MM",
"LU": "txr_1I9pUzBiORp9oTlK8zsYnVgS",
"LV": "txr_1I9pVCBiORp9oTlKUGQ94mXO",
"MT": "txr_1I9pVPBiORp9oTlKDaogHVHn",
"NL": "txr_1I9pVeBiORp9oTlKbn6ZdXvh",
"PL": "txr_1I9pVvBiORp9oTlKJuyxDeDD",
"PT": "txr_1I9pW8BiORp9oTlKEiGKbdcq",
"RO": "txr_1I9pWNBiORp9oTlKRvGIm5mx",
"SE": "txr_1I9pWbBiORp9oTlKqGEvmQ0H",
"SI": "txr_1I9pWrBiORp9oTlKljnvpOqI",
"SK": "txr_1I9pX9BiORp9oTlKDtkJ8A09",
}
A map of the european tax rates according to https://ec.europa.eu/taxation_customs/sites/taxation/files/resources/documents/taxation/vat/how_vat_works/rates/vat_rates_en.pdf
Functions ¶
func AccessSecretVersion ¶
accessSecretVersion accesses the payload for the given secret version if one exists. The version can be a version number as a string (e.g. "5") or an alias (e.g. "latest").
func AddBigInts ¶
func AddressToWithdrawalCredentials ¶
AddressToWithdrawalCredentials converts a valid address to withdrawalCredentials
func AuthorizedAPIMiddleware ¶
AuthorizedAPIMiddleware Demands an Authorization header to be present with a valid user api token Once authorization passes, this middleware sets a context entry with the authenticated userID
func BitAtVector ¶
func BitAtVectorReversed ¶
func CopyButton ¶
func CopyButton(clipboardText interface{}) string
func CopyButtonText ¶
func CopyButtonText(clipboardText interface{}) string
func CopyButtonWithTitle ¶
func CreateAccessToken ¶
CreateAccessToken Creates a new access token for a given user
func DerefString ¶
func ElementExists ¶
func EpochOfSlot ¶
EpochOfSlot returns the corresponding epoch of a slot
func EpochToTime ¶
EpochToTime will return a time.Time for an epoch
func EpochsPerDay ¶
func EpochsPerDay() uint64
func Eth1TotalReward ¶
func Eth1TotalReward(block *types.Eth1BlockIndexed) *big.Int
func EthBytesToFloat ¶
func ExchangeRateForCurrency ¶
func FirstEpochOfSyncPeriod ¶
func FixAddressCasing ¶
func ForkVersionAtEpoch ¶
func ForkVersionAtEpoch(epoch uint64) *types.ForkVersion
ForkVersionAtEpoch returns the forkversion active a specific epoch
func FormatAddCommas ¶
func FormatAddCommasFormated ¶
func FormatAddress ¶
func FormatAddressAll ¶
func FormatAddressAsLink ¶
func FormatAddressEthBalance ¶
func FormatAddressEthBalance(balance *types.Eth1AddressBalance) template.HTML
func FormatAddressLong ¶
func FormatAddressWithLimits ¶
func FormatAmountFormatted ¶
func FormatAttestationInclusionSlot ¶
FormatAttestationInclusionSlot will return the block-slot formated as html
func FormatAttestationStatus ¶
FormatAttestationStatus will return a user-friendly attestation for an attestation status number
func FormatAttestationStatusShort ¶
FormatAttestationStatusShort will return a user-friendly attestation for an attestation status number
func FormatAttestorAssignmentKey ¶
FormatAttestorAssignmentKey will format attestor assignment keys
func FormatBalance ¶
FormatBalance will return a string for a balance
func FormatBalanceChange ¶
FormatBalanceChange will return a string for a balance change
func FormatBalanceShort ¶
FormatBalance will return a string for a balance
func FormatBalanceSql ¶
func FormatBigAmount ¶
func FormatBitlist ¶
func FormatBitvector ¶
func FormatBlockHash ¶
func FormatBlockNumber ¶
func FormatBlockReward ¶
func FormatBlockRoot ¶
FormatBlockRoot will return the block-root formated as html
func FormatBlockSlot ¶
FormatBlockSlot will return the block-slot formated as html
func FormatBlockStatus ¶
FormatBlockStatus will return an html status for a block.
func FormatBlockStatusShort ¶
FormatBlockStatusShort will return an html status for a block.
func FormatBuilder ¶
func FormatBytesAmount ¶
func FormatCurrentBalance ¶
FormatCurrentBalance will return the current balance formated as string with 9 digits after the comma (1 gwei = 1e9 eth)
func FormatDepositAmount ¶
FormatDepositAmount will return the deposit amount formated as string
func FormatDifficulty ¶
func FormatEffectiveBalance ¶
FormatEffectiveBalance will return the effective balance formated as string with 1 digit after the comma
func FormatEligibleBalance ¶
FormatBalance will return a string for a balance
func FormatEpoch ¶
FormatEpoch will return the epoch formated as html
func FormatErc20Decimals ¶
func FormatErc20Decimals(balance []byte, metadata *types.ERC20Metadata) decimal.Decimal
func FormatEth1Address ¶
FormatEth1Address will return the eth1-address formated as html
func FormatEth1AddressFull ¶
FormatEth1AddressFull will return the eth1-address formated as html
func FormatEth1AddressString ¶
FormatEth1AddressString will return the eth1-address formated as html string
func FormatEth1AddressStringLowerCase ¶
FormatEth1AddressString will return the eth1-address formated as html string
func FormatEth1Block ¶
FormatEth1Block will return the eth1-block formated as html
func FormatEth1BlockHash ¶
FormatEth1BlockHash will return the eth1-block formated as html
func FormatEth1TxHash ¶
FormatEth1TxHash will return the eth1-tx-hash formated as html
func FormatEth1TxStatus ¶
FormatBalance will return a string for a balance
func FormatEtherValue ¶
func FormatExchangedAmount ¶
func FormatFloat ¶
func FormatGlobalParticipationRate ¶
FormatGlobalParticipationRate will return the global-participation-rate formated as html
func FormatGraffiti ¶
FormatGraffiti will return the graffiti formated as html
func FormatGraffitiAsLink ¶
FormatGraffitiAsLink will return the graffiti formated as html-link
func FormatGraffitiString ¶
FormatGraffitiString formats (and escapes) the graffiti
func FormatHash ¶
FormatHash will return a hash formated as html hash is required, trunc is optional. Only the first value in trunc_opt will be used.
func FormatHashWithCopy ¶
func FormatHashrate ¶
func FormatInOutSelf ¶
func FormatInclusionDelay ¶
FormatAttestationInclusionSlot will return the block-slot formated as html
func FormatIncome ¶
FormatIncome will return a string for a balance
func FormatIncomeClElInt64 ¶
func FormatIncomeNoCurrency ¶
func FormatIncomeSql ¶
func FormatMachineName ¶
func FormatMessageToHtml ¶
func FormatMethod ¶
func FormatNotificationChannel ¶
func FormatNotificationChannel(ch types.NotificationChannel) template.HTML
func FormatNumber ¶
func FormatNumber(number interface{}) string
func FormatParticipation ¶
func FormatPercentage ¶
FormatPercentage will return a string for a percentage
func FormatPercentageColored ¶
func FormatPercentageWithGPrecision ¶
FormatPercentageWithGPrecision will return a string for a percentage the maximum number of significant digits (trailing zeros are removed).
func FormatPercentageWithPrecision ¶
FormatPercentageWithPrecision will return a string for a percentage
func FormatPoolPerformance ¶
func FormatPublicKey ¶
FormatPublicKey will return html formatted text for a validator-public-key
func FormatSlashedValidator ¶
FormatSlashedValidator will return html formatted text for a slashed validator
func FormatSlashedValidatorInt64 ¶
FormatSlashedValidatorInt64 will return html formatted text for a slashed validator
func FormatSlashedValidatorWithName ¶
FormatSlashedValidator will return html formatted text for a slashed validator
func FormatSlashedValidators ¶
FormatSlashedValidators will return html formatted text for slashed validators
func FormatSlashedValidatorsInt64 ¶
FormatSlashedValidatorsInt64 will return html formatted text for slashed validators
func FormatSlashedValidatorsWithName ¶
FormatSlashedValidators will return html formatted text for slashed validators
func FormatSlotToTimestamp ¶
FormatSlotToTimestamp will return the time elapsed since blockSlot
func FormatSyncParticipationStatus ¶
FormatSyncParticipationStatus will return a user-friendly format for an sync-participation-status number
func FormatThousandsEnglish ¶
func FormatTimestamp ¶
FormatTimestamp will return a timestamp formated as html. This is supposed to be used together with client-side js
func FormatTimestampTs ¶
FormatTimestamp will return a timestamp formated as html. This is supposed to be used together with client-side js
func FormatTimestampUInt64 ¶
FormatTimestamp will return a timestamp formated as html. This is supposed to be used together with client-side js
func FormatTokenBalance ¶
func FormatTokenBalance(balance *types.Eth1AddressBalance) template.HTML
func FormatTokenName ¶
func FormatTokenName(balance *types.Eth1AddressBalance) template.HTML
func FormatTokenSymbol ¶
func FormatTokenSymbolTitle ¶
func FormatTokenValue ¶
func FormatTokenValue(balance *types.Eth1AddressBalance) template.HTML
func FormatTransactionHash ¶
func FormatTransactionType ¶
func FormatTsWithoutTooltip ¶
FormatTs will return a timestamp formated as html. This is supposed to be used together with client-side js
func FormatTxHash ¶
func FormatValidator ¶
FormatValidator will return html formatted text for a validator
func FormatValidatorInt64 ¶
FormatValidatorInt64 will return html formatted text for a validator (for an int64 validator-id)
func FormatValidatorName ¶
func FormatValidatorStatus ¶
FormatValidatorStatus will return the validator-status formated as html possible states pending, active_online, active_offline, exiting_online, exciting_offline, slashing_online, slashing_offline, exited, slashed
func FormatValidatorTag ¶
FormatValidatorTag will return html formated text of a validator-tag. Depending on the tag it will describe the tag in a tooltip and link to more information regarding the tag.
func FormatValidatorTags ¶
func FormatValidatorWithName ¶
func FormatValidatorsInt64 ¶
FormatValidatosrInt64 will return html formatted text for validators
func FormatWithdrawalShort ¶
FormatBlockStatusShort will return an html status for a block.
func FormatYesNo ¶
FormatYesNo will return yes or no formated as html
func GenerateQRCodeForAddress ¶
Generates a QR code for an address returns two transparent base64 encoded img strings for dark and light theme the first has a black QR code the second a white QR code
func GenerateRandomAPIKey ¶
GenerateAPIKey generates an API key for a user
func GetFlashes ¶
func GetFlashes(w http.ResponseWriter, r *http.Request, name string) []interface{}
func GetNetwork ¶
func GetNetwork() string
func GetPurchaseGroup ¶
func GetSigningDomain ¶
func GetTemplateFuncs ¶
GetTemplateFuncs will get the template functions
func GetTimeToNextWithdrawal ¶
GetTimeToNextWithdrawal calculates the time it takes for the validators next withdrawal to be processed.
func GraffitiToSring ¶
func HashAndEncode ¶
HashAndEncode digests the input with sha256 and returns it as hex string
func IncludeSvg ¶
func InitSessionStore ¶
func InitSessionStore(secret string)
InitSessionStore initializes SessionStore with the given secret.
func IsApiRequest ¶
func IsEth1Address ¶
IsEth1Address verifies whether a string represents an eth1-address. In contrast to IsValidEth1Address, this also returns true for the 0x0 address
func IsValidEmail ¶
IsValidEmail verifies whether a string represents a valid email-address.
func IsValidEth1Address ¶
IsValidEth1Address verifies whether a string represents a valid eth1-address.
func IsValidEth1Tx ¶
IsValidEth1Tx verifies whether a string represents a valid eth1-tx-hash.
func IsValidUrl ¶
IsValidUrl verifies whether a string represents a valid Url.
func IsValidWithdrawalCredentials ¶
IsValidWithdrawalCredentials verifies whether a string represents valid withdrawal credentials.
func KFormatterEthPrice ¶
func LogError ¶
LogError logs an error with callstack info that skips callerSkip many levels with arbitrarily many additional infos. callerSkip equal to 0 gives you info directly where LogError is called.
func LogFatal ¶
LogFatal logs a fatal error with callstack info that skips callerSkip many levels with arbitrarily many additional infos. callerSkip equal to 0 gives you info directly where LogFatal is called.
func MustParseHex ¶
MustParseHex will parse a string into hex
func ProcessSecrets ¶
func ProcessSecrets(cfg interface{}) error
func ReadConfig ¶
ReadConfig will process a configuration
func ReverseSlice ¶
func ReverseSlice[S ~[]E, E any](s S)
func RoundDecimals ¶
RoundDecimals rounds (nearest) a number to the specified number of digits after comma
func SendOAuthErrorResponse ¶
SendOAuthErrorResponse creates and sends a OAuth error response according to RFC6749
func SendOAuthResponse ¶
SendOAuthResponse creates and sends a OAuth response according to RFC6749
func SliceContains ¶
sliceContains reports whether the provided string is present in the given slice of strings.
func SqlRowsToJSON ¶
func StripPrefix ¶
func SyncPeriodOfEpoch ¶
func TimeToEpoch ¶
TimeToEpoch will return an epoch for a given time
func TimeToSlot ¶
TimeToSlot returns time to slot in seconds
func TimeToSyncPeriod ¶
func TryFetchContractMetadata ¶
func TryFetchContractMetadata(address []byte) (*types.ContractMetadata, error)
func ValidateReCAPTCHA ¶
ValidateReCAPTCHA validates a ReCaptcha server side
func VerifyBlsToExecutionChangeSignature ¶
func VerifyBlsToExecutionChangeSignature(op *capella.SignedBLSToExecutionChange) error
VerifyBlsToExecutionChangeSignature verifies the signature of an bls_to_execution_change message see: https://github.com/wealdtech/ethdo/blob/master/cmd/validator/credentials/set/process.go see: https://github.com/prysmaticlabs/prysm/blob/76ed634f7386609f0d1ee47b703eb0143c995464/beacon-chain/core/blocks/withdrawals.go
func VerifyVoluntaryExitSignature ¶
func VerifyVoluntaryExitSignature(op *phase0.SignedVoluntaryExit, forkVersion, pubkeyBytes []byte) error
VerifyVoluntaryExitSignature verifies the signature of an voluntary_exit message
func WeekOfSlot ¶
WeekOfSlot returns the corresponding week of a slot
func WithdrawalCredentialsToAddress ¶
WithdrawalCredentialsToAddress converts withdrawalCredentials to an address if possible
Types ¶
type CustomClaims ¶
type CustomClaims struct { UserID uint64 `json:"userID"` AppID uint64 `json:"appID"` DeviceID uint64 `json:"deviceID"` Package string `json:"package"` Theme string `json:"theme"` jwt.StandardClaims }
CustomClaims Structure of JWT body, contains standard JWT claims and userID as a custom claim
func GetAuthorizationClaims ¶
func GetAuthorizationClaims(r *http.Request) *CustomClaims
func UnsafeGetClaims ¶
func UnsafeGetClaims(tokenString string) (*CustomClaims, error)
UnsafeGetClaims this method returns the userID of a given jwt token WITHOUT VALIDATION DO NOT USE THIS METHOD AS RELIABLE SOURCE FOR USERID
func ValidateAccessTokenGetClaims ¶
func ValidateAccessTokenGetClaims(tokenString string) (*CustomClaims, error)
ValidateAccessTokenGetClaims validates the jwt token and returns the UserID
type CustomSession ¶
func (*CustomSession) AddFlash ¶
func (cs *CustomSession) AddFlash(value string)
func (*CustomSession) DeleteValue ¶
func (cs *CustomSession) DeleteValue(key string)
func (*CustomSession) Flashes ¶
func (cs *CustomSession) Flashes(vars ...string) []interface{}
func (*CustomSession) GetValue ¶
func (cs *CustomSession) GetValue(key string) interface{}
func (*CustomSession) Save ¶
func (cs *CustomSession) Save(r *http.Request, w http.ResponseWriter) error
func (*CustomSession) SetValue ¶
func (cs *CustomSession) SetValue(key string, value interface{})
func (*CustomSession) Values ¶
func (cs *CustomSession) Values() map[interface{}]interface{}
type CustomSessionStore ¶
type CustomSessionStore struct {
// TODO: Implement
SCS *scs.SessionManager
}
var SessionStore *CustomSessionStore
func (*CustomSessionStore) Get ¶
func (css *CustomSessionStore) Get(r *http.Request, name string) (*CustomSession, error)
type Decoder ¶
Decoder has the same semantics as Setter, but takes higher precedence. It is provided for historical compatibility.
type OAuthErrorResponse ¶
type OAuthErrorResponse struct { Error string `json:"error"` Description string `json:"error_description"` }
OAuthErrorResponse Structure of an OAuth error response