Documentation ¶
Index ¶
- Constants
- Variables
- func AddAddressLink(v *gocui.View, a common.Address)
- func AddAddressShortLink(v *gocui.View, a common.Address)
- func AddDollarLink(v *gocui.View, val float64)
- func AddDollarValueLink(v *gocui.View, val *big.Int, t *Token)
- func AddValueLink(v *gocui.View, val *big.Int, t *Token)
- func AddValueSymbolLink(v *gocui.View, val *big.Int, t *Token)
- func AddressFromAny(value any) common.Address
- func Amount2Str(amount *big.Int, decimals int) string
- func BigIntFromAny(value any) *big.Int
- func ConfirmEIP712Template(data apitypes.TypedData, confirmed bool) string
- func Contains(s string, subststr string) bool
- func Create(name, pass string) error
- func Exists(name string) bool
- func Float(value *big.Int, decimals int) *big.Float
- func Float64(value *big.Int, decimals int) float64
- func FmtAmount(amount *big.Int, decimals int, fixed bool) string
- func FmtFloat64(v float64, fixed bool) string
- func FmtFloat64D(v float64, fixed bool) string
- func FmtFloat64DN(num float64) string
- func FormatFloatWithCommas(num float64) string
- func FormatUInt64(v uint64, fixed bool) string
- func GetDataFolder() (string, error)
- func GetHostName(URL string) string
- func InitConfig()
- func IntFromAny(value any) int
- func IsContractDownloaded(a common.Address) bool
- func IsInArray(slice []string, item string) bool
- func Open(name string, pass string) error
- func OpenBrowser(url string) error
- func RestoreConfig(path string) error
- func SaveConfig() error
- func SaveToFile(w *Wallet, file, pass string) error
- func ShortAddress(a common.Address) string
- func Split3(input string) []string
- func SplitN(input string, n int) []string
- func Str2Wei(str string, decimals int) (*big.Int, error)
- func SystemCommand(command string) error
- func TagAddressShortLink(a common.Address) string
- func TagBytesLink(b []byte) string
- func TagDollarLink(val float64) string
- func TagDollarValueLink(val *big.Int, t *Token) string
- func TagLink(text, action, tip string) string
- func TagShortDollarLink(val float64) string
- func TagShortDollarValueLink(val *big.Int, t *Token) string
- func TagShortValueSymbolLink(val *big.Int, t *Token) string
- func TagUint64Link(val uint64) string
- func TagValueLink(val *big.Int, t *Token) string
- func TagValueSymbolLink(val *big.Int, t *Token) string
- func Uint256FromHex(hex string) *big.Int
- func WalletList() []string
- type Address
- type Blockchain
- type Contract
- type LP_V3
- type LP_V3_Position
- type Origin
- type PD_V3
- type SConfig
- type SignedDataInfo
- type Signer
- type Token
- type Wallet
- func (w *Wallet) AddBlockchain(b *Blockchain) error
- func (w *Wallet) AddLP_V3(lp *LP_V3) error
- func (w *Wallet) AddLP_V3Position(lp *LP_V3_Position) error
- func (w *Wallet) AddOrigin(o *Origin) error
- func (w *Wallet) AddOriginAddress(url string, a string) error
- func (w *Wallet) AddToken(chain int, a common.Address, n string, s string, d int) error
- func (w *Wallet) DeleteBlockchain(name string) error
- func (w *Wallet) DeleteToken(chain int, a common.Address) error
- func (w *Wallet) EditBlockchain(ub *Blockchain) error
- func (w *Wallet) GetAddress(a any) *Address
- func (w *Wallet) GetAddressByName(n string) *Address
- func (w *Wallet) GetBlockchain(id int) *Blockchain
- func (w *Wallet) GetBlockchainByName(n string) *Blockchain
- func (w *Wallet) GetContract(a common.Address) *Contract
- func (w *Wallet) GetLP_V3(chainId int, addr common.Address) *LP_V3
- func (w *Wallet) GetLP_V3Position(chainId int, provider common.Address, nft *big.Int) *LP_V3_Position
- func (w *Wallet) GetLP_V3_by_name(chainId int, name string) *LP_V3
- func (w *Wallet) GetNativeToken(b *Blockchain) (*Token, error)
- func (w *Wallet) GetOrigin(url string) *Origin
- func (w *Wallet) GetSigner(n string) *Signer
- func (w *Wallet) GetSignerWithCopies(name string) []*Signer
- func (w *Wallet) GetSignerWithCopyIndex(name string) (*Signer, int)
- func (w *Wallet) GetToken(chain int, a string) *Token
- func (w *Wallet) GetTokenByAddress(chain int, a common.Address) *Token
- func (w *Wallet) GetTokenBySymbol(chain int, s string) *Token
- func (w *Wallet) IsContractTrusted(addr common.Address) bool
- func (w *Wallet) PromoteOriginAddress(url string, a string) error
- func (w *Wallet) RemoveLP_V3(chainId int, provider common.Address) error
- func (w *Wallet) RemoveLP_V3Position(addr common.Address, chainId int, provider common.Address, nft *big.Int) error
- func (w *Wallet) RemoveOrigin(url string) error
- func (w *Wallet) RemoveOriginAddress(url string, a common.Address) error
- func (w *Wallet) Save() error
- func (w *Wallet) SetContract(a common.Address, c *Contract) error
- func (w *Wallet) SetOrigin(url string) error
- func (w *Wallet) SetOriginChain(url string, ch string) error
- func (w *Wallet) SetParamInt(name string, val int) error
- func (w *Wallet) SetParamStr(name string, val string) error
- func (w *Wallet) TrustContract(addr common.Address) error
- func (w *Wallet) UntrustContract(addr common.Address) error
- type XF
- func (n *XF) Add(x *XF) *XF
- func (n *XF) BigInt() *big.Int
- func (n *XF) Div(x *XF) *XF
- func (n *XF) Dump() string
- func (n *XF) Float64() float64
- func (n *XF) Format(fixed bool, prefix string) string
- func (n *XF) IsZero() bool
- func (n *XF) Mul(x *XF) *XF
- func (n *XF) Norm() *XF
- func (n *XF) OrderOfMagnitude() int
- func (n *XF) String() string
- func (n *XF) Sub(x *XF) *XF
Constants ¶
View Source
const ( ICON_DELETE = "\U0000f057 " //"\uf00d" ICON_EDIT = "\uf044 " ICON_COPY = "\uf0c5 " ICON_DROPLIST = "\ueb6e " ICON_PROMOTE = "\ued65 " ICON_ADD = "\ueadc " ICON_3DOTS = "\U000f01d8" ICON_BACK = "\U000f006e " ICON_SEND = "\U000f048a " ICON_LINK = "\uf08e " ICON_FEED = "\uf09e " ICON_DOWNLOAD = "\ueac2 " ICON_VSC = "\U000f0a1e " ICON_TRUST = "\uebc1 " ICON_NO_ENTRY = "\uf4f4 " ICON_LIGHT = "\U000f06e8 " ICON_CHECK = "\U000f0134 " ICON_UNCHECK = "\U000f0130 " ICON_ALERT = "\U000f0028 " )
View Source
const (
ALERT_ARROW = "<blink>\U000f0028\uf178 </blink>"
)
View Source
const CONFIG_NAME = "config.yaml"
View Source
const LOG_NAME = "web3pro.log"
View Source
const MAX_DECIMALS = 80
View Source
const PRECISION = 20
View Source
const SOLT_SIZE = 32
View Source
const VERSION = "0.1.0"
Variables ¶
View Source
var AppName = "web3pro"
View Source
var ConfPath = CONFIG_NAME
View Source
var ConfigChanged = false
View Source
var DataFolder = "data"
View Source
var EXPLORER_API_TYPES = []string{"etherscan", "blockscout"}
View Source
var FMT_NEG_SUFFIXES = []string{"", "m", "µ", "n", "p", "f", "a", "/^21", "/^24", "/^27", "/^30", "/^33",
"/^36", "/^39", "/^42", "/^45", "/^48", "/^51", "/^54", "/^57", "/^60", "/^63", "/^66", "/^69", "/^72", "/^75", "/^76"}
var FMT_NEG_SUFFIXES = []string{"", "/K", "/M", "/B", "/T", "/Qa", "/Qi", "/^21", "/^24", "/^27", "/^30", "/^33",
"/^36", "/^39", "/^42", "/^45", "/^48", "/^51", "/^54", "/^57", "/^60", "/^63", "/^66", "/^69", "/^72", "/^75", "/^76"}
View Source
var FMT_SUFFIXES = []string{"", "k", "M", "B", "T", "Qa", "Qi", "^21", "^24", "^27", "^30", "^33", "^36", "^39",
"^42", "^45", "^48", "^51", "^54", "^57", "^60", "^63", "^66", "^69", "^72", "^75", "^76"}
View Source
var KNOWN_FEEDERS = []string{"dexscreener", "coinmarketcap"}
View Source
var KNOWN_SIGNER_TYPES = []string{"mnemonics", "ledger", "trezor"}
View Source
var LogPath = LOG_NAME
View Source
var PD []XF
View Source
var PredefinedBlockchains []Blockchain = []Blockchain{}/* 242 elements not displayed */
View Source
var PrefedinedLP_V3 = map[int]([]PD_V3){ 1: { { Name: "Uni", Address: common.HexToAddress("0xC36442b4a4522E871399CD717aBDD847Ab11FE88"), URL: "https://app.uniswap.org/swap", }, { Name: "Pancake", Address: common.HexToAddress("0x46A15B0b27311cedF172AB29E4f4766fbE7F4364"), URL: "https://pancakeswap.finance/swap&chin=eth", }, }, 369: { { Name: "9Inch", Address: common.HexToAddress("0x18A532b36A9F6B10b3FEC5BF225C00A0Ec89B79E"), URL: "https://v3.9inch.io/?chain=pulse", }, { Name: "9mm", Address: common.HexToAddress("0xCC05bf158202b4F461Ede8843d76dcd7Bbad07f2"), URL: "https://v3.9mm.pro", }, }, 56: { { Name: "Pancake", Address: common.HexToAddress("0x46A15B0b27311cedF172AB29E4f4766fbE7F4364"), URL: "https://pancakeswap.finance/swap&chin=eth", }, }, }
View Source
var STANDARD_DERIVATIONS = map[string]struct { Name string Format string }{ "legacy": { Name: "Legacy (MEW, MyCrypto) m/44'/60'/0'/%d", Format: "m/44'/60'/0'/%d", }, "ledger-live": { Name: "Ledger Live m/44'/60'/%d'/0/0", Format: "m/44'/60'/%d'/0/0", }, "default": { Name: "Default m/44'/60'/0'/0/%d", Format: "m/44'/60'/0'/0/%d", }, }
View Source
var StandardOnClickHotspot func(v *gocui.View, hs *gocui.Hotspot)
View Source
var StandardOnOverHotspot func(v *gocui.View, hs *gocui.Hotspot)
View Source
var XF_NaN = &XF{big.NewInt(0), 0, true}
Functions ¶
func AddDollarLink ¶
func AddressFromAny ¶
func BigIntFromAny ¶
func ConfirmEIP712Template ¶
func FmtFloat64 ¶
func FmtFloat64D ¶
func FormatFloatWithCommas ¶
func FormatUInt64 ¶
func GetDataFolder ¶
func GetHostName ¶
func InitConfig ¶
func InitConfig()
func IntFromAny ¶
func IsContractDownloaded ¶
func OpenBrowser ¶
func RestoreConfig ¶
func SaveConfig ¶
func SaveConfig() error
func SaveToFile ¶
func ShortAddress ¶
func Split3 ¶
Split3 splits the input string into a slice of strings. Guarantees that the result has at least 3 elements.
func SplitN ¶
Split splits the input string into a slice of strings. Guarantees that the result has at least n elements.
func SystemCommand ¶
func TagAddressShortLink ¶
func TagBytesLink ¶
func TagDollarLink ¶
func TagShortDollarLink ¶
func TagUint64Link ¶
func Uint256FromHex ¶
func WalletList ¶
func WalletList() []string
Types ¶
type Blockchain ¶
type Blockchain struct { Name string `json:"name"` Url string `json:"url"` ChainId int `json:"chain_id"` ExplorerUrl string `json:"explorer_url"` ExplorerAPIUrl string `json:"explorer_api_url"` ExplorerAPIToken string `json:"explorer_api_token"` ExplorerApiType string `json:"explorer_api_type"` Currency string `json:"currency"` WTokenAddress common.Address `json:"wrapped_native_token_address"` Multicall common.Address `json:"multicall"` }
func (*Blockchain) ExplorerLink ¶
func (b *Blockchain) ExplorerLink(address common.Address) string
type LP_V3_Position ¶
type LP_V3_Position struct { Owner common.Address `json:"owner"` ChainId int `json:"chain_id"` Provider common.Address `json:"provider"` NFT_Token *big.Int `json:"nft_token"` Token0 common.Address `json:"token0"` Token1 common.Address `json:"token1"` Fee *big.Int `json:"fee"` Pool common.Address `json:"pool"` TickLower int64 `json:"tick_lower"` TickUpper int64 `json:"tick_upper"` }
type Origin ¶
type SConfig ¶
type SConfig struct { WalletName string `yaml:"wallet_name"` // last wallet used Verbosity string `yaml:"verbosity"` // log verbosity Theme string `yaml:"theme"` // UI theme BusTimeout time.Duration `yaml:"bus_timeout"` // timeout for bus requests BusHardTimeout time.Duration `yaml:"bus_hard_timeout"` // hard timeout for bus requests USBLog bool `yaml:"usb_log"` // log USB events USBBackgroundEnumerate bool `yaml:"usb_background_enumerate"` // enumerate USB devices in background PriceFeed string `yaml:"price_feed"` // price feed PriceUpdatePeriod string `yaml:"price_update_period"` // price update period Editor string `yaml:"editor"` // editor CMC_API_KEY string `yaml:"cmc_api_key"` // CoinMarketCap API key }
type SignedDataInfo ¶
type Signer ¶
type Signer struct { Name string `json:"name"` Type string `json:"type"` MasterKey string `json:"master-key"` Copies []string `json:"copies"` }
func (*Signer) GetAllCopies ¶
type Token ¶
type Token struct { ChainId int `json:"chain_id"` Name string `json:"name"` Symbol string `json:"symbol"` Address common.Address `json:"address"` Decimals int `json:"decimals"` Native bool `json:"native"` Unique bool `json:"-"` // Unique name in the blockchain PriceFeeder string `json:"price_feeder"` PriceFeedParam string `json:"price_feed_id"` Price float64 `json:"price"` PriceChange24 float64 `json:"price_change_24"` PriceTimestamp time.Time `json:"price_timestamp"` // Unix timestamp }
func (*Token) GetPrintName ¶
type Wallet ¶
type Wallet struct { Name string `json:"name"` Blockchains []*Blockchain `json:"blockchains"` Signers []*Signer `json:"signers"` Addresses []*Address `json:"addresses"` Tokens []*Token `json:"tokens"` Origins []*Origin `json:"origins"` LP_V3_Providers []*LP_V3 `json:"lp_v3_providers"` LP_V3_Positions []*LP_V3_Position `json:"lp_v3_positions"` Contracts map[common.Address]*Contract AppsPaneOn bool `json:"apps_pane_on"` LP_V3PaneOn bool `json:"lp_v3_pane_on"` CurrentChainId int `json:"current_chain_id"` CurrentAddress common.Address `json:"current_address"` CurrentOrigin string `json:"current_origin"` // Auxilary params ParamInt map[string]int `json:"param_int"` ParamStr map[string]string `json:"param_str"` SoundOn bool `json:"sound_on"` Sound string `json:"sound"` // contains filtered or unexported fields }
var CurrentWallet *Wallet
func (*Wallet) AddBlockchain ¶
func (w *Wallet) AddBlockchain(b *Blockchain) error
func (*Wallet) AddLP_V3Position ¶
func (w *Wallet) AddLP_V3Position(lp *LP_V3_Position) error
func (*Wallet) DeleteBlockchain ¶
func (*Wallet) EditBlockchain ¶
func (w *Wallet) EditBlockchain(ub *Blockchain) error
func (*Wallet) GetAddress ¶
func (*Wallet) GetAddressByName ¶
func (*Wallet) GetBlockchain ¶
func (w *Wallet) GetBlockchain(id int) *Blockchain
func (*Wallet) GetBlockchainByName ¶
func (w *Wallet) GetBlockchainByName(n string) *Blockchain
func (*Wallet) GetLP_V3Position ¶
func (*Wallet) GetLP_V3_by_name ¶
func (*Wallet) GetNativeToken ¶
func (w *Wallet) GetNativeToken(b *Blockchain) (*Token, error)
func (*Wallet) GetSignerWithCopies ¶
func (*Wallet) GetSignerWithCopyIndex ¶
func (*Wallet) GetTokenByAddress ¶
func (*Wallet) PromoteOriginAddress ¶
func (*Wallet) RemoveLP_V3 ¶
func (*Wallet) RemoveLP_V3Position ¶
func (*Wallet) RemoveOrigin ¶
func (*Wallet) RemoveOriginAddress ¶
type XF ¶
func NewXF_BigFloat ¶
func NewXF_Float64 ¶
func NewXF_UInt64 ¶
func (*XF) OrderOfMagnitude ¶
Click to show internal directories.
Click to hide internal directories.