package substrate
import "github.com/threefoldtech/tfchain/clients/tfchain-client-go"
Index ¶
- Constants
- Variables
- func Decode(data []byte, value interface{}) error
- func Encode(value interface{}) ([]byte, error)
- func FromKeyBytes(address []byte) (string, error)
- func HexEncodeToString(b []byte) string
- type AccountID
- func FromAddress(address string) (account AccountID, err error)
- func (a AccountID) MarshalJSON() ([]byte, error)
- func (a AccountID) PublicKey() []byte
- func (a AccountID) String() string
- type AccountInfo
- type ActivationServiceError
- type Approved
- type AveragePriceIsAboveMaxPrice
- type AveragePriceIsAboveMinPrice
- type Balance
- type BalancesMinted
- type BatchCreateContractData
- type BillingFrequencyChanged
- type BlockNumber
- type Bonded
- type BridgeBurnTransactionCreated
- type BridgeBurnTransactionExpired
- type BurnTransaction
- type BurnTransactionCreated
- type BurnTransactionProcessed
- type BurnTransactionProposed
- type BurnTransactionReady
- type BurnTransactionSignatureAdded
- type CallResponse
- type CertificationCodeStored
- type CertificationCodes
- type Closed
- type ClosedByCouncil
- type Conn
- type ConnectionPriceSet
- type Consumption
- type ConsumptionReportReceived
- type Contract
- type ContractBill
- type ContractBilled
- type ContractCreated
- type ContractDeployed
- type ContractGracePeriodElapsed
- type ContractGracePeriodEnded
- type ContractGracePeriodStarted
- type ContractPaymentOverdrawn
- type ContractResources
- type ContractState
- func (r *ContractState) Decode(decoder scale.Decoder) error
- func (r ContractState) Encode(encoder scale.Encoder) (err error)
- type ContractType
- func (r *ContractType) Decode(decoder scale.Decoder) error
- func (r ContractType) Encode(encoder scale.Encoder) (err error)
- type ContractUpdated
- type CouncilMemberVeto
- type DeletedState
- func (r *DeletedState) Decode(decoder scale.Decoder) error
- func (r DeletedState) Encode(encoder scale.Encoder) (err error)
- type Disapproved
- type DiscountLevel
- func (r *DiscountLevel) Decode(decoder scale.Decoder) error
- func (r DiscountLevel) Encode(encoder scale.Encoder) (err error)
- type Entity
- type EntityDeleted
- type EntityProof
- type EntityStored
- type EntryEvent
- type EventBatchCompletedWithErrors
- type EventDispatchedAs
- type EventItemFailed
- type EventRecords
- type EventSchedulerCallUnavailable
- type EventSchedulerPeriodicFailed
- type EventSchedulerPermanentlyOverweight
- type EventWithBalance
- type EventWithWho
- type Executed
- type Farm
- type FarmCertification
- func (p *FarmCertification) Decode(decoder scale.Decoder) error
- func (p FarmCertification) Encode(encoder scale.Encoder) (err error)
- type FarmCertificationSet
- type FarmDeleted
- type FarmMarkedAsDedicated
- type FarmPayoutV2AddressRegistered
- type FarmStored
- type FarmingPolicy
- type FarmingPolicyLimit
- type FarmingPolicySet
- type FarmingPolicyStored
- type FarmingPolicyUpdated
- type HexHash
- type IP
- type IPsFreed
- type IPsReserved
- type Identity
- func NewIdentityFromEd25519Key(sk ed25519.PrivateKey) (Identity, error)
- func NewIdentityFromEd25519Phrase(phrase string) (Identity, error)
- func NewIdentityFromSr25519Phrase(phrase string) (Identity, error)
- type Interface
- type Location
- type Manager
- type MemberEvent
- type Meta
- type MintCompleted
- type MintTransaction
- type MintTransactionExpired
- type MintTransactionProposed
- type MintTransactionVoted
- type NameContract
- type NameContractCanceled
- type Node
- type NodeCertification
- func (p *NodeCertification) Decode(decoder scale.Decoder) error
- func (p NodeCertification) Encode(encoder scale.Encoder) (err error)
- type NodeCertificationSet
- type NodeCertifierAdded
- type NodeCertifierRemoved
- type NodeContract
- type NodeContractCanceled
- type NodeDeleted
- type NodeExtra
- type NodeExtraFeeSet
- type NodeMarkAsDedicated
- type NodePower
- type NodePublicConfig
- type NodeStored
- type NodeUptimeReported
- type NruConsumption
- type NruConsumptionReportReceived
- type OffchainWorkerExecuted
- type OptionBoardSerial
- func (m *OptionBoardSerial) Decode(decoder scale.Decoder) (err error)
- func (m OptionBoardSerial) Encode(encoder scale.Encoder) (err error)
- type OptionDomain
- func (m *OptionDomain) Decode(decoder scale.Decoder) (err error)
- func (m OptionDomain) Encode(encoder scale.Encoder) (err error)
- type OptionFarmingPolicyLimit
- func (m *OptionFarmingPolicyLimit) Decode(decoder scale.Decoder) (err error)
- func (m OptionFarmingPolicyLimit) Encode(encoder scale.Encoder) (err error)
- type OptionIP
- func (m *OptionIP) Decode(decoder scale.Decoder) (err error)
- func (m OptionIP) Encode(encoder scale.Encoder) (err error)
- type OptionPublicConfig
- func (m *OptionPublicConfig) Decode(decoder scale.Decoder) (err error)
- func (m OptionPublicConfig) Encode(encoder scale.Encoder) (err error)
- type OptionRelay
- func (r *OptionRelay) Decode(decoder scale.Decoder) error
- func (m OptionRelay) Encode(encoder scale.Encoder) (err error)
- type Policy
- type Power
- func (r *Power) Decode(decoder scale.Decoder) error
- func (r Power) Encode(encoder scale.Encoder) (err error)
- type PowerState
- func (r *PowerState) Decode(decoder scale.Decoder) error
- func (r PowerState) Encode(encoder scale.Encoder) (err error)
- type PowerStateChanged
- type PowerTargetChanged
- type PriceStored
- type PricingPolicy
- type PricingPolicyStored
- type Proposed
- type Provider
- type PublicConfig
- type PublicIP
- type PublicIPInput
- type RefundTransaction
- type RefundTransactionCreated
- type RefundTransactionProcessed
- type RefundTransactionReady
- type RefundTransactionSignatureAdded
- type RentContract
- type RentContractCanceled
- type RentWaived
- type Resources
- type RewardDistributed
- type Role
- func (r *Role) Decode(decoder scale.Decoder) error
- func (r Role) Encode(encoder scale.Encoder) (err error)
- type ScannedNode
- type ServiceContract
- type ServiceContractBill
- type ServiceContractBilled
- type ServiceContractCanceled
- type ServiceContractCreated
- type ServiceContractState
- func (r *ServiceContractState) Decode(decoder scale.Decoder) error
- func (r ServiceContractState) Encode(encoder scale.Encoder) (err error)
- type SolutionProvider
- type SolutionProviderApproved
- type SolutionProviderCreated
- type StellarSignature
- type Substrate
- func (s *Substrate) AcceptTermsAndConditions(identity Identity, documentLink string, documentHash string) error
- func (s *Substrate) BatchAllCreateContract(identity Identity, contractData []BatchCreateContractData) ([]uint64, error)
- func (s *Substrate) BatchCancelContract(identity Identity, contracts []uint64) error
- func (s *Substrate) BatchCreateContract(identity Identity, contractData []BatchCreateContractData) ([]uint64, *int, error)
- func (s *Substrate) Call(cl Conn, meta Meta, identity Identity, call types.Call) (response *CallResponse, err error)
- func (s *Substrate) CallOnce(cl Conn, meta Meta, identity Identity, call types.Call) (hash types.Hash, err error)
- func (s *Substrate) CancelContract(identity Identity, contract uint64) error
- func (s *Substrate) Close()
- func (s *Substrate) CreateFarm(identity Identity, name string, publicIps []PublicIPInput) error
- func (s *Substrate) CreateNameContract(identity Identity, name string) (uint64, error)
- func (s *Substrate) CreateNode(identity Identity, node Node) (uint32, error)
- func (s *Substrate) CreateNodeContract(identity Identity, node uint32, body string, hash string, publicIPs uint32, solutionProviderID *uint64) (uint64, error)
- func (s *Substrate) CreateRefundTransactionOrAddSig(identity Identity, tx_hash string, target string, amount int64, signature string, stellarAddress string, sequence_number uint64) error
- func (s *Substrate) CreateRentContract(identity Identity, node uint32, solutionProviderID *uint64) (uint64, error)
- func (s *Substrate) CreateTwin(identity Identity, relay string, pk []byte) (uint32, error)
- func (s *Substrate) EnsureAccount(identity Identity, activationURL, termsAndConditionsLink, termsAndConditionsHash string) (info AccountInfo, err error)
- func (s *Substrate) FetchEventsForBlockRange(start uint32, end uint32) (types.StorageKey, []types.StorageChangeSet, error)
- func (s *Substrate) GetAccount(identity Identity) (info AccountInfo, err error)
- func (s *Substrate) GetAccountPublicInfo(account AccountID) (info AccountInfo, err error)
- func (s *Substrate) GetAverageTFTPrice() (price types.U32, err error)
- func (s *Substrate) GetBalance(account AccountID) (balance Balance, err error)
- func (s *Substrate) GetBlock(block types.Hash) (*types.SignedBlock, error)
- func (s *Substrate) GetBlockByNumber(blockNumber types.U32) (*types.SignedBlock, error)
- func (s *Substrate) GetBurnTransaction(burnTransactionID types.U64) (*BurnTransaction, error)
- func (s *Substrate) GetClient() (Conn, Meta, error)
- func (s *Substrate) GetContract(id uint64) (*Contract, error)
- func (s *Substrate) GetContractIDByNameRegistration(name string) (uint64, error)
- func (s *Substrate) GetContractWithHash(node uint32, hash HexHash) (uint64, error)
- func (s *Substrate) GetCurrentHeight() (uint32, error)
- func (s *Substrate) GetDedicatedNodePrice(nodeID uint32) (uint64, error)
- func (s *Substrate) GetDepositFee() (int64, error)
- func (s *Substrate) GetEntity(id uint32) (*Entity, error)
- func (s *Substrate) GetEventsForBlock(start uint32) (*EventRecords, error)
- func (s *Substrate) GetFarm(id uint32) (*Farm, error)
- func (s *Substrate) GetFarmByName(name string) (uint32, error)
- func (s *Substrate) GetLastNodeID() (uint32, error)
- func (s *Substrate) GetNode(id uint32) (*Node, error)
- func (s *Substrate) GetNodeByTwinID(twin uint32) (uint32, error)
- func (s *Substrate) GetNodeContracts(node uint32) ([]types.U64, error)
- func (s *Substrate) GetNodeRentContract(node uint32) (uint64, error)
- func (s *Substrate) GetNodes(farmID uint32) ([]uint32, error)
- func (s *Substrate) GetPowerTarget(nodeID uint32) (power NodePower, err error)
- func (s *Substrate) GetPricingPolicy(id uint32) (pricingPolicy PricingPolicy, err error)
- func (s *Substrate) GetRefundTransaction(txHash string) (*RefundTransaction, error)
- func (s *Substrate) GetServiceContract(id uint64) (*ServiceContract, error)
- func (s *Substrate) GetServiceContractID() (uint64, error)
- func (s *Substrate) GetTFTPrice() (price types.U32, err error)
- func (s *Substrate) GetTwin(id uint32) (*Twin, error)
- func (s *Substrate) GetTwinByPubKey(pk []byte) (uint32, error)
- func (s *Substrate) GetUser(id uint32) (*User, error)
- func (s *Substrate) GetZosVersion() (string, error)
- func (s *Substrate) IsBurnedAlready(burnTransactionID types.U64) (exists bool, err error)
- func (s *Substrate) IsMintedAlready(mintTxID string) (exists bool, err error)
- func (s *Substrate) IsRefundedAlready(txHash string) (exists bool, err error)
- func (s *Substrate) IsValidator(identity Identity) (exists bool, err error)
- func (s *Substrate) KVStoreDelete(identity Identity, key string) error
- func (s *Substrate) KVStoreGet(identity Identity, key string) ([]byte, error)
- func (s *Substrate) KVStoreList(identity Identity) (map[string]string, error)
- func (s *Substrate) KVStoreSet(identity Identity, key string, value string) error
- func (s *Substrate) ProposeBurnTransactionOrAddSig(identity Identity, txID uint64, target string, amount *big.Int, signature string, stellarAddress string, sequence_number uint64) error
- func (s *Substrate) ProposeOrVoteMintTransaction(identity Identity, txID string, target AccountID, amount *big.Int) error
- func (s *Substrate) Report(identity Identity, consumptions []NruConsumption) (types.Hash, error)
- func (s *Substrate) ScanNodes(ctx context.Context, from, to uint32) (<-chan ScannedNode, error)
- func (s *Substrate) ServiceContractApprove(identity Identity, contract uint64) error
- func (s *Substrate) ServiceContractBill(identity Identity, contract uint64, variable_amount uint64, metadata string) error
- func (s *Substrate) ServiceContractCancel(identity Identity, contract uint64) error
- func (s *Substrate) ServiceContractCreate(identity Identity, service AccountID, consumer AccountID) (uint64, error)
- func (s *Substrate) ServiceContractReject(identity Identity, contract uint64) error
- func (s *Substrate) ServiceContractSetFees(identity Identity, contract uint64, base_fee uint64, variable_fee uint64) error
- func (s *Substrate) ServiceContractSetMetadata(identity Identity, contract uint64, metadata string) error
- func (s *Substrate) SetBurnTransactionExecuted(identity Identity, txID uint64) error
- func (s *Substrate) SetContractConsumption(identity Identity, resources ...ContractResources) error
- func (s *Substrate) SetDedicatedNodePrice(identity Identity, nodeId uint32, price uint64) (hash types.Hash, err error)
- func (s *Substrate) SetNodeCertificate(identity Identity, id uint32, cert NodeCertification) error
- func (s *Substrate) SetNodePowerState(identity Identity, up bool) (hash types.Hash, err error)
- func (s *Substrate) SetNodePowerTarget(identity Identity, nodeID uint32, up bool) (hash types.Hash, err error)
- func (s *Substrate) SetRefundTransactionExecuted(identity Identity, txHash string) error
- func (s *Substrate) SignedTermsAndConditions(account AccountID) ([]TermsAndConditions, error)
- func (s *Substrate) SwapToStellar(identity Identity, targetStellarAddress string, amount big.Int) error
- func (s *Substrate) Time() (t time.Time, err error)
- func (s *Substrate) Transfer(identity Identity, amount uint64, destination AccountID) error
- func (s *Substrate) UpdateNode(identity Identity, node Node) (uint32, error)
- func (s *Substrate) UpdateNodeContract(identity Identity, contract uint64, body string, hash string) (uint64, error)
- func (s *Substrate) UpdateNodeUptime(identity Identity, uptime uint64) (hash types.Hash, err error)
- func (s *Substrate) UpdateNodeUptimeV2(identity Identity, uptime, timestampHint uint64) (hash types.Hash, err error)
- func (s *Substrate) UpdateTwin(identity Identity, relay string, pk []byte) (uint32, error)
- type TermsAndConditions
- type TokensBurned
- type Twin
- type TwinAccountBounded
- type TwinDeleted
- type TwinEntityRemoved
- type TwinEntityStored
- type TwinStored
- type Unit
- type UpdatedUsedResources
- type User
- type Val
- type Validator
- type ValidatorAdded
- type ValidatorApproved
- type ValidatorCreated
- type ValidatorRemoved
- type ValidatorRequestState
- type Versioned
- type Voted
- type ZosVersionUpdated
Constants ¶
const ( // TFT in uTFT TFT = 10_000_000 // uTFT // ReactivateThreshold is threshold to reactivate the account if funds went below that ReactivateThreshold = TFT * 0.001 // uTFT )
Variables ¶
var ( ErrBurnTransactionNotFound = fmt.Errorf("burn tx not found") ErrRefundTransactionNotFound = fmt.Errorf("refund tx not found") ErrFailedToDecode = fmt.Errorf("failed to decode events, skipping") )
var ( //ErrInvalidVersion is returned if version 4bytes is invalid ErrInvalidVersion = fmt.Errorf("invalid version") //ErrUnknownVersion is returned if version number is not supported ErrUnknownVersion = fmt.Errorf("unknown version") //ErrNotFound is returned if an object is not found ErrNotFound = fmt.Errorf("object not found") //ErrClosed is returned if the client is closed ErrClosed = fmt.Errorf("client closed") )
Functions ¶
func Decode ¶
func Encode ¶
func FromKeyBytes ¶
func HexEncodeToString ¶
Types ¶
type AccountID ¶
AccountID type
func FromAddress ¶
FromAddress creates an AccountID from a SS58 address
func (AccountID) MarshalJSON ¶
MarshalJSON implementation
func (AccountID) PublicKey ¶
PublicKey gets public key from account id
func (AccountID) String ¶
String return string representation of account
type AccountInfo ¶
type AccountInfo struct { Nonce types.U32 `json:"nonce"` Consumers types.U32 `json:"consumers"` Providers types.U32 `json:"providers"` Sufficients types.U32 `json:"sufficients"` Data Balance `json:"data"` }
type ActivationServiceError ¶
type ActivationServiceError struct { StatusCode int // 0 or a valid HTTP status code. 0 indicates that a response was not received due to an error such host unreachable. Err error }
TODO: Add service response status code if avialble
func (ActivationServiceError) Error ¶
func (e ActivationServiceError) Error() string
type Approved ¶
type Approved struct { Phase types.Phase ProposalHash types.Hash `json:"proposal_hash"` Topics []types.Hash }
type AveragePriceIsAboveMaxPrice ¶
type AveragePriceIsAboveMaxPrice struct { Phase types.Phase Average types.U32 `json:"average"` Max types.U32 `json:"max"` Topics []types.Hash }
type AveragePriceIsAboveMinPrice ¶
type AveragePriceIsAboveMinPrice struct { Phase types.Phase Average types.U32 `json:"average"` Min types.U32 `json:"min"` Topics []types.Hash }
type Balance ¶
type Balance struct { Free types.U128 `json:"free"` Reserved types.U128 `json:"reserved"` MiscFrozen types.U128 `json:"misc_frozen"` FreeFrozen types.U128 `json:"free_frozen"` }
Balance
type BalancesMinted ¶
type BalancesMinted struct { Phase types.Phase Who AccountID `json:"who"` Amount types.U128 `json:"amount"` Topics []types.Hash }
type BatchCreateContractData ¶
type BatchCreateContractData struct { Node uint32 `json:"node"` Body string `json:"body"` Hash string `json:"hash"` PublicIPs uint32 `json:"public_ips"` SolutionProviderID *uint64 `json:"solution_provider_id"` // for name contracts. if set the contract is assumed to be a name contract // and other fields are ignored Name string `json:"name"` }
BatchCreateContractData struct for batch create contract
type BillingFrequencyChanged ¶
type BillingFrequencyChanged struct { Phase types.Phase Frequency types.U64 `json:"frequency"` Topics []types.Hash }
type BlockNumber ¶
type Bonded ¶
type BridgeBurnTransactionCreated ¶
type BridgeBurnTransactionCreated struct { Phase types.Phase BurnTransactionID types.U64 `json:"burn_transaction_id"` Source types.AccountID `json:"source"` Target []byte `json:"target"` Amount types.U64 `json:"amount"` Topics []types.Hash }
BridgeBurnTransactionCreated
type BridgeBurnTransactionExpired ¶
type BridgeBurnTransactionExpired struct { Phase types.Phase BurnTransactionID types.U64 `json:"burn_transaction_id"` Source types.OptionAccountID `json:"source"` Target []byte `json:"target"` Amount types.U64 `json:"amount"` Topics []types.Hash }
BridgeBurnTransactionExpired
type BurnTransaction ¶
type BurnTransaction struct { Block BlockNumber `json:"block"` Amount types.U64 `json:"amount"` Source types.OptionAccountID `json:"source"` Target string `json:"target"` Signatures []StellarSignature `json:"signatures"` SequenceNumber types.U64 `json:"sequence_number"` }
type BurnTransactionCreated ¶
type BurnTransactionCreated struct { Phase types.Phase `json:"phase"` Target AccountID `json:"target"` // TODO check if this works .... Balance types.U128 `json:"balance"` BlockNumber BlockNumber `json:"block_number"` Message string `json:"message"` Topics []types.Hash `json:"topics"` }
type BurnTransactionProcessed ¶
type BurnTransactionProcessed struct { Phase types.Phase Burn BurnTransaction `json:"burn"` Topics []types.Hash }
BurnTransactionProcessed
type BurnTransactionProposed ¶
type BurnTransactionProposed struct { Phase types.Phase BurnTransactionID types.U64 `json:"burn_transaction_id"` Target []byte `json:"target"` Amount types.U64 `json:"amount"` Topics []types.Hash }
BurnTransactionProposed
type BurnTransactionReady ¶
type BurnTransactionReady struct { Phase types.Phase BurnTransactionID types.U64 `json:"burn_transaction_id"` Topics []types.Hash }
BurnTransactionReady
type BurnTransactionSignatureAdded ¶
type BurnTransactionSignatureAdded struct { Phase types.Phase BurnTransactionID types.U64 `json:"burn_transaction_id"` Signature StellarSignature `json:"signature"` Topics []types.Hash }
BurnTransactionSignatureAdded
type CallResponse ¶
type CallResponse struct { Hash types.Hash Events *EventRecords Block *types.SignedBlock Identity Identity }
type CertificationCodeStored ¶
type CertificationCodeStored struct { Phase types.Phase Codes CertificationCodes `json:"contract_id"` Topics []types.Hash }
type CertificationCodes ¶
type CertificationCodes struct { Versioned ID types.U32 `json:"id"` Name string `json:"name"` Description string `json:"description"` CertificationCodeType byte `json:"certification_code_type"` }
type Closed ¶
type Closed struct { Phase types.Phase ProposalHash types.Hash `json:"proposal_hash"` Yes types.U32 `json:"yes"` YesWeight types.U64 `json:"yes_weight"` No types.U32 `json:"no"` NoWeight types.U64 `json:"no_weight"` Topics []types.Hash }
type ClosedByCouncil ¶
type ClosedByCouncil struct { Phase types.Phase ProposalHash types.Hash `json:"proposal_hash"` Vetos []AccountID `json:"vetos"` Topics []types.Hash }
type Conn ¶
type Conn = *gsrpc.SubstrateAPI
type ConnectionPriceSet ¶
type ConnectionPriceSet struct { Phase types.Phase Price types.U32 `json:"price"` Topics []types.Hash }
type Consumption ¶
type Consumption struct { ContractID types.U64 `json:"contract_id"` Timestamp types.U64 `json:"timestamp"` CRU types.U64 `json:"cru"` SRU types.U64 `json:"sru"` HRU types.U64 `json:"hru"` MRU types.U64 `json:"mru"` NRU types.U64 `json:"nru"` }
Consumption structure
type ConsumptionReportReceived ¶
type ConsumptionReportReceived struct { Phase types.Phase Consumption Consumption `json:"consumption"` Topics []types.Hash }
DEPRECATED ConsumptionReportReceived
type Contract ¶
type Contract struct { Versioned State ContractState `json:"state"` ContractID types.U64 `json:"contract_id"` TwinID types.U32 `json:"twin_id"` ContractType ContractType `json:"contract_type"` SolutionProviderID types.OptionU64 `json:"solution_provider_id"` }
Contract structure
type ContractBill ¶
type ContractBill struct { ContractID types.U64 `json:"contract_id"` Timestamp types.U64 `json:"timestamp"` DiscountLevel DiscountLevel `json:"discount_level"` AmountBilled types.U128 `json:"amount_billed"` }
ContractBill structure
type ContractBilled ¶
type ContractBilled struct { Phase types.Phase ContractBill ContractBill `json:"contract_bill"` Topics []types.Hash }
ContractBilled
type ContractCreated ¶
type ContractCreated struct { Phase types.Phase Contract Contract `json:"contract"` Topics []types.Hash }
ContractCreated is the contract created event
type ContractDeployed ¶
type ContractDeployed struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` AccountID AccountID `json:"account_id"` Topics []types.Hash }
ContractDeployed
type ContractGracePeriodElapsed ¶
type ContractGracePeriodElapsed struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` GracePeriod types.U64 `json:"grace_period"` Topics []types.Hash }
type ContractGracePeriodEnded ¶
type ContractGracePeriodEnded struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` NodeID types.U32 `json:"node_id"` TwinID types.U32 `json:"twin_id"` Topics []types.Hash }
type ContractGracePeriodStarted ¶
type ContractGracePeriodStarted struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` NodeID types.U32 `json:"node_id"` TwinID types.U32 `json:"twin_id"` StartBlock types.U64 `json:"start_block"` Topics []types.Hash }
type ContractPaymentOverdrawn ¶
type ContractPaymentOverdrawn struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` Timestamp types.U64 `json:"timestamp"` PartiallyBilledAmount types.U128 `json:"partially_billed_amount"` Overdraft types.U128 `json:"overdraft"` Topics []types.Hash }
type ContractResources ¶
type ContractResources struct { ContractID types.U64 `json:"contract_id"` Used Resources `json:"resources"` }
type ContractState ¶
type ContractState struct { IsCreated bool `json:"is_created"` IsDeleted bool `json:"is_deleted"` AsDeleted DeletedState `json:"as_deleted"` IsGracePeriod bool `json:"is_grace_period"` AsGracePeriodBlockNumber types.U64 `json:"as_grace_period_block_number"` }
ContractState enum
func (*ContractState) Decode ¶
func (r *ContractState) Decode(decoder scale.Decoder) error
Decode implementation for the enum type
func (ContractState) Encode ¶
func (r ContractState) Encode(encoder scale.Encoder) (err error)
Encode implementation
type ContractType ¶
type ContractType struct { IsNodeContract bool `json:"is_node_contract"` NodeContract NodeContract `json:"node_contract"` IsNameContract bool `json:"is_name_contract"` NameContract NameContract `json:"name_contract"` IsRentContract bool `json:"is_rent_contract"` RentContract RentContract `json:"rent_contract"` }
func (*ContractType) Decode ¶
func (r *ContractType) Decode(decoder scale.Decoder) error
Decode implementation for the enum type
func (ContractType) Encode ¶
func (r ContractType) Encode(encoder scale.Encoder) (err error)
Encode implementation
type ContractUpdated ¶
type ContractUpdated struct { Phase types.Phase Contract Contract `json:"contract"` Topics []types.Hash }
ContractUpdated is the contract updated event
type CouncilMemberVeto ¶
type CouncilMemberVeto struct { Phase types.Phase ProposalHash types.Hash `json:"proposal_hash"` Who AccountID `json:"who"` Topics []types.Hash }
type DeletedState ¶
type DeletedState struct { IsCanceledByUser bool `json:"is_canceled_by_user"` IsOutOfFunds bool `json:"is_out_of_funds"` IsCanceledByCollective bool `json:"is_canceled_by_collective"` }
func (*DeletedState) Decode ¶
func (r *DeletedState) Decode(decoder scale.Decoder) error
Decode implementation for the enum type
func (DeletedState) Encode ¶
func (r DeletedState) Encode(encoder scale.Encoder) (err error)
Encode implementation
type Disapproved ¶
type Disapproved struct { Phase types.Phase ProposalHash types.Hash `json:"proposal_hash"` Topics []types.Hash }
type DiscountLevel ¶
type DiscountLevel struct { IsNone bool `json:"is_none"` IsDefault bool `json:"is_default"` IsBronze bool `json:"is_bronze"` IsSilver bool `json:"is_silver"` IsGold bool `json:"is_gold"` }
DiscountLevel enum
func (*DiscountLevel) Decode ¶
func (r *DiscountLevel) Decode(decoder scale.Decoder) error
Decode implementation for the enum type
func (DiscountLevel) Encode ¶
func (r DiscountLevel) Encode(encoder scale.Encoder) (err error)
Encode implementation
type Entity ¶
type Entity struct { Versioned ID types.U32 `json:"id"` Name string `json:"name"` Account AccountID `json:"account_id"` Country string `json:"country"` City string `json:"city"` }
Entity type
type EntityDeleted ¶
type EntityDeleted struct { Phase types.Phase Entity types.U32 `json:"entity_id"` Topics []types.Hash }
type EntityProof ¶
type EntityProof struct { EntityID types.U32 `json:"entity_id"` Signature string `json:"signature"` }
EntityProof struct
type EntityStored ¶
type EntryEvent ¶
type EntryEvent struct { Phase types.Phase Account AccountID `json:"account_id"` Key []byte `json:"key"` Value []byte `json:"value"` Topics []types.Hash }
type EventBatchCompletedWithErrors ¶
type EventDispatchedAs ¶
type EventItemFailed ¶
type EventRecords ¶
type EventRecords struct { types.EventRecords SmartContractModule_ContractCreated []ContractCreated //nolint:stylecheck,golint SmartContractModule_ContractUpdated []ContractUpdated //nolint:stylecheck,golint SmartContractModule_NodeContractCanceled []NodeContractCanceled //nolint:stylecheck,golint SmartContractModule_NameContractCanceled []NameContractCanceled //nolint:stylecheck,golint SmartContractModule_IPsReserved []IPsReserved //nolint:stylecheck,golint SmartContractModule_IPsFreed []IPsFreed //nolint:stylecheck,golint SmartContractModule_ContractDeployed []ContractDeployed //nolint:stylecheck,golint SmartContractModule_ConsumptionReportReceived []ConsumptionReportReceived //nolint:stylecheck,golint SmartContractModule_ContractBilled []ContractBilled //nolint:stylecheck,golint SmartContractModule_TokensBurned []TokensBurned //nolint:stylecheck,golint SmartContractModule_UpdatedUsedResources []UpdatedUsedResources //nolint:stylecheck,golint SmartContractModule_NruConsumptionReportReceived []NruConsumptionReportReceived //nolint:stylecheck,golint SmartContractModule_RentContractCanceled []RentContractCanceled //nolint:stylecheck,golint SmartContractModule_ContractGracePeriodStarted []ContractGracePeriodStarted //nolint:stylecheck,golint SmartContractModule_ContractGracePeriodEnded []ContractGracePeriodEnded //nolint:stylecheck,golint SmartContractModule_NodeMarkedAsDedicated []NodeMarkAsDedicated //nolint:stylecheck,golint SmartContractModule_SolutionProviderCreated []SolutionProviderCreated //nolint:stylecheck,golint SmartContractModule_SolutionProviderApproved []SolutionProviderApproved //nolint:stylecheck,golint SmartContractModule_ServiceContractCreated []ServiceContractCreated //nolint:stylecheck,golint SmartContractModule_ServiceContractMetadataSet []ServiceContractCreated //nolint:stylecheck,golint SmartContractModule_ServiceContractFeesSet []ServiceContractCreated //nolint:stylecheck,golint SmartContractModule_ServiceContractApproved []ServiceContractCreated //nolint:stylecheck,golint SmartContractModule_ServiceContractCanceled []ServiceContractCanceled //nolint:stylecheck,golint SmartContractModule_ServiceContractBilled []ServiceContractBilled //nolint:stylecheck,golint SmartContractModule_BillingFrequencyChanged []BillingFrequencyChanged //nolint:stylecheck,golint SmartContractModule_NodeExtraFeeSet []NodeExtraFeeSet //nolint:stylecheck,golint SmartContractModule_RentWaived []RentWaived //nolint:stylecheck,golint SmartContractModule_ContractGracePeriodElapsed []ContractGracePeriodElapsed //nolint:stylecheck,golint SmartContractModule_ContractPaymentOverdrawn []ContractPaymentOverdrawn //nolint:stylecheck,golint SmartContractModule_RewardDistributed []RewardDistributed //nolint:stylecheck,golint // farm events TfgridModule_FarmStored []FarmStored //nolint:stylecheck,golint TfgridModule_FarmUpdated []FarmStored //nolint:stylecheck,golint TfgridModule_FarmDeleted []FarmDeleted //nolint:stylecheck,golint // node events TfgridModule_NodeStored []NodeStored //nolint:stylecheck,golint TfgridModule_NodeUpdated []NodeStored //nolint:stylecheck,golint TfgridModule_NodeDeleted []NodeDeleted //nolint:stylecheck,golint TfgridModule_NodeUptimeReported []NodeUptimeReported //nolint:stylecheck,golint TfgridModule_NodePublicConfigStored []NodePublicConfig //nolint:stylecheck,golint TfgridModule_PowerTargetChanged []PowerTargetChanged //nolint:stylecheck,golint TfgridModule_PowerStateChanged []PowerStateChanged //nolint:stylecheck,golint // entity events TfgridModule_EntityStored []EntityStored //nolint:stylecheck,golint TfgridModule_EntityUpdated []EntityStored //nolint:stylecheck,golint TfgridModule_EntityDeleted []EntityDeleted //nolint:stylecheck,golint // twin events TfgridModule_TwinStored []TwinStored //nolint:stylecheck,golint TfgridModule_TwinUpdated []TwinStored //nolint:stylecheck,golint TfgridModule_TwinDeleted []TwinDeleted //nolint:stylecheck,golint TfgridModule_TwinEntityStored []TwinEntityStored //nolint:stylecheck,golint TfgridModule_TwinEntityRemoved []TwinEntityRemoved //nolint:stylecheck,golint TfgridModule_TwinAccountBounded []TwinAccountBounded //nolint:stylecheck,golint // policy events TfgridModule_PricingPolicyStored []PricingPolicyStored //nolint:stylecheck,golint TfgridModule_FarmingPolicyStored []FarmingPolicyStored //nolint:stylecheck,golint // other events TfgridModule_FarmPayoutV2AddressRegistered []FarmPayoutV2AddressRegistered //nolint:stylecheck,golint TfgridModule_FarmMarkedAsDedicated []FarmMarkedAsDedicated //nolint:stylecheck,golint TfgridModule_ConnectionPriceSet []ConnectionPriceSet //nolint:stylecheck,golint TfgridModule_NodeCertificationSet []NodeCertificationSet //nolint:stylecheck,golint TfgridModule_NodeCertifierAdded []NodeCertifierAdded //nolint:stylecheck,golint TfgridModule_NodeCertifierRemoved []NodeCertifierRemoved //nolint:stylecheck,golint TfgridModule_FarmingPolicyUpdated []FarmingPolicyUpdated //nolint:stylecheck,golint TfgridModule_FarmingPolicySet []FarmingPolicySet //nolint:stylecheck,golint TfgridModule_FarmCertificationSet []FarmCertificationSet //nolint:stylecheck,golint TfgridModule_ZosVersionUpdated []ZosVersionUpdated //nolint:stylecheck,golint // burn module events BurningModule_BurnTransactionCreated []BurnTransactionCreated //nolint:stylecheck,golint // mints TFTBridgeModule_MintTransactionProposed []MintTransactionProposed //nolint:stylecheck,golint TFTBridgeModule_MintTransactionVoted []MintTransactionVoted //nolint:stylecheck,golint TFTBridgeModule_MintCompleted []MintCompleted //nolint:stylecheck,golint TFTBridgeModule_MintTransactionExpired []MintTransactionExpired //nolint:stylecheck,golint // burns TFTBridgeModule_BurnTransactionCreated []BridgeBurnTransactionCreated //nolint:stylecheck,golint TFTBridgeModule_BurnTransactionProposed []BurnTransactionProposed //nolint:stylecheck,golint TFTBridgeModule_BurnTransactionSignatureAdded []BurnTransactionSignatureAdded //nolint:stylecheck,golint TFTBridgeModule_BurnTransactionReady []BurnTransactionReady //nolint:stylecheck,golint TFTBridgeModule_BurnTransactionProcessed []BurnTransactionProcessed //nolint:stylecheck,golint TFTBridgeModule_BurnTransactionExpired []BridgeBurnTransactionExpired //nolint:stylecheck,golint // refunds TFTBridgeModule_RefundTransactionCreated []RefundTransactionCreated //nolint:stylecheck,golint TFTBridgeModule_RefundTransactionsignatureAdded []RefundTransactionSignatureAdded //nolint:stylecheck,golint TFTBridgeModule_RefundTransactionReady []RefundTransactionReady //nolint:stylecheck,golint TFTBridgeModule_RefundTransactionProcessed []RefundTransactionProcessed //nolint:stylecheck,golint TFTBridgeModule_RefundTransactionExpired []RefundTransactionCreated //nolint:stylecheck,golint // TFTPrice module TFTPriceModule_PriceStored []PriceStored //nolint:stylecheck,golint TFTPriceModule_AveragePriceStored []PriceStored //nolint:stylecheck,golint TFTPriceModule_OffchainWorkerExecuted []OffchainWorkerExecuted //nolint:stylecheck,golint TFTPriceModule_AveragePriceIsAboveMaxPrice []AveragePriceIsAboveMaxPrice TFTPriceModule_AveragePriceIsBelowMinPrice []AveragePriceIsAboveMinPrice // KVStore TFKVStore_EntrySet []EntryEvent //nolint:stylecheck,golint TFKVStore_EntryGot []EntryEvent //nolint:stylecheck,golint TFKVStore_EntryTaken []EntryEvent //nolint:stylecheck,golint // Validatorset pallet ValidatorSet_ValidatorAdditionInitiated []ValidatorAdded //nolint:stylecheck,golint ValidatorSet_ValidatorRemovalInitiated []ValidatorRemoved //nolint:stylecheck,golint Validator_Bonded []Bonded //nolint:stylecheck,golint Validator_ValidatorRequestCreated []ValidatorCreated //nolint:stylecheck,golint Validator_ValidatorRequestApproved []ValidatorApproved //nolint:stylecheck,golint Validator_ValidatorActivated []ValidatorApproved //nolint:stylecheck,golint Validator_ValidatorRemoved []ValidatorApproved //nolint:stylecheck,golint Validator_NodeValidatorChanged []Bonded //nolint:stylecheck,golint Validator_NodeValidatorRemoved []Bonded //nolint:stylecheck,golint CouncilMembership_MemberAdded []MemberEvent //nolint:stylecheck,golint CouncilMembership_MemberRemoved []MemberEvent //nolint:stylecheck,golint CouncilMembership_MembersSwapped []MemberEvent //nolint:stylecheck,golint CouncilMembership_MembersReset []MemberEvent //nolint:stylecheck,golint CouncilMembership_KeyChanged []MemberEvent //nolint:stylecheck,golint CouncilMembership_Dummy []MemberEvent //nolint:stylecheck,golint // Dao Pallet Dao_Voted []Voted //nolint:stylecheck,golint Dao_Proposed []Proposed //nolint:stylecheck,golint Dao_Approved []Approved //nolint:stylecheck,golint Dao_Disapproved []Disapproved //nolint:stylecheck,golint Dao_Executed []Executed //nolint:stylecheck,golint Dao_Closed []Closed //nolint:stylecheck,golint Dao_ClosedByCouncil []ClosedByCouncil //nolint:stylecheck,golint Dao_CouncilMemberVeto []CouncilMemberVeto //nolint:stylecheck,golint // Scheduler Pallet (temporary until go-substrate-rpc-client is fixed: https://github.com/centrifuge/go-substrate-rpc-client/issues/344) []EventSchedulerCallUnavailable `test-gen-blockchain:"polkadot"` Scheduler_PeriodicFailed []EventSchedulerPeriodicFailed `test-gen-blockchain:"polkadot"` Scheduler_PermanentlyOverweight []EventSchedulerPermanentlyOverweight `test-gen-blockchain:"polkadot"` Utility_BatchCompletedWithErrors []EventBatchCompletedWithErrors `test-gen-blockchain:"centrifuge-parachain"` Utility_ItemFailed []EventItemFailed `test-gen-blockchain:"centrifuge-parachain"` Utility_DispatchedAs []EventDispatchedAs `test-gen-blockchain:"centrifuge-parachain"` // overrides Balances_Minted []BalancesMinted //nolint:stylecheck,golint Balances_BalanceSet []BalancesMinted //nolint:stylecheck,golint Balances_Burned []BalancesMinted //nolint:stylecheck,golint Balances_Suspended []BalancesMinted //nolint:stylecheck,golint Balances_Restored []BalancesMinted //nolint:stylecheck,golint Balances_Upgraded []EventWithWho //nolint:stylecheck,golint Balances_Issued []EventWithBalance //nolint:stylecheck,golint Balances_Rescinded []EventWithBalance //nolint:stylecheck,golint Balances_Locked []BalancesMinted //nolint:stylecheck,golint Balances_Unlocked []BalancesMinted //nolint:stylecheck,golint Balances_Frozen []BalancesMinted //nolint:stylecheck,golint Balances_Thawed []BalancesMinted //nolint:stylecheck,golint }
EventRecords is a struct that extends the default events with our events
type EventSchedulerCallUnavailable ¶
type EventSchedulerCallUnavailable struct { types.Phase types.TaskAddress types.OptionBytes []types.Hash }
type EventSchedulerPeriodicFailed ¶
type EventSchedulerPeriodicFailed struct { Phase types.Phase Task types.TaskAddress ID types.OptionBytes Topics []types.Hash }
type EventSchedulerPermanentlyOverweight ¶
type EventSchedulerPermanentlyOverweight struct { Phase types.Phase Task types.TaskAddress ID types.OptionBytes Topics []types.Hash }
type EventWithBalance ¶
type EventWithBalance struct { Phase types.Phase Amount types.U128 `json:"amount"` Topics []types.Hash }
type EventWithWho ¶
type Executed ¶
type Executed struct { Phase types.Phase ProposalHash types.Hash `json:"proposal_hash"` Result types.DispatchResult `json:"result"` Topics []types.Hash }
type Farm ¶
type Farm struct { Versioned ID types.U32 `json:"id"` Name string `json:"name"` TwinID types.U32 `json:"twin_id"` PricingPolicyID types.U32 `json:"pricing_policy_id"` CertificationType FarmCertification `json:"certification_type"` PublicIPs []PublicIP `json:"public_ips"` DedicatedFarm bool `json:"dedicated_farm"` FarmingPoliciesLimit OptionFarmingPolicyLimit `json:"farming_policies_limit"` }
Farm type
type FarmCertification ¶
type FarmCertification struct { IsNotCertified bool `json:"is_not_certified"` IsGold bool `json:"is_gold"` }
NodeCertification is a substrate enum
func (*FarmCertification) Decode ¶
func (p *FarmCertification) Decode(decoder scale.Decoder) error
Decode implementation for the enum type
func (FarmCertification) Encode ¶
func (p FarmCertification) Encode(encoder scale.Encoder) (err error)
Decode implementation for the enum type
type FarmCertificationSet ¶
type FarmCertificationSet struct { Phase types.Phase Farm types.U32 `json:"farm_id"` Certification FarmCertification `json:"farm_certification"` Topics []types.Hash }
type FarmDeleted ¶
type FarmMarkedAsDedicated ¶
type FarmMarkedAsDedicated struct { Phase types.Phase Farm types.U32 `json:"farm_id"` Topics []types.Hash }
type FarmPayoutV2AddressRegistered ¶
type FarmPayoutV2AddressRegistered struct { Phase types.Phase Farm types.U32 `json:"farm_id"` Address string `json:"address"` Topics []types.Hash }
type FarmStored ¶
type FarmingPolicy ¶
type FarmingPolicy struct { Versioned ID types.U32 `json:"id"` Name string `json:"name"` CU types.U32 `json:"cu"` SU types.U32 `json:"su"` NU types.U32 `json:"nu"` IPv4 types.U32 `json:"ipv4"` MinimalUptime types.U16 `json:"minimal_uptime"` PolicyCreated types.U32 `json:"policy_created"` PolicyEnd types.U32 `json:"policy_end"` Immutable bool `json:"immutable"` Default bool `json:"default"` NodeCertification NodeCertification `json:"node_certification"` FarmCertification FarmCertification `json:"farm_certification"` }
type FarmingPolicyLimit ¶
type FarmingPolicyLimit struct { FarmingPolicyID types.U32 `json:"farming_policy_id"` Cu types.OptionU64 `json:"cu"` Su types.OptionU64 `json:"su"` End types.OptionU64 `json:"end"` NodeCount types.OptionU32 `json:"node_count"` NodeCertification bool `json:"node_certification"` }
type FarmingPolicySet ¶
type FarmingPolicySet struct { Phase types.Phase Farm types.U32 `json:"farm_id"` FarmingPolicy OptionFarmingPolicyLimit `json:"farming_policy"` Topics []types.Hash }
type FarmingPolicyStored ¶
type FarmingPolicyStored struct { Phase types.Phase Policy FarmingPolicy `json:"farming_policy"` Topics []types.Hash }
type FarmingPolicyUpdated ¶
type FarmingPolicyUpdated struct { Phase types.Phase FarmingPolicy FarmingPolicy `json:"farming_policy"` Topics []types.Hash }
type HexHash ¶
type HexHash [32]byte
func NewHexHash ¶
NewHexHash will create a new hash from a hex input (32 bytes)
func (HexHash) String ¶
type IP ¶
type IPsFreed ¶
type IPsFreed struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` IPs []PublicIP `json:"ips"` Topics []types.Hash }
IPsFreed
type IPsReserved ¶
type IPsReserved struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` IPs []PublicIP `json:"ips"` Topics []types.Hash }
IPsReserved
type Identity ¶
type Identity interface { KeyPair() (subkey.KeyPair, error) Sign(data []byte) ([]byte, error) Type() string MultiSignature(sig []byte) types.MultiSignature Address() string PublicKey() []byte URI() string }
Identity is a user identity
func NewIdentityFromEd25519Key ¶
func NewIdentityFromEd25519Key(sk ed25519.PrivateKey) (Identity, error)
func NewIdentityFromEd25519Phrase ¶
func NewIdentityFromSr25519Phrase ¶
type Interface ¶
type Interface struct { Name string `json:"name"` Mac string `json:"mac"` IPs []string `json:"ips"` }
type Location ¶
type Location struct { City string `json:"city"` Country string `json:"country"` Latitude string `json:"latitude"` Longitude string `json:"longitude"` }
Location type
type Manager ¶
func NewManager ¶
type MemberEvent ¶
to handle council member events that are not defined in base types
type Meta ¶
type MintCompleted ¶
type MintCompleted struct { Phase types.Phase MintTransaction MintTransaction `json:"mint_transaction"` TxHash string `json:"tx_hash"` Topics []types.Hash }
MintCompleted
type MintTransaction ¶
type MintTransaction struct { Amount types.U64 `json:"amount"` Target types.AccountID `json:"target"` Block types.U32 `json:"block"` Votes types.U32 `json:"votes"` }
type MintTransactionExpired ¶
type MintTransactionExpired struct { Phase types.Phase TxHash string `json:"tx_hash"` Amount types.U64 `json:"amount"` Target AccountID `json:"target"` Topics []types.Hash }
MintTransactionExpired
type MintTransactionProposed ¶
type MintTransactionProposed struct { Phase types.Phase TxHash string `json:"tx_hash"` Target AccountID `json:"target"` Amount types.U64 `json:"amount"` Topics []types.Hash }
MintTransactionProposed
type MintTransactionVoted ¶
type MintTransactionVoted struct { Phase types.Phase TxHash string `json:"tx_hash"` Topics []types.Hash }
MintTransactionVoted
type NameContract ¶
type NameContract struct { Name string `json:"name"` }
type NameContractCanceled ¶
type NameContractCanceled struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` Topics []types.Hash }
NameContractCanceled
type Node ¶
type Node struct { Versioned ID types.U32 `json:"id"` FarmID types.U32 `json:"farm_id"` TwinID types.U32 `json:"twin_id"` Resources Resources `json:"resources"` Location Location `json:"location"` PublicConfig OptionPublicConfig `json:"public_config"` Created types.U64 `json:"created"` FarmingPolicy types.U32 `json:"farming_policy"` Interfaces []Interface `json:"interfaces"` Certification NodeCertification `json:"certification"` SecureBoot bool `json:"secure_boot"` Virtualized bool `json:"virtualized"` BoardSerial OptionBoardSerial `json:"board_serial"` ConnectionPrice types.U32 `json:"connection_price"` }
Node type
func (*Node) Eq ¶
Eq compare changes on node settable fields
type NodeCertification ¶
NodeCertification is a substrate enum
func (*NodeCertification) Decode ¶
func (p *NodeCertification) Decode(decoder scale.Decoder) error
Decode implementation for the enum type
func (NodeCertification) Encode ¶
func (p NodeCertification) Encode(encoder scale.Encoder) (err error)
Decode implementation for the enum type
type NodeCertificationSet ¶
type NodeCertificationSet struct { Phase types.Phase NodeId types.U32 `json:"node_id"` Certification NodeCertification `json:"certification"` Topics []types.Hash }
type NodeCertifierAdded ¶
type NodeCertifierAdded struct { Phase types.Phase Address AccountID `json:"address"` Topics []types.Hash }
type NodeCertifierRemoved ¶
type NodeCertifierRemoved struct { Phase types.Phase Address AccountID `json:"address"` Topics []types.Hash }
type NodeContract ¶
type NodeContract struct { Node types.U32 `json:"node_id"` DeploymentHash HexHash `json:"deployment_hash"` DeploymentData string `json:"deployment_data"` PublicIPsCount types.U32 `json:"public_ips_count"` PublicIPs []PublicIP `json:"public_ips"` }
type NodeContractCanceled ¶
type NodeContractCanceled struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` Node types.U32 `json:"node_id"` Twin types.U32 `json:"twin_id"` Topics []types.Hash }
NodeContractCanceled
type NodeDeleted ¶
type NodeExtra ¶
type NodeExtra struct { Secure bool `json:"secure"` Virtualized bool `json:"virtualized"` SerialNumber OptionBoardSerial `json:"serial_number"` }
type NodeExtraFeeSet ¶
type NodeExtraFeeSet struct { Phase types.Phase NodeID types.U32 `json:"node_id"` ExtraFee types.U64 `json:"extra_fee"` Topics []types.Hash }
type NodeMarkAsDedicated ¶
type NodeMarkAsDedicated struct { Phase types.Phase NodeID types.U32 `json:"node_id"` Dedicated bool `json:"dedicated"` Topics []types.Hash }
type NodePower ¶
type NodePower struct { State PowerState `json:"state"` Target Power `json:"target"` }
type NodePublicConfig ¶
type NodePublicConfig struct { Phase types.Phase Node types.U32 `json:"node_id"` Config OptionPublicConfig `json:"config"` Topics []types.Hash }
type NodeStored ¶
type NodeUptimeReported ¶
type NodeUptimeReported struct { Phase types.Phase Node types.U32 `json:"node_id"` Timestamp types.U64 `json:"timestamp"` Uptime types.U64 `json:"uptime"` Topics []types.Hash }
type NruConsumption ¶
type NruConsumption struct { ContractID types.U64 `json:"contract_id"` Timestamp types.U64 `json:"timestamp"` Window types.U64 `json:"window"` NRU types.U64 `json:"nru"` }
Consumption structure
func (*NruConsumption) IsEmpty ¶
func (s *NruConsumption) IsEmpty() bool
IsEmpty true if consumption is zero
type NruConsumptionReportReceived ¶
type NruConsumptionReportReceived struct { Phase types.Phase Consumption NruConsumption `json:"consumption"` Topics []types.Hash }
ConsumptionReportReceived
type OffchainWorkerExecuted ¶
type OffchainWorkerExecuted struct { Phase types.Phase Account AccountID `json:"account_id"` Topics []types.Hash }
type OptionBoardSerial ¶
OptionBoardSerial type
func (*OptionBoardSerial) Decode ¶
func (m *OptionBoardSerial) Decode(decoder scale.Decoder) (err error)
Decode implementation
func (OptionBoardSerial) Encode ¶
func (m OptionBoardSerial) Encode(encoder scale.Encoder) (err error)
Encode implementation
type OptionDomain ¶
func (*OptionDomain) Decode ¶
func (m *OptionDomain) Decode(decoder scale.Decoder) (err error)
Decode implementation
func (OptionDomain) Encode ¶
func (m OptionDomain) Encode(encoder scale.Encoder) (err error)
Encode implementation
type OptionFarmingPolicyLimit ¶
type OptionFarmingPolicyLimit struct { HasValue bool `json:"has_value"` AsValue FarmingPolicyLimit `json:"as_value"` }
OptionFarmingPolicyLimit type
func (*OptionFarmingPolicyLimit) Decode ¶
func (m *OptionFarmingPolicyLimit) Decode(decoder scale.Decoder) (err error)
Decode implementation
func (OptionFarmingPolicyLimit) Encode ¶
func (m OptionFarmingPolicyLimit) Encode(encoder scale.Encoder) (err error)
Encode implementation
type OptionIP ¶
func (*OptionIP) Decode ¶
Decode implementation
func (OptionIP) Encode ¶
Encode implementation
type OptionPublicConfig ¶
type OptionPublicConfig struct { HasValue bool `json:"has_value"` AsValue PublicConfig `json:"as_value"` }
OptionPublicConfig type
func (*OptionPublicConfig) Decode ¶
func (m *OptionPublicConfig) Decode(decoder scale.Decoder) (err error)
Decode implementation
func (OptionPublicConfig) Encode ¶
func (m OptionPublicConfig) Encode(encoder scale.Encoder) (err error)
Encode implementation
type OptionRelay ¶
OptionRelay type
func (*OptionRelay) Decode ¶
func (r *OptionRelay) Decode(decoder scale.Decoder) error
Decode implementation for the enum type
func (OptionRelay) Encode ¶
func (m OptionRelay) Encode(encoder scale.Encoder) (err error)
Encode implementation
type Policy ¶
type Power ¶
func (*Power) Decode ¶
Decode implementation for the enum type
func (Power) Encode ¶
Encode implementation
type PowerState ¶
type PowerState struct { IsUp bool `json:"is_up"` IsDown bool `json:"is_down"` AsDownBlockNumber BlockNumber `json:"as_down_block_number"` }
func (*PowerState) Decode ¶
func (r *PowerState) Decode(decoder scale.Decoder) error
Decode implementation for the enum type
func (PowerState) Encode ¶
func (r PowerState) Encode(encoder scale.Encoder) (err error)
Encode implementation
type PowerStateChanged ¶
type PowerStateChanged struct { Phase types.Phase Farm types.U32 `json:"farm_id"` Node types.U32 `json:"node_id"` PowerState PowerState `json:"power_state"` Topics []types.Hash }
type PowerTargetChanged ¶
type PowerTargetChanged struct { Phase types.Phase Farm types.U32 `json:"farm_id"` Node types.U32 `json:"node_id"` PowerTarget Power `json:"power_target"` Topics []types.Hash }
type PriceStored ¶
type PriceStored struct { Phase types.Phase // in rust this is a U16F16 which is a custom type of 4 bytes width to // represent a float point with a Price types.U32 `json:"price"` Topics []types.Hash }
type PricingPolicy ¶
type PricingPolicy struct { Versioned ID types.U32 `json:"id"` Name string `json:"name"` SU Policy `json:"su"` CU Policy `json:"cu"` NU Policy `json:"nu"` IPU Policy `json:"ipu"` UniqueName Policy `json:"unique_name"` DomainName Policy `json:"domain_name"` FoundationAccount AccountID `json:"foundation_name"` CertifiedSalesAccount AccountID `json:"certified_sales_account"` DedicatedNodesDiscount types.U8 `json:"dedication_nodes_discount"` }
PricingPolicy struct represents a PricingPolicy
type PricingPolicyStored ¶
type PricingPolicyStored struct { Phase types.Phase Policy PricingPolicy `json:"pricing_policy"` Topics []types.Hash }
type Proposed ¶
type Proposed struct { Phase types.Phase Account AccountID `json:"account_id"` ProposalIndex types.U32 `json:"proposal_index"` ProposalHash types.Hash `json:"proposal_hash"` Threshold types.U32 `json:"threshold"` Topics []types.Hash }
type Provider ¶
type PublicConfig ¶
type PublicConfig struct { IP4 IP `json:"ip4"` IP6 OptionIP `json:"ip6"` Domain OptionDomain `json:"domain"` }
PublicConfig type
type PublicIP ¶
type PublicIP struct { IP string `json:"ip"` Gateway string `json:"gateway"` ContractID types.U64 `json:"contract_id"` }
PublicIP structure
type PublicIPInput ¶
PublicIPInput structure
type RefundTransaction ¶
type RefundTransaction struct { Block types.U32 `json:"block"` Amount types.U64 `json:"amount"` Target string `json:"target"` TxHash string `json:"tx_hash"` Signatures []StellarSignature `json:"signatures"` SequenceNumber types.U64 `json:"sequence_number"` }
type RefundTransactionCreated ¶
type RefundTransactionCreated struct { Phase types.Phase RefundTransactionHash []byte `json:"refund_transaction_hash"` Target []byte `json:"target"` Amount types.U64 `json:"amount"` Topics []types.Hash }
RefundTransactionCreated
type RefundTransactionProcessed ¶
type RefundTransactionProcessed struct { Phase types.Phase RefundTransactionHash RefundTransaction `json:"refund_transaction_hash"` Topics []types.Hash }
RefundTransactionProcessed
type RefundTransactionReady ¶
type RefundTransactionReady struct { Phase types.Phase RefundTransactionHash []byte `json:"refund_transaction_hash"` Topics []types.Hash }
RefundTransactionReady
type RefundTransactionSignatureAdded ¶
type RefundTransactionSignatureAdded struct { Phase types.Phase RefundTransactionHash []byte `json:"refund_transaction_hash"` Signature StellarSignature `json:"signature"` Topics []types.Hash }
RefundTransactionSignatureAdded
type RentContract ¶
type RentContractCanceled ¶
type RentContractCanceled struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` Topics []types.Hash }
RentContractCanceled
type RentWaived ¶
type RentWaived struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` Topics []types.Hash }
type Resources ¶
type Resources struct { HRU types.U64 `json:"hru"` SRU types.U64 `json:"sru"` CRU types.U64 `json:"cru"` MRU types.U64 `json:"mru"` }
Resources type
type RewardDistributed ¶
type RewardDistributed struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` StandardRewards types.U128 `json:"standard_rewards"` AdditionalRewards types.U128 `json:"additional_rewards"` Topics []types.Hash }
type Role ¶
Role type
func (*Role) Decode ¶
Decode implementation for the enum type
func (Role) Encode ¶
Encode implementation
type ScannedNode ¶
type ServiceContract ¶
type ServiceContract struct { ServiceContractID types.U64 `json:"service_contract_id"` ServiceTwinID types.U32 `json:"service_twin_id"` ConsumerTwinID types.U32 `json:"consumer_twin_id"` BaseFee types.U64 `json:"base_fee"` VariableFee types.U64 `json:"variable_fee"` Metadata string `json:"metadata"` AcceptedByService bool `json:"accepted_by_service"` AcceptedByConsumer bool `json:"accepted_by_consumer"` LastBill types.U64 `json:"last_bill"` State ServiceContractState `json:"state"` }
ServiceContract struct
type ServiceContractBill ¶
type ServiceContractBill struct { VariableAmount types.U64 `json:"variable_amount"` Window types.U64 `json:"window"` Metadata string `json:"metadata"` }
ServiceContractBill struct
type ServiceContractBilled ¶
type ServiceContractBilled struct { Phase types.Phase ServiceContract ServiceContract `json:"service_contract"` ServiceContractBill ServiceContractBill `json:"service_contract_bill"` Amount types.U128 `json:"amount"` Topics []types.Hash }
ServiceContractBilled
type ServiceContractCanceled ¶
type ServiceContractCanceled struct { Phase types.Phase ServiceContractID types.U64 `json:"service_contract_id"` Cause DeletedState `json:"cause"` Topics []types.Hash }
ServiceContractCanceled
type ServiceContractCreated ¶
type ServiceContractCreated struct { Phase types.Phase ServiceContract ServiceContract `json:"service_contract"` Topics []types.Hash }
ServiceContractCreated
type ServiceContractState ¶
type ServiceContractState struct { IsCreated bool `json:"is_created"` IsAgreementReady bool `json:"is_agreement_ready"` IsApprovedByBoth bool `json:"is_approved_by_both"` }
ServiceContractState enum
func (*ServiceContractState) Decode ¶
func (r *ServiceContractState) Decode(decoder scale.Decoder) error
Decode implementation for the ServiceContractState enum type
func (ServiceContractState) Encode ¶
func (r ServiceContractState) Encode(encoder scale.Encoder) (err error)
Encode implementation for the ServiceContractState enum type
type SolutionProvider ¶
type SolutionProvider struct { SolutionProviderID types.U64 `json:"solution_provider_id"` Providers []Provider `json:"providers"` Description string `json:"description"` Link string `json:"link"` Approved bool `json:"approved"` }
type SolutionProviderApproved ¶
type SolutionProviderApproved struct { Phase types.Phase SolutionProviderID types.U64 `json:"solution_provider_id"` Approved bool `json:"approved"` Topics []types.Hash }
type SolutionProviderCreated ¶
type SolutionProviderCreated struct { Phase types.Phase SolutionProvider SolutionProvider `json:"solution_provider"` Topics []types.Hash }
type StellarSignature ¶
type StellarSignature struct { Signature []byte `json:"signature"` StellarAddress []byte `json:"stellar_address"` }
type Substrate ¶
type Substrate struct {
// contains filtered or unexported fields
}
Substrate client
func (*Substrate) AcceptTermsAndConditions ¶
func (s *Substrate) AcceptTermsAndConditions(identity Identity, documentLink string, documentHash string) error
AcceptTermsAndConditions accepts terms and conditions
func (*Substrate) BatchAllCreateContract ¶
func (s *Substrate) BatchAllCreateContract(identity Identity, contractData []BatchCreateContractData) ([]uint64, error)
BatchAllCreateContract creates a batch of contracts for deployments atomically. transaction will rollback on error
func (*Substrate) BatchCancelContract ¶
BatchCancelContract cancels a batch of contracts
func (*Substrate) BatchCreateContract ¶
func (s *Substrate) BatchCreateContract(identity Identity, contractData []BatchCreateContractData) ([]uint64, *int, error)
BatchCreateContract creates a batch of contracts for deployments non-atomically. on error returns the created contracts, the first failing contract index and the error message.
func (*Substrate) Call ¶
func (s *Substrate) Call(cl Conn, meta Meta, identity Identity, call types.Call) (response *CallResponse, err error)
Call call this extrinsic and retry if Usurped
func (*Substrate) CallOnce ¶
func (s *Substrate) CallOnce(cl Conn, meta Meta, identity Identity, call types.Call) (hash types.Hash, err error)
func (*Substrate) CancelContract ¶
CancelContract creates a contract for deployment
func (*Substrate) Close ¶
func (s *Substrate) Close()
func (*Substrate) CreateFarm ¶
func (s *Substrate) CreateFarm(identity Identity, name string, publicIps []PublicIPInput) error
CreateFarm creates a farm takes in a name and public ip list
func (*Substrate) CreateNameContract ¶
CreateNameContract creates a contract for deployment
func (*Substrate) CreateNode ¶
CreateNode creates a node, this ignores public_config since this is only setable by the farmer
func (*Substrate) CreateNodeContract ¶
func (s *Substrate) CreateNodeContract(identity Identity, node uint32, body string, hash string, publicIPs uint32, solutionProviderID *uint64) (uint64, error)
CreateNodeContract creates a contract for deployment
func (*Substrate) CreateRefundTransactionOrAddSig ¶
func (s *Substrate) CreateRefundTransactionOrAddSig(identity Identity, tx_hash string, target string, amount int64, signature string, stellarAddress string, sequence_number uint64) error
func (*Substrate) CreateRentContract ¶
func (s *Substrate) CreateRentContract(identity Identity, node uint32, solutionProviderID *uint64) (uint64, error)
CreateRentContract creates a rent contract on a node
func (*Substrate) CreateTwin ¶
CreateTwin creates a twin
func (*Substrate) EnsureAccount ¶
func (s *Substrate) EnsureAccount(identity Identity, activationURL, termsAndConditionsLink, termsAndConditionsHash string) (info AccountInfo, err error)
EnsureAccount makes sure account is available on blockchain if not, it uses activation service to create one. EnsureAccount is safe to call on already activated accounts and it's mostly a NO-OP operation unless the account funds are very low, it will then make sure to reactivate the account (fund it) if the free tokens are <= ReactivateThreefold uTFT
func (*Substrate) FetchEventsForBlockRange ¶
func (s *Substrate) FetchEventsForBlockRange(start uint32, end uint32) (types.StorageKey, []types.StorageChangeSet, error)
func (*Substrate) GetAccount ¶
func (s *Substrate) GetAccount(identity Identity) (info AccountInfo, err error)
GetAccount gets account info with secure key
func (*Substrate) GetAccountPublicInfo ¶
func (s *Substrate) GetAccountPublicInfo(account AccountID) (info AccountInfo, err error)
GetAccountPublicInfo gets the info for a given account ID
func (*Substrate) GetAverageTFTPrice ¶
GetAverageTFTPrice gets the average TFT price
func (*Substrate) GetBalance ¶
GetBalance gets the balance for a given account ID
func (*Substrate) GetBlock ¶
func (*Substrate) GetBlockByNumber ¶
func (*Substrate) GetBurnTransaction ¶
func (s *Substrate) GetBurnTransaction(burnTransactionID types.U64) (*BurnTransaction, error)
func (*Substrate) GetClient ¶
func (*Substrate) GetContract ¶
GetContract we should not have calls to create contract, instead only get
func (*Substrate) GetContractIDByNameRegistration ¶
GetContractIDByNameRegistration gets a contract given the its name
func (*Substrate) GetContractWithHash ¶
GetContractWithHash gets a contract given the node id and hash
func (*Substrate) GetCurrentHeight ¶
func (*Substrate) GetDedicatedNodePrice ¶
GetDedicatedeNodePrice returns the price of a dedicated node
func (*Substrate) GetDepositFee ¶
func (*Substrate) GetEntity ¶
GetEntity gets a entity with ID
func (*Substrate) GetEventsForBlock ¶
func (s *Substrate) GetEventsForBlock(start uint32) (*EventRecords, error)
func (*Substrate) GetFarm ¶
GetFarm gets a farm with ID
func (*Substrate) GetFarmByName ¶
GetFarm gets a farm with ID
func (*Substrate) GetLastNodeID ¶
GetNode with id
func (*Substrate) GetNode ¶
GetNode with id
func (*Substrate) GetNodeByTwinID ¶
GetNodeByTwinID gets a node by twin id
func (*Substrate) GetNodeContracts ¶
GetNodeContracts gets all contracts on a node (pk) in given state
func (*Substrate) GetNodeRentContract ¶
GetNodeContracts gets all contracts on a node (pk) in given state
func (*Substrate) GetNodes ¶
GetNodes gets nodes' IDs using farm id
func (*Substrate) GetPowerTarget ¶
GetPowerTarget returns the power target for a node
func (*Substrate) GetPricingPolicy ¶
func (s *Substrate) GetPricingPolicy(id uint32) (pricingPolicy PricingPolicy, err error)
GetPricingPolicies gets pricing policy from tfgrid module
func (*Substrate) GetRefundTransaction ¶
func (s *Substrate) GetRefundTransaction(txHash string) (*RefundTransaction, error)
func (*Substrate) GetServiceContract ¶
func (s *Substrate) GetServiceContract(id uint64) (*ServiceContract, error)
GetServiceContract gets a service contract given the service contract id
func (*Substrate) GetServiceContractID ¶
GetServiceContractID gets the current value of storage ServiceContractID
func (*Substrate) GetTFTPrice ¶
GetTFTPrice gets the TFT price
func (*Substrate) GetTwin ¶
GetTwin gets a twin
func (*Substrate) GetTwinByPubKey ¶
GetTwinByPubKey gets a twin with public key
func (*Substrate) GetUser ¶
GetUser with id
func (*Substrate) GetZosVersion ¶
GetZosVersion gets the latest version for each network
func (*Substrate) IsBurnedAlready ¶
func (*Substrate) IsMintedAlready ¶
func (*Substrate) IsRefundedAlready ¶
func (*Substrate) IsValidator ¶
func (*Substrate) KVStoreDelete ¶
func (*Substrate) KVStoreGet ¶
func (*Substrate) KVStoreList ¶
func (*Substrate) KVStoreSet ¶
func (*Substrate) ProposeBurnTransactionOrAddSig ¶
func (s *Substrate) ProposeBurnTransactionOrAddSig(identity Identity, txID uint64, target string, amount *big.Int, signature string, stellarAddress string, sequence_number uint64) error
func (*Substrate) ProposeOrVoteMintTransaction ¶
func (s *Substrate) ProposeOrVoteMintTransaction(identity Identity, txID string, target AccountID, amount *big.Int) error
func (*Substrate) Report ¶
Report send a capacity report to substrate
func (*Substrate) ScanNodes ¶
func (*Substrate) ServiceContractApprove ¶
ServiceContractApprove approves a service contract
func (*Substrate) ServiceContractBill ¶
func (s *Substrate) ServiceContractBill(identity Identity, contract uint64, variable_amount uint64, metadata string) error
ServiceContractBill bills a service contract
func (*Substrate) ServiceContractCancel ¶
ServiceContractCancel cancels a service contract
func (*Substrate) ServiceContractCreate ¶
func (s *Substrate) ServiceContractCreate(identity Identity, service AccountID, consumer AccountID) (uint64, error)
ServiceContractCreate creates a service contract
func (*Substrate) ServiceContractReject ¶
ServiceContractReject rejects a service contract
func (*Substrate) ServiceContractSetFees ¶
func (s *Substrate) ServiceContractSetFees(identity Identity, contract uint64, base_fee uint64, variable_fee uint64) error
ServiceContractSetFees sets fees for a service contract
func (*Substrate) ServiceContractSetMetadata ¶
func (s *Substrate) ServiceContractSetMetadata(identity Identity, contract uint64, metadata string) error
ServiceContractSetMetadata sets metadata for a service contract
func (*Substrate) SetBurnTransactionExecuted ¶
func (*Substrate) SetContractConsumption ¶
func (s *Substrate) SetContractConsumption(identity Identity, resources ...ContractResources) error
SetContractConsumption can only be called by the node that owns the contract to set the used resources associated with the node.
func (*Substrate) SetDedicatedNodePrice ¶
func (s *Substrate) SetDedicatedNodePrice(identity Identity, nodeId uint32, price uint64) (hash types.Hash, err error)
SetDedicatedNodePrice sets an extra price on a node expressed in mUSD This price will be distributed back to the farmer if the node is rented Setting this price also makes the node only available to rent as dedicated
func (*Substrate) SetNodeCertificate ¶
func (s *Substrate) SetNodeCertificate(identity Identity, id uint32, cert NodeCertification) error
SetNodeCertificate sets the node certificate type
func (*Substrate) SetNodePowerState ¶
SetNodePowerState updates the node uptime to given value
func (*Substrate) SetNodePowerTarget ¶
func (s *Substrate) SetNodePowerTarget(identity Identity, nodeID uint32, up bool) (hash types.Hash, err error)
SetNodePowerTarget updates the power target of a node
func (*Substrate) SetRefundTransactionExecuted ¶
func (*Substrate) SignedTermsAndConditions ¶
func (s *Substrate) SignedTermsAndConditions(account AccountID) ([]TermsAndConditions, error)
SignedTermsAndConditions return list of signed terms and conditions for this account
func (*Substrate) SwapToStellar ¶
func (s *Substrate) SwapToStellar(identity Identity, targetStellarAddress string, amount big.Int) error
func (*Substrate) Time ¶
func (*Substrate) Transfer ¶
func (*Substrate) UpdateNode ¶
UpdateNode updates a node, this ignores public_config and only keep the value set by the farmer
func (*Substrate) UpdateNodeContract ¶
func (s *Substrate) UpdateNodeContract(identity Identity, contract uint64, body string, hash string) (uint64, error)
UpdateNodeContract updates existing contract
func (*Substrate) UpdateNodeUptime ¶
UpdateNodeUptime updates the node uptime to given value
func (*Substrate) UpdateNodeUptimeV2 ¶
func (s *Substrate) UpdateNodeUptimeV2(identity Identity, uptime, timestampHint uint64) (hash types.Hash, err error)
UpdateNodeUptime updates the node uptime to given value
func (*Substrate) UpdateTwin ¶
UpdateTwin updates a twin
type TermsAndConditions ¶
type TermsAndConditions struct { Account AccountID `json:"account_id"` Timestamp types.U64 `json:"timestamp"` DocumentLink string `json:"document_link"` DocumentHash string `json:"document_hash"` }
type TokensBurned ¶
type TokensBurned struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` Amount types.U128 `json:"amount"` Topics []types.Hash }
TokensBurned
type Twin ¶
type Twin struct { ID types.U32 `json:"id"` Account AccountID `json:"acocunt_id"` Relay OptionRelay `json:"relay"` Entities []EntityProof `json:"entities"` Pk types.OptionBytes `json:"pk"` }
Twin struct
type TwinAccountBounded ¶
type TwinAccountBounded struct { Phase types.Phase Twin types.U32 `json:"twin_id"` Account AccountID `json:"account_id"` Topics []types.Hash }
type TwinDeleted ¶
type TwinEntityRemoved ¶
type TwinEntityRemoved struct { Phase types.Phase Twin types.U32 `json:"twin_id"` Entity types.U32 `json:"identity_id"` Topics []types.Hash }
type TwinEntityStored ¶
type TwinEntityStored struct { Phase types.Phase Twin types.U32 `json:"twin_id"` Entity types.U32 `json:"entity_id"` Signature []byte `json:"signature"` Topics []types.Hash }
type TwinStored ¶
type Unit ¶
type Unit byte
numeric enum for unit
type UpdatedUsedResources ¶
type UpdatedUsedResources struct { Phase types.Phase ContractResources ContractResources `json:"contract_resources"` Topics []types.Hash }
type User ¶
type User struct { Versioned ID types.U32 `json:"id"` Name string `json:"name"` CountryID types.U32 `json:"country_id"` CityID types.U32 `json:"city_id"` Address AccountID `json:"address"` }
User from substrate
type Val ¶
type Validator ¶
type Validator struct { ValidatorNodeAccount AccountID `json:"validator_node_account"` StashAccount AccountID `json:"stash_account"` Description string `json:"description"` TfConnectId string `json:"tf_connect_id"` Info string `json:"info"` State ValidatorRequestState `json:"state"` }
type ValidatorAdded ¶
type ValidatorAdded struct { Phase types.Phase Account AccountID `json:"account_id"` Topics []types.Hash }
type ValidatorApproved ¶
type ValidatorApproved struct { Phase types.Phase Validator Validator `json:"validator"` Topics []types.Hash }
type ValidatorCreated ¶
type ValidatorCreated struct { Phase types.Phase Account AccountID `json:"account_id"` Validator Validator `json:"validator"` Topics []types.Hash }
type ValidatorRemoved ¶
type ValidatorRemoved struct { Phase types.Phase Account AccountID `json:"account_id"` Topics []types.Hash }
type ValidatorRequestState ¶
type ValidatorRequestState struct { IsCreated bool `json:"is_created"` IsApproved bool `json:"is_approved"` IsValidating bool `json:"is_validating"` }
func (*ValidatorRequestState) Decode ¶
func (r *ValidatorRequestState) Decode(decoder scale.Decoder) error
Decode implementation for the enum type
type Versioned ¶
type Versioned struct { Version uint32 `json:"version"` }
Versioned base for all types
type Voted ¶
type Voted struct { Phase types.Phase Account AccountID `json:"account_id"` ProposalHash types.Hash `json:"proposal_hash"` Voted bool `json:"voted"` Yes types.U32 `json:"yes"` No types.U32 `json:"no"` Topics []types.Hash }
type ZosVersionUpdated ¶
type ZosVersionUpdated struct { Phase types.Phase Version string `json:"version"` Topics []types.Hash }
Source Files ¶
account.go blocks.go bridge.go burn_events.go burning.go codec.go contract.go contract_events.go dao.go depositfee.go entity.go events.go farm.go impl.go kvstore.go minting.go node.go price.go refunds.go retrying_client.go service_contract.go termsandconditions.go tft_bridge_events.go transfer.go twin.go types.go user.go utils.go validator.go zos_version.go
- Version
- v0.0.0-20241127100051-77e684bcb1b2 (latest)
- Published
- Nov 27, 2024
- Platform
- linux/amd64
- Imports
- 28 packages
- Last checked
- 2 months ago –
Tools for package owners.