cmn

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

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

Go to latest
Published: Feb 12, 2026 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

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{}/* 243 elements not displayed */
View Source
var PredefinedStakings []Staking = []Staking{
	{
		Name:         "SAVVA Staking",
		ChainId:      369,
		Contract:     common.HexToAddress("0x6BC07cC3d6c0927320d273D6318ef5405f2eB911"),
		URL:          "https://savva.app",
		StakedToken:  common.HexToAddress("0xb528a9DB27A74dB802C74D0CCc40657efE5F0A45"),
		BalanceFunc:  "balanceOf",
		Reward1Token: common.HexToAddress("0xb528a9DB27A74dB802C74D0CCc40657efE5F0A45"),
		Reward1Func:  "claimable",
	},
	{
		Name:         "Liquid Loans",
		ChainId:      369,
		Contract:     common.HexToAddress("0x853F0CD4B0083eDf7cFf5Ad9A296f02Ffb71C995"),
		URL:          "https://go.liquidloans.io/#/staking-pool",
		StakedToken:  common.HexToAddress("0x9159f1D2a9f51998Fc9Ab03fbd8f265ab14A1b3B"),
		BalanceFunc:  "stakes",
		Reward1Token: common.HexToAddress("0x0dEEd1486bc52aA0d3E6f8849cEC5adD6598A162"),
		Reward1Func:  "getPendingUSDLGain",
		Reward2Token: common.HexToAddress("0xA1077a294dDE1B09bB078844df40758a5D0f9a27"),
		Reward2Func:  "getPendingPLSGain",
	},
	{
		Name:         "INC Printer",
		ChainId:      369,
		Contract:     common.HexToAddress("0x35b99f29b3Ec3276A2b3Bb5863326B1c100aa160"),
		URL:          "https://incprinter.com/#/",
		StakedToken:  common.HexToAddress("0x6c203a555824ec90a215f37916cf8db58ebe2fa3"),
		BalanceFunc:  "stakes",
		Reward1Token: common.HexToAddress("0x144cd22aaa2a80fed0bb8b1deaddc51a53df1d50"),
		Reward1Func:  "getPendingLUSDGain",
		Reward2Token: common.HexToAddress("0xA1077a294dDE1B09bB078844df40758a5D0f9a27"),
		Reward2Func:  "getPendingETHGain",
	},
	{
		Name:         "INC INCD-DAI",
		ChainId:      369,
		Contract:     common.HexToAddress("0x5A0D3cC13A523Dd7A9279C5Eb4f363593dA4198e"),
		URL:          "https://incprinter.com/#/",
		StakedToken:  common.HexToAddress("0x2cb92b1e8b2fc53b5a9165e765488e17b38c26d3"),
		BalanceFunc:  "balanceOf",
		Reward1Token: common.HexToAddress("0x6c203a555824ec90a215f37916cf8db58ebe2fa3"),
		Reward1Func:  "earned",
	},
	{
		Name:         "INC PRINT-INC",
		ChainId:      369,
		Contract:     common.HexToAddress("0x857ab0cb7449Fb29429FC30596F08cfbf9F171F5"),
		URL:          "https://incprinter.com/#/",
		StakedToken:  common.HexToAddress("0xf35f8db9b6760799db76796340aacc69dea0c644"),
		BalanceFunc:  "balanceOf",
		Reward1Token: common.HexToAddress("0x6c203a555824ec90a215f37916cf8db58ebe2fa3"),
		Reward1Func:  "earned",
	},

	{
		Name:         "Monad Staking",
		ChainId:      143,
		Contract:     common.HexToAddress("0x0000000000000000000000000000000000001000"),
		URL:          "https://monadvision.com/myspace?feature=Stake",
		StakedToken:  common.HexToAddress("0x0000000000000000000000000000000000000000"),
		BalanceFunc:  "getDelegator",
		Reward1Token: common.HexToAddress("0x0000000000000000000000000000000000000000"),
		Reward1Func:  "getDelegator",
		ValidatorId:  0,
	},

	{
		Name:         "Aztec Staking",
		ChainId:      1,
		Contract:     common.HexToAddress("0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f"),
		URL:          "https://stake.aztec.network",
		StakedToken:  common.HexToAddress("0xA27EC0006e59f245217Ff08CD52A7E8b169E62D2"),
		Reward1Token: common.HexToAddress("0xA27EC0006e59f245217Ff08CD52A7E8b169E62D2"),
		Hardcoded:    true,
	},
}
View Source
var PrefedinedLP_V2 = map[int]([]PD_V2){
	1: {
		{
			Name:       "Uniswap",
			Factory:    common.HexToAddress("0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f"),
			Router:     common.HexToAddress("0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"),
			URL:        "https://app.uniswap.org/positions",
			SubgraphID: "A3Np3RQbaBA6oKJgiwDJeo5T3zrYfGHPWFYayMwtNDum",
		},
		{
			Name:       "SushiSwap",
			Factory:    common.HexToAddress("0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac"),
			Router:     common.HexToAddress("0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F"),
			URL:        "https://www.sushi.com/pool",
			SubgraphID: "6NUtT5mGjZ1tSshKLf5Q3uEEJtjBZJo1TpL5MXsUBqrT",
		},
	},
	42161: {
		{
			Name:       "Uniswap",
			Factory:    common.HexToAddress("0xf1D7CC64Fb4452F05c498126312eBE29f30Fbcf9"),
			Router:     common.HexToAddress("0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24"),
			URL:        "https://app.uniswap.org/positions",
			SubgraphID: "EYCKATKGBKLWvSfwvBjzfCBmGwYNdVkduYXVivCsLRFu",
		},
		{
			Name:       "SushiSwap",
			Factory:    common.HexToAddress("0xc35DADB65012eC5796536bD9864eD8773aBc74C4"),
			Router:     common.HexToAddress("0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506"),
			URL:        "https://www.sushi.com/pool",
			SubgraphID: "8nFDCAhdnJQEhQF3ZRnfWkJ6FkRsfAiiVabVn4eGoAZH",
		},
		{
			Name:       "Camelot",
			Factory:    common.HexToAddress("0x6EcCab422D763aC031210895C81787E87B43A652"),
			Router:     common.HexToAddress("0xc873fEcbd354f5A56E00E710B90EF4201db2448d"),
			URL:        "https://app.camelot.exchange/liquidity",
			SubgraphID: "",
		},
	},
	10: {
		{
			Name:       "Uniswap",
			Factory:    common.HexToAddress("0x0c3c1c532F1e39EdF36BE9Fe0bE1410313E074Bf"),
			Router:     common.HexToAddress("0x4A7b5Da61326A6379179b40d00F57E5bbDC962c2"),
			URL:        "https://app.uniswap.org/positions",
			SubgraphID: "",
		},
		{
			Name:       "Velodrome",
			Factory:    common.HexToAddress("0x25CbdDb98b35ab1FF77413456B31EC81A6B6B746"),
			Router:     common.HexToAddress("0x9c12939390052919aF3155f41Bf4160Fd3666A6f"),
			URL:        "https://velodrome.finance/liquidity",
			SubgraphID: "",
		},
	},
	137: {
		{
			Name:       "Uniswap",
			Factory:    common.HexToAddress("0x9e5A52f57b3038F1B8EeE45F28b3C1967e22799C"),
			Router:     common.HexToAddress("0xedf6066a2b290C185783862C7F4776A2C8077AD1"),
			URL:        "https://app.uniswap.org/positions",
			SubgraphID: "",
		},
		{
			Name:       "QuickSwap",
			Factory:    common.HexToAddress("0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32"),
			Router:     common.HexToAddress("0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff"),
			URL:        "https://quickswap.exchange/#/pools",
			SubgraphID: "FqsRcH1XqSjqVx9GRTvEJe959aCbKrcyGgDWBrUkG24g",
		},
		{
			Name:       "SushiSwap",
			Factory:    common.HexToAddress("0xc35DADB65012eC5796536bD9864eD8773aBc74C4"),
			Router:     common.HexToAddress("0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506"),
			URL:        "https://www.sushi.com/pool",
			SubgraphID: "8obLTNcEuGMqkTMFpoNnqNzwRzNvM7o7L1rHo2RDkPCN",
		},
	},
	56: {
		{
			Name:       "PancakeSwap",
			Factory:    common.HexToAddress("0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73"),
			Router:     common.HexToAddress("0x10ED43C718714eb63d5aA57B78B54704E256024E"),
			URL:        "https://pancakeswap.finance/liquidity",
			SubgraphID: "EsL7geTRcA3LaLLM9EcMFzYbUgnvf8RixoEEGErrodB3",
		},
		{
			Name:       "SushiSwap",
			Factory:    common.HexToAddress("0xc35DADB65012eC5796536bD9864eD8773aBc74C4"),
			Router:     common.HexToAddress("0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506"),
			URL:        "https://www.sushi.com/pool",
			SubgraphID: "",
		},
	},
	8453: {
		{
			Name:       "Uniswap",
			Factory:    common.HexToAddress("0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6"),
			Router:     common.HexToAddress("0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24"),
			URL:        "https://app.uniswap.org/positions",
			SubgraphID: "",
		},
		{
			Name:       "PancakeSwap",
			Factory:    common.HexToAddress("0x02a84c1b3BBD7401a5f7fa98a384EBC70bB5749E"),
			Router:     common.HexToAddress("0x8cFe327CEc66d1C090Dd72bd0FF11d690C33a2Eb"),
			URL:        "https://pancakeswap.finance/liquidity",
			SubgraphID: "2NjL7L4CmQaGJSacM43ofmH6ARf6gJoBeBaJtz9eWAQ9",
		},
		{
			Name:       "Aerodrome",
			Factory:    common.HexToAddress("0x420DD381b31aEf6683db6B902084cB0FFECe40Da"),
			Router:     common.HexToAddress("0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43"),
			URL:        "https://aerodrome.finance/liquidity",
			SubgraphID: "",
		},
		{
			Name:       "SushiSwap",
			Factory:    common.HexToAddress("0x71524B4f93c58fcbF659783284E38825f0622859"),
			Router:     common.HexToAddress("0x6BDED42c6DA8FBf0d2bA55B2fa120C5e0c8D7891"),
			URL:        "https://www.sushi.com/pool",
			SubgraphID: "",
		},
	},
	43114: {
		{
			Name:       "TraderJoe",
			Factory:    common.HexToAddress("0x9Ad6C38BE94206cA50bb0d90783181c47F58c0a8"),
			Router:     common.HexToAddress("0x60aE616a2155Ee3d9A68541Ba4544862310933d4"),
			URL:        "https://traderjoexyz.com/avalanche/pool",
			SubgraphID: "5Mw8qH6fRMCRxYXee7NqLh9FP5i5TMT5GFjFaHZMgxkF",
		},
		{
			Name:       "SushiSwap",
			Factory:    common.HexToAddress("0xc35DADB65012eC5796536bD9864eD8773aBc74C4"),
			Router:     common.HexToAddress("0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506"),
			URL:        "https://www.sushi.com/pool",
			SubgraphID: "6nDfs3qv13SvhCr1PUD8M6hrWQ88xEQAvMGJNyucC4aq",
		},
	},
	369: {
		{
			Name:       "PulseX V1",
			Factory:    common.HexToAddress("0x1715a3E4A142d8b698131108995174F37aEBA10D"),
			Router:     common.HexToAddress("0x98bf93ebf5c380C0e6Ae8e192A7e2AE08edAcc02"),
			URL:        "https://app.pulsex.com/liquidity",
			SubgraphID: "https://graph.pulsechain.com/subgraphs/name/pulsechain/pulsex",
		},
		{
			Name:       "PulseX V2",
			Factory:    common.HexToAddress("0x29eA7545DEf87022BAdc76323F373EA1e707C523"),
			Router:     common.HexToAddress("0x165C3410fC91EF562C50559f7d2289fEbed552d9"),
			URL:        "https://app.pulsex.com/liquidity",
			SubgraphID: "https://graph.pulsechain.com/subgraphs/name/pulsechain/pulsexv2",
		},
		{
			Name:       "9mm V2",
			Factory:    common.HexToAddress("0x3a0Fa7884dD93f3cd234bBE2A0958Ef04b05E13b"),
			Router:     common.HexToAddress("0xcC73b59F8D6e5b0DE5bBf5eA186e5F0C888b4208"),
			URL:        "https://swap.9mm.pro",
			SubgraphID: "https://info-api.9mm.pro/subgraphs/name/pulsechain/9mm",
		},
	},
	250: {
		{
			Name:       "SpookySwap",
			Factory:    common.HexToAddress("0x152eE697f2E276fA89E96742e9bB9aB1F2E61bE3"),
			Router:     common.HexToAddress("0xF491e7B69E4244ad4002BC14e878a34207E38c29"),
			URL:        "https://spooky.fi/#/pools",
			SubgraphID: "2VaKGu3kDewSd3mBmhAJcBA1snJnWPnS3v8wpACz3tLM",
		},
		{
			Name:       "SushiSwap",
			Factory:    common.HexToAddress("0xc35DADB65012eC5796536bD9864eD8773aBc74C4"),
			Router:     common.HexToAddress("0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506"),
			URL:        "https://www.sushi.com/pool",
			SubgraphID: "3nozHgmPEDLRSgLPKfVD9XKdrajkumuhfE4Cb8Q6GLMK",
		},
	},
}

SubgraphID can be either: - A subgraph ID (combined with Config.TheGraphGateway at runtime) - A full URL starting with "http" (used as-is, e.g., for PulseChain's own Graph)

Get your API key at https://thegraph.com/studio/apikeys/

NOTE: Only subgraphs with "liquidityPositions" entity support discovery. PancakeSwap and some other DEXes use a different schema without user position tracking.

View Source
var PrefedinedLP_V3 = map[int]([]PD_V3){
	1: {
		{
			Name:    "Uniswap",
			Address: common.HexToAddress("0xC36442b4a4522E871399CD717aBDD847Ab11FE88"),
			URL:     "https://app.uniswap.org/positions",
		},
		{
			Name:    "PancakeSwap",
			Address: common.HexToAddress("0x46A15B0b27311cedF172AB29E4f4766fbE7F4364"),
			URL:     "https://pancakeswap.finance/liquidity",
		},
		{
			Name:    "SushiSwap",
			Address: common.HexToAddress("0x2214A42d8e2A1d20635c2cb0664422c528B6A432"),
			URL:     "https://www.sushi.com/pool",
		},
	},
	42161: {
		{
			Name:    "Uniswap",
			Address: common.HexToAddress("0xC36442b4a4522E871399CD717aBDD847Ab11FE88"),
			URL:     "https://app.uniswap.org/positions",
		},
		{
			Name:    "PancakeSwap",
			Address: common.HexToAddress("0x46A15B0b27311cedF172AB29E4f4766fbE7F4364"),
			URL:     "https://pancakeswap.finance/liquidity",
		},
		{
			Name:    "SushiSwap",
			Address: common.HexToAddress("0x2214A42d8e2A1d20635c2cb0664422c528B6A432"),
			URL:     "https://www.sushi.com/pool",
		},
		{
			Name:    "Camelot",
			Address: common.HexToAddress("0x00c7f3082833e796A5b3e4Bd59f6642FF44DCD15"),
			URL:     "https://app.camelot.exchange/liquidity",
		},
	},
	10: {
		{
			Name:    "Uniswap",
			Address: common.HexToAddress("0xC36442b4a4522E871399CD717aBDD847Ab11FE88"),
			URL:     "https://app.uniswap.org/positions",
		},
		{
			Name:    "Velodrome",
			Address: common.HexToAddress("0x416b433906b1B72FA758e166e239c43d68dC6F29"),
			URL:     "https://velodrome.finance/liquidity",
		},
	},
	137: {
		{
			Name:    "Uniswap",
			Address: common.HexToAddress("0xC36442b4a4522E871399CD717aBDD847Ab11FE88"),
			URL:     "https://app.uniswap.org/positions",
		},
		{
			Name:    "QuickSwap",
			Address: common.HexToAddress("0x8eF88E4c7CfbbaC1C163f7eddd4B578792201de6"),
			URL:     "https://quickswap.exchange/#/pools",
		},
		{
			Name:    "SushiSwap",
			Address: common.HexToAddress("0x2214A42d8e2A1d20635c2cb0664422c528B6A432"),
			URL:     "https://www.sushi.com/pool",
		},
	},
	56: {
		{
			Name:    "PancakeSwap",
			Address: common.HexToAddress("0x46A15B0b27311cedF172AB29E4f4766fbE7F4364"),
			URL:     "https://pancakeswap.finance/liquidity",
		},
		{
			Name:    "Uniswap",
			Address: common.HexToAddress("0x7b8A01B39D58278b5DE7e48c8449c9f4F5170613"),
			URL:     "https://app.uniswap.org/positions",
		},
		{
			Name:    "SushiSwap",
			Address: common.HexToAddress("0x2214A42d8e2A1d20635c2cb0664422c528B6A432"),
			URL:     "https://www.sushi.com/pool",
		},
	},
	8453: {
		{
			Name:    "Uniswap",
			Address: common.HexToAddress("0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1"),
			URL:     "https://app.uniswap.org/positions",
		},
		{
			Name:    "Aerodrome",
			Address: common.HexToAddress("0x827922686190790b37229fd06084350E74485b72"),
			URL:     "https://aerodrome.finance/liquidity",
		},
		{
			Name:    "SushiSwap",
			Address: common.HexToAddress("0x80C7DD17B01855a6D2347444a0FCC36136a314de"),
			URL:     "https://www.sushi.com/pool",
		},
		{
			Name:    "PancakeSwap",
			Address: common.HexToAddress("0x46A15B0b27311cedF172AB29E4f4766fbE7F4364"),
			URL:     "https://pancakeswap.finance/liquidity",
		},
	},
	43114: {
		{
			Name:    "Uniswap",
			Address: common.HexToAddress("0x655C406EBFa14EE2006250925e54ec43AD184f8B"),
			URL:     "https://app.uniswap.org/positions",
		},
		{
			Name:    "TraderJoe",
			Address: common.HexToAddress("0x7BFd7192E76D950832c77BB412aaE841049D8D9B"),
			URL:     "https://traderjoexyz.com/avalanche/pool",
		},
		{
			Name:    "SushiSwap",
			Address: common.HexToAddress("0x2214A42d8e2A1d20635c2cb0664422c528B6A432"),
			URL:     "https://www.sushi.com/pool",
		},
	},
	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",
		},
		{
			Name:    "PulseX",
			Address: common.HexToAddress("0x1a6c311a6d865dc3f35fea3e74d8c2f032ee7aa2"),
			URL:     "https://app.pulsex.com/liquidity",
		},
	},
	324: {
		{
			Name:    "PancakeSwap",
			Address: common.HexToAddress("0xa815e2eD7f7d5B0c49fda367F249232a1B9D2883"),
			URL:     "https://pancakeswap.finance/liquidity",
		},
		{
			Name:    "SyncSwap",
			Address: common.HexToAddress("0x8f5E695569D47F86E3229B2b41cf8e64E5Ddb5b5"),
			URL:     "https://syncswap.xyz/pools",
		},
	},
	250: {
		{
			Name:    "SpookySwap",
			Address: common.HexToAddress("0x89f9F823A234E71A3C92bb66cf7c2bc2e9B69092"),
			URL:     "https://spooky.fi/#/pools",
		},
		{
			Name:    "SushiSwap",
			Address: common.HexToAddress("0x2214A42d8e2A1d20635c2cb0664422c528B6A432"),
			URL:     "https://www.sushi.com/pool",
		},
	},
	59144: {
		{
			Name:    "PancakeSwap",
			Address: common.HexToAddress("0x46A15B0b27311cedF172AB29E4f4766fbE7F4364"),
			URL:     "https://pancakeswap.finance/liquidity",
		},
		{
			Name:    "Lynex",
			Address: common.HexToAddress("0xAB5ed8c81B65b6Bd2bC5F2DF4b59d81d6b6e5e9a"),
			URL:     "https://app.lynex.fi/liquidity",
		},
	},
	534352: {
		{
			Name:    "Uniswap",
			Address: common.HexToAddress("0xB39002E4033b162fAc607fc3471E205FA2aE5967"),
			URL:     "https://app.uniswap.org/positions",
		},
		{
			Name:    "SushiSwap",
			Address: common.HexToAddress("0x80C7DD17B01855a6D2347444a0FCC36136a314de"),
			URL:     "https://www.sushi.com/pool",
		},
	},
	81457: {
		{
			Name:    "Thruster",
			Address: common.HexToAddress("0x434575EaEa081b735C985FA9bf63CD7b87e227F9"),
			URL:     "https://app.thruster.finance/liquidity",
		},
		{
			Name:    "SushiSwap",
			Address: common.HexToAddress("0x80C7DD17B01855a6D2347444a0FCC36136a314de"),
			URL:     "https://www.sushi.com/pool",
		},
	},
}
View Source
var PrefedinedLP_V4 = map[int]([]PD_V4){
	1: {
		{
			Name:            "Uniswap",
			ProviderAddress: common.HexToAddress("0xbD216513d74C8cf14cf4747E6AaA6420FF64ee9e"),
			PoolManager:     common.HexToAddress("0x000000000004444c5dc75cb358380d2e3de08a90"),
			StateView:       common.HexToAddress("0x7ffe42c4a5deea5b0fec41c94c136cf115597227"),
			URL:             "https://app.uniswap.org/positions",
			SubgraphURL:     "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/DiYPVdygkfjDWhbxGSqAQxwBKmfKnkWQojqeM2rkLb3G",
		},
	},
	42161: {
		{
			Name:            "Uniswap",
			ProviderAddress: common.HexToAddress("0xd88F38F930b7952f2DB2432Cb002E7abbF3dD869"),
			PoolManager:     common.HexToAddress("0x360E68faCcca8cA495c1B759Fd9EEe466db9FB32"),
			StateView:       common.HexToAddress("0x76fd297e2d437cd7f76d50f01afe6160f86e9990"),
			URL:             "https://app.uniswap.org/positions",
			SubgraphURL:     "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/GUWTydadTY23DvLudPv7MRhQkooMmSjpJ1tvcr9Lgkgq",
		},
	},
	10: {
		{
			Name:            "Uniswap",
			ProviderAddress: common.HexToAddress("0x3C3Ea4B57a46241e54610e5f022E5c45859A1017"),
			PoolManager:     common.HexToAddress("0x9a13F98Cb987694C9F086b1F5eB990EeA8264Ec3"),
			StateView:       common.HexToAddress("0xc18a3169788f4f75a170290584eca6395c75ecdb"),
			URL:             "https://app.uniswap.org/positions",
			SubgraphURL:     "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/5pSBzyD1GBFmqSBjLrDGMWPVYwEv2BNswsGvLxWEWNfR",
		},
	},
	137: {
		{
			Name:            "Uniswap",
			ProviderAddress: common.HexToAddress("0x1Ec2eBf4F37E7363FDfe3f0E37A14CE0Ff938447"),
			PoolManager:     common.HexToAddress("0x67366782805870060151383F4BbFF9daB53e5cD6"),
			StateView:       common.HexToAddress("0x5ea1bd7974c8a611cbab0bdcafcb1d9cc9b3ba5a"),
			URL:             "https://app.uniswap.org/positions",
			SubgraphURL:     "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/6NMLgPeuGdWk9pxHEwnUJK2xrMVuGYFWm2i4eWMSDGWC",
		},
	},
	56: {
		{
			Name:            "Uniswap",
			ProviderAddress: common.HexToAddress("0x7A4a5c919aE2541AeD11041A1AEeE68f1287f95b"),
			PoolManager:     common.HexToAddress("0x28e2Ea090877bF75740558f6BFB36A5ffeE9e9dF"),
			StateView:       common.HexToAddress("0xd13dd3d6e93f276fafc9db9e6bb47c1180aee0c4"),
			URL:             "https://app.uniswap.org/positions",
			SubgraphURL:     "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/3HfqCn5cpVG5FLQ6JpVhDvnSJPqRu95KCJwqsKMgAt7X",
		},
	},
	8453: {
		{
			Name:            "Uniswap",
			ProviderAddress: common.HexToAddress("0x7C5f5A4bBd8fD63184577525326123B519429bDc"),
			PoolManager:     common.HexToAddress("0x498581fF718922c3f8e6A244956aF099B2652b2b"),
			StateView:       common.HexToAddress("0xa3c0c9b65bad0b08107aa264b0f3db444b867a71"),
			URL:             "https://app.uniswap.org/positions",
			SubgraphURL:     "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/GCZR3WReDkPmZSqkPWupSNTsssZSJqvHmCApPc4GqsxU",
		},
	},
	43114: {
		{
			Name:            "Uniswap",
			ProviderAddress: common.HexToAddress("0xb3CD9b4CF08b107ae6f3F6C9fD7Fb7bb7c2fA0E6"),
			PoolManager:     common.HexToAddress("0x06380C0e0912312B5150364B9DC4542BA0DbBc85"),
			StateView:       common.HexToAddress("0xc3c9e198c735a4b97e3e683f391ccbdd60b69286"),
			URL:             "https://app.uniswap.org/positions",
			SubgraphURL:     "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/6GeeX9tBAquHtSm4So2pXXNmjuQJbm3HiLLsE6dKi4UD",
		},
	},
	324: {
		{
			Name:            "Uniswap",
			ProviderAddress: common.HexToAddress("0x9a13F98Cb987694C9F086b1F5eB990EeA8264Ec3"),
			PoolManager:     common.HexToAddress("0x9a89c8E57D0fC74E55926289120B7B8A248D99f7"),
			StateView:       common.HexToAddress("0x0000000000000000000000000000000000000000"),
			URL:             "https://app.uniswap.org/positions",
			SubgraphURL:     "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/4HRo4yiNyAWr1p3r6QfLB4K14cMDbR4JjmGUU5g4Y6xK",
		},
	},
	81457: {
		{
			Name:            "Uniswap",
			ProviderAddress: common.HexToAddress("0x4eE8DDd4f5697E5a7805Bebd5e4Cc118Cae9A903"),
			PoolManager:     common.HexToAddress("0x1631559198A9e474033433b2958daBC135ab6446"),
			StateView:       common.HexToAddress("0x12a88ae16f46dce4e8b15368008ab3380885df30"),
			URL:             "https://app.uniswap.org/positions",
			SubgraphURL:     "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/Bc94BthHCL8qKsxfPcAuFGDMBwB6f5NcXkLhNq8sLJar",
		},
	},
	7777777: {
		{
			Name:            "Uniswap",
			ProviderAddress: common.HexToAddress("0x4eE8DDd4f5697E5a7805Bebd5e4Cc118Cae9A903"),
			PoolManager:     common.HexToAddress("0x0575338e4C17006aE181B47900A84404247CA30f"),
			StateView:       common.HexToAddress("0x385785af07d63b50d0a0ea57c4ff89d06adf7328"),
			URL:             "https://app.uniswap.org/positions",
			SubgraphURL:     "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/BcrwnLuDhD7ny2BmWxLUGvEf1H4SgSBMEkPm5HJm9wMU",
		},
	},
	480: {
		{
			Name:            "Uniswap",
			ProviderAddress: common.HexToAddress("0x4eE8DDd4f5697E5a7805Bebd5e4Cc118Cae9A903"),
			PoolManager:     common.HexToAddress("0xb1860D529182ac3BC1F51Fa2ABd56662b7D13f33"),
			StateView:       common.HexToAddress("0x51d394718bc09297262e368c1a481217fdeb71eb"),
			URL:             "https://app.uniswap.org/positions",
			SubgraphURL:     "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/28xHHc4JPBrWRFxAdx1vAAXivUBuPdnUisCb8YjLBmvK",
		},
	},
	143: {
		{
			Name:            "Uniswap",
			ProviderAddress: common.HexToAddress("0x5b7ec4a94ff9bedb700fb82ab09d5846972f4016"),
			PoolManager:     common.HexToAddress("0x188d586ddcf52439676ca21a244753fa19f9ea8e"),
			StateView:       common.HexToAddress("0x77395f3b2e73ae90843717371294fa97cc419d64"),
			URL:             "https://app.uniswap.org/positions",
			SubgraphURL:     "",
		},
	},
}
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 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 AddFixedAddressShortLink(v *gocui.View, a common.Address, width int)
func AddFixedDollarLink(v *gocui.View, val float64, width int)
func AddFixedDollarValueLink(v *gocui.View, val *big.Int, t *Token, width int)
func AddFixedValueLink(v *gocui.View, val *big.Int, t *Token, width int)
func AddValueLink(v *gocui.View, val *big.Int, t *Token)
func AddValueSymbolLink(v *gocui.View, val *big.Int, t *Token)

func AddressFromAny

func AddressFromAny(value any) common.Address

func Amount2Str

func Amount2Str(amount *big.Int, decimals int) string

func BackupList

func BackupList() []string

func BigIntFromAny

func BigIntFromAny(value any) *big.Int

func ConfirmEIP712Template

func ConfirmEIP712Template(data apitypes.TypedData, confirmed bool) string

func Contains

func Contains(s string, subststr string) bool

func Create

func Create(name, pass string) error

func Exists

func Exists(name string) bool

func FixedWidth

func FixedWidth(s string, width int) string

FixedWidth returns a string padded/truncated to exactly width characters

func Float

func Float(value *big.Int, decimals int) *big.Float

func Float64

func Float64(value *big.Int, decimals int) float64

func FmtAmount

func FmtAmount(amount *big.Int, decimals int, fixed bool) string

func FmtFloat64

func FmtFloat64(v float64, fixed bool) string

func FmtFloat64D

func FmtFloat64D(v float64, fixed bool) string

func FmtFloat64DN

func FmtFloat64DN(num float64) string

Normal format with 4 decimal places

func FormatFloatWithCommas

func FormatFloatWithCommas(num float64) string

func FormatUInt64

func FormatUInt64(v uint64, fixed bool) string

func GetDataFolder

func GetDataFolder() (string, error)

func GetHostName

func GetHostName(URL string) string

func InitConfig

func InitConfig()

func IntFromAny

func IntFromAny(value any) int

func IsContractDownloaded

func IsContractDownloaded(a common.Address) bool

func IsInArray

func IsInArray(slice []string, item string) bool

func Open

func Open(name string, pass string) error

func OpenBrowser

func OpenBrowser(url string) error

func RestoreConfig

func RestoreConfig(path string) error

func SaveConfig

func SaveConfig() error

func SaveToFile

func SaveToFile(w *Wallet, file, pass string) error

func ShortAddress

func ShortAddress(a common.Address) string

func Split3

func Split3(input string) []string

Split3 splits the input string into a slice of strings. Guarantees that the result has at least 3 elements.

func SplitN

func SplitN(input string, n int) []string

Split splits the input string into a slice of strings. Guarantees that the result has at least n elements.

func Str2Wei

func Str2Wei(str string, decimals int) (*big.Int, error)

convert string to the "weis" value

func SystemCommand

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 TagFixedDollarLink(val float64, width int) string
func TagFixedValueLink(val *big.Int, t *Token, width int) 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 Truncate

func Truncate(s string, maxLen int) string

Truncate truncates a string to maxLen characters, adding ellipsis if truncated

func Uint256FromHex

func Uint256FromHex(hex string) *big.Int

func WalletList

func WalletList() []string

Types

type Address

type Address struct {
	Name    string         `json:"name"`
	Tag     string         `json:"tag"`
	Address common.Address `json:"address"`
	Signer  string         `json:"signer"`
	Path    string         `json:"path"`
}

type Blockchain

type Blockchain struct {
	Name             string         `json:"name"`
	ShortName        string         `json:"short_name"` // 4 chars max, for display in LP listings
	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"`
	RPCRateLimit     int            `json:"rpc_rate_limit,omitempty"` // RPC calls per second (auto-tuned or fixed)
	RPCRateAuto      bool           `json:"rpc_rate_auto,omitempty"`  // true = auto-tune rate, false = use fixed rate
}
func (b *Blockchain) ExplorerLink(address common.Address) string

func (*Blockchain) GetShortName

func (b *Blockchain) GetShortName() string

GetShortName returns ShortName if set, otherwise falls back to Currency

type Contract

type Contract struct {
	Name    string `json:"name"`
	Trusted bool   `json:"trusted"`
}

type LP_V2

type LP_V2 struct {
	Name       string         `json:"name"`
	Factory    common.Address `json:"factory"` // Factory contract address
	Router     common.Address `json:"router"`  // Router contract address
	ChainId    int            `json:"chain_id"`
	URL        string         `json:"url"`         // Web UI URL
	SubgraphID string         `json:"subgraph_id"` // The Graph subgraph ID for discovery
}

type LP_V2_Position

type LP_V2_Position struct {
	Owner   common.Address `json:"owner"`
	ChainId int            `json:"chain_id"`
	Factory common.Address `json:"factory"`
	Pair    common.Address `json:"pair"` // LP token / pair contract address
	Token0  common.Address `json:"token0"`
	Token1  common.Address `json:"token1"`
}

type LP_V3

type LP_V3 struct {
	Name     string         `json:"name"`
	Provider common.Address `json:"provider"`
	ChainId  int            `json:"chain_id"`
	URL      string         `json:"url"`
}

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 LP_V4

type LP_V4 struct {
	Name        string         `json:"name"`
	Provider    common.Address `json:"provider"`     // PositionManager contract
	PoolManager common.Address `json:"pool_manager"` // Singleton PoolManager
	StateView   common.Address `json:"state_view"`   // StateView contract for reading pool state
	ChainId     int            `json:"chain_id"`
	URL         string         `json:"url"`          // Web UI URL
	SubgraphURL string         `json:"subgraph_url"` // Subgraph API URL for discovery
}

type LP_V4_Position

type LP_V4_Position struct {
	Owner       common.Address `json:"owner"`
	ChainId     int            `json:"chain_id"`
	Provider    common.Address `json:"provider"`
	PoolManager common.Address `json:"pool_manager"`
	NFT_Token   *big.Int       `json:"nft_token"`
	PoolId      [32]byte       `json:"pool_id"`
	Currency0   common.Address `json:"currency0"`
	Currency1   common.Address `json:"currency1"`
	Fee         int64          `json:"fee"`
	TickSpacing int64          `json:"tick_spacing"`
	TickLower   int64          `json:"tick_lower"`
	TickUpper   int64          `json:"tick_upper"`
	Liquidity   *big.Int       `json:"liquidity"`
	HookAddress common.Address `json:"hook_address"`
}

type Origin

type Origin struct {
	URL       string           `json:"url"`
	ChainId   int              `json:"chain_id"`
	Addresses []common.Address `json:"addresses"`
}

func (*Origin) IsAllowed

func (o *Origin) IsAllowed(a common.Address) bool

func (*Origin) ShortName

func (o *Origin) ShortName() string

type PD_V2

type PD_V2 struct {
	Name       string
	Factory    common.Address
	Router     common.Address
	URL        string
	SubgraphID string // The Graph subgraph ID or full URL (if starts with http)
}

type PD_V3

type PD_V3 struct {
	Name    string
	Address common.Address
	URL     string
}

type PD_V4

type PD_V4 struct {
	Name            string
	ProviderAddress common.Address // PositionManager
	PoolManager     common.Address // Singleton PoolManager
	StateView       common.Address // StateView contract for reading pool state
	URL             string
	SubgraphURL     string
}

type SConfig

type SConfig struct {
	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
	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
	TheGraphAPIKey    string        `yaml:"thegraph_api_key"`    // The Graph API key for subgraph queries
	TheGraphGateway   string        `yaml:"thegraph_gateway"`    // The Graph gateway URL (default: https://gateway.thegraph.com/api/{api-key}/subgraphs/id/)
	MinTokenValue     float64       `yaml:"min_token_value"`     // minimum USD value to show token in tokens pane
	WSEnabled         bool          `yaml:"ws_enabled"`          // enable WebSocket server for browser communication
}
var Config *SConfig = &SConfig{
	Verbosity:         "debug",
	Theme:             "dark",
	BusTimeout:        3 * time.Minute,
	BusHardTimeout:    5 * time.Minute,
	PriceUpdatePeriod: "15m",
	Editor:            "code",
	TheGraphGateway:   "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/",
	MinTokenValue:     1,
	WSEnabled:         true,
}

type SignedDataInfo

type SignedDataInfo struct {
	Type       string
	Blockchain *Blockchain
	Token      *Token
	Value      *big.Int
	Address    *Address
}

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

func (s *Signer) GetAllCopies() []string

type Staking

type Staking struct {
	Name         string         `json:"name"`
	ChainId      int            `json:"chain_id"`
	Contract     common.Address `json:"contract"`      // Staking contract address
	URL          string         `json:"url"`           // Provider website URL
	StakedToken  common.Address `json:"staked_token"`  // Token being staked
	BalanceFunc  string         `json:"balance_func"`  // Function name to get staked balance (e.g., "balanceOf", "stakedAmount")
	Reward1Token common.Address `json:"reward1_token"` // First reward token address
	Reward1Func  string         `json:"reward1_func"`  // First reward pending function (e.g., "earned")
	Reward2Token common.Address `json:"reward2_token"` // Second reward token address (optional)
	Reward2Func  string         `json:"reward2_func"`  // Second reward pending function (optional)
	ValidatorId  uint64         `json:"validator_id"`  // Validator ID for native staking (e.g., Monad)
	Hardcoded    bool           `json:"hardcoded"`     // If true, uses custom logic (cannot be configured, only deleted)
}

Staking represents a staking contract configuration

type StakingPosition

type StakingPosition struct {
	Owner        common.Address `json:"owner"`
	ChainId      int            `json:"chain_id"`
	Contract     common.Address `json:"contract"`      // Reference to the staking contract
	ValidatorId  uint64         `json:"validator_id"`  // Validator ID for native staking (e.g., Monad)
	VaultAddress common.Address `json:"vault_address"` // User's vault address for vault-based staking (e.g., Aztec)
}

StakingPosition represents a user's position in a staking contract

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
	Ignored        bool           `json:"ignored,omitempty"`
	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) Float64

func (t *Token) Float64(value *big.Int) float64

func (*Token) FmtValue64D

func (t *Token) FmtValue64D(v float64, fixed bool) string

func (*Token) GetPrintName

func (t *Token) GetPrintName() string

func (*Token) Str2Wei

func (t *Token) Str2Wei(str string) (*big.Int, error)

convert string to the "weis" value

func (*Token) Value2Str

func (t *Token) Value2Str(value *big.Int) string

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_V2_Providers  []*LP_V2           `json:"lp_v2_providers"`
	LP_V2_Positions  []*LP_V2_Position  `json:"lp_v2_positions"`
	LP_V3_Providers  []*LP_V3           `json:"lp_v3_providers"`
	LP_V3_Positions  []*LP_V3_Position  `json:"lp_v3_positions"`
	LP_V4_Providers  []*LP_V4           `json:"lp_v4_providers"`
	LP_V4_Positions  []*LP_V4_Position  `json:"lp_v4_positions"`
	Stakings         []*Staking         `json:"stakings"`
	StakingPositions []*StakingPosition `json:"staking_positions"`
	Contracts        map[common.Address]*Contract
	AppsPaneOn       bool `json:"apps_pane_on"`
	LP_V2PaneOn      bool `json:"lp_v2_pane_on"`
	LP_V3PaneOn      bool `json:"lp_v3_pane_on"`
	LP_V4PaneOn      bool `json:"lp_v4_pane_on"`
	TokenPaneOn      bool `json:"token_pane_on"`
	StakingPaneOn    bool `json:"staking_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 OpenFromFile

func OpenFromFile(filePath string, pass string) (*Wallet, error)

OpenFromFile opens a wallet from a specific file path (used for restore)

func (*Wallet) AddBlockchain

func (w *Wallet) AddBlockchain(b *Blockchain) error

func (*Wallet) AddLP_V2

func (w *Wallet) AddLP_V2(lp *LP_V2) error

func (*Wallet) AddLP_V2Position

func (w *Wallet) AddLP_V2Position(lp *LP_V2_Position) error

func (*Wallet) AddLP_V3

func (w *Wallet) AddLP_V3(lp *LP_V3) error

func (*Wallet) AddLP_V3Position

func (w *Wallet) AddLP_V3Position(lp *LP_V3_Position) error

func (*Wallet) AddLP_V4

func (w *Wallet) AddLP_V4(lp *LP_V4) error

func (*Wallet) AddLP_V4Position

func (w *Wallet) AddLP_V4Position(lp *LP_V4_Position) error

func (*Wallet) AddOrigin

func (w *Wallet) AddOrigin(o *Origin) error

func (*Wallet) AddOriginAddress

func (w *Wallet) AddOriginAddress(url string, a string) error

func (*Wallet) AddStaking

func (w *Wallet) AddStaking(s *Staking) error

func (*Wallet) AddStakingPosition

func (w *Wallet) AddStakingPosition(pos *StakingPosition) error

func (*Wallet) AddToken

func (w *Wallet) AddToken(chain int, a common.Address, n string, s string, d int) error

func (*Wallet) ChangePassword

func (w *Wallet) ChangePassword(newPass string) error

ChangePassword changes the wallet password and re-saves the wallet

func (*Wallet) DeleteBlockchain

func (w *Wallet) DeleteBlockchain(name string) error

func (*Wallet) DeleteToken

func (w *Wallet) DeleteToken(chain int, a common.Address) error

func (*Wallet) EditBlockchain

func (w *Wallet) EditBlockchain(ub *Blockchain) error

func (*Wallet) GetAddress

func (w *Wallet) GetAddress(a any) *Address

func (*Wallet) GetAddressByName

func (w *Wallet) GetAddressByName(n string) *Address

func (*Wallet) GetBlockchain

func (w *Wallet) GetBlockchain(id int) *Blockchain

func (*Wallet) GetBlockchainByName

func (w *Wallet) GetBlockchainByName(n string) *Blockchain

func (*Wallet) GetContract

func (w *Wallet) GetContract(a common.Address) *Contract

func (*Wallet) GetFilePath

func (w *Wallet) GetFilePath() string

func (*Wallet) GetLP_V2

func (w *Wallet) GetLP_V2(chainId int, factory common.Address) *LP_V2

func (*Wallet) GetLP_V2Position

func (w *Wallet) GetLP_V2Position(chainId int, factory common.Address, pair common.Address) *LP_V2_Position

func (*Wallet) GetLP_V2_by_name

func (w *Wallet) GetLP_V2_by_name(chainId int, name string) *LP_V2

func (*Wallet) GetLP_V3

func (w *Wallet) GetLP_V3(chainId int, addr common.Address) *LP_V3

func (*Wallet) GetLP_V3Position

func (w *Wallet) GetLP_V3Position(chainId int, provider common.Address, nft *big.Int) *LP_V3_Position

func (*Wallet) GetLP_V3_by_name

func (w *Wallet) GetLP_V3_by_name(chainId int, name string) *LP_V3

func (*Wallet) GetLP_V4

func (w *Wallet) GetLP_V4(chainId int, addr common.Address) *LP_V4

func (*Wallet) GetLP_V4Position

func (w *Wallet) GetLP_V4Position(chainId int, provider common.Address, nft *big.Int) *LP_V4_Position

func (*Wallet) GetLP_V4_by_name

func (w *Wallet) GetLP_V4_by_name(chainId int, name string) *LP_V4

func (*Wallet) GetNativeToken

func (w *Wallet) GetNativeToken(b *Blockchain) (*Token, error)

func (*Wallet) GetOrigin

func (w *Wallet) GetOrigin(url string) *Origin

func (*Wallet) GetSigner

func (w *Wallet) GetSigner(n string) *Signer

func (*Wallet) GetSignerWithCopies

func (w *Wallet) GetSignerWithCopies(name string) []*Signer

func (*Wallet) GetSignerWithCopyIndex

func (w *Wallet) GetSignerWithCopyIndex(name string) (*Signer, int)

func (*Wallet) GetStaking

func (w *Wallet) GetStaking(chainId int, contract common.Address) *Staking

func (*Wallet) GetStakingByName

func (w *Wallet) GetStakingByName(chainId int, name string) *Staking

func (*Wallet) GetStakingPosition

func (w *Wallet) GetStakingPosition(chainId int, contract common.Address, owner common.Address) *StakingPosition

func (*Wallet) GetStakingPositionWithValidator

func (w *Wallet) GetStakingPositionWithValidator(chainId int, contract common.Address, owner common.Address, validatorId uint64) *StakingPosition

func (*Wallet) GetToken

func (w *Wallet) GetToken(chain int, a string) *Token

func (*Wallet) GetTokenByAddress

func (w *Wallet) GetTokenByAddress(chain int, a common.Address) *Token

func (*Wallet) GetTokenBySymbol

func (w *Wallet) GetTokenBySymbol(chain int, s string) *Token

func (*Wallet) IsContractTrusted

func (w *Wallet) IsContractTrusted(addr common.Address) bool

func (*Wallet) PromoteOriginAddress

func (w *Wallet) PromoteOriginAddress(url string, a string) error

func (*Wallet) RemoveLP_V2

func (w *Wallet) RemoveLP_V2(chainId int, factory common.Address) error

func (*Wallet) RemoveLP_V2Position

func (w *Wallet) RemoveLP_V2Position(addr common.Address, chainId int, factory common.Address, pair common.Address) error

func (*Wallet) RemoveLP_V3

func (w *Wallet) RemoveLP_V3(chainId int, provider common.Address) error

func (*Wallet) RemoveLP_V3Position

func (w *Wallet) RemoveLP_V3Position(addr common.Address, chainId int, provider common.Address, nft *big.Int) error

func (*Wallet) RemoveLP_V4

func (w *Wallet) RemoveLP_V4(chainId int, provider common.Address) error

func (*Wallet) RemoveLP_V4Position

func (w *Wallet) RemoveLP_V4Position(addr common.Address, chainId int, provider common.Address, nft *big.Int) error

func (*Wallet) RemoveOrigin

func (w *Wallet) RemoveOrigin(url string) error

func (*Wallet) RemoveOriginAddress

func (w *Wallet) RemoveOriginAddress(url string, a common.Address) error

func (*Wallet) RemoveStaking

func (w *Wallet) RemoveStaking(chainId int, contract common.Address) error

func (*Wallet) RemoveStakingPosition

func (w *Wallet) RemoveStakingPosition(chainId int, contract common.Address, owner common.Address) error

func (*Wallet) RemoveStakingPositionWithValidator

func (w *Wallet) RemoveStakingPositionWithValidator(chainId int, contract common.Address, owner common.Address, validatorId uint64) error

func (*Wallet) Save

func (w *Wallet) Save() error

func (*Wallet) SetContract

func (w *Wallet) SetContract(a common.Address, c *Contract) error

func (*Wallet) SetOrigin

func (w *Wallet) SetOrigin(url string) error

func (*Wallet) SetOriginChain

func (w *Wallet) SetOriginChain(url string, ch string) error

func (*Wallet) SetParamInt

func (w *Wallet) SetParamInt(name string, val int) error

func (*Wallet) SetParamStr

func (w *Wallet) SetParamStr(name string, val string) error

func (*Wallet) TrustContract

func (w *Wallet) TrustContract(addr common.Address) error

func (*Wallet) UntrustContract

func (w *Wallet) UntrustContract(addr common.Address) error

func (*Wallet) VerifyPassword

func (w *Wallet) VerifyPassword(pass string) bool

VerifyPassword checks if the provided password matches the current wallet password

type XF

type XF struct {
	*big.Int

	NaN bool
	// contains filtered or unexported fields
}

func Add

func Add(x, y *XF) *XF

func Div

func Div(x, y *XF) *XF

func Mul

func Mul(x, y *XF) *XF

func NewXF

func NewXF(v *big.Int, decimal int) *XF

func NewXF_BigFloat

func NewXF_BigFloat(v *big.Float) *XF

func NewXF_Float64

func NewXF_Float64(v float64) *XF

func NewXF_UInt64

func NewXF_UInt64(v uint64) *XF

func ParseXF

func ParseXF(s string) (*XF, error)

func Pow10

func Pow10(N int) *XF

func Sub

func Sub(x, y *XF) *XF

func (*XF) Add

func (n *XF) Add(x *XF) *XF

func (*XF) BigInt

func (n *XF) BigInt() *big.Int

func (*XF) Div

func (n *XF) Div(x *XF) *XF

func (*XF) Dump

func (n *XF) Dump() string

func (*XF) Float64

func (n *XF) Float64() float64

func (*XF) Format

func (n *XF) Format(fixed bool, prefix string) string

func (*XF) IsZero

func (n *XF) IsZero() bool

func (*XF) Mul

func (n *XF) Mul(x *XF) *XF

func (*XF) Norm

func (n *XF) Norm() *XF

func (*XF) OrderOfMagnitude

func (n *XF) OrderOfMagnitude() int

func (*XF) String

func (n *XF) String() string

func (*XF) Sub

func (n *XF) Sub(x *XF) *XF

Jump to

Keyboard shortcuts

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