tonkey

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	// contains filtered or unexported fields
}

Key represents a TON ed25519 key

func FromEncryptedJSON

func FromEncryptedJSON(keyJSON []byte, password string) (Key, error)

FromEncryptedJSON gets key from json and password

func KeyFor

func KeyFor(raw internal.Raw) Key

KeyFor loads a Key from a raw seed

func MustNewInsecure

func MustNewInsecure(reader io.Reader) Key

MustNewInsecure creates a Key or panics if an error occurs

func New

func New() (Key, error)

New creates a new Key using secure randomness

func (Key) AddressBase64

func (key Key) AddressBase64() string

AddressBase64 returns the user-friendly version of the TON address https://docs.ton.org/v3/concepts/dive-into-ton/ton-blockchain/smart-contract-addresses#user-friendly-address

func (Key) GetPublic

func (key Key) GetPublic() ed25519.PublicKey

GetPublic returns the raw ed25519 public key bytes

func (Key) ID

func (key Key) ID() string

ID returns the hex-encoded public key (same as PublicKeyStr)

func (Key) PubkeyToAddress

func (key Key) PubkeyToAddress() *address.Address

PubkeyToAddress returns the wallet v3 address for workchain 0

func (Key) PubkeyToAddressWith

func (key Key) PubkeyToAddressWith(version wallet.VersionConfig, workchain int8) (*address.Address, error)

PubkeyToAddressWith returns the TON wallet address for the given wallet version and workchain

func (Key) PublicKeyStr

func (key Key) PublicKeyStr() string

PublicKeyStr returns the hex-encoded public key

func (Key) Raw

func (key Key) Raw() internal.Raw

Raw returns the private key seed

func (Key) RawAddress

func (key Key) RawAddress() string

RawAddress returns the raw version of the TON address, which includes the workchain https://docs.ton.org/v3/concepts/dive-into-ton/ton-blockchain/smart-contract-addresses#raw-address

func (Key) Sign

func (key Key) Sign(msg []byte) ([]byte, error)

Sign signs a message using ed25519

func (Key) ToEncryptedJSON

func (key Key) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) ([]byte, error)

ToEncryptedJSON returns encrypted JSON representing key

Jump to

Keyboard shortcuts

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