Documentation
¶
Index ¶
- func Deserialize(rx io.Reader, target any) error
- func Serialize(w io.Writer, source any) error
- type Address
- type AddressType
- type FinalizeTxParam
- type FinalizedTx
- type GenContext
- type TxDest
- func (dst *TxDest) AmountCommitment(scalar *edwards25519.Scalar) *edwards25519.Point
- func (dst *TxDest) BlindedAssetId(scalar *edwards25519.Scalar) *edwards25519.Point
- func (dst *TxDest) ConcealingPoint(scalar *edwards25519.Scalar) *edwards25519.Point
- func (dst *TxDest) StealthAddress(scalar *edwards25519.Scalar) *edwards25519.Point
- type TxDestHtlcOut
- type TxSource
- type TxSourceOutputEntry
- type Wallet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deserialize ¶
Deserialize implements epee deserializer (kind of)
Types ¶
type Address ¶
type Address struct { Type AddressType Flags uint8 SpendKey []byte ViewKey []byte PaymentId []byte }
func ParseAddress ¶
ParseAddress will parse a zano address and return and Address object containing the address
func (*Address) SetPaymentId ¶
SetPaymentId sets the payment ID for the given address, and updates the address type accordingly.
type AddressType ¶
type AddressType uint64
const ( PublicAddress AddressType = 0xc5 // Zx PublicIntegAddress AddressType = 0x3678 // iZ PublicIntegAddressV2 AddressType = 0x36f8 // iZ (new format) PublicAuditAddress AddressType = 0x98c8 // aZx PublicAuditIntegAddress AddressType = 0x8a49 // aiZX )
func (AddressType) Auditable ¶
func (a AddressType) Auditable() bool
func (AddressType) HasFlags ¶
func (a AddressType) HasFlags() bool
func (AddressType) String ¶
func (a AddressType) String() string
type FinalizeTxParam ¶
type FinalizeTxParam struct { UnlockTime uint64 Extra []*zanobase.Variant // currency::extra_v Attachments []*zanobase.Variant // currency::attachment_v CryptAddress *zanobase.AccountPublicAddr // currency::account_public_address TxOutsAttr uint8 Shuffle bool Flags uint8 MultisigId zanobase.Value256 // crypto::hash Sources []*TxSource // currency::tx_source_entry SelectedTransfers []zanobase.Varint // not sure why, but this is encoded as "01 00" in the bytestream PreparedDestinations []*TxDest // currency::tx_destination_entry ExpirationTime uint64 SpendPubKey *zanobase.Point // only for validations TxVersion uint64 //TxHardforkId uint64 // size_t; IN NEW VERSION FIXME ModeSeparateFee uint64 }
func ParseFTP ¶
func ParseFTP(buf, viewSecretKey []byte) (*FinalizeTxParam, error)
type FinalizedTx ¶
type FinalizedTx struct { Tx *zanobase.Transaction `json:"tx"` TxId zanobase.Value256 `json:"txid"` // might be zeroes? OneTimeKey zanobase.Value256 `json:"one_time_key"` // crypto::secret_key FTP *FinalizeTxParam `json:"ftp"` HtlcOrigin string `json:"htlc_origin"` OutsKeyImages []*zanobase.KeyImageIndex `json:"outs_key_images,omitempty"` // pairs (out_index, key_image) for each change output Derivation zanobase.Value256 `json:"derivation"` // crypto::key_derivation, a ec_point WasNotPrepared bool `json:"was_not_prepared"` // true if tx was not prepared/created for some good reason (e.g. not enough outs for UTXO defragmentation tx). Because we decided not to throw exceptions for non-error cases. -- sowle }
func ParseFinalized ¶
func ParseFinalized(buf, viewSecretKey []byte) (*FinalizedTx, error)
type GenContext ¶
type GenContext struct { }
type TxDest ¶
type TxDest struct { Amount uint64 Addr []*zanobase.AccountPublicAddr // account_public_address; destination address, in case of 1 address - txout_to_key, in case of more - txout_multisig MinimumSigs uint64 // if txout_multisig: minimum signatures that are required to spend this output (minimum_sigs <= addr.size()) IF txout_to_key - not used AmountToProvide uint64 // amount money that provided by initial creator of tx, used with partially created transactions UnlockTime uint64 // HtlcOptions *TxDestHtlcOut // destination_option_htlc_out AssetId zanobase.Value256 // not blinded, not premultiplied Flags uint64 // set of flags (see tx_destination_entry_flags) // contains filtered or unexported fields }
func (*TxDest) AmountCommitment ¶
func (dst *TxDest) AmountCommitment(scalar *edwards25519.Scalar) *edwards25519.Point
func (*TxDest) BlindedAssetId ¶
func (dst *TxDest) BlindedAssetId(scalar *edwards25519.Scalar) *edwards25519.Point
func (*TxDest) ConcealingPoint ¶
func (dst *TxDest) ConcealingPoint(scalar *edwards25519.Scalar) *edwards25519.Point
func (*TxDest) StealthAddress ¶
func (dst *TxDest) StealthAddress(scalar *edwards25519.Scalar) *edwards25519.Point
type TxDestHtlcOut ¶
type TxSource ¶
type TxSource struct { Outputs []*TxSourceOutputEntry RealOutput uint64 RealOutTxKey zanobase.Value256 // crypto::public_key RealOutAmountBlindingMask zanobase.Value256 // crypto::scalar_t RealOutAssetIdBlindingMask zanobase.Value256 // crypto::scalar_t RealOutInTxIndex uint64 // size_t, index in transaction outputs vector Amount uint64 TransferIndex uint64 MultisigId zanobase.Value256 // crypto::hash if txin_multisig: multisig output id MsSigsCount uint64 // size_t MsKeysCount uint64 // size_t SeparatelySignedTxComplete bool HtlcOrigin string // for htlc, specify origin. len = 1, content = "\x00" ? }
type TxSourceOutputEntry ¶
type TxSourceOutputEntry struct { OutReference *zanobase.Variant // TxOutRef // either global output index or ref_by_id StealthAddress zanobase.Value256 // crypto::public_key, a.k.a output's one-time public key ConcealingPoint zanobase.Value256 // only for ZC outputs AmountCommitment zanobase.Value256 // only for ZC outputs BlindedAssetID zanobase.Value256 // only for ZC outputs }
type Wallet ¶
type Wallet struct { SpendPrivKey *edwards25519.Scalar SpendPubKey *edwards25519.Point ViewPrivKey *edwards25519.Scalar ViewPubKey *edwards25519.Point Flags uint8 // flag 1 = auditable }
func LoadSpendSecret ¶
LoadSpendSecret initializesd a Wallet based on a spend secret as found in zano if you run spendkey. Note that zano's displayed key is in little endian so this function will reverse the bytes for you.
Set flags to zero for normal keys, or 1 for auditable keys.
func (*Wallet) ParseFinalized ¶
func (w *Wallet) ParseFinalized(buf []byte) (*FinalizedTx, error)
func (*Wallet) Sign ¶
func (w *Wallet) Sign(ftp *FinalizeTxParam, oneTimeKey []byte) (*FinalizedTx, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.