wallet

package
v0.0.0-...-54f08f8 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressFromPubKey

func AddressFromPubKey(key ed25519.PublicKey, ver Version) (*address.Address, error)

func GetStateInit

func GetStateInit(pubKey ed25519.PublicKey, ver Version) (*tlb.StateInit, error)

func NewSeed

func NewSeed() []string

func NewSeedWithPassword

func NewSeedWithPassword(password string) []string

Types

type TonAPI

type TonAPI interface {
	GetMasterchainInfo(ctx context.Context) (*tlb.BlockInfo, error)
	GetAccount(ctx context.Context, block *tlb.BlockInfo, addr *address.Address) (*ton.Account, error)
	SendExternalMessage(ctx context.Context, addr *address.Address, msg *cell.Cell) error
	SendExternalInitMessage(ctx context.Context, addr *address.Address, msg *cell.Cell, state *tlb.StateInit) error
	RunGetMethod(ctx context.Context, blockInfo *tlb.BlockInfo, addr *address.Address, method string, params ...interface{}) ([]interface{}, error)
}

type Version

type Version int
const (
	V1 Version = 1
	V2 Version = 2
	V3 Version = 3
	V4 Version = 4
)

type Wallet

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

func FromPrivateKey

func FromPrivateKey(api TonAPI, key ed25519.PrivateKey, version Version) (*Wallet, error)

func FromSeed

func FromSeed(api TonAPI, seed []string, version Version) (*Wallet, error)

func FromSeedWithPassword

func FromSeedWithPassword(api TonAPI, seed []string, password string, version Version) (*Wallet, error)

func (*Wallet) Address

func (w *Wallet) Address() *address.Address

func (*Wallet) DeployContract

func (w *Wallet) DeployContract(ctx context.Context, amount *tlb.Grams, body, code, data *cell.Cell) (*address.Address, error)

func (*Wallet) GetBalance

func (w *Wallet) GetBalance(ctx context.Context, block *tlb.BlockInfo) (*tlb.Grams, error)

func (*Wallet) Send

func (w *Wallet) Send(ctx context.Context, mode byte, message *tlb.InternalMessage) error

func (*Wallet) Transfer

func (w *Wallet) Transfer(ctx context.Context, to *address.Address, amount *tlb.Grams, comment string) error

Jump to

Keyboard shortcuts

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