addrdec

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	STMMainNetPublicKeyPrefixCompat = "STM"
	STMTestNetPublicKeyPrefixCompat = "TST"

	//STM stuff
	STM_mainnetPublic        = addressEncoder.AddressType{"base58", addressEncoder.BTCAlphabet, "ripemd160", "", 33, []byte(STMMainNetPublicKeyPrefixCompat), nil}
	STM_testnetPublic        = addressEncoder.AddressType{"base58", addressEncoder.BTCAlphabet, "ripemd160", "", 33, []byte(STMTestNetPublicKeyPrefixCompat), nil}
	STM_PrivateWIF           = addressEncoder.AddressType{"base58", addressEncoder.BTCAlphabet, "doubleSHA256", "", 32, []byte{0x80}, nil}
	STM_PrivateWIFCompressed = addressEncoder.AddressType{"base58", addressEncoder.BTCAlphabet, "doubleSHA256", "", 32, []byte{0x80}, []byte{0x01}}

	Default = AddressDecoderV2{}
)

Functions

func CalculateAccountRolePrivateKey added in v1.0.2

func CalculateAccountRolePrivateKey(accountName, role, password string) ([]byte, error)

计算角色私钥

func GetCompPubKey added in v1.0.2

func GetCompPubKey(priKey []byte, curveType uint32) ([]byte, error)

获取角色的压缩公钥

func GetRoleCompressKey added in v1.0.2

func GetRoleCompressKey(accountName, role, password string, curveType uint32) ([]byte, error)

Types

type AddressDecoderV2

type AddressDecoderV2 struct {
	*openwallet.AddressDecoderV2Base
	IsTestNet bool
}

AddressDecoderV2

func NewAddressDecoderV2

func NewAddressDecoderV2(isTestNet bool) *AddressDecoderV2

NewAddressDecoder 地址解析器

func (*AddressDecoderV2) AddressDecode

func (dec *AddressDecoderV2) AddressDecode(pubKey string, opts ...interface{}) ([]byte, error)

AddressDecode decode address

func (*AddressDecoderV2) AddressEncode

func (dec *AddressDecoderV2) AddressEncode(hash []byte, opts ...interface{}) (string, error)

AddressEncode encode address

Jump to

Keyboard shortcuts

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