Documentation
¶
Index ¶
- Constants
- Variables
- func CalcTxInput(amount float64, unspent []*neogo.UTXO) ([]*neogo.UTXO, float64, error)
- func WriteLightScryptKeyStore(key *Key, password string) ([]byte, error)
- func WriteScryptKeyStore(key *Key, password string) ([]byte, error)
- type Key
- type RawClaimTx
- type RawTx
- type RawTxAttr
- type RawTxInput
- type RawTxOutput
- type RawTxScript
- type RawTxSerializable
Constants ¶
View Source
const ( GasAssert = "602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7" NEOAssert = "c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b" )
Asserts .
View Source
const ( MinerTransaction byte = 0x00 IssueTransaction byte = 0x01 ClaimTransaction byte = 0x02 EnrollmentTransaction byte = 0x20 RegisterTransaction byte = 0x40 ContractTransaction byte = 0x80 PublishTransaction byte = 0xd0 InvocationTransaction byte = 0xd1 )
Transaction types
View Source
const ( ContractHash = byte(0x00) ECDH02 = byte(0x02) ECDH03 = byte(0x03) Script = byte(0x20) Vote = byte(0x30) CertURL = byte(0x80) DescriptionURL = byte(0x81) Description = byte(90) Hash1 = byte(0xa1) Hash2 = byte(0xa2) Hash3 = byte(0xa3) Hash4 = byte(0xa4) Hash5 = byte(0xa5) Hash6 = byte(0xa6) Hash7 = byte(0xa7) Hash8 = byte(0xa8) Hash9 = byte(0xa9) Hash10 = byte(0xaa) Hash11 = byte(0xab) Hash12 = byte(0xac) Hash13 = byte(0xad) Hash14 = byte(0xae) Hash15 = byte(0xaf) Remark = byte(0xf0) Remark1 = byte(0xf1) Remark2 = byte(0xf2) Remark3 = byte(0xf3) Remark4 = byte(0xf4) Remark5 = byte(0xf5) Remark6 = byte(0xf6) Remark7 = byte(0xf7) Remark8 = byte(0xf8) Remark9 = byte(0xf9) Remark10 = byte(0xfa) Remark11 = byte(0xfb) Remark12 = byte(0xfc) Remark13 = byte(0xfd) Remark14 = byte(0xfe) Remark15 = byte(0xff) )
Attr Usage
Variables ¶
View Source
var ( StandardScryptN = 1 << 18 StandardScryptP = 1 LightScryptN = 1 << 12 LightScryptP = 6 )
const variables
View Source
var (
ErrNoUTXO = errors.New("no enough utxo")
)
Err
Functions ¶
func CalcTxInput ¶
CalcTxInput .
func WriteLightScryptKeyStore ¶
WriteLightScryptKeyStore write keystore with Scrypt format
Types ¶
type Key ¶
type Key struct {
ID uuid.UUID // Key ID
Address string // address
PrivateKey *btc.PrivateKey // btc private key
}
Key NEO wallet key
func KeyFromPrivateKey ¶
KeyFromPrivateKey neo key from private key bytes
type RawTx ¶
type RawTx struct {
Type byte // transaction type
Version byte // tx version
XData RawTxSerializable // special tx data
Attributes []*RawTxAttr // tx attribute
Inputs []*RawTxInput // tx inputs
Outputs []*RawTxOutput // tx output
Scripts []*RawTxScript // tx scripts
}
RawTx raw transaction object
func CreateClaimTx ¶
CreateClaimTx .
func CreateSendAssertTx ¶
func CreateSendAssertTx(assert, from, to string, amount float64, unspent []*neogo.UTXO) (*RawTx, error)
CreateSendAssertTx create send assert tx object
func (*RawTx) GenerateWithSign ¶
GenerateWithSign generate raw tx with sign data
type RawTxInput ¶
RawTxInput raw tx input parameter
func (*RawTxInput) WriteBytes ¶
func (input *RawTxInput) WriteBytes(writer io.Writer) error
WriteBytes .
type RawTxOutput ¶
RawTxOutput raw tx output utxo
func (*RawTxOutput) WriteBytes ¶
func (output *RawTxOutput) WriteBytes(writer io.Writer) error
WriteBytes .
type RawTxScript ¶
RawTxScript .
func (*RawTxScript) WriteBytes ¶
func (script *RawTxScript) WriteBytes(writer io.Writer) error
WriteBytes .
Click to show internal directories.
Click to hide internal directories.