Documentation ¶
Index ¶
- Constants
- type AccountIndex
- type Address
- func (a *Address) Algorithm() Algorithm
- func (a *Address) Chain() *Chain
- func (a *Address) DerivationPath() *DerivationPath
- func (a *Address) Format() Format
- func (a *Address) Hash() string
- func (a *Address) NSS() string
- func (a *Address) NSSHash() string
- func (a *Address) SetAddressAlgorithm(aa string) error
- func (a *Address) SetAddressFormat(af string) error
- func (a *Address) SetAddressPrefix(ap string) error
- func (a *Address) SetAddressSuffix(as string) error
- func (a *Address) SetCoinType(ct string) error
- func (a *Address) SetDerivationPath(dp string) error
- func (a *Address) SetDerivationType(dt string) error
- func (a *Address) String() string
- type AddressIndex
- type Algorithm
- type Chain
- func (c *Chain) ChainId() ChainId
- func (c *Chain) CoinType() CoinType
- func (c *Chain) Key() ChainKey
- func (c *Chain) NetworkType() NetworkType
- func (c *Chain) SetChainId(chainId ChainId)
- func (c *Chain) SetCoinType(coinType CoinType)
- func (c *Chain) SetNetworkType(networkType NetworkType)
- func (c *Chain) String() string
- type ChainId
- type ChainKey
- type ChargeType
- type CoinType
- type DerivationPath
- func (dp *DerivationPath) Account() AccountIndex
- func (dp *DerivationPath) AddressIndex() AddressIndex
- func (dp *DerivationPath) Charge() ChargeType
- func (dp *DerivationPath) Coin() CoinType
- func (dp *DerivationPath) DerivationType() DerivationType
- func (dp *DerivationPath) IsHardenedAddress() bool
- func (dp *DerivationPath) ParsePath(path string) error
- func (dp *DerivationPath) String() string
- type DerivationType
- type Format
- type MHDA
- type NetworkType
Constants ¶
View Source
const ( Secp256k1 = Algorithm(`secp256k1`) Ed25519 = Algorithm(`ed25519`) Sr25519 = Algorithm(`sr25519`) // Polkadot https://wiki.polkadot.network/docs/learn-account-advanced Secp256r1 = Algorithm(`secp256r1`) // SUI https://docs.sui.io/learn/cryptography/sui-wallet-specs Secp384r1 = Algorithm(`secp384r1`) Secp521r1 = Algorithm(`secp521r1`) Prime256v1 = Algorithm(`prime256v1`) // OpenSSL HEX = Format(`hex`) P2PKH = Format(`p2pkh`) P2S4 = Format(`p2s4`) P2WPKH = Format(`p2wpkh`) Bech32 = Format(`bech32`) Base58 = Format(`base58`) SS58 = Format(`ss58`) )
View Source
const ( // btc BTC = CoinType(0) LTC = CoinType(2) DOGE = CoinType(3) // evm ETH = CoinType(60) BNB = CoinType(714) // old stype BSC = CoinType(9006) MATIC = CoinType(966) GLMR = CoinType(1284) DASH = CoinType(5) XMR = CoinType(128) ZEC = CoinType(133) ATOM = CoinType(168) TRX = CoinType(195) SOL = CoinType(501) //https://support.avax.network/en/articles/7004986-what-derivation-paths-does-avalanche-use AVAX = CoinType(9000) )
View Source
const ( ROOT = DerivationType(`root`) BIP32 = DerivationType(`bip32`) BIP44 = DerivationType(`bip44`) BIP84 = DerivationType(`bip84`) CIP11 = DerivationType(`cip11`) ZIP32 = DerivationType(`zip32`) ChargeExternal = ChargeType(0) ChargeInternal = ChargeType(1) )
View Source
const ( Bitcoin = NetworkType(`btc`) EthereumVM = NetworkType(`evm`) AvalancheVM = NetworkType(`avm`) TronVM = NetworkType(`tvm`) Cosmos = NetworkType(`cosmos`) Solana = NetworkType(`sol`) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountIndex ¶
type AccountIndex uint32
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
func NewAddress ¶
func NewAddress(chain *Chain, path *DerivationPath, params ...string) *Address
NewAddress add optional params: aa, af, ap, as
func (*Address) DerivationPath ¶
func (a *Address) DerivationPath() *DerivationPath
func (*Address) SetAddressAlgorithm ¶
func (*Address) SetAddressFormat ¶
func (*Address) SetAddressPrefix ¶
func (*Address) SetAddressSuffix ¶
func (*Address) SetCoinType ¶
func (*Address) SetDerivationPath ¶
func (*Address) SetDerivationType ¶
type AddressIndex ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func ChainFromKey ¶
func ChainFromNSS ¶
func (*Chain) NetworkType ¶
func (c *Chain) NetworkType() NetworkType
func (*Chain) SetChainId ¶
func (*Chain) SetCoinType ¶
func (*Chain) SetNetworkType ¶
func (c *Chain) SetNetworkType(networkType NetworkType)
type ChainKey ¶
type ChainKey string
ChainKey - string identifier for declaration any chain or subchain
type ChargeType ¶
type ChargeType uint8
type DerivationPath ¶
type DerivationPath struct {
// contains filtered or unexported fields
}
func NewDerivationPath ¶
func NewDerivationPath(derivationType DerivationType, coin CoinType, account AccountIndex, charge ChargeType, index AddressIndex) *DerivationPath
func ParseDerivationPath ¶
func ParseDerivationPath(dt DerivationType, path string) (*DerivationPath, error)
func (*DerivationPath) Account ¶
func (dp *DerivationPath) Account() AccountIndex
func (*DerivationPath) AddressIndex ¶
func (dp *DerivationPath) AddressIndex() AddressIndex
func (*DerivationPath) Charge ¶
func (dp *DerivationPath) Charge() ChargeType
func (*DerivationPath) Coin ¶
func (dp *DerivationPath) Coin() CoinType
func (*DerivationPath) DerivationType ¶
func (dp *DerivationPath) DerivationType() DerivationType
func (*DerivationPath) IsHardenedAddress ¶
func (dp *DerivationPath) IsHardenedAddress() bool
func (*DerivationPath) ParsePath ¶
func (dp *DerivationPath) ParsePath(path string) error
func (*DerivationPath) String ¶
func (dp *DerivationPath) String() string
type DerivationType ¶
type DerivationType string
type MHDA ¶
type MHDA interface { Chain() *Chain // DerivationType() DerivationType DerivationPath() *DerivationPath Algorithm() Algorithm Format() Format NSS() string String() string Hash() string NSSHash() string }
func ParseURNRx ¶
type NetworkType ¶
type NetworkType string
func NetworkTypeFromString ¶
func NetworkTypeFromString(src string) (NetworkType, error)
func (NetworkType) IsValid ¶
func (nt NetworkType) IsValid() bool
func (NetworkType) String ¶
func (nt NetworkType) String() string
Click to show internal directories.
Click to hide internal directories.