Documentation ¶
Index ¶
- Constants
- Variables
- func BlindHash(hash, secret []byte) ([]byte, error)
- func EncodeAddress(typ AddressType, addrhash []byte) (string, error)
- func EncodeBlindedAddress(hash, secret []byte) (string, error)
- func HasAddressPrefix(s string) bool
- func HasKeyPrefix(s string) bool
- func HasSignaturePrefix(s string) bool
- func IsAddressBytes(b []byte) bool
- func MatchBlindedAddress(a, b Address, secret []byte) bool
- type Address
- func (a Address) BakerAddress() string
- func (a Address) Bytes() []byte
- func (a Address) Bytes22() []byte
- func (a Address) Clone() Address
- func (a Address) ContractAddress() string
- func (a *Address) DecodeBlindedString(addr string) error
- func (a Address) Equal(b Address) bool
- func (a Address) IsValid() bool
- func (a Address) MarshalBinary() ([]byte, error)
- func (a Address) MarshalText() ([]byte, error)
- func (a Address) String() string
- func (a *Address) UnmarshalBinary(b []byte) error
- func (a *Address) UnmarshalText(data []byte) error
- type AddressFilter
- type AddressSet
- type AddressType
- type BallotVote
- type BlockHash
- type ChainIdHash
- type ExprHash
- type Hash
- type HashType
- type Key
- func (k Key) Address() Address
- func (k Key) Bytes() []byte
- func (k Key) Clone() Key
- func (k Key) Hash() []byte
- func (k Key) IsEqual(k2 Key) bool
- func (k Key) IsValid() bool
- func (k Key) MarshalBinary() ([]byte, error)
- func (k Key) MarshalText() ([]byte, error)
- func (k Key) String() string
- func (k *Key) UnmarshalBinary(b []byte) error
- func (k *Key) UnmarshalText(data []byte) error
- type KeyType
- type NonceHash
- type OpHash
- type OpStatus
- type OpType
- type Params
- func (p *Params) ContainsHeight(height int64) bool
- func (p *Params) ConvertAmount(value float64) int64
- func (p *Params) ConvertValue(amount int64) float64
- func (p *Params) CycleEndHeight(cycle int64) int64
- func (p *Params) CycleFromHeight(height int64) int64
- func (p *Params) CycleStartHeight(cycle int64) int64
- func (p *Params) ForNetwork(net ChainIdHash) *Params
- func (p *Params) ForProtocol(proto ProtocolHash) *Params
- func (p *Params) IsCycleEnd(height int64) bool
- func (p *Params) IsCycleStart(height int64) bool
- func (p *Params) IsMainnet() bool
- func (p *Params) IsPostBabylon() bool
- func (p *Params) IsPreBabylonHeight(height int64) bool
- func (p *Params) IsVoteEnd(height int64) bool
- func (p *Params) IsVoteStart(height int64) bool
- func (p *Params) MaxBlockReward() int64
- func (p *Params) MaxSnapshotIndex() int64
- func (p *Params) SnapshotBlock(cycle, index int64) int64
- func (p *Params) VotingStartCycleFromHeight(height int64) int64
- type ProtocolHash
- type RightType
- type Signature
- func (s Signature) Clone() Signature
- func (s Signature) IsEqual(s2 Signature) bool
- func (s Signature) IsValid() bool
- func (s Signature) MarshalBinary() ([]byte, error)
- func (s Signature) MarshalText() ([]byte, error)
- func (s Signature) String() string
- func (s *Signature) UnmarshalBinary(b []byte) error
- func (s *Signature) UnmarshalText(data []byte) error
- type SignatureType
- type VotingPeriodKind
Constants ¶
const ( Name = "Tezos" Symbol = "XTZ" // base58 prefixes for 4 byte hash magics CHAIN_ID_PREFIX = "Net" // base58 prefixes for 16 byte hash magics ID_HASH_PREFIX = "id" // base58 prefixes for 20 byte hash magics ED25519_PUBLIC_KEY_HASH_PREFIX = "tz1" SECP256K1_PUBLIC_KEY_HASH_PREFIX = "tz2" P256_PUBLIC_KEY_HASH_PREFIX = "tz3" NOCURVE_PUBLIC_KEY_HASH_PREFIX = "KT1" // originated contract identifier BAKER_PUBLIC_KEY_HASH_PREFIX = "SG1" // baker contract in v008 BLINDED_PUBLIC_KEY_HASH_PREFIX = "btz1" // blinded tz1 // base58 prefixes for 32 byte hash magics BLOCK_HASH_PREFIX = "B" OPERATION_HASH_PREFIX = "o" OPERATION_LIST_HASH_PREFIX = "Lo" OPERATION_LIST_LIST_HASH_PREFIX = "LLo" PROTOCOL_HASH_PREFIX = "P" CONTEXT_HASH_PREFIX = "Co" NONCE_HASH_PREFIX = "nce" ED25519_SEED_PREFIX = "edsk" ED25519_PUBLIC_KEY_PREFIX = "edpk" SECP256K1_SECRET_KEY_PREFIX = "spsk" P256_SECRET_KEY_PREFIX = "p2sk" // base58 prefixes for 33 byte hash magics SECP256K1_PUBLIC_KEY_PREFIX = "sppk" P256_PUBLIC_KEY_PREFIX = "p2pk" SECP256K1_SCALAR_PREFIX = "SSp" SECP256K1_ELEMENT_PREFIX = "GSp" // base58 prefixes for 54 byte hash magics SCRIPT_EXPR_HASH_PREFIX = "expr" // base58 prefixes for 56 byte hash magics ED25519_ENCRYPTED_SEED_PREFIX = "edesk" SECP256K1_ENCRYPTED_SECRET_KEY_PREFIX = "spesk" P256_ENCRYPTED_SECRET_KEY_PREFIX = "p2esk" // base58 prefixes for 64 byte hash magics ED25519_SECRET_KEY_PREFIX = "edsk" ED25519_SIGNATURE_PREFIX = "edsig" SECP256K1_SIGNATURE_PREFIX = "spsig1" P256_SIGNATURE_PREFIX = "p2sig" GENERIC_SIGNATURE_PREFIX = "sig" )
Variables ¶
var ( // ErrChecksumMismatch describes an error where decoding failed due // to a bad checksum. ErrChecksumMismatch = errors.New("checksum mismatch") // ErrUnknownAddressType describes an error where an address can not // decoded as a specific address type due to the string encoding // begining with an identifier byte unknown to any standard or // registered (via Register) network. ErrUnknownAddressType = errors.New("unknown address type") // InvalidAddress is an empty invalid address InvalidAddress = Address{Type: AddressTypeInvalid, Hash: nil} // ZeroAddress is a tz1 address with all bytes zero ZeroAddress = Address{Type: AddressTypeEd25519, Hash: make([]byte, HashTypePkhEd25519.Len())} )
var ( // ErrUnknownHashType describes an error where a hash can not // decoded as a specific hash type because the string encoding // starts with an unknown identifier. ErrUnknownHashType = errors.New("unknown hash type") // InvalidHash represents an empty invalid hash type InvalidHash = Hash{Type: HashTypeInvalid, Hash: nil} // ZeroHash ZeroOpHash = NewOpHash(make([]byte, HashTypeOperation.Len())) ZeroBlockHash = NewBlockHash(make([]byte, HashTypeBlock.Len())) )
var ( // ErrUnknownKeyType describes an error where a type for a // public key is undefined. ErrUnknownKeyType = errors.New("unknown key type") InvalidKey = Key{Type: KeyTypeInvalid, Data: nil} )
var ( // 4 byte hash magics CHAIN_ID = []byte{0x57, 0x52, 0x00} // "\087\082\000" (* Net(15) *) // 16 byte hash magics ID_HASH_ID = []byte{0x99, 0x67} // "\153\103" (* id(30) *) cryptobox_public_key_hash // 20 byte hash magics ED25519_PUBLIC_KEY_HASH_ID = []byte{0x06, 0xA1, 0x9F} // "\006\161\159" (* tz1(36) *) SECP256K1_PUBLIC_KEY_HASH_ID = []byte{0x06, 0xA1, 0xA1} // "\006\161\161" (* tz2(36) *) P256_PUBLIC_KEY_HASH_ID = []byte{0x06, 0xA1, 0xA4} // "\006\161\164" (* tz3(36) *) NOCURVE_PUBLIC_KEY_HASH_ID = []byte{0x02, 0x5A, 0x79} // "\002\090\121" (* KT1(36) *) BAKER_PUBLIC_KEY_HASH_ID = []byte{0x03, 0x38, 0xE2} // "\003\056\226" (* SG1(36) *) BLINDED_PUBLIC_KEY_HASH_ID = []byte{0x01, 0x02, 0x31, 0xDF} // "\002\090\121" (* btz1(37) *) // 32 byte hash magics BLOCK_HASH_ID = []byte{0x01, 0x34} // "\001\052" (* B(51) *) OPERATION_HASH_ID = []byte{0x05, 0x74} // "\005\116" (* o(51) *) OPERATION_LIST_HASH_ID = []byte{0x85, 0xE9} // "\133\233" (* Lo(52) *) OPERATION_LIST_LIST_HASH_ID = []byte{0x1D, 0x9F, 0x6D} // "\029\159\109" (* LLo(53) *) PROTOCOL_HASH_ID = []byte{0x02, 0xAA} // "\002\170" (* P(51) *) CONTEXT_HASH_ID = []byte{0x4F, 0xC7} // "\079\199" (* Co(52) *) NONCE_HASH_ID = []byte{0x45, 0xDC, 0xA9} // "\069\220\169" (* nce(53) *) ED25519_SEED_ID = []byte{0x0D, 0x0F, 0x3A, 0x07} // "\013\015\058\007" (* edsk(54) *) ED25519_PUBLIC_KEY_ID = []byte{0x0D, 0x0F, 0x25, 0xD9} // "\013\015\037\217" (* edpk(54) *) SECP256K1_SECRET_KEY_ID = []byte{0x11, 0xA2, 0xE0, 0xD2} // "\017\162\224\201" (* spsk(54) *) P256_SECRET_KEY_ID = []byte{0x10, 0x51, 0xEE, 0xBD} // "\016\081\238\189" (* p2sk(54) *) // 33 byte hash magics SECP256K1_PUBLIC_KEY_ID = []byte{0x03, 0xFE, 0xE2, 0x56} // "\003\254\226\086" (* sppk(55) *) P256_PUBLIC_KEY_ID = []byte{0x03, 0xB2, 0x8B, 0x7F} // "\003\178\139\127" (* p2pk(55) *) SECP256K1_SCALAR_ID = []byte{0x26, 0xF8, 0x88} // "\038\248\136" (* SSp(53) *) SECP256K1_ELEMENT_ID = []byte{0x05, 0x5C, 0x00} // "\005\092\000" (* GSp(54) *) // 54 byte hash magics SCRIPT_EXPR_HASH_ID = []byte{0x0D, 0x2C, 0x40, 0x1B} // "\013\044\064\027" (* expr(54) *) // 56 byte hash magics ED25519_ENCRYPTED_SEED_ID = []byte{0x07, 0x5A, 0x3C, 0xB3, 0x29} // "\007\090\060\179\041" (* edesk(88) *) SECP256K1_ENCRYPTED_SECRET_KEY_ID = []byte{0x09, 0xED, 0xF1, 0xAE, 0x96} // "\009\237\241\174\150" (* spesk(88) *) P256_ENCRYPTED_SECRET_KEY_ID = []byte{0x09, 0x30, 0x39, 0x73, 0xAB} // "\009\048\057\115\171" (* p2esk(88) *) // 64 byte hash magics ED25519_SECRET_KEY_ID = []byte{0x2B, 0xF6, 0x4E, 0x07} // "\043\246\078\007" (* edsk(98) *) ED25519_SIGNATURE_ID = []byte{0x09, 0xF5, 0xCD, 0x86, 0x12} // "\009\245\205\134\018" (* edsig(99) *) SECP256K1_SIGNATURE_ID = []byte{0x0D, 0x73, 0x65, 0x13, 0x3F} // "\013\115\101\019\063" (* spsig1(99) *) P256_SIGNATURE_ID = []byte{0x36, 0xF0, 0x2C, 0x34} // "\054\240\044\052" (* p2sig(98) *) GENERIC_SIGNATURE_ID = []byte{0x04, 0x82, 0x2B} // "\004\130\043" (* sig(96) *) )
var ( ProtoV000 = ParseProtocolHashSafe("Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P") ProtoV001 = ParseProtocolHashSafe("PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY") ProtoV002 = ParseProtocolHashSafe("PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt") ProtoV003 = ParseProtocolHashSafe("PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP") ProtoV004 = ParseProtocolHashSafe("Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd") ProtoV005_1 = ParseProtocolHashSafe("PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU") ProtoV005_2 = ParseProtocolHashSafe("PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS") ProtoV006_1 = ParseProtocolHashSafe("PtCarthavAMoXqbjBPVgDCRd5LgT7qqKWUPXnYii3xCaHRBMfHH") ProtoV006_2 = ParseProtocolHashSafe("PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb") ProtoV007 = ParseProtocolHashSafe("PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo") ProtoV008_1 = ParseProtocolHashSafe("PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq") ProtoV008_2 = ParseProtocolHashSafe("PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA") ProtoV009 = ParseProtocolHashSafe("PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i") Mainnet = MustParseChainIdHash("NetXdQprcVkpaWU") Alphanet = MustParseChainIdHash("NetXgtSLGNJvNye") Zeronet = MustParseChainIdHash("NetXKakFj1A7ouL") Babylonnet = MustParseChainIdHash("NetXUdfLh6Gm88t") Carthagenet = MustParseChainIdHash("NetXjD3HPJJjmcd") Delphinet = MustParseChainIdHash("NetXm8tYqnMWky1") Edonet = MustParseChainIdHash("NetXSp4gfdanies") Edonet2 = MustParseChainIdHash("NetXSgo1ZT2DRUG") Florencenet = MustParseChainIdHash("NetXxkAx4woPLyu") // maximum depth of branches for ops to be included on chain, also // defines max depth of a possible reorg and max block priorities MaxBranchDepth int64 = 64 )
var ( // ErrUnknownSignatureType describes an error where a type for a // signature is undefined. ErrUnknownSignatureType = errors.New("unknown signature type") InvalidSignature = Signature{Type: SignatureTypeInvalid, Data: nil} )
var VotingPeriods = []VotingPeriodKind{ VotingPeriodProposal, VotingPeriodExploration, VotingPeriodCooldown, VotingPeriodPromotion, VotingPeriodAdoption, }
Functions ¶
func EncodeAddress ¶
func EncodeAddress(typ AddressType, addrhash []byte) (string, error)
func EncodeBlindedAddress ¶
func HasAddressPrefix ¶
func HasKeyPrefix ¶
func HasSignaturePrefix ¶
func IsAddressBytes ¶
func MatchBlindedAddress ¶
Checks if address a when blinded with secret equals blinded address b.
Types ¶
type Address ¶
type Address struct { Type AddressType Hash []byte }
func DecodeBlindedAddress ¶
func MustParseAddress ¶
func NewAddress ¶
func NewAddress(typ AddressType, hash []byte) Address
func ParseAddress ¶
func (Address) BakerAddress ¶
BakerAddress returns the string encoding of the address when used as baker contract.
func (Address) Bytes22 ¶
Tezos compatible binary encoding with padding for contracts and leading 0-byte for EOAs
func (Address) ContractAddress ¶
ContractAddress returns the string encoding of the address when used as originated contract.
func (*Address) DecodeBlindedString ¶
func (Address) MarshalBinary ¶
output the 22 byte version
func (Address) MarshalText ¶
func (*Address) UnmarshalBinary ¶
support both the 21 byte and 22 byte versions be resilient to longer byte strings with extra padding
func (*Address) UnmarshalText ¶
type AddressFilter ¶
type AddressFilter struct {
// contains filtered or unexported fields
}
func NewAddressFilter ¶
func NewAddressFilter(addrs ...Address) *AddressFilter
func (*AddressFilter) Add ¶
func (s *AddressFilter) Add(addr Address)
func (*AddressFilter) AddUnique ¶
func (s *AddressFilter) AddUnique(addr Address) bool
func (AddressFilter) Contains ¶
func (s AddressFilter) Contains(addr Address) bool
func (*AddressFilter) Len ¶
func (s *AddressFilter) Len() int
func (*AddressFilter) Merge ¶
func (s *AddressFilter) Merge(b *AddressFilter)
func (*AddressFilter) Remove ¶
func (s *AddressFilter) Remove(addr Address)
type AddressSet ¶
type AddressSet struct {
// contains filtered or unexported fields
}
func NewAddressSet ¶
func NewAddressSet(addrs ...Address) *AddressSet
func (*AddressSet) Add ¶
func (s *AddressSet) Add(addr Address)
func (*AddressSet) AddUnique ¶
func (s *AddressSet) AddUnique(addr Address) bool
func (AddressSet) Contains ¶
func (s AddressSet) Contains(addr Address) bool
func (*AddressSet) Len ¶
func (s *AddressSet) Len() int
func (*AddressSet) Map ¶
func (s *AddressSet) Map() map[uint64]Address
func (*AddressSet) Merge ¶
func (s *AddressSet) Merge(b *AddressSet)
func (*AddressSet) Remove ¶
func (s *AddressSet) Remove(addr Address)
type AddressType ¶
type AddressType byte
const ( AddressTypeInvalid AddressType = iota AddressTypeEd25519 AddressTypeSecp256k1 AddressTypeP256 AddressTypeContract AddressTypeBlinded AddressTypeBaker )
func ParseAddressTag ¶
func ParseAddressTag(b byte) AddressType
func ParseAddressType ¶
func ParseAddressType(s string) AddressType
func (AddressType) HashType ¶
func (t AddressType) HashType() HashType
func (AddressType) IsValid ¶
func (t AddressType) IsValid() bool
func (AddressType) KeyType ¶
func (t AddressType) KeyType() KeyType
func (AddressType) Prefix ¶
func (t AddressType) Prefix() string
func (AddressType) String ¶
func (t AddressType) String() string
func (AddressType) Tag ¶
func (t AddressType) Tag() byte
type BallotVote ¶
type BallotVote byte
const ( BallotVoteInvalid BallotVote = iota BallotVoteYay BallotVoteNay BallotVotePass )
func ParseBallotVote ¶
func ParseBallotVote(s string) BallotVote
func (BallotVote) IsValid ¶
func (v BallotVote) IsValid() bool
func (BallotVote) MarshalText ¶
func (v BallotVote) MarshalText() ([]byte, error)
func (BallotVote) String ¶
func (v BallotVote) String() string
func (*BallotVote) UnmarshalText ¶
func (v *BallotVote) UnmarshalText(data []byte) error
type BlockHash ¶
type BlockHash struct {
Hash
}
BlockHash
func MustParseBlockHash ¶
func NewBlockHash ¶
func ParseBlockHash ¶
func (*BlockHash) UnmarshalBinary ¶
func (*BlockHash) UnmarshalText ¶
type ChainIdHash ¶
type ChainIdHash struct {
Hash
}
ChainIdHash
func MustParseChainIdHash ¶
func MustParseChainIdHash(s string) ChainIdHash
func NewChainIdHash ¶
func NewChainIdHash(buf []byte) ChainIdHash
func ParseChainIdHash ¶
func ParseChainIdHash(s string) (ChainIdHash, error)
func (ChainIdHash) Clone ¶
func (h ChainIdHash) Clone() ChainIdHash
func (ChainIdHash) Equal ¶
func (h ChainIdHash) Equal(h2 ChainIdHash) bool
func (*ChainIdHash) UnmarshalBinary ¶
func (h *ChainIdHash) UnmarshalBinary(data []byte) error
func (*ChainIdHash) UnmarshalText ¶
func (h *ChainIdHash) UnmarshalText(data []byte) error
type ExprHash ¶
type ExprHash struct {
Hash
}
ExprHash
func MustParseExprHash ¶
func NewExprHash ¶
func ParseExprHash ¶
func (*ExprHash) UnmarshalBinary ¶
func (*ExprHash) UnmarshalText ¶
type HashType ¶
type HashType byte
const ( HashTypeInvalid HashType = iota HashTypeChainId HashTypeId HashTypePkhEd25519 HashTypePkhSecp256k1 HashTypePkhP256 HashTypePkhNocurve HashTypePkhBlinded HashTypePkhBaker HashTypeBlock HashTypeOperation HashTypeOperationList HashTypeOperationListList HashTypeProtocol HashTypeContext HashTypeNonce HashTypeSeedEd25519 HashTypePkEd25519 HashTypeSkEd25519 HashTypePkSecp256k1 HashTypeSkSecp256k1 HashTypePkP256 HashTypeSkP256 HashTypeScalarSecp256k1 HashTypeElementSecp256k1 HashTypeScriptExpr HashTypeEncryptedSeedEd25519 HashTypeEncryptedSkSecp256k1 HashTypeEncryptedSkP256 HashTypeSigEd25519 HashTypeSigSecp256k1 HashTypeSigP256 HashTypeSigGeneric )
func ParseHashType ¶
func (HashType) MatchPrefix ¶
func (HashType) PrefixBytes ¶
type Key ¶
func (Key) MarshalBinary ¶
func (Key) MarshalText ¶
func (*Key) UnmarshalBinary ¶
func (*Key) UnmarshalText ¶
type KeyType ¶
type KeyType byte
func ParseKeyTag ¶
func (KeyType) AddressType ¶
func (t KeyType) AddressType() AddressType
func (KeyType) PrefixBytes ¶
type NonceHash ¶
type NonceHash struct {
Hash
}
NonceHash
func MustParseNonceHash ¶
func NewNonceHash ¶
func ParseNonceHash ¶
func ParseNonceHashSafe ¶
func (*NonceHash) UnmarshalBinary ¶
func (*NonceHash) UnmarshalText ¶
type OpHash ¶
type OpHash struct {
Hash
}
OpHash
func MustParseOpHash ¶
func ParseOpHash ¶
func (*OpHash) UnmarshalBinary ¶
func (*OpHash) UnmarshalText ¶
type OpStatus ¶
type OpStatus byte
func ParseOpStatus ¶
func (*OpStatus) MarshalText ¶
func (*OpStatus) UnmarshalText ¶
type OpType ¶
type OpType byte
const ( OpTypeBake OpType = iota // 0 OpTypeActivateAccount // 1 OpTypeDoubleBakingEvidence // 2 OpTypeDoubleEndorsementEvidence // 3 OpTypeSeedNonceRevelation // 4 OpTypeTransaction // 5 OpTypeOrigination // 6 OpTypeDelegation // 7 OpTypeReveal // 8 OpTypeEndorsement // 9 OpTypeProposals // 10 OpTypeBallot // 11 OpTypeUnfreeze // 12 indexer only OpTypeInvoice // 13 indexer only OpTypeAirdrop // 14 indexer only OpTypeSeedSlash // 15 indexer only OpTypeMigration // 16 indexer only OpTypeFailingNoop // 17 v009 OpTypeBatch = 254 // indexer only, output-only OpTypeInvalid = 255 )
func ParseOpTag ¶
func ParseOpType ¶
func (*OpType) MarshalText ¶
func (*OpType) UnmarshalText ¶
type Params ¶
type Params struct { // chain identity, not part of RPC Name string `json:"name"` Network string `json:"network"` Symbol string `json:"symbol"` Deployment int `json:"deployment"` // as activated on chain Version int `json:"version"` // as implemented ChainId ChainIdHash `json:"chain_id"` Protocol ProtocolHash `json:"protocol"` StartHeight int64 `json:"start_height"` EndHeight int64 `json:"end_height"` Decimals int `json:"decimals"` Token int64 `json:"units"` // atomic units per token NoRewardCycles int64 `json:"no_reward_cycles"` // from mainnet genesis SecurityDepositRampUpCycles int64 `json:"security_deposit_ramp_up_cycles"` // increase 1/64th each cycle PreservedCycles int64 `json:"preserved_cycles"` BlocksPerCycle int64 `json:"blocks_per_cycle"` BlocksPerCommitment int64 `json:"blocks_per_commitment"` BlocksPerRollSnapshot int64 `json:"blocks_per_roll_snapshot"` BlocksPerVotingPeriod int64 `json:"blocks_per_voting_period"` TimeBetweenBlocks [2]time.Duration `json:"time_between_blocks"` EndorsersPerBlock int `json:"endorsers_per_block"` HardGasLimitPerOperation int64 `json:"hard_gas_limit_per_operation"` HardGasLimitPerBlock int64 `json:"hard_gas_limit_per_block"` ProofOfWorkThreshold int64 `json:"proof_of_work_threshold"` ProofOfWorkNonceSize int `json:"proof_of_work_nonce_size"` TokensPerRoll int64 `json:"tokens_per_roll"` MichelsonMaximumTypeSize int `json:"michelson_maximum_type_size"` SeedNonceRevelationTip int64 `json:"seed_nonce_revelation_tip"` OriginationSize int64 `json:"origination_size"` OriginationBurn int64 `json:"origination_burn"` BlockSecurityDeposit int64 `json:"block_security_deposit"` EndorsementSecurityDeposit int64 `json:"endorsement_security_deposit"` BlockReward int64 `json:"block_reward"` EndorsementReward int64 `json:"endorsement_reward"` BlockRewardV6 [2]int64 `json:"block_rewards_v6"` EndorsementRewardV6 [2]int64 `json:"endorsement_rewards_v6"` CostPerByte int64 `json:"cost_per_byte"` HardStorageLimitPerOperation int64 `json:"hard_storage_limit_per_operation"` TestChainDuration int64 `json:"test_chain_duration"` MaxOperationDataLength int `json:"max_operation_data_length"` MaxProposalsPerDelegate int `json:"max_proposals_per_delegate"` MaxRevelationsPerBlock int `json:"max_revelations_per_block"` NonceLength int `json:"nonce_length"` // New in Bablyon v005 MinProposalQuorum int64 `json:"min_proposal_quorum"` QuorumMin int64 `json:"quorum_min"` QuorumMax int64 `json:"quorum_max"` // New in Delphi v007 MaxAnonOpsPerBlock int `json:"max_anon_ops_per_block"` // was max_revelations_per_block // hidden invoice feature Invoices map[string]int64 `json:"invoices,omitempty"` // extra features to follow protocol upgrades SilentSpendable bool `json:"silent_spendable"` // contracts are spendable/delegatable without flag set HasOriginationBug bool `json:"has_origination_bug"` ReactivateByTx bool `json:"reactivate_by_tx"` OperationTagsVersion int `json:"operation_tags_version"` NumVotingPeriods int `json:"num_voting_periods"` StartBlockOffset int64 `json:"vote_block_offset"` // correct voting start/end detection }
func (*Params) ContainsHeight ¶
func (*Params) ConvertAmount ¶
convertAmount converts a floating point number, which may or may not be representable as an integer, to an integer type by rounding to the nearest integer. This is performed consistent with the General Decimal Arithmetic spec and according to IEEE 754-2008 roundTiesToEven
func (*Params) ConvertValue ¶
func (*Params) CycleEndHeight ¶
func (*Params) CycleFromHeight ¶
func (*Params) CycleStartHeight ¶
func (*Params) ForNetwork ¶
func (p *Params) ForNetwork(net ChainIdHash) *Params
func (*Params) ForProtocol ¶
func (p *Params) ForProtocol(proto ProtocolHash) *Params
func (*Params) IsCycleEnd ¶
func (*Params) IsCycleStart ¶
func (*Params) IsPostBabylon ¶
func (*Params) IsPreBabylonHeight ¶
func (*Params) IsVoteStart ¶
func (*Params) MaxBlockReward ¶
func (*Params) MaxSnapshotIndex ¶
func (*Params) SnapshotBlock ¶
func (*Params) VotingStartCycleFromHeight ¶
type ProtocolHash ¶
type ProtocolHash struct {
Hash
}
ProtocolHash
func MustParseProtocolHash ¶
func MustParseProtocolHash(s string) ProtocolHash
func NewProtocolHash ¶
func NewProtocolHash(buf []byte) ProtocolHash
func ParseProtocolHash ¶
func ParseProtocolHash(s string) (ProtocolHash, error)
func ParseProtocolHashSafe ¶
func ParseProtocolHashSafe(s string) ProtocolHash
func (ProtocolHash) Clone ¶
func (h ProtocolHash) Clone() ProtocolHash
func (ProtocolHash) Equal ¶
func (h ProtocolHash) Equal(h2 ProtocolHash) bool
func (*ProtocolHash) UnmarshalBinary ¶
func (h *ProtocolHash) UnmarshalBinary(data []byte) error
func (*ProtocolHash) UnmarshalText ¶
func (h *ProtocolHash) UnmarshalText(data []byte) error
type RightType ¶
type RightType byte
func ParseRightType ¶
func (RightType) MarshalText ¶
func (*RightType) UnmarshalText ¶
type Signature ¶
type Signature struct { Type SignatureType Data []byte }
func NewSignature ¶
func NewSignature(typ SignatureType, data []byte) Signature
func ParseSignature ¶
func (Signature) MarshalBinary ¶
func (Signature) MarshalText ¶
func (*Signature) UnmarshalBinary ¶
func (*Signature) UnmarshalText ¶
type SignatureType ¶
type SignatureType byte
const ( SignatureTypeEd25519 SignatureType = iota SignatureTypeSecp256k1 SignatureTypeP256 SignatureTypeGeneric SignatureTypeInvalid )
func ParseSignatureTag ¶
func ParseSignatureTag(b byte) SignatureType
func (SignatureType) HashType ¶
func (t SignatureType) HashType() HashType
func (SignatureType) IsValid ¶
func (t SignatureType) IsValid() bool
func (SignatureType) Len ¶
func (t SignatureType) Len() int
func (SignatureType) Prefix ¶
func (t SignatureType) Prefix() string
func (SignatureType) PrefixBytes ¶
func (t SignatureType) PrefixBytes() []byte
func (SignatureType) Tag ¶
func (t SignatureType) Tag() byte
type VotingPeriodKind ¶
type VotingPeriodKind byte
const ( VotingPeriodInvalid VotingPeriodKind = iota VotingPeriodProposal VotingPeriodExploration VotingPeriodCooldown VotingPeriodPromotion VotingPeriodAdoption )
func ParseVotingPeriod ¶
func ParseVotingPeriod(s string) VotingPeriodKind
func ToVotingPeriod ¶
func ToVotingPeriod(i int) VotingPeriodKind
func (VotingPeriodKind) IsValid ¶
func (v VotingPeriodKind) IsValid() bool
func (VotingPeriodKind) MarshalText ¶
func (v VotingPeriodKind) MarshalText() ([]byte, error)
func (VotingPeriodKind) Num ¶
func (v VotingPeriodKind) Num() int
func (VotingPeriodKind) String ¶
func (v VotingPeriodKind) String() string
func (*VotingPeriodKind) UnmarshalText ¶
func (v *VotingPeriodKind) UnmarshalText(data []byte) error