address

package
v0.43.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2021 License: MIT Imports: 15 Imported by: 14

Documentation

Index

Constants

View Source
const (
	Mainnet Mode = "ckb"
	Testnet Mode = "ckt"

	TypeFull  Type = "Full"
	TypeShort Type = "Short"

	ShortFormat               = "01"
	FullDataFormat            = "02"
	FullTypeFormat            = "04"
	CodeHashIndexSingleSig    = "00"
	CodeHashIndexMultisigSig  = "01"
	CodeHashIndexAnyoneCanPay = "02"
)
View Source
const (
	MAINNET_ACP_CODE_HASH    = "0xd369597ff47f29fbc0d47d2e3775370d1250b85140c670e4718af712983a2354"
	TESTNET_ACP_CODE_HASH    = "0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356"
	MAINNET_CHEQUE_CODE_HASH = "0xe4d4ecc6e5f9a059bf2f7a82cca292083aebc0c421566a52484fe2ec51a9fb0c"
	TESTNET_CHEQUE_CODE_HASH = "0x60d5f39efce409c587cb9ea359cefdead650ca128f0bd9cb3855348f98c70d5b"
)

Variables

This section is empty.

Functions

func Generate

func Generate(mode Mode, script *types.Script) (string, error)

func GenerateAcpAddress added in v0.43.1

func GenerateAcpAddress(secp256k1Address string) (string, error)

func GenerateChequeAddress added in v0.43.1

func GenerateChequeAddress(senderAddress, receiverAddress string) (string, error)

func GenerateFullPayloadAddress added in v0.2.1

func GenerateFullPayloadAddress(hashType string, mode Mode, script *types.Script) (string, error)

func GenerateSecp256k1MultisigScript

func GenerateSecp256k1MultisigScript(requireN, threshold int, publicKeys [][]byte) (*types.Script, []byte, error)

Types

type AddressGenerateResult added in v0.43.1

type AddressGenerateResult struct {
	Address    string
	LockArgs   string
	PrivateKey string
}

func GenerateShortAddress added in v0.43.1

func GenerateShortAddress(mode Mode) (*AddressGenerateResult, error)

type Mode

type Mode string

type ParsedAddress

type ParsedAddress struct {
	Mode   Mode
	Type   Type
	Script *types.Script
}

func Parse

func Parse(address string) (*ParsedAddress, error)

func ValidateChequeAddress added in v0.3.0

func ValidateChequeAddress(addr string, systemScripts *utils.SystemScripts) (*ParsedAddress, error)

type Type

type Type string

Jump to

Keyboard shortcuts

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