Versions in this module Expand all Collapse all v1 v1.3.0 Apr 24, 2020 v1.2.1 Oct 16, 2019 v1.2.0 Oct 9, 2019 Changes in this version + const BotFeeForNetworkAddressInfoChangeMultiplier + const BotFeePerAdditionalNameMultiplier + const BotMonth + const BotMonthlyFeeMultiplier + const BotRegistrationFeeMultiplier + const MaxAddressesPerBot + const MaxBotID + const MaxBotPrepaidMonths + const MaxBotPrepaidMonthsInSeconds + const MaxLengthBotName + const MaxLengthHostname + const MaxNamesPerBot + const MinBotID + const RegexpBotName + const RegexpHostname + const TransactionNonceLength + const TransactionVersionBotNameTransfer + const TransactionVersionBotRecordUpdate + const TransactionVersionBotRegistration + var BotSignatureSpecifierReceiver = [...]byte + var BotSignatureSpecifierSender = [...]byte + var ErrBotExpirationExtendOverflow = errors.New("a 3bot can only have up to 24 months prepaid") + var ErrBotKeyAlreadyRegistered = errors.New("bot key is already registered") + var ErrBotKeyNotFound = errors.New("3bot public key not found") + var ErrBotNameAlreadyRegistered = errors.New("bot name is already registered") + var ErrBotNameDoesNotExist = errors.New("the name is not registerd with this 3bot") + var ErrBotNameExpired = errors.New("3bot name expired") + var ErrBotNameNotFound = errors.New("3bot name not found") + var ErrBotNameNotUnique = errors.New("the name is already registerd with this 3bot") + var ErrBotNameTooLong = errors.New("the length of a hostname can maximum be 127 bytes long") + var ErrBotNotFound = errors.New("3bot not found") + var ErrHostnameTooLong = errors.New("the length of a hostname can maximum be 63 bytes long") + var ErrInvalidBotName = errors.New("invalid bot name") + var ErrInvalidNetworkAddress = errors.New("invalid network address") + var ErrNetworkAddressDoesNotExist = errors.New("the network address is not registerd with this 3bot") + var ErrNetworkAddressNotUnique = errors.New("the network address is already registerd with this 3bot") + var ErrNilBotName = errors.New("nil bot name") + var ErrNilHostname = errors.New("nil hostname") + var ErrTooManyBotAddresses = errors.New("a 3bot can have a maximum of 10 addresses") + var ErrTooManyBotNames = errors.New("a 3bot can have a maximum of 5 names") + var SpecifierBotNameTransferTransaction = types.Specifier + var SpecifierBotRecordUpdateTransaction = types.Specifier + var SpecifierBotRegistrationTransaction = types.Specifier + func ComputeMonthlyBotFees(months uint8, oneCoin types.Currency) types.Currency + type BotID uint32 + func (id *BotID) LoadString(str string) error + func (id BotID) String() string + type BotIdentifierSignaturePair struct + Identifier BotID + Signature types.ByteSlice + type BotMonthsAndFlagsData struct + HasAddresses bool + HasNames bool + HasRefund bool + NrOfMonths uint8 + func (maf *BotMonthsAndFlagsData) UnmarshalRivine(r io.Reader) error + func (maf *BotMonthsAndFlagsData) UnmarshalSia(r io.Reader) error + func (maf BotMonthsAndFlagsData) MarshalRivine(w io.Writer) error + func (maf BotMonthsAndFlagsData) MarshalSia(w io.Writer) error + type BotName struct + func NewBotName(name string) (BotName, error) + func (bn *BotName) LoadString(str string) (err error) + func (bn *BotName) UnmarshalJSON(b []byte) error + func (bn *BotName) UnmarshalRivine(r io.Reader) error + func (bn *BotName) UnmarshalSia(r io.Reader) error + func (bn BotName) Compare(obn BotName) int + func (bn BotName) Equals(obn BotName) bool + func (bn BotName) MarshalJSON() ([]byte, error) + func (bn BotName) MarshalRivine(w io.Writer) error + func (bn BotName) MarshalSia(w io.Writer) error + func (bn BotName) String() string + type BotNameSortedSet struct + func (bnss *BotNameSortedSet) AddName(name BotName) error + func (bnss *BotNameSortedSet) BinaryDecode(r io.Reader, length int) error + func (bnss *BotNameSortedSet) RemoveName(name BotName) error + func (bnss *BotNameSortedSet) UnmarshalJSON(data []byte) error + func (bnss *BotNameSortedSet) UnmarshalRivine(r io.Reader) error + func (bnss *BotNameSortedSet) UnmarshalSia(r io.Reader) error + func (bnss BotNameSortedSet) BinaryEncode(w io.Writer) (int, error) + func (bnss BotNameSortedSet) Difference(other BotNameSortedSet) []BotName + func (bnss BotNameSortedSet) Intersection(other BotNameSortedSet) []BotName + func (bnss BotNameSortedSet) Len() int + func (bnss BotNameSortedSet) MarshalJSON() ([]byte, error) + func (bnss BotNameSortedSet) MarshalRivine(w io.Writer) error + func (bnss BotNameSortedSet) MarshalSia(w io.Writer) error + type BotNameTransferTransaction struct + CoinInputs []types.CoinInput + Names []BotName + Receiver BotIdentifierSignaturePair + RefundCoinOutput *types.CoinOutput + Sender BotIdentifierSignaturePair + TransactionFee types.Currency + func BotNameTransferTransactionFromTransaction(tx types.Transaction) (BotNameTransferTransaction, error) + func BotNameTransferTransactionFromTransactionData(txData types.TransactionData) (BotNameTransferTransaction, error) + func (bnttx *BotNameTransferTransaction) RequiredBotFee(oneCoin types.Currency) types.Currency + func (bnttx *BotNameTransferTransaction) RevertReceiverBotRecordUpdate(record *BotRecord) error + func (bnttx *BotNameTransferTransaction) RevertSenderBotRecordUpdate(record *BotRecord) error + func (bnttx *BotNameTransferTransaction) Transaction(oneCoin types.Currency) types.Transaction + func (bnttx *BotNameTransferTransaction) TransactionData(oneCoin types.Currency) types.TransactionData + func (bnttx *BotNameTransferTransaction) UnmarshalRivine(r io.Reader) error + func (bnttx *BotNameTransferTransaction) UnmarshalSia(r io.Reader) error + func (bnttx *BotNameTransferTransaction) UpdateReceiverBotRecord(blockTime types.Timestamp, record *BotRecord) error + func (bnttx *BotNameTransferTransaction) UpdateSenderBotRecord(blockTime types.Timestamp, record *BotRecord) error + func (bnttx BotNameTransferTransaction) MarshalRivine(w io.Writer) error + func (bnttx BotNameTransferTransaction) MarshalSia(w io.Writer) error + type BotNameTransferTransactionController struct + OneCoin types.Currency + Registry BotRecordReadRegistry + RegistryPoolAddress types.UnlockHash + func (bnttc BotNameTransferTransactionController) DecodeTransactionData(r io.Reader) (types.TransactionData, error) + func (bnttc BotNameTransferTransactionController) EncodeTransactionData(w io.Writer, txData types.TransactionData) error + func (bnttc BotNameTransferTransactionController) EncodeTransactionIDInput(w io.Writer, txData types.TransactionData) error + func (bnttc BotNameTransferTransactionController) GetCustomMinerPayouts(extension interface{}) ([]types.MinerPayout, error) + func (bnttc BotNameTransferTransactionController) JSONDecodeTransactionData(data []byte) (types.TransactionData, error) + func (bnttc BotNameTransferTransactionController) JSONEncodeTransactionData(txData types.TransactionData) ([]byte, error) + func (bnttc BotNameTransferTransactionController) SignExtension(extension interface{}, ...) (interface{}, error) + func (bnttc BotNameTransferTransactionController) SignatureHash(t types.Transaction, extraObjects ...interface{}) (crypto.Hash, error) + type BotNameTransferTransactionExtension struct + Names []BotName + Receiver BotIdentifierSignaturePair + Sender BotIdentifierSignaturePair + func (bnttxe *BotNameTransferTransactionExtension) RequiredBotFee(oneCoin types.Currency) types.Currency + type BotRecord struct + Addresses NetworkAddressSortedSet + Expiration CompactTimestamp + ID BotID + Names BotNameSortedSet + PublicKey types.PublicKey + func (record *BotRecord) AddNames(names ...BotName) error + func (record *BotRecord) AddNetworkAddresses(addresses ...NetworkAddress) error + func (record *BotRecord) ExtendExpirationDate(blockTime types.Timestamp, addedMonths uint8) error + func (record *BotRecord) IsExpired(blockTime types.Timestamp) bool + func (record *BotRecord) RemoveNames(names ...BotName) error + func (record *BotRecord) RemoveNetworkAddresses(addresses ...NetworkAddress) error + func (record *BotRecord) ResetNames() + func (record *BotRecord) UnmarshalRivine(r io.Reader) error + func (record *BotRecord) UnmarshalSia(r io.Reader) error + func (record BotRecord) MarshalRivine(w io.Writer) error + func (record BotRecord) MarshalSia(w io.Writer) error + type BotRecordAddressUpdate struct + Add []NetworkAddress + Remove []NetworkAddress + type BotRecordNameUpdate struct + Add []BotName + Remove []BotName + type BotRecordReadRegistry interface + GetBotTransactionIdentifiers func(id BotID) ([]types.TransactionID, error) + GetRecordForID func(id BotID) (*BotRecord, error) + GetRecordForKey func(key types.PublicKey) (*BotRecord, error) + GetRecordForName func(name BotName) (*BotRecord, error) + type BotRecordUpdateTransaction struct + Addresses BotRecordAddressUpdate + CoinInputs []types.CoinInput + Identifier BotID + Names BotRecordNameUpdate + NrOfMonths uint8 + RefundCoinOutput *types.CoinOutput + Signature types.ByteSlice + TransactionFee types.Currency + func BotRecordUpdateTransactionFromTransaction(tx types.Transaction) (BotRecordUpdateTransaction, error) + func BotRecordUpdateTransactionFromTransactionData(txData types.TransactionData) (BotRecordUpdateTransaction, error) + func (brutx *BotRecordUpdateTransaction) RequiredBotFee(oneCoin types.Currency) (fee types.Currency) + func (brutx *BotRecordUpdateTransaction) RevertBotRecordUpdate(record *BotRecord) error + func (brutx *BotRecordUpdateTransaction) Transaction(oneCoin types.Currency) types.Transaction + func (brutx *BotRecordUpdateTransaction) TransactionData(oneCoin types.Currency) types.TransactionData + func (brutx *BotRecordUpdateTransaction) UnmarshalRivine(r io.Reader) error + func (brutx *BotRecordUpdateTransaction) UnmarshalSia(r io.Reader) error + func (brutx *BotRecordUpdateTransaction) UpdateBotRecord(blockTime types.Timestamp, record *BotRecord) error + func (brutx BotRecordUpdateTransaction) MarshalRivine(w io.Writer) error + func (brutx BotRecordUpdateTransaction) MarshalSia(w io.Writer) error + type BotRecordUpdateTransactionExtension struct + AddressUpdate BotRecordAddressUpdate + Identifier BotID + NameUpdate BotRecordNameUpdate + NrOfMonths uint8 + Signature types.ByteSlice + func (brutxe *BotRecordUpdateTransactionExtension) RequiredBotFee(oneCoin types.Currency) (fee types.Currency) + type BotRegistrationTransaction struct + Addresses []NetworkAddress + CoinInputs []types.CoinInput + Identification PublicKeySignaturePair + Names []BotName + NrOfMonths uint8 + RefundCoinOutput *types.CoinOutput + TransactionFee types.Currency + func BotRegistrationTransactionFromTransaction(tx types.Transaction) (BotRegistrationTransaction, error) + func BotRegistrationTransactionFromTransactionData(txData types.TransactionData) (BotRegistrationTransaction, error) + func (brtx *BotRegistrationTransaction) RequiredBotFee(oneCoin types.Currency) types.Currency + func (brtx *BotRegistrationTransaction) Transaction(oneCoin types.Currency) types.Transaction + func (brtx *BotRegistrationTransaction) TransactionData(oneCoin types.Currency) types.TransactionData + func (brtx *BotRegistrationTransaction) UnmarshalRivine(r io.Reader) error + func (brtx *BotRegistrationTransaction) UnmarshalSia(r io.Reader) error + func (brtx BotRegistrationTransaction) MarshalRivine(w io.Writer) error + func (brtx BotRegistrationTransaction) MarshalSia(w io.Writer) error + type BotRegistrationTransactionController struct + OneCoin types.Currency + Registry BotRecordReadRegistry + RegistryPoolAddress types.UnlockHash + func (brtc BotRegistrationTransactionController) DecodeTransactionData(r io.Reader) (types.TransactionData, error) + func (brtc BotRegistrationTransactionController) EncodeTransactionData(w io.Writer, txData types.TransactionData) error + func (brtc BotRegistrationTransactionController) EncodeTransactionIDInput(w io.Writer, txData types.TransactionData) error + func (brtc BotRegistrationTransactionController) GetCommonExtensionData(extension interface{}) (types.CommonTransactionExtensionData, error) + func (brtc BotRegistrationTransactionController) GetCustomMinerPayouts(extension interface{}) ([]types.MinerPayout, error) + func (brtc BotRegistrationTransactionController) JSONDecodeTransactionData(data []byte) (types.TransactionData, error) + func (brtc BotRegistrationTransactionController) JSONEncodeTransactionData(txData types.TransactionData) ([]byte, error) + func (brtc BotRegistrationTransactionController) SignExtension(extension interface{}, ...) (interface{}, error) + func (brtc BotRegistrationTransactionController) SignatureHash(t types.Transaction, extraObjects ...interface{}) (crypto.Hash, error) + type BotRegistrationTransactionExtension struct + Addresses []NetworkAddress + Identification PublicKeySignaturePair + Names []BotName + NrOfMonths uint8 + func (brtxe *BotRegistrationTransactionExtension) RequiredBotFee(oneCoin types.Currency) types.Currency + type BotUpdateRecordTransactionController struct + OneCoin types.Currency + Registry BotRecordReadRegistry + RegistryPoolAddress types.UnlockHash + func (brutc BotUpdateRecordTransactionController) DecodeTransactionData(r io.Reader) (types.TransactionData, error) + func (brutc BotUpdateRecordTransactionController) EncodeTransactionData(w io.Writer, txData types.TransactionData) error + func (brutc BotUpdateRecordTransactionController) EncodeTransactionIDInput(w io.Writer, txData types.TransactionData) error + func (brutc BotUpdateRecordTransactionController) GetCustomMinerPayouts(extension interface{}) ([]types.MinerPayout, error) + func (brutc BotUpdateRecordTransactionController) JSONDecodeTransactionData(data []byte) (types.TransactionData, error) + func (brutc BotUpdateRecordTransactionController) JSONEncodeTransactionData(txData types.TransactionData) ([]byte, error) + func (brutc BotUpdateRecordTransactionController) SignExtension(extension interface{}, ...) (interface{}, error) + func (brutc BotUpdateRecordTransactionController) SignatureHash(t types.Transaction, extraObjects ...interface{}) (crypto.Hash, error) + type CompactTimestamp uint64 + const CompactTimestampAccuracyInSeconds + const CompactTimestampNullpoint + func NowAsCompactTimestamp() CompactTimestamp + func SiaTimestampAsCompactTimestamp(ts types.Timestamp) CompactTimestamp + func (cts *CompactTimestamp) SetUInt32(x uint32) + func (cts *CompactTimestamp) UnmarshalJSON(b []byte) error + func (cts *CompactTimestamp) UnmarshalRivine(r io.Reader) error + func (cts *CompactTimestamp) UnmarshalSia(r io.Reader) error + func (cts CompactTimestamp) MarshalRivine(w io.Writer) error + func (cts CompactTimestamp) MarshalSia(w io.Writer) error + func (cts CompactTimestamp) SiaTimestamp() types.Timestamp + func (cts CompactTimestamp) UInt32() uint32 + type NetworkAddress struct + func NewNetworkAddress(addr string) (NetworkAddress, error) + func (na *NetworkAddress) LoadString(str string) (err error) + func (na *NetworkAddress) UnmarshalJSON(b []byte) error + func (na *NetworkAddress) UnmarshalRivine(r io.Reader) error + func (na *NetworkAddress) UnmarshalSia(r io.Reader) error + func (na NetworkAddress) Compare(ona NetworkAddress) int + func (na NetworkAddress) Equals(ona NetworkAddress) bool + func (na NetworkAddress) MarshalJSON() ([]byte, error) + func (na NetworkAddress) MarshalRivine(w io.Writer) error + func (na NetworkAddress) MarshalSia(w io.Writer) error + func (na NetworkAddress) String() string + type NetworkAddressSortedSet struct + func (nass *NetworkAddressSortedSet) AddAddress(address NetworkAddress) error + func (nass *NetworkAddressSortedSet) BinaryDecode(r io.Reader, length int) error + func (nass *NetworkAddressSortedSet) RemoveAddress(address NetworkAddress) error + func (nass *NetworkAddressSortedSet) UnmarshalJSON(data []byte) error + func (nass *NetworkAddressSortedSet) UnmarshalRivine(r io.Reader) error + func (nass *NetworkAddressSortedSet) UnmarshalSia(r io.Reader) error + func (nass NetworkAddressSortedSet) BinaryEncode(w io.Writer) (int, error) + func (nass NetworkAddressSortedSet) Len() int + func (nass NetworkAddressSortedSet) MarshalJSON() ([]byte, error) + func (nass NetworkAddressSortedSet) MarshalRivine(w io.Writer) error + func (nass NetworkAddressSortedSet) MarshalSia(w io.Writer) error + type NetworkAddressType uint8 + const NetworkAddressHostname + const NetworkAddressIPv4 + const NetworkAddressIPv6 + type PublicKeySignaturePair struct + PublicKey types.PublicKey + Signature types.ByteSlice + func (pksp *PublicKeySignaturePair) UnmarshalRivine(r io.Reader) error + func (pksp *PublicKeySignaturePair) UnmarshalSia(r io.Reader) error + func (pksp PublicKeySignaturePair) MarshalRivine(w io.Writer) error + func (pksp PublicKeySignaturePair) MarshalSia(w io.Writer) error + type TransactionNonce [TransactionNonceLength]byte + func RandomTransactionNonce() (nonce TransactionNonce) + func (tn *TransactionNonce) UnmarshalJSON(in []byte) error + func (tn TransactionNonce) MarshalJSON() ([]byte, error) v1.2.0-rc1 Oct 8, 2019