Documentation ¶
Index ¶
- Constants
- Variables
- func Bech32Decode(bech32 string) (hrp string, data []byte)
- func Bech32Encode(hrp string, data []byte) string
- func IsBech32Valid(bech32 string) bool
- func MerkleRoot(txs []byte) [32]byte
- func VerifyHrp(hrp string) bool
- type AccountType
- type Address
- type Block
- func (block Block) Hash() Hash
- func (block Block) Legacy() BlockLegacy
- func (block Block) MarshalJSON() ([]byte, error)
- func (block Block) MerkleRootHash() (hash Hash)
- func (block Block) PreviousBlockHash() (hash Hash)
- func (block Block) PublicKey() PublicKey
- func (block Block) SetMerkleRootHash(hash Hash)
- func (block Block) SetPreviousBlockHash(hash Hash)
- func (block Block) SetPublicKey(publicKey PublicKey)
- func (block Block) SetTimestamp(timestamp uint32)
- func (block Block) SetTransactionCount(txCount int) Block
- func (block Block) SetVersion(version uint8) Block
- func (block Block) Timestamp() uint32
- func (block Block) Transaction(idx int) Transaction
- func (block Block) TransactionCount() int
- func (block Block) Verify() error
- func (block Block) Version() uint8
- type BlockLegacy
- func (block BlockLegacy) Hash() Hash
- func (block BlockLegacy) MerkleRootHash() (hash Hash)
- func (block BlockLegacy) PreviousBlockHash() (hash Hash)
- func (block BlockLegacy) PublicKey() PublicKey
- func (block BlockLegacy) SetVersion(version uint8)
- func (block BlockLegacy) Timestamp() uint32
- func (block BlockLegacy) Transaction(idx int) Transaction
- func (block BlockLegacy) TransactionCount() int
- func (block BlockLegacy) Verify() error
- func (block BlockLegacy) Version() uint8
- type Hash
- type Prefix
- type PublicKey
- type SecretKey
- type Transaction
- func (transaction Transaction) Amount() uint64
- func (transaction Transaction) BlockHeight() uint32
- func (transaction Transaction) BlockTimestamp() uint32
- func (transaction Transaction) BlockTransactionIndex() uint16
- func (transaction Transaction) Description() (description string)
- func (transaction Transaction) FeeAccountBalance() uint64
- func (transaction Transaction) FeeAccountInterestRate() uint16
- func (transaction Transaction) FeeAccountTransactionCount() uint64
- func (transaction Transaction) FeeAddress() (address Address)
- func (transaction Transaction) FeeAmount() uint64
- func (transaction Transaction) FeePercent() uint16
- func (transaction Transaction) FeePercentMeta() uint16
- func (transaction Transaction) HasFee() bool
- func (transaction Transaction) HasRecipient() bool
- func (transaction Transaction) Hash() Hash
- func (transaction Transaction) MarshalJSON() ([]byte, error)
- func (transaction Transaction) Nonce() uint32
- func (transaction Transaction) Prefix() Prefix
- func (transaction Transaction) ProfitPercent() uint16
- func (transaction Transaction) Recipient() (recipient Address)
- func (transaction Transaction) RecipientAccountBalance() uint64
- func (transaction Transaction) RecipientAccountInterestRate() uint16
- func (transaction Transaction) RecipientAccountTransactionCount() uint64
- func (transaction Transaction) RecipientAccountType() AccountType
- func (transaction Transaction) Sender() (sender Address)
- func (transaction Transaction) SenderAccountBalance() uint64
- func (transaction Transaction) SenderAccountInterestRate() uint16
- func (transaction Transaction) SenderAccountTransactionCount() uint64
- func (transaction Transaction) SenderAccountType() AccountType
- func (transaction Transaction) SetAmount(amount uint64) Transaction
- func (transaction Transaction) SetBlockHeight(height uint32)
- func (transaction Transaction) SetBlockTimestamp(timestamp uint32)
- func (transaction Transaction) SetBlockTransactionIndex(index int)
- func (transaction Transaction) SetDescription(description string) Transaction
- func (transaction Transaction) SetFeeAccountBalance(balance uint64)
- func (transaction Transaction) SetFeeAccountInterestRate(percent uint16)
- func (transaction Transaction) SetFeeAccountTransactionCount(height uint64)
- func (transaction Transaction) SetFeeAddress(address Address)
- func (transaction Transaction) SetFeeAmount(amount uint64)
- func (transaction Transaction) SetFeePercent(val uint16) Transaction
- func (transaction Transaction) SetFeePercentMeta(percent uint16)
- func (transaction Transaction) SetNonce(nonce uint32) Transaction
- func (transaction Transaction) SetPrefix(pfx Prefix) Transaction
- func (transaction Transaction) SetProfitPercent(val uint16) Transaction
- func (transaction Transaction) SetRecipient(recipient Address) Transaction
- func (transaction Transaction) SetRecipientAccountBalance(balance uint64)
- func (transaction Transaction) SetRecipientAccountInterestRate(percent uint16)
- func (transaction Transaction) SetRecipientAccountTransactionCount(height uint64)
- func (transaction Transaction) SetRecipientAccountType(accountType AccountType)
- func (transaction Transaction) SetSender(sender Address) Transaction
- func (transaction Transaction) SetSenderAccountBalance(balance uint64)
- func (transaction Transaction) SetSenderAccountInterestRate(percent uint16)
- func (transaction Transaction) SetSenderAccountTransactionCount(height uint64)
- func (transaction Transaction) SetSenderAccountType(accountType AccountType)
- func (transaction Transaction) SetSubstructure(substructure uint8) Transaction
- func (transaction Transaction) SetTimestamp(epoch uint32) Transaction
- func (transaction Transaction) SetTransactionHeight(height uint64)
- func (transaction Transaction) SetVersion(version uint8) Transaction
- func (transaction Transaction) Timestamp() uint32
- func (transaction Transaction) TransactionHeight() uint64
- func (transaction Transaction) Type() string
- func (transaction Transaction) Verify() error
- func (transaction Transaction) Version() uint8
- type TxIndex
Constants ¶
View Source
const ( PfxVerGenesis Prefix = 0x0000 PfxVerUmi Prefix = 0x55A9 PfxVerRoy Prefix = 0x49F9 PfxVerIsp Prefix = 0x2670 PfxVerGls Prefix = 0x1d93 PfxVerGlz Prefix = 0x1d9a PfxVerRod Prefix = 0x49E4 PfxSubRod uint16 = 32768 )
View Source
const ( TxLength = 150 TxConfirmedLength = 268 )
View Source
const ( TxV0Genesis uint8 = iota TxV1Send TxV2CreateStructure TxV3UpdateStructure TxV4ChangeProfitAddress TxV5ChangeFeeAddress TxV6ActivateTransit TxV7DeactivateTransit TxV8Send TxV9CreateStructure TxV10UpdateStructure TxV11ChangeProfitAddress TxV12ChangeFeeAddress TxV13ActivateTransit TxV14DeactivateTransit TxV15Burn TxV16CreateSubstructure TxV17UpdateSubStructure TxV18BurnRod )
View Source
const ( TxGenesis = "genesis" TxSend = "send" TxCreateStructure = "createStructure" TxUpdateStructure = "updateStructure" TxChangeProfitAddress = "changeProfitAddress" TxChangeFeeAddress = "changeFeeAddress" TxActivateTransit = "activateTransit" TxDeactivateTransit = "deactivateTransit" TxBurn = "burn" TxCreateSubstructure = "createSubstructure" TxUpdateSubstructure = "updateSubstructure" TxBurnRod = "burnRod" )
View Source
const (
AddrLength = 34
)
View Source
const (
HdrLength = 167
)
View Source
const (
PfxLength = 2
)
Variables ¶
View Source
var ErrAddress = errors.New("address")
View Source
var ErrBlock = errors.New("block")
View Source
var ErrVerify = errors.New("err")
Functions ¶
func Bech32Decode ¶
func Bech32Encode ¶
func IsBech32Valid ¶
func MerkleRoot ¶
Types ¶
type AccountType ¶
type AccountType uint8
const ( Genesis AccountType = iota Umi Deposit Fee Profit Transit Dev Royalty )
func (AccountType) String ¶
func (accountType AccountType) String() string
type Block ¶
type Block []byte
func (Block) Legacy ¶
func (block Block) Legacy() BlockLegacy
func (Block) MarshalJSON ¶
func (Block) MerkleRootHash ¶
func (Block) PreviousBlockHash ¶
func (Block) SetMerkleRootHash ¶
func (Block) SetPreviousBlockHash ¶
func (Block) SetPublicKey ¶
func (Block) SetTimestamp ¶
func (Block) SetTransactionCount ¶
func (Block) SetVersion ¶
func (Block) Transaction ¶
func (block Block) Transaction(idx int) Transaction
func (Block) TransactionCount ¶
type BlockLegacy ¶
type BlockLegacy []byte
func (BlockLegacy) Hash ¶
func (block BlockLegacy) Hash() Hash
func (BlockLegacy) MerkleRootHash ¶
func (block BlockLegacy) MerkleRootHash() (hash Hash)
func (BlockLegacy) PreviousBlockHash ¶
func (block BlockLegacy) PreviousBlockHash() (hash Hash)
func (BlockLegacy) PublicKey ¶
func (block BlockLegacy) PublicKey() PublicKey
func (BlockLegacy) SetVersion ¶
func (block BlockLegacy) SetVersion(version uint8)
func (BlockLegacy) Timestamp ¶
func (block BlockLegacy) Timestamp() uint32
func (BlockLegacy) Transaction ¶
func (block BlockLegacy) Transaction(idx int) Transaction
func (BlockLegacy) TransactionCount ¶
func (block BlockLegacy) TransactionCount() int
func (BlockLegacy) Verify ¶
func (block BlockLegacy) Verify() error
func (BlockLegacy) Version ¶
func (block BlockLegacy) Version() uint8
type Transaction ¶
type Transaction []byte
func NewTransaction ¶
func NewTransaction() Transaction
func (Transaction) Amount ¶
func (transaction Transaction) Amount() uint64
func (Transaction) BlockHeight ¶
func (transaction Transaction) BlockHeight() uint32
func (Transaction) BlockTimestamp ¶
func (transaction Transaction) BlockTimestamp() uint32
func (Transaction) BlockTransactionIndex ¶
func (transaction Transaction) BlockTransactionIndex() uint16
func (Transaction) Description ¶
func (transaction Transaction) Description() (description string)
func (Transaction) FeeAccountBalance ¶
func (transaction Transaction) FeeAccountBalance() uint64
func (Transaction) FeeAccountInterestRate ¶
func (transaction Transaction) FeeAccountInterestRate() uint16
func (Transaction) FeeAccountTransactionCount ¶
func (transaction Transaction) FeeAccountTransactionCount() uint64
func (Transaction) FeeAddress ¶
func (transaction Transaction) FeeAddress() (address Address)
func (Transaction) FeeAmount ¶
func (transaction Transaction) FeeAmount() uint64
func (Transaction) FeePercent ¶
func (transaction Transaction) FeePercent() uint16
func (Transaction) FeePercentMeta ¶
func (transaction Transaction) FeePercentMeta() uint16
func (Transaction) HasFee ¶
func (transaction Transaction) HasFee() bool
func (Transaction) HasRecipient ¶
func (transaction Transaction) HasRecipient() bool
func (Transaction) Hash ¶
func (transaction Transaction) Hash() Hash
func (Transaction) MarshalJSON ¶
func (transaction Transaction) MarshalJSON() ([]byte, error)
func (Transaction) Nonce ¶
func (transaction Transaction) Nonce() uint32
func (Transaction) Prefix ¶
func (transaction Transaction) Prefix() Prefix
func (Transaction) ProfitPercent ¶
func (transaction Transaction) ProfitPercent() uint16
func (Transaction) Recipient ¶
func (transaction Transaction) Recipient() (recipient Address)
func (Transaction) RecipientAccountBalance ¶
func (transaction Transaction) RecipientAccountBalance() uint64
func (Transaction) RecipientAccountInterestRate ¶
func (transaction Transaction) RecipientAccountInterestRate() uint16
func (Transaction) RecipientAccountTransactionCount ¶
func (transaction Transaction) RecipientAccountTransactionCount() uint64
func (Transaction) RecipientAccountType ¶
func (transaction Transaction) RecipientAccountType() AccountType
func (Transaction) Sender ¶
func (transaction Transaction) Sender() (sender Address)
func (Transaction) SenderAccountBalance ¶
func (transaction Transaction) SenderAccountBalance() uint64
func (Transaction) SenderAccountInterestRate ¶
func (transaction Transaction) SenderAccountInterestRate() uint16
func (Transaction) SenderAccountTransactionCount ¶
func (transaction Transaction) SenderAccountTransactionCount() uint64
func (Transaction) SenderAccountType ¶
func (transaction Transaction) SenderAccountType() AccountType
func (Transaction) SetAmount ¶
func (transaction Transaction) SetAmount(amount uint64) Transaction
func (Transaction) SetBlockHeight ¶
func (transaction Transaction) SetBlockHeight(height uint32)
func (Transaction) SetBlockTimestamp ¶
func (transaction Transaction) SetBlockTimestamp(timestamp uint32)
func (Transaction) SetBlockTransactionIndex ¶
func (transaction Transaction) SetBlockTransactionIndex(index int)
func (Transaction) SetDescription ¶
func (transaction Transaction) SetDescription(description string) Transaction
func (Transaction) SetFeeAccountBalance ¶
func (transaction Transaction) SetFeeAccountBalance(balance uint64)
func (Transaction) SetFeeAccountInterestRate ¶
func (transaction Transaction) SetFeeAccountInterestRate(percent uint16)
func (Transaction) SetFeeAccountTransactionCount ¶
func (transaction Transaction) SetFeeAccountTransactionCount(height uint64)
func (Transaction) SetFeeAddress ¶
func (transaction Transaction) SetFeeAddress(address Address)
func (Transaction) SetFeeAmount ¶
func (transaction Transaction) SetFeeAmount(amount uint64)
func (Transaction) SetFeePercent ¶
func (transaction Transaction) SetFeePercent(val uint16) Transaction
func (Transaction) SetFeePercentMeta ¶
func (transaction Transaction) SetFeePercentMeta(percent uint16)
func (Transaction) SetNonce ¶
func (transaction Transaction) SetNonce(nonce uint32) Transaction
func (Transaction) SetPrefix ¶
func (transaction Transaction) SetPrefix(pfx Prefix) Transaction
func (Transaction) SetProfitPercent ¶
func (transaction Transaction) SetProfitPercent(val uint16) Transaction
func (Transaction) SetRecipient ¶
func (transaction Transaction) SetRecipient(recipient Address) Transaction
func (Transaction) SetRecipientAccountBalance ¶
func (transaction Transaction) SetRecipientAccountBalance(balance uint64)
func (Transaction) SetRecipientAccountInterestRate ¶
func (transaction Transaction) SetRecipientAccountInterestRate(percent uint16)
func (Transaction) SetRecipientAccountTransactionCount ¶
func (transaction Transaction) SetRecipientAccountTransactionCount(height uint64)
func (Transaction) SetRecipientAccountType ¶
func (transaction Transaction) SetRecipientAccountType(accountType AccountType)
func (Transaction) SetSender ¶
func (transaction Transaction) SetSender(sender Address) Transaction
func (Transaction) SetSenderAccountBalance ¶
func (transaction Transaction) SetSenderAccountBalance(balance uint64)
func (Transaction) SetSenderAccountInterestRate ¶
func (transaction Transaction) SetSenderAccountInterestRate(percent uint16)
func (Transaction) SetSenderAccountTransactionCount ¶
func (transaction Transaction) SetSenderAccountTransactionCount(height uint64)
func (Transaction) SetSenderAccountType ¶
func (transaction Transaction) SetSenderAccountType(accountType AccountType)
func (Transaction) SetSubstructure ¶
func (transaction Transaction) SetSubstructure(substructure uint8) Transaction
func (Transaction) SetTimestamp ¶
func (transaction Transaction) SetTimestamp(epoch uint32) Transaction
func (Transaction) SetTransactionHeight ¶
func (transaction Transaction) SetTransactionHeight(height uint64)
func (Transaction) SetVersion ¶
func (transaction Transaction) SetVersion(version uint8) Transaction
func (Transaction) Timestamp ¶
func (transaction Transaction) Timestamp() uint32
func (Transaction) TransactionHeight ¶
func (transaction Transaction) TransactionHeight() uint64
func (Transaction) Type ¶
func (transaction Transaction) Type() string
func (Transaction) Verify ¶
func (transaction Transaction) Verify() error
func (Transaction) Version ¶
func (transaction Transaction) Version() uint8
Click to show internal directories.
Click to hide internal directories.