Documentation
¶
Overview ¶
Package compat provides compatibility layers for external dependencies
Index ¶
- func BytesToHex(bytes []byte) string
- func CreateAccountWithLabel(w *wallet.Wallet, password, label string) error
- func NeoGoVersion() string
- func StringToUint160(hexString string) (util.Uint160, error)
- func StringToUint256(hexString string) (util.Uint256, error)
- func Uint160FromBytes(bytes []byte) (util.Uint160, error)
- func Uint256FromBytes(bytes []byte) (util.Uint256, error)
- type AccountHelper
- type PrivateKeyHelper
- type TransactionHelper
- func (h *TransactionHelper) CreateDeploymentScript(nef []byte, manifest []byte) ([]byte, error)
- func (h *TransactionHelper) CreateInvocationTx(script []byte, account *wallet.Account, sysFee int64, netFee int64, ...) (*transaction.Transaction, error)
- func (h *TransactionHelper) CreateSmartContractScript(scriptHash util.Uint160, method string, params []interface{}) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAccountWithLabel ¶
CreateAccountWithLabel creates an account with a password and label This adapts to different neo-go API versions
func StringToUint160 ¶
StringToUint160 converts a hex string to Uint160 for neo-go
func StringToUint256 ¶
StringToUint256 converts a hex string to Uint256 for neo-go
func Uint160FromBytes ¶
Uint160FromBytes creates a Uint160 from bytes using reflection to handle different neo-go versions
Types ¶
type AccountHelper ¶
AccountHelper provides compatibility functions for wallet.Account
func NewAccountHelper ¶
func NewAccountHelper(account *wallet.Account) *AccountHelper
NewAccountHelper creates a new helper for a wallet account
func (*AccountHelper) GetAddress ¶
func (h *AccountHelper) GetAddress() string
GetAddress returns the account address
func (*AccountHelper) GetPrivateKeyHex ¶
func (h *AccountHelper) GetPrivateKeyHex() string
GetPrivateKeyHex returns the account private key as a hex string This handles different neo-go versions by using safe fallbacks
func (*AccountHelper) GetPublicKeyHex ¶
func (h *AccountHelper) GetPublicKeyHex() string
GetPublicKeyHex returns the account public key as a hex string This handles different neo-go versions by using safe fallbacks
type PrivateKeyHelper ¶
type PrivateKeyHelper struct{}
PrivateKeyHelper provides utilities for private key operations
func NewPrivateKeyHelper ¶
func NewPrivateKeyHelper() *PrivateKeyHelper
NewPrivateKeyHelper creates a new private key helper
func (*PrivateKeyHelper) FromBytes ¶
func (h *PrivateKeyHelper) FromBytes(data []byte) (*keys.PrivateKey, error)
FromBytes creates a private key from bytes
type TransactionHelper ¶
type TransactionHelper struct {
}
TransactionHelper provides compatibility functions for transactions
func NewTransactionHelper ¶
func NewTransactionHelper() *TransactionHelper
NewTransactionHelper creates a new transaction helper
func (*TransactionHelper) CreateDeploymentScript ¶
func (h *TransactionHelper) CreateDeploymentScript( nef []byte, manifest []byte, ) ([]byte, error)
CreateDeploymentScript creates a deployment script for different neo-go versions
func (*TransactionHelper) CreateInvocationTx ¶
func (h *TransactionHelper) CreateInvocationTx( script []byte, account *wallet.Account, sysFee int64, netFee int64, additionalAttributes ...transaction.Attribute, ) (*transaction.Transaction, error)
CreateInvocationTx creates an invocation transaction for different neo-go versions
func (*TransactionHelper) CreateSmartContractScript ¶
func (h *TransactionHelper) CreateSmartContractScript( scriptHash util.Uint160, method string, params []interface{}, ) ([]byte, error)
CreateSmartContractScript creates a smart contract script for different neo-go versions