wallet

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NEO2Prefix is the first byte of address for NEO2.
	NEO2Prefix byte = 0x17
	// NEO3Prefix is the first byte of address for NEO3.
	NEO3Prefix byte = 0x35
)

Variables

View Source
var Prefix = NEO3Prefix

Prefix is the byte used to prepend to addresses when encoding them, it can be changed and defaults to 53 (0x35), the standard NEO prefix.

Functions

func ByteArrayToString

func ByteArrayToString(byteArray []byte) string

func BytesFromPublicKey

func BytesFromPublicKey(pub *ecdsa.PublicKey) []byte

func ConvertScriptHashToAddressString

func ConvertScriptHashToAddressString(scriptHash string) (util.Uint160, string, error)

func CreateTransactionFromFunctionCall

func CreateTransactionFromFunctionCall(contractScriptHash string, operation string, network RPC_NETWORK, acc *wallet.Account, params []smartcontract.Parameter) (util.Uint256, *transaction.Transaction, error)

CreateTransactionFromFunctionCall creates a transaction to call a function on a smart contract) that still requires executing Before this is ready for sending Consider using https://pkg.go.dev/github.com/nspcc-dev/neo-go/pkg/rpc/client#Client.CreateTxFromScript as an alternative

func GasToken

func GasToken(cli client.Client) (util.Uint160, error)

func GenerateEphemeralAccount

func GenerateEphemeralAccount() (*wallet.Account, error)

func GenerateMultiSignWalletFromSigners

func GenerateMultiSignWalletFromSigners()

todo ...

func GenerateNewSecureWallet

func GenerateNewSecureWallet(path, name, password string) (*wallet.Wallet, error)

func GenerateNewWallet

func GenerateNewWallet(path string) (*wallet.Wallet, error)

func GetCredentialsFromPath

func GetCredentialsFromPath(path, address, password string) (ecdsa.PrivateKey, error)

func GetCredentialsFromWallet

func GetCredentialsFromWallet(address, password string, w *wallet.Wallet) (ecdsa.PrivateKey, error)

func GetLogForTransaction

func GetLogForTransaction(network RPC_NETWORK, transactionID util.Uint256) (*result.ApplicationLog, error)

func GetNep17Balances

func GetNep17Balances(walletAddress string, network RPC_NETWORK) (map[string]Nep17Tokens, error)

func GetPeers

func GetPeers(ntwk RPC_NETWORK) ([]result.Peer, error)

func GetWalletFromPrivateKey

func GetWalletFromPrivateKey(key ecdsa.PrivateKey) *wallet.Account

func PrettyPrint

func PrettyPrint(data interface{}) (string, error)

func PrivateKeyFromHexString

func PrivateKeyFromHexString(hexString string) (*ecdsa.PrivateKey, error)

func RetrieveWallet

func RetrieveWallet(path string) (*wallet.Wallet, error)

func StringToUint160

func StringToUint160(s string) (u util.Uint160, err error)

StringToUint160 attempts to decode the given NEO address string into an Uint160.

func Uint160ToString

func Uint160ToString(u util.Uint160) string

Uint160ToString returns the "NEO address" from the given Uint160.

func UnlockWallet

func UnlockWallet(path, address, password string) (*wallet.Account, error)

Types

type Nep17Tokens

type Nep17Tokens struct {
	Asset  util.Uint160 `json:"asset"`
	Amount uint64       `json:"amount""`
	Symbol string       `json:"symbol"`
	Info   wallet.Token `json:"meta"`
	Error  error        `json:"error"`
}

type RPC_NETWORK

type RPC_NETWORK string

Jump to

Keyboard shortcuts

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