chain

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 33 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// Audit
	AuditVerifyProof               = "Audit.VerifyProof"
	AuditSubmitProof               = "Audit.SubmitProof"
	AuditGenerateChallenge         = "Audit.GenerateChallenge"
	AuditSubmitIdleProof           = "Audit.SubmitIdleProof"
	AuditSubmitServiceProof        = "Audit.SubmitServiceProof"
	AuditSubmitIdleVerifyResult    = "Audit.SubmitIdleVerifyResult"
	AuditSubmitServiceVerifyResult = "Audit.SubmitServiceVerifyResult"

	// Balances
	BalancesWithdraw = "Balances.Withdraw"
	BalancesTransfer = "Balances.Transfer"

	// FileBank
	FileBankDeleteFile            = "FileBank.DeleteFile"
	FileBankFillerDelete          = "FileBank.FillerDelete"
	FileBankFillerUpload          = "FileBank.FillerUpload"
	FileBankUploadDeclaration     = "FileBank.UploadDeclaration"
	FileBankCreateBucket          = "FileBank.CreateBucket"
	FileBankDeleteBucket          = "FileBank.DeleteBucket"
	FileBankTransferReport        = "FileBank.TransferReport"
	FileBankReplaceFiller         = "FileBank.ReplaceFiller"
	FileBankGenerateRestoralOrder = "FileBank.GenerateRestoralOrder"
	FileBankClaimRestoralOrder    = "FileBank.ClaimRestoralOrder"
	FileBankRecoveryCompleted     = "FileBank.RecoveryCompleted"
	FileBankStorageCompleted      = "FileBank.StorageCompleted"
	FileBankIdleSpaceCert         = "FileBank.IdleSpaceCert"
	FileBankReplaceIdleSpace      = "FileBank.ReplaceIdleSpace"
	FileBankCalculateReport       = "FileBank.CalculateReport"

	FileBankTerritorFileDelivery = "FileBank.TerritorFileDelivery"

	// Oss
	OssAuthorize       = "Oss.Authorize"
	OssCancelAuthorize = "Oss.CancelAuthorize"
	OssOssRegister     = "Oss.OssRegister"
	OssOssUpdate       = "Oss.OssUpdate"
	OssOssDestroy      = "Oss.OssDestroy"

	// Sminer
	SminerRegistered               = "Sminer.Registered"
	SminerRegisterPoisKey          = "Sminer.RegisterPoisKey"
	SminerDrawFaucetMoney          = "Sminer.DrawFaucetMoney"
	SminerFaucetTopUpMoney         = "Sminer.FaucetTopUpMoney"
	SminerIncreaseCollateral       = "Sminer.IncreaseCollateral"
	SminerDeposit                  = "Sminer.Deposit"
	SminerUpdateBeneficiary        = "Sminer.UpdateBeneficiary"
	SminerUpdatePeerId             = "Sminer.UpdatePeerId"
	SminerReceive                  = "Sminer.Receive"
	SminerMinerExitPrep            = "Sminer.MinerExitPrep"
	SminerWithdraw                 = "Sminer.Withdraw"
	SminerIncreaseDeclarationSpace = "Sminer.IncreaseDeclarationSpace"

	// Staking
	StakingStakersElected = "Staking.StakersElected"
	StakingEraPaid        = "Staking.EraPaid"
	StakingPayoutStarted  = "Staking.PayoutStarted"
	StakingRewarded       = "Staking.Rewarded"
	StakingUnbonded       = "Staking.Unbonded"

	// StorageHandler
	StorageHandlerMintTerritory        = "StorageHandler.MintTerritory"
	StorageHandlerExpansionTerritory   = "StorageHandler.ExpansionTerritory"
	StorageHandlerRenewalTerritory     = "StorageHandler.RenewalTerritory"
	StorageHandlerReactivateTerritory  = "StorageHandler.ReactivateTerritory"
	StorageHandlerConsignment          = "StorageHandler.Consignment"
	StorageHandlerCancleConsignment    = "StorageHandler.CancleConsignment"
	StorageHandlerBuyConsignment       = "StorageHandler.BuyConsignment"
	StorageHandlerCancelPurchaseAction = "StorageHandler.CancelPurchaseAction"

	// TeeWorker
	TeeWorkerExit                          = "TeeWorker.Exit"
	TeeWorkerMasterKeyLaunched             = "TeeWorker.MasterKeyLaunched"
	TeeWorkerKeyfairyAdded                 = "TeeWorker.KeyfairyAdded"
	TeeWorkerWorkerAdded                   = "TeeWorker.WorkerAdded"
	TeeWorkerWorkerUpdated                 = "TeeWorker.WorkerUpdated"
	TeeWorkerMasterKeyRotated              = "TeeWorker.MasterKeyRotated"
	TeeWorkerMasterKeyRotationFailed       = "TeeWorker.MasterKeyRotationFailed"
	TeeWorkerMinimumCesealVersionChangedTo = "TeeWorker.MinimumCesealVersionChangedTo"

	//
	TransactionPaymentTransactionFeePaid = "TransactionPayment.TransactionFeePaid"
	//
	EvmAccountMappingTransactionFeePaid = "EvmAccountMapping.TransactionFeePaid"

	// System
	SystemExtrinsicSuccess = "System.ExtrinsicSuccess"
	SystemExtrinsicFailed  = "System.ExtrinsicFailed"
	SystemNewAccount       = "System.NewAccount"
)
View Source
const (
	// AssetConversion
	ExtName_AssetConversion_add_liquidity                = "AssetConversion.add_liquidity"
	ExtName_AssetConversion_create_pool                  = "AssetConversion.create_pool"
	ExtName_AssetConversion_remove_liquidity             = "AssetConversion.remove_liquidity"
	ExtName_AssetConversion_swap_exact_tokens_for_tokens = "AssetConversion.swap_exact_tokens_for_tokens"
	ExtName_AssetConversion_swap_tokens_for_exact_tokens = "AssetConversion.swap_tokens_for_exact_tokens"

	// AssetRate
	ExtName_AssetRate_create = "AssetRate.create"
	ExtName_AssetRate_remove = "AssetRate.remove"
	ExtName_AssetRate_update = "AssetRate.update"

	// Assets
	ExtName_Assets_approve_transfer      = "Assets.approve_transfer"
	ExtName_Assets_block                 = "Assets.block"
	ExtName_Assets_burn                  = "Assets.burn"
	ExtName_Assets_cancel_approval       = "Assets.cancel_approval"
	ExtName_Assets_clear_metadata        = "Assets.clear_metadata"
	ExtName_Assets_create                = "Assets.create"
	ExtName_Assets_destroy_accounts      = "Assets.destroy_accounts"
	ExtName_Assets_destroy_approvals     = "Assets.destroy_approvals"
	ExtName_Assets_finish_destroy        = "Assets.finish_destroy"
	ExtName_Assets_force_asset_status    = "Assets.force_asset_status"
	ExtName_Assets_force_cancel_approval = "Assets.force_cancel_approval"
	ExtName_Assets_force_clear_metadata  = "Assets.force_clear_metadata"
	ExtName_Assets_force_create          = "Assets.force_create"
	ExtName_Assets_force_set_metadata    = "Assets.force_set_metadata"
	ExtName_Assets_force_transfer        = "Assets.force_transfer"
	ExtName_Assets_freeze                = "Assets.freeze"
	ExtName_Assets_freeze_asset          = "Assets.freeze_asset"
	ExtName_Assets_mint                  = "Assets.mint"
	ExtName_Assets_refund                = "Assets.refund"
	ExtName_Assets_refund_other          = "Assets.refund_other"
	ExtName_Assets_set_metadata          = "Assets.set_metadata"
	ExtName_Assets_set_min_balance       = "Assets.set_min_balance"
	ExtName_Assets_set_team              = "Assets.set_team"
	ExtName_Assets_start_destroy         = "Assets.start_destroy"
	ExtName_Assets_thaw                  = "Assets.thaw"
	ExtName_Assets_thaw_asset            = "Assets.thaw_asset"
	ExtName_Assets_touch                 = "Assets.touch"
	ExtName_Assets_touch_other           = "Assets.touch_other"
	ExtName_Assets_transfer              = "Assets.transfer"
	ExtName_Assets_transfer_approved     = "Assets.transfer_approved"
	ExtName_Assets_transfer_keep_alive   = "Assets.transfer_keep_alive"
	ExtName_Assets_transfer_ownership    = "Assets.transfer_ownership"

	// Audit
	ExtName_Audit_point_miner_challenge        = "Audit.point_miner_challenge"
	ExtName_Audit_submit_idle_proof            = "Audit.submit_idle_proof"
	ExtName_Audit_submit_service_proof         = "Audit.submit_service_proof"
	ExtName_Audit_submit_verify_idle_result    = "Audit.submit_verify_idle_result"
	ExtName_Audit_submit_verify_service_result = "Audit.submit_verify_service_result"
	ExtName_Audit_test_update_clear_slip       = "Audit.test_update_clear_slip"
	ExtName_Audit_test_update_verify_slip      = "Audit.test_update_verify_slip"
	ExtName_Audit_update_counted_clear         = "Audit.update_counted_clear"

	// Babe
	ExtName_Babe_plan_config_change           = "Babe.plan_config_change"
	ExtName_Babe_report_equivocation          = "Babe.report_equivocation"
	ExtName_Babe_report_equivocation_unsigned = "Babe.report_equivocation_unsigned"

	// Balances
	ExtName_Balances_force_adjust_total_issuance = "Balances.force_adjust_total_issuance"
	ExtName_Balances_force_set_balance           = "Balances.force_set_balance"
	ExtName_Balances_force_transfer              = "Balances.force_transfer"
	ExtName_Balances_force_unreserve             = "Balances.force_unreserve"
	// ExtName_Balances_set_balance_deprecated      = "Balances.set_balance_deprecated"
	// ExtName_Balances_transfer                    = "Balances.transfer"
	ExtName_Balances_transfer_all         = "Balances.transfer_all"
	ExtName_Balances_transfer_allow_death = "Balances.transfer_allow_death"
	ExtName_Balances_transferKeepAlive    = "Balances.transfer_keep_alive"
	ExtName_Balances_upgrade_accounts     = "Balances.upgrade_accounts"

	// BaseFee
	ExtName_BaseFee_set_base_fee_per_gas = "BaseFee.set_base_fee_per_gas"
	ExtName_BaseFee_set_elasticity       = "BaseFee.set_elasticity"

	// Cacher
	ExtName_Cacher_logout   = "Cacher.logout"
	ExtName_Cacher_pay      = "Cacher.pay"
	ExtName_Cacher_register = "Cacher.register"
	ExtName_Cacher_update   = "Cacher.update"

	// CesMq
	ExtName_CesMq_force_push_pallet_message = "CesMq.force_push_pallet_message"
	ExtName_CesMq_push_message              = "CesMq.push_message"
	ExtName_CesMq_sync_offchain_message     = "CesMq.sync_offchain_message"

	// CessTreasury
	ExtName_CessTreasury_pid_burn_funds    = "CessTreasury.pid_burn_funds"
	ExtName_CessTreasury_pid_send_funds    = "CessTreasury.pid_send_funds"
	ExtName_CessTreasury_send_funds_to_pid = "CessTreasury.send_funds_to_pid"
	ExtName_CessTreasury_send_funds_to_sid = "CessTreasury.send_funds_to_sid"
	ExtName_CessTreasury_sid_burn_funds    = "CessTreasury.sid_burn_funds"
	ExtName_CessTreasury_sid_send_funds    = "CessTreasury.sid_send_funds"

	// Contracts
	ExtName_Contracts_call                             = "Contracts.call"
	ExtName_Contracts_call_old_weight                  = "Contracts.call_old_weight"
	ExtName_Contracts_instantiate                      = "Contracts.instantiate"
	ExtName_Contracts_instantiate_old_weight           = "Contracts.instantiate_old_weight"
	ExtName_Contracts_instantiate_with_code            = "Contracts.instantiate_with_code"
	ExtName_Contracts_instantiate_with_code_old_weight = "Contracts.instantiate_with_code_old_weight"
	ExtName_Contracts_migrate                          = "Contracts.migrate"
	ExtName_Contracts_remove_code                      = "Contracts.remove_code"
	ExtName_Contracts_set_code                         = "Contracts.set_code"
	ExtName_Contracts_upload_code                      = "Contracts.upload_code"

	// Council
	ExtName_Council_close               = "Council.close"
	ExtName_Council_disapprove_proposal = "Council.disapprove_proposal"
	ExtName_Council_execute             = "Council.execute"
	ExtName_Council_propose             = "Council.propose"
	ExtName_Council_set_members         = "Council.set_members"
	ExtName_Council_vote                = "Council.vote"

	// ElectionProviderMultiPhase
	ExtName_ElectionProviderMultiPhase_governance_fallback           = "ElectionProviderMultiPhase.governance_fallback"
	ExtName_ElectionProviderMultiPhase_set_emergency_election_result = "ElectionProviderMultiPhase.set_emergency_election_result"
	ExtName_ElectionProviderMultiPhase_set_minimum_untrusted_score   = "ElectionProviderMultiPhase.set_minimum_untrusted_score"
	ExtName_ElectionProviderMultiPhase_submit                        = "ElectionProviderMultiPhase.submit"
	ExtName_ElectionProviderMultiPhase_submit_unsigned               = "ElectionProviderMultiPhase.submit_unsigned"

	// Ethereum
	ExtName_Ethereum_transact = "Ethereum.transact"

	// EVM
	ExtName_Evm_call     = "EVM.call"
	ExtName_Evm_create   = "EVM.create"
	ExtName_Evm_create2  = "EVM.create2"
	ExtName_Evm_withdraw = "EVM.withdraw"

	// EvmAccountMapping
	ExtName_EvmAccountMapping_meta_call = "EvmAccountMapping.meta_call"

	// FastUnstake
	ExtName_FastUnstake_control               = "FastUnstake.control"
	ExtName_FastUnstake_deregister            = "FastUnstake.deregister"
	ExtName_FastUnstake_register_fast_unstake = "FastUnstake.register_fast_unstake"

	// FileBank
	ExtName_FileBank_calculate_report             = "FileBank.calculate_report"
	ExtName_FileBank_cert_idle_space              = "FileBank.cert_idle_space"
	ExtName_FileBank_claim_restoral_noexist_order = "FileBank.claim_restoral_noexist_order"
	ExtName_FileBank_claim_restoral_order         = "FileBank.claim_restoral_order"
	ExtName_FileBank_create_bucket                = "FileBank.create_bucket"
	ExtName_FileBank_delete_bucket                = "FileBank.delete_bucket"
	ExtName_FileBank_delete_file                  = "FileBank.delete_file"
	ExtName_FileBank_generate_restoral_order      = "FileBank.generate_restoral_order"
	//ExtName_FileBank_ownership_transfer           = "FileBank.ownership_transfer"
	ExtName_FileBank_replace_idle_space      = "FileBank.replace_idle_space"
	ExtName_FileBank_restoral_order_complete = "FileBank.restoral_order_complete"
	ExtName_FileBank_root_clear_file         = "FileBank.root_clear_file"
	ExtName_FileBank_territory_file_delivery = "FileBank.territory_file_delivery"
	ExtName_FileBank_transfer_report         = "FileBank.transfer_report"
	ExtName_FileBank_upload_declaration      = "FileBank.upload_declaration"

	// Grandpa
	ExtName_Grandpa_note_stalled                 = "Grandpa.note_stalled"
	ExtName_Grandpa_report_equivocation          = "Grandpa.report_equivocation"
	ExtName_Grandpa_report_equivocation_unsigned = "Grandpa.report_equivocation_unsigned"

	// ImOnline
	ExtName_ImOnline_heartbeat = "ImOnline.heartbeat"

	// Indices
	ExtName_Indices_claim          = "Indices.claim"
	ExtName_Indices_force_transfer = "Indices.force_transfer"
	ExtName_Indices_free           = "Indices.free"
	ExtName_Indices_freeze         = "Indices.freeze"
	ExtName_Indices_transfer       = "Indices.transfer"

	// MultiBlockMigrations
	ExtName_MultiBlockMigrations_clear_historic          = "MultiBlockMigrations.clear_historic"
	ExtName_MultiBlockMigrations_force_onboard_mbms      = "MultiBlockMigrations.force_onboard_mbms"
	ExtName_MultiBlockMigrations_force_set_active_cursor = "MultiBlockMigrations.force_set_active_cursor"
	ExtName_MultiBlockMigrations_force_set_cursor        = "MultiBlockMigrations.force_set_cursor"

	// Multisig
	ExtName_Multisig_approve_as_multi    = "Multisig.approve_as_multi"
	ExtName_Multisig_as_multi            = "Multisig.as_multi"
	ExtName_Multisig_as_multi_threshold1 = "Multisig.as_multi_threshold_1"
	ExtName_Multisig_cancel_as_multi     = "Multisig.cancel_as_multi"

	// Oss
	ExtName_Oss_authorize        = "Oss.authorize"
	ExtName_Oss_cancel_authorize = "Oss.cancel_authorize"
	ExtName_Oss_destroy          = "Oss.destroy"
	ExtName_Oss_proxy_authorzie  = "Oss.proxy_authorzie"
	ExtName_Oss_register         = "Oss.register"
	ExtName_Oss_update           = "Oss.update"

	// Parameters
	ExtName_Parameters_set_parameter = "Parameters.set_parameter"

	// PoolAssets
	ExtName_PoolAssets_approve_transfer      = "PoolAssets.approve_transfer"
	ExtName_PoolAssets_block                 = "PoolAssets.block"
	ExtName_PoolAssets_burn                  = "PoolAssets.burn"
	ExtName_PoolAssets_cancel_approval       = "PoolAssets.cancel_approval"
	ExtName_PoolAssets_clear_metadata        = "PoolAssets.clear_metadata"
	ExtName_PoolAssets_create                = "PoolAssets.create"
	ExtName_PoolAssets_destroy_accounts      = "PoolAssets.destroy_accounts"
	ExtName_PoolAssets_destroy_approvals     = "PoolAssets.destroy_approvals"
	ExtName_PoolAssets_finish_destroy        = "PoolAssets.finish_destroy"
	ExtName_PoolAssets_force_asset_status    = "PoolAssets.force_asset_status"
	ExtName_PoolAssets_force_cancel_approval = "PoolAssets.force_cancel_approval"
	ExtName_PoolAssets_force_clear_metadata  = "PoolAssets.force_clear_metadata"
	ExtName_PoolAssets_force_create          = "PoolAssets.force_create"
	ExtName_PoolAssets_force_set_metadata    = "PoolAssets.force_set_metadata"
	ExtName_PoolAssets_force_transfer        = "PoolAssets.force_transfer"
	ExtName_PoolAssets_freeze                = "PoolAssets.freeze"
	ExtName_PoolAssets_freeze_asset          = "PoolAssets.freeze_asset"
	ExtName_PoolAssets_mint                  = "PoolAssets.mint"
	ExtName_PoolAssets_refund                = "PoolAssets.refund"
	ExtName_PoolAssets_refund_other          = "PoolAssets.refund_other"
	ExtName_PoolAssets_set_metadata          = "PoolAssets.set_metadata"
	ExtName_PoolAssets_set_min_balance       = "PoolAssets.set_min_balance"
	ExtName_PoolAssets_set_team              = "PoolAssets.set_team"
	ExtName_PoolAssets_start_destroy         = "PoolAssets.start_destroy"
	ExtName_PoolAssets_thaw                  = "PoolAssets.thaw"
	ExtName_PoolAssets_thaw_asset            = "PoolAssets.thaw_asset"
	ExtName_PoolAssets_touch                 = "PoolAssets.touch"
	ExtName_PoolAssets_touch_other           = "PoolAssets.touch_other"
	ExtName_PoolAssets_transfer              = "PoolAssets.transfer"
	ExtName_PoolAssets_transfer_approved     = "PoolAssets.transfer_approved"
	ExtName_PoolAssets_transfer_keep_alive   = "PoolAssets.transfer_keep_alive"
	ExtName_PoolAssets_transfer_ownership    = "PoolAssets.transfer_ownership"

	// Preimage
	ExtName_Preimage_ensure_updated     = "Preimage.ensure_updated"
	ExtName_Preimage_note_preimage      = "Preimage.note_preimage"
	ExtName_Preimage_request_preimage   = "Preimage.request_preimage"
	ExtName_Preimage_unnote_preimage    = "Preimage.unnote_preimage"
	ExtName_Preimage_unrequest_preimage = "Preimage.unrequest_preimage"

	// Proxy
	ExtName_Proxy_add_proxy           = "Proxy.add_proxy"
	ExtName_Proxy_announce            = "Proxy.announce"
	ExtName_Proxy_create_pure         = "Proxy.create_pure"
	ExtName_Proxy_kill_pure           = "Proxy.kill_pure"
	ExtName_Proxy_proxy               = "Proxy.proxy"
	ExtName_Proxy_proxy_announced     = "Proxy.proxy_announced"
	ExtName_Proxy_reject_announcement = "Proxy.reject_announcement"
	ExtName_Proxy_remove_announcement = "Proxy.remove_announcement"
	ExtName_Proxy_remove_proxies      = "Proxy.remove_proxies"
	ExtName_Proxy_remove_proxy        = "Proxy.remove_proxy"

	// Reservoir
	ExtName_Reservoir_attend_evnet   = "Reservoir.attend_event"
	ExtName_Reservoir_create_event   = "Reservoir.create_event"
	ExtName_Reservoir_event_withdraw = "Reservoir.event_withdraw"
	ExtName_Reservoir_filling        = "Reservoir.filling"
	ExtName_Reservoir_store          = "Reservoir.store"
	ExtName_Reservoir_withdraw       = "Reservoir.withdraw"

	// Scheduler
	ExtName_Scheduler_cancel               = "Scheduler.cancel"
	ExtName_Scheduler_cancel_named         = "Scheduler.cancel_named"
	ExtName_Scheduler_cancel_retry         = "Scheduler.cancel_retry"
	ExtName_Scheduler_cancel_retry_named   = "Scheduler.cancel_retry_named"
	ExtName_Scheduler_schedule             = "Scheduler.schedule"
	ExtName_Scheduler_schedule_after       = "Scheduler.schedule_after"
	ExtName_Scheduler_schedule_named       = "Scheduler.schedule_named"
	ExtName_Scheduler_schedule_named_after = "Scheduler.schedule_named_after"
	ExtName_Scheduler_set_retry            = "Scheduler.set_retry"
	ExtName_Scheduler_set_retry_named      = "Scheduler.set_retry_named"

	// Session
	ExtName_Session_purge_keys = "Session.purge_keys"
	ExtName_Session_set_keys   = "Session.set_keys"

	// Sminer
	ExtName_Sminer_clear_miner_service        = "Sminer.clear_miner_service"
	ExtName_Sminer_faucet                     = "Sminer.faucet"
	ExtName_Sminer_faucet_top_up              = "Sminer.faucet_top_up"
	ExtName_Sminer_increase_collateral        = "Sminer.increase_collateral"
	ExtName_Sminer_increase_declaration_space = "Sminer.increase_declaration_space"
	ExtName_Sminer_miner_exit                 = "Sminer.miner_exit"
	ExtName_Sminer_miner_exit_prep            = "Sminer.miner_exit_prep"
	ExtName_Sminer_miner_withdraw             = "Sminer.miner_withdraw"
	ExtName_Sminer_receive_reward             = "Sminer.receive_reward"
	ExtName_Sminer_register_pois_key          = "Sminer.register_pois_key"
	ExtName_Sminer_regnstk                    = "Sminer.regnstk"
	ExtName_Sminer_regnstk_assign_staking     = "Sminer.regnstk_assign_staking"
	ExtName_Sminer_set_facuet_whitelist       = "Sminer.set_facuet_whitelist"
	ExtName_Sminer_update_beneficiary         = "Sminer.update_beneficiary"
	ExtName_Sminer_update_expender            = "Sminer.update_expender"
	ExtName_Sminer_update_peer_id             = "Sminer.update_peer_id"

	// Staking
	ExtName_Staking_bond                       = "Staking.bond"
	ExtName_Staking_bond_extra                 = "Staking.bond_extra"
	ExtName_Staking_cancel_deferred_slash      = "Staking.cancel_deferred_slash"
	ExtName_Staking_chill                      = "Staking.chill"
	ExtName_Staking_chill_other                = "Staking.chill_other"
	ExtName_Staking_deprecate_controller_batch = "Staking.deprecate_controller_batch"
	ExtName_Staking_force_apply_min_commission = "Staking.force_apply_min_commission"
	ExtName_Staking_force_new_era              = "Staking.force_new_era"
	ExtName_Staking_force_new_era_always       = "Staking.force_new_era_always"
	ExtName_Staking_force_no_eras              = "Staking.force_no_eras"
	ExtName_Staking_force_unstake              = "Staking.force_unstake"
	ExtName_Staking_increase_validator_count   = "Staking.increase_validator_count"
	ExtName_Staking_kick                       = "Staking.kick"
	ExtName_Staking_nominate                   = "Staking.nominate"
	ExtName_Staking_payout_stakers             = "Staking.payout_stakers"
	ExtName_Staking_payout_stakers_by_page     = "Staking.payout_stakers_by_page"
	ExtName_Staking_reap_stash                 = "Staking.reap_stash"
	ExtName_Staking_rebond                     = "Staking.rebond"
	ExtName_Staking_restore_ledger             = "Staking.restore_ledger"
	ExtName_Staking_scale_validator_count      = "Staking.scale_validator_count"
	ExtName_Staking_set_controller             = "Staking.set_controller"
	ExtName_Staking_set_invulnerables          = "Staking.set_invulnerables"
	ExtName_Staking_set_min_commission         = "Staking.set_min_commission"
	ExtName_Staking_set_payee                  = "Staking.set_payee"
	ExtName_Staking_set_staking_configs        = "Staking.set_staking_configs"
	ExtName_Staking_set_validator_count        = "Staking.set_validator_count"
	ExtName_Staking_unbond                     = "Staking.unbond"
	ExtName_Staking_update_payee               = "Staking.update_payee"
	ExtName_Staking_validate                   = "Staking.validate"
	ExtName_Staking_withdraw_unbonded          = "Staking.withdraw_unbonded"

	// StateTrieMigration
	ExtName_StateTrieMigration_continue_migrate       = "StateTrieMigration.continue_migrate"
	ExtName_StateTrieMigration_control_auto_migration = "StateTrieMigration.control_auto_migration"
	ExtName_StateTrieMigration_force_set_progress     = "StateTrieMigration.force_set_progress"
	ExtName_StateTrieMigration_migrate_custom_child   = "StateTrieMigration.migrate_custom_child"
	ExtName_StateTrieMigration_migrate_custom_top     = "StateTrieMigration.migrate_custom_top"
	ExtName_StateTrieMigration_set_signed_max_limits  = "StateTrieMigration.set_signed_max_limits"

	// StorageHandler
	//ExtName_StorageHandler_buySpace               = "StorageHandler.buy_space"
	ExtName_StorageHandler_buy_consignment        = "StorageHandler.buy_consignment"
	ExtName_StorageHandler_cancel_consignment     = "StorageHandler.cancel_consignment"
	ExtName_StorageHandler_cancel_purchase_action = "StorageHandler.cancel_purchase_action"
	ExtName_StorageHandler_clear_service_space    = "StorageHandler.clear_service_space"
	//ExtName_StorageHandler_clear_user_used_space  = "StorageHandler.clear_user_used_space"
	ExtName_StorageHandler_create_order          = "StorageHandler.create_order"
	ExtName_StorageHandler_exec_consignment      = "StorageHandler.exec_consignment"
	ExtName_StorageHandler_exec_order            = "StorageHandler.exec_order"
	ExtName_StorageHandler_expanding_territory   = "StorageHandler.expanding_territory"
	ExtName_StorageHandler_mint_territory        = "StorageHandler.mint_territory"
	ExtName_StorageHandler_reactivate_territory  = "StorageHandler.reactivate_territory"
	ExtName_StorageHandler_renewal_territory     = "StorageHandler.renewal_territory"
	ExtName_StorageHandler_territory_consignment = "StorageHandler.territory_consignment"
	ExtName_StorageHandler_territory_grants      = "StorageHandler.territory_grants"
	ExtName_StorageHandler_territory_rename      = "StorageHandler.territory_rename"
	//ExtName_StorageHandler_expansion_space        = "StorageHandler.expansion_space"
	ExtName_StorageHandler_update_expired_exec        = "StorageHandler.update_expired_exec"
	ExtName_StorageHandler_update_price               = "StorageHandler.update_price"
	ExtName_StorageHandler_update_user_territory_life = "StorageHandler.update_user_territory_life"

	// Sudo
	ExtName_Sudo_remove_key            = "Sudo.remove_key"
	ExtName_Sudo_set_key               = "Sudo.set_key"
	ExtName_Sudo_sudo                  = "Sudo.sudo"
	ExtName_Sudo_sudo_as               = "Sudo.sudo_as"
	ExtName_Sudo_sudo_unchecked_weight = "Sudo.sudo_unchecked_weight"

	// System
	ExtName_System_apply_authorized_upgrade         = "System.apply_authorized_upgrade"
	ExtName_System_authorize_upgrade                = "System.authorize_upgrade"
	ExtName_System_authorize_upgrade_without_checks = "System.authorize_upgrade_without_checks"
	ExtName_System_kill_prefix                      = "System.kill_prefix"
	ExtName_System_kill_storage                     = "System.kill_storage"
	ExtName_System_remark                           = "System.remark"
	ExtName_System_remark_with_event                = "System.remark_with_event"
	ExtName_System_set_code                         = "System.set_code"
	ExtName_System_set_code_without_checks          = "System.set_code_without_checks"
	ExtName_System_set_heap_pages                   = "System.set_heap_pages"
	ExtName_System_set_storage                      = "System.set_storage"

	// TechnicalCommittee
	ExtName_TechnicalCommittee_close               = "TechnicalCommittee.close"
	ExtName_TechnicalCommittee_disapprove_proposal = "TechnicalCommittee.disapprove_proposal"
	ExtName_TechnicalCommittee_execute             = "TechnicalCommittee.execute"
	ExtName_TechnicalCommittee_propose             = "TechnicalCommittee.propose"
	ExtName_TechnicalCommittee_set_members         = "TechnicalCommittee.set_members"
	ExtName_TechnicalCommittee_vote                = "TechnicalCommittee.vote"

	// TeeWorker
	ExtName_TeeWorker_add_ceseal                 = "TeeWorker.add_ceseal"
	ExtName_TeeWorker_apply_master_key           = "TeeWorker.apply_master_key"
	ExtName_TeeWorker_change_first_holder        = "TeeWorker.change_first_holder"
	ExtName_TeeWorker_clear_master_key           = "TeeWorker.clear_master_key"
	ExtName_TeeWorker_force_clear_tee            = "TeeWorker.force_clear_tee"
	ExtName_TeeWorker_force_register_worker      = "TeeWorker.force_register_worker"
	ExtName_TeeWorker_launch_master_key          = "TeeWorker.launch_master_key"
	ExtName_TeeWorker_migration_last_work        = "TeeWorker.migration_last_work"
	ExtName_TeeWorker_patch_clear_invalid_tee    = "TeeWorker.patch_clear_invalid_tee"
	ExtName_TeeWorker_patch_clear_not_work_tee   = "TeeWorker.patch_clear_not_work_tee"
	ExtName_TeeWorker_refresh_tee_status         = "TeeWorker.refresh_tee_status"
	ExtName_TeeWorker_register_worker            = "TeeWorker.register_worker"
	ExtName_TeeWorker_register_worker_v2         = "TeeWorker.register_worker_v2"
	ExtName_TeeWorker_remove_ceseal              = "TeeWorker.remove_ceseal"
	ExtName_TeeWorker_set_minimum_ceseal_version = "TeeWorker.set_minimum_ceseal_version"
	ExtName_TeeWorker_set_note_stalled           = "TeeWorker.set_note_stalled"
	ExtName_TeeWorker_update_worker_endpoint     = "TeeWorker.update_worker_endpoint"

	// Timestamp
	ExtName_Timestamp_set = "Timestamp.set"

	// TransactionStorage
	ExtName_TransactionStorage_check_proof = "TransactionStorage.check_proof"
	ExtName_TransactionStorage_renew       = "TransactionStorage.renew"
	ExtName_TransactionStorage_store       = "TransactionStorage.store"

	// Treasury
	ExtName_Treasury_approve_proposal = "Treasury.approve_proposal"
	ExtName_Treasury_check_status     = "Treasury.check_status"
	ExtName_Treasury_payout           = "Treasury.payout"
	ExtName_Treasury_propose_spend    = "Treasury.propose_spend"
	ExtName_Treasury_reject_proposal  = "Treasury.reject_proposal"
	ExtName_Treasury_remove_approval  = "Treasury.remove_approval"
	ExtName_Treasury_spend            = "Treasury.spend"
	ExtName_Treasury_spend_local      = "Treasury.spend_local"
	ExtName_Treasury_void_spend       = "Treasury.void_spend"

	// Utility
	ExtName_Utility_as_derivative = "Utility.as_derivative"
	ExtName_Utility_batch         = "Utility.batch"
	ExtName_Utility_batch_all     = "Utility.batch_all"
	ExtName_Utility_dispatch_as   = "Utility.dispatch_as"
	ExtName_Utility_force_batch   = "Utility.force_batch"
	ExtName_Utility_with_weight   = "Utility.with_weight"

	// VoterList
	ExtName_VoterList_put_in_front_of       = "VoterList.put_in_front_of"
	ExtName_VoterList_put_in_front_of_other = "VoterList.put_in_front_of_other"
	ExtName_VoterList_rebag                 = "VoterList.rebag"
)
View Source
const (
	// Audit
	Audit = "Audit"
	// Babe
	Babe = "Babe"
	// Balances
	Balances = "Balances"
	// CessTreasury
	CessTreasury = "CessTreasury"
	// EVM
	EVM = "EVM"
	// FileBank
	FileBank = "FileBank"
	// Oss
	Oss = "Oss"

	// SchedulerCredit
	SchedulerCredit = "SchedulerCredit"
	// Session
	Session = "Session"
	// Sminer
	Sminer = "Sminer"
	// Staking
	Staking = "Staking"
	// StorageHandler
	StorageHandler = "StorageHandler"

	// System
	System = "System"
	// TeeWorker
	TeeWorker = "TeeWorker"
)

pallet names

View Source
const (
	// Audit
	ChallengeSlip        = "ChallengeSlip"
	ChallengeSnapShot    = "ChallengeSnapShot"
	CountedClear         = "CountedClear"
	CountedServiceFailed = "CountedServiceFailed"
	VerifySlip           = "VerifySlip"

	// Babe
	Authorities = "Authorities"

	// Balances
	TotalIssuance    = "TotalIssuance"
	InactiveIssuance = "InactiveIssuance"

	// CessTreasury
	CurrencyReward = "CurrencyReward"
	EraReward      = "EraReward"
	ReserveReward  = "ReserveReward"
	RoundReward    = "RoundReward"

	// FileBank
	File                = "File"
	Bucket              = "Bucket"
	DealMap             = "DealMap"
	FillerMap           = "FillerMap"
	PendingReplacements = "PendingReplacements"
	RestoralOrder       = "RestoralOrder"
	UserBucketList      = "UserBucketList"
	UserHoldFileList    = "UserHoldFileList"

	// Oss
	// Oss
	AuthorityList = "AuthorityList"

	// SchedulerCredit
	CurrentCounters = "CurrentCounters"

	// Session
	// Validators = "Validators"
	KeyOwner = "keyOwner"

	// Sminer
	AllMiner              = "AllMiner"
	CounterForMinerItems  = "CounterForMinerItems"
	MinerItems            = "MinerItems"
	RewardMap             = "RewardMap"
	Expenders             = "Expenders"
	RestoralTarget        = "RestoralTarget"
	StakingStartBlock     = "StakingStartBlock"
	CompleteSnapShot      = "CompleteSnapShot"
	CompleteMinerSnapShot = "CompleteMinerSnapShot"

	// Staking
	CounterForValidators = "CounterForValidators"
	CounterForNominators = "CounterForNominators"
	CurrentEra           = "CurrentEra"
	ErasTotalStake       = "ErasTotalStake"
	ErasStakers          = "ErasStakers"
	ErasStakersPaged     = "ErasStakersPaged"
	ErasStakersOverview  = "ErasStakersOverview"
	ErasRewardPoints     = "ErasRewardPoints"
	Ledger               = "Ledger"
	Nominators           = "Nominators"
	Bonded               = "Bonded"
	Validators           = "Validators"
	ErasValidatorReward  = "ErasValidatorReward"
	ValidatorCount       = "ValidatorCount"

	// StorageHandler
	UserOwnedSpace    = "UserOwnedSpace"
	UnitPrice         = "UnitPrice"
	TotalIdleSpace    = "TotalIdleSpace"
	TotalServiceSpace = "TotalServiceSpace"
	PurchasedSpace    = "PurchasedSpace"
	Territory         = "Territory"
	PayOrder          = "PayOrder"
	Consignment       = "Consignment"

	// System
	Account = "Account"
	Events  = "Events"

	// TeeWorker
	Workers       = "Workers"
	MasterPubkey  = "MasterPubkey"
	Endpoints     = "Endpoints"
	WorkerAddedAt = "WorkerAddedAt"
)

chain state

View Source
const (
	// Chain
	RPC_Chain_getBlock         = "chain_getBlock"
	RPC_Chain_getBlockHash     = "chain_getBlockHash"
	RPC_Chain_getFinalizedHead = "chain_getFinalizedHead"

	//Net
	RPC_NET_Listening = "net_listening"

	// System
	RPC_SYS_Properties = "system_properties"
	RPC_SYS_SyncState  = "system_syncState"
	RPC_SYS_Version    = "system_version"
	RPC_SYS_Chain      = "system_chain"
)

RPC Call

View Source
const (
	Active = iota
	Calculate
	Missing
	Recovery
)
View Source
const (
	MINER_STATE_POSITIVE = "positive"
	MINER_STATE_FROZEN   = "frozen"
	MINER_STATE_EXIT     = "exit"
	MINER_STATE_LOCK     = "lock"
	MINER_STATE_OFFLINE  = "offline"
)
View Source
const (
	TeeType_Full     uint8 = 0
	TeeType_Verifier uint8 = 1
	TeeType_Marker   uint8 = 2
)

0:Full 1:Verifier 2:Marker

View Source
const (
	ERR_Failed           = "failed"
	ERR_Timeout          = "timeout"
	ERR_Empty            = "empty"
	ERR_PriorityIsTooLow = "Priority is too low"
)
View Source
const (
	FileHashLen            = 64
	RandomLen              = 20
	PeerIdPublicKeyLen     = 38
	PoISKeyLen             = 256
	TeeSignatureLen        = 256
	AccumulatorLen         = 256
	SpaceChallengeParamLen = 8
	BloomFilterLen         = 256
	MaxSegmentNum          = 1000
	WorkerPublicKeyLen     = 32
	MasterPublicKeyLen     = 32
	EcdhPublicKeyLen       = 32
	TeeSigLen              = 64
	RrscAppPublicLen       = 32
	TerritoryKeyLen        = 32
)

BlockInterval is the time interval for generating blocks, in seconds

View Source
const BlockIntervalSec = 6
View Source
const CESSWalletLen = 49
View Source
const DOT = "."

DOT is "." character

View Source
const MinTransactionBalance = "1000000000000000000"

the minimum account balance required for transaction

View Source
const StakingStakePerTiB = 4000
View Source
const TokenPrecision_CESS = "000000000000000000"

Unit precision of CESS token

View Source
const TreasuryAccount = "cXhT9Xh3DhrBMDmXcGeMPDmTzDm1J8vDxBtKvogV33pPshnWS"

Variables

View Source
var (
	ERR_RPC_CONNECTION   = errors.New("rpc err: connection failed")
	ERR_RPC_IP_FORMAT    = errors.New("unsupported ip format")
	ERR_RPC_TIMEOUT      = errors.New("timeout")
	ERR_RPC_EMPTY_VALUE  = errors.New("empty")
	ERR_IdleProofIsEmpty = errors.New("idle data proof is empty")
)
View Source
var AudiAppPublicType = AppPublicType{'a', 'u', 'd', 'i'}
View Source
var ExtrinsicsName map[types.CallIndex]string
View Source
var GranAppPublicType = AppPublicType{'g', 'r', 'a', 'n'}
View Source
var ImonAppPublicType = AppPublicType{'i', 'm', 'o', 'n'}
View Source
var RrscAppPublicType = AppPublicType{'r', 'r', 's', 'c'}

Functions

func CreatePrefixedKey added in v0.6.0

func CreatePrefixedKey(pallet, method string) []byte

func ExplicitBigInt added in v0.5.1

func ExplicitBigInt(v reflect.Value, depth int) string

func H160ToSS58 added in v0.6.0

func H160ToSS58(origin string, chain_id uint16) (string, error)

H160ToSS58 convert Eth account to polkadot account

  • origin: eth account
  • chain_id: chain id, CESS chain id is 11330

Return:

  • string: polkadot account
  • error: error message

func IsWorkerPublicKeyAllZero added in v0.6.0

func IsWorkerPublicKeyAllZero(puk WorkerPublicKey) bool

func ParseAccountFromEvent added in v0.5.1

func ParseAccountFromEvent(e *parser.Event) (string, error)

func ParseChallResultFromEvent added in v0.5.1

func ParseChallResultFromEvent(e *parser.Event) (string, bool, error)

func ParseStakingEraPaidFromEvent added in v0.6.0

func ParseStakingEraPaidFromEvent(e *parser.Event) (uint32, string, string, error)

func ParseStakingPayoutStartedFromEvent added in v0.6.0

func ParseStakingPayoutStartedFromEvent(e *parser.Event) (uint32, string, error)

func ParseStakingRewardedFromEvent added in v0.6.0

func ParseStakingRewardedFromEvent(e *parser.Event) (string, string, error)

func ParseStringFromEvent added in v0.5.1

func ParseStringFromEvent(e *parser.Event) (string, error)

func ParseTransferInfoFromEvent added in v0.5.1

func ParseTransferInfoFromEvent(e *parser.Event) (string, string, string, error)

func RrscAppPublicToByte added in v0.6.0

func RrscAppPublicToByte(public RrscAppPublic) types.Bytes

Types

type AccessInfo added in v0.6.0

type AccessInfo struct {
	R types.H160
	C []types.H160
}

type Accumulator added in v0.6.0

type Accumulator [AccumulatorLen]types.U8

type ActualWeightType added in v0.6.0

type ActualWeightType struct {
	RefTime   types.U64
	ProofSize types.U64
}

type AllDeleteFileEvent added in v0.6.0

type AllDeleteFileEvent struct {
	Operator string
	Owner    string
	Filehash string
}

type AllUploadDeclarationEvent added in v0.6.0

type AllUploadDeclarationEvent struct {
	Operator string
	Owner    string
	Filehash string
}

type AppPublicType added in v0.6.0

type AppPublicType [4]types.U8

type BlockData added in v0.6.0

type BlockData struct {
	BlockHash           string
	PreHash             string
	ExtHash             string
	StHash              string
	AllGasFee           string
	Timestamp           int64
	BlockId             uint32
	IsNewEra            bool
	EraPaid             EraPaid
	SysEvents           []string
	NewAccounts         []string
	GenChallenge        []string
	StorageCompleted    []string
	MinerReg            []MinerRegInfo
	Extrinsics          []ExtrinsicsInfo
	TransferInfo        []TransferInfo
	UploadDecInfo       []UploadDecInfo
	DeleteFileInfo      []DeleteFileInfo
	CreateBucketInfo    []CreateBucketInfo
	DeleteBucketInfo    []DeleteBucketInfo
	SubmitIdleProve     []SubmitIdleProve
	SubmitServiceProve  []SubmitServiceProve
	SubmitIdleResult    []SubmitIdleResult
	SubmitServiceResult []SubmitServiceResult
	Punishment          []Punishment
	MinerRegPoiskeys    []MinerRegPoiskey
	GatewayReg          []GatewayReg
	StakingPayouts      []StakingPayout
	Unbonded            []Unbonded
	MintTerritory       []MintTerritory
}

type BloomFilter added in v0.6.0

type BloomFilter [BloomFilterLen]types.U64

func BytesToBloomFilter added in v0.6.0

func BytesToBloomFilter(val []byte) (BloomFilter, error)

type BucketInfo added in v0.6.0

type BucketInfo struct {
	FileList  []FileHash
	Authority []types.AccountID
}

Oss

type ChainClient added in v0.5.1

type ChainClient struct {
	// contains filtered or unexported fields
}

func NewChainClient added in v0.3.10

func NewChainClient(ctx context.Context, name string, rpcs []string, mnemonic string, t time.Duration) (*ChainClient, error)

NewChainClient creates a chainclient

  • ctx: context
  • name: customised name, can be empty
  • rpcs: rpc addresses
  • mnemonic: account mnemonic, can be empty
  • t: waiting time for transaction packing, default is 30 seconds

Return:

  • *ChainClient: chain client
  • error: error message

func NewChainClientUnconnectedRpc added in v0.6.0

func NewChainClientUnconnectedRpc(ctx context.Context, name string, rpcs []string, mnemonic string, t time.Duration) (*ChainClient, error)

NewChainClientUnconnectedRpc creates a chainclient unconnected rpc

  • ctx: context
  • name: customised name, can be empty
  • rpcs: rpc addresses
  • mnemonic: account mnemonic, can be empty
  • t: waiting time for transaction packing, default is 30 seconds

Return:

  • *ChainClient: chain client
  • error: error message

func (*ChainClient) Authorize added in v0.6.0

func (c *ChainClient) Authorize(accountID []byte) (string, error)

Authorize to authorise space usage to another account

  • accountID: authorised account

Return:

  • string: block hash
  • error: error message

Node:

  • accountID should be oss account

func (*ChainClient) BuyConsignment added in v0.6.0

func (c *ChainClient) BuyConsignment(token types.H256, territory_name string) (string, error)

BuyConsignment purchase territories for consignment

  • token: territory key
  • territory_name: renamed territory name

Return:

  • string: block hash
  • error: error message

func (*ChainClient) CalculateReport added in v0.6.0

func (c *ChainClient) CalculateReport(teeSig types.Bytes, tagSigInfo TagSigInfo) (string, error)

CalculateReport report file tag calculation completed

  • teeSig: tee sign
  • tagSigInfo: tag sig info

Return:

  • string: block hash
  • error: error message

Note:

  • for storage miner use only

func (*ChainClient) CancelAuthorize added in v0.6.0

func (c *ChainClient) CancelAuthorize(accountID []byte) (string, error)

CancelAuthorize cancels authorisation for an account

  • accountID: account with cancelled authorisations

Return:

  • string: block hash
  • error: error message

func (*ChainClient) CancelConsignment added in v0.6.0

func (c *ChainClient) CancelConsignment(territory_name string) (string, error)

CancelConsignment cancel consignment territory

  • territory_name: territory name

Return:

  • string: block hash
  • error: error message

func (*ChainClient) CancelPurchaseAction added in v0.6.0

func (c *ChainClient) CancelPurchaseAction(token types.H256) (string, error)

CancelPurchaseAction cancel purchase territories for consignment

  • token: territory key

Return:

  • string: block hash
  • error: error message

func (*ChainClient) CertIdleSpace added in v0.5.1

func (c *ChainClient) CertIdleSpace(spaceProofInfo SpaceProofInfo, teeSignWithAcc, teeSign types.Bytes, teePuk WorkerPublicKey) (string, error)

CertIdleSpace authenticates idle file to the chain

  • spaceProofInfo: space proof info
  • teeSignWithAcc: tee sign with account
  • teeSign: tee sign
  • teePuk: tee work public key

Return:

  • string: block hash
  • error: error message

Note:

  • for storage miner use only

func (*ChainClient) ChainGetBlock added in v0.6.0

func (c *ChainClient) ChainGetBlock(hash types.Hash) (types.SignedBlock, error)

ChainGetBlock get SignedBlock info by block hash

Return:

  • types.SignedBlock: SignedBlock info
  • error: error message

func (*ChainClient) ChainGetBlockHash added in v0.6.0

func (c *ChainClient) ChainGetBlockHash(block uint32) (types.Hash, error)

ChainGetBlockHash get block hash by block number

Return:

  • types.Hash: block hash
  • error: error message

func (*ChainClient) ChainGetFinalizedHead added in v0.6.0

func (c *ChainClient) ChainGetFinalizedHead() (types.Hash, error)

ChainGetFinalizedHead get finalized block hash

Return:

  • types.Hash: block hash
  • error: error message

func (*ChainClient) ClaimRestoralNoExistOrder added in v0.5.1

func (c *ChainClient) ClaimRestoralNoExistOrder(puk []byte, fid, fragmentHash string) (string, error)

ClaimRestoralNoExistOrder claim the restoral order of an exited storage miner

  • puk: storage miner account
  • fid: file identification
  • fragmentHash: fragment hash

Return:

  • string: block hash
  • error: error message

Note:

  • for storage miner use only

func (*ChainClient) ClaimRestoralOrder added in v0.5.1

func (c *ChainClient) ClaimRestoralOrder(fragmentHash string) (string, error)

ClaimRestoralOrder claim a restoral order

  • fragmentHash: fragment hash

Return:

  • string: block hash
  • error: error message

Note:

  • for storage miner use only

func (*ChainClient) Close added in v0.5.1

func (c *ChainClient) Close()

close chain client

func (*ChainClient) CreateBucket added in v0.5.1

func (c *ChainClient) CreateBucket(owner []byte, bucketName string) (string, error)

CreateBucket create a bucket for owner

  • owner: bucket owner account
  • bucketName: bucket name

Return:

  • string: block hash
  • error: error message

Note:

  • cannot create a bucket that already exists
  • if you are not the owner, the owner account must be authorised to you

func (*ChainClient) DeleteBucket added in v0.5.1

func (c *ChainClient) DeleteBucket(owner []byte, bucketName string) (string, error)

DeleteBucket delete a bucket for owner

  • owner: bucket owner account
  • bucketName: bucket name

Return:

  • string: block hash
  • error: error message

Note:

  • if you are not the owner, the owner account must be authorised to you

func (*ChainClient) DeleteFile added in v0.5.1

func (c *ChainClient) DeleteFile(owner []byte, fid string) (string, error)

DeleteFile delete a bucket for owner

  • owner: file owner account
  • fid: file identification

Return:

  • string: block hash
  • error: error message

Note:

  • if you are not the owner, the owner account must be authorised to you

func (*ChainClient) DestroyOss added in v0.6.0

func (c *ChainClient) DestroyOss() (string, error)

DestroyOss destroys the oss role of the current account

Return:

  • string: block hash
  • error: error message

func (*ChainClient) ExpandingTerritory added in v0.6.0

func (c *ChainClient) ExpandingTerritory(territory_name string, gib_count uint32) (string, error)

ExpandingTerritory expanding the territory size

  • territory_name: territory name
  • gib_count: size to be expanded

Return:

  • string: block hash
  • error: error message

func (*ChainClient) GenerateRestoralOrder added in v0.5.1

func (c *ChainClient) GenerateRestoralOrder(fid, fragmentHash string) (string, error)

GenerateRestoralOrder generate restoral orders for file fragment

  • fid: file identification
  • fragmentHash: fragment hash

Return:

  • string: block hash
  • error: error message

Note:

  • for storage miner use only

func (*ChainClient) GetBalances added in v0.6.0

func (c *ChainClient) GetBalances() uint64

GetBalances get current account balance, the unit is CESS

func (*ChainClient) GetCurrentRpcAddr added in v0.5.1

func (c *ChainClient) GetCurrentRpcAddr() string

GetCurrentRpcAddr get the current rpc address being used

func (*ChainClient) GetMetadata added in v0.5.1

func (c *ChainClient) GetMetadata() *types.Metadata

GetMetadata get chain metadata

func (*ChainClient) GetNetworkEnv added in v0.5.1

func (c *ChainClient) GetNetworkEnv() string

GetNetworkEnv get network env

func (*ChainClient) GetRpcState added in v0.6.0

func (c *ChainClient) GetRpcState() bool

GetRpcState get the rpc connection status flag

  • true: connection is normal
  • false: connection failed

func (*ChainClient) GetSDKName added in v0.5.1

func (c *ChainClient) GetSDKName() string

GetSDKName get sdk name

func (*ChainClient) GetSignatureAcc added in v0.5.1

func (c *ChainClient) GetSignatureAcc() string

GetSignatureAcc get your current account address

Note:

  • make sure you fill in mnemonic when you create the sdk client

func (*ChainClient) GetSignatureAccPulickey added in v0.5.1

func (c *ChainClient) GetSignatureAccPulickey() []byte

GetSignatureAccPulickey get your current account public key

Note:

  • make sure you fill in mnemonic when you create the sdk client

func (*ChainClient) GetSubstrateAPI added in v0.5.1

func (c *ChainClient) GetSubstrateAPI() *gsrpc.SubstrateAPI

GetSubstrateAPI get substrate api

func (*ChainClient) GetTokenSymbol added in v0.5.1

func (c *ChainClient) GetTokenSymbol() string

GetTokenSymbol get token symbol

func (*ChainClient) GetURI added in v0.5.1

func (c *ChainClient) GetURI() string

GetURI get the mnemonic for your current account

func (*ChainClient) IncreaseCollateral added in v0.6.0

func (c *ChainClient) IncreaseCollateral(accountID []byte, token string) (string, error)

IncreaseCollateral increases the number of staking for storage miner

  • accountID: storage miner account
  • token: number of staking

Return:

  • string: block hash
  • error: error message

Note:

  • The number of staking to be added is calculated in the smallest unit, if you want to add 1CESS staking, you need to fill in "1000000000000000000"

func (*ChainClient) IncreaseDeclarationSpace added in v0.5.1

func (c *ChainClient) IncreaseDeclarationSpace(tibCount uint32) (string, error)

IncreaseDeclarationSpace increases the size of space declared on the chain

  • tibCount: the size of the declaration space increased, in TiB

Return:

  • string: block hash
  • error: error message

Note:

  • the size of the declared space cannot be reduced
  • when the staking does not meet the declared space size, you will be frozen

func (*ChainClient) InitExtrinsicsName added in v0.5.1

func (c *ChainClient) InitExtrinsicsName() error

InitExtrinsicsName initialises all transaction names

Return:

  • error: error message

Note:

  • If you need to parse all transaction events, you need to call this function.

func (*ChainClient) InitExtrinsicsNameForMiner added in v0.6.2

func (c *ChainClient) InitExtrinsicsNameForMiner() error

InitExtrinsicsNameForMiner initialises all transaction required by the storage miner

Return:

  • error: error message

Note:

  • The storage miner program needs to call this function, otherwise the transaction event cannot be parsed.

func (*ChainClient) InitExtrinsicsNameForOSS added in v0.6.2

func (c *ChainClient) InitExtrinsicsNameForOSS() error

InitExtrinsicsNameForOSS initialises all transaction required by the deoss

Return:

  • error: error message

Note:

  • The deoss program needs to call this function, otherwise the transaction event cannot be parsed.

func (*ChainClient) MinerExitPrep added in v0.6.0

func (c *ChainClient) MinerExitPrep() (string, error)

MinerExitPrep pre-exit storage miner

Return:

  • string: block hash
  • error: error message

Note:

  • after pre-exit, you need to wait for one day before it will automatically exit
  • cannot register as a storage miner again after pre-exit

func (*ChainClient) MinerWithdraw added in v0.6.0

func (c *ChainClient) MinerWithdraw() (string, error)

MinerWithdraw withdraws all staking

Return:

  • string: block hash
  • error: error message

Note:

  • must be an exited miner to withdraw
  • wait a day to withdraw after pre-exit

func (*ChainClient) MintTerritory added in v0.6.0

func (c *ChainClient) MintTerritory(gib_count uint32, territory_name string, days uint32) (string, error)

MintTerritory purchase a territory

  • gib_count: territory size
  • territory_name: territory name
  • days: the validity period of the territory, in days

Return:

  • string: block hash
  • error: error message

func (*ChainClient) NetListening added in v0.5.1

func (c *ChainClient) NetListening() (bool, error)

NetListening query net listenning

Return:

  • bool: net listenning
  • error: error message

func (*ChainClient) ParseBlockData added in v0.5.1

func (c *ChainClient) ParseBlockData(blocknumber uint64) (BlockData, error)

func (*ChainClient) PlaceStorageOrder added in v0.6.0

func (c *ChainClient) PlaceStorageOrder(fid, file_name, bucket_name, territory_name string, segment []SegmentDataInfo, owner []byte, file_size uint64) (string, error)

PlaceStorageOrder place an order for storage file

  • fid: file identification
  • file_name: file name
  • bucket_name: bucket name
  • territory_name: territory name
  • segment: segment info
  • owner: account of the file owner
  • filesize: file size

Return:

  • string: block hash
  • error: error message

func (*ChainClient) QueryAccountInfo added in v0.5.1

func (c *ChainClient) QueryAccountInfo(account string, block int32) (types.AccountInfo, error)

QueryAccountInfo query account info

  • account: account
  • block: block number, less than 0 indicates the latest block

Return:

  • types.AccountInfo: account info
  • error: error message

func (*ChainClient) QueryAccountInfoByAccountID added in v0.6.0

func (c *ChainClient) QueryAccountInfoByAccountID(accountID []byte, block int32) (types.AccountInfo, error)

QueryAccountInfoByAccountID query account info

  • accountID: account id
  • block: block number, less than 0 indicates the latest block

Return:

  • types.AccountInfo: account info
  • error: error message

func (*ChainClient) QueryAllAccountInfo added in v0.6.0

func (c *ChainClient) QueryAllAccountInfo(block int32) ([]types.AccountInfo, error)

QueryAllAccountInfo query all account info

  • block: block number, less than 0 indicates the latest block

Return:

  • []types.AccountInfo: all account info
  • error: error message

func (*ChainClient) QueryAllBonded added in v0.6.0

func (c *ChainClient) QueryAllBonded(block int32) ([]types.AccountID, error)

QueryAllBonded query all consensus and nominators accounts

  • block: block number, less than 0 indicates the latest block

Return:

  • []types.AccountID: all consensus and nominators accounts
  • error: error message

func (*ChainClient) QueryAllBucketName added in v0.6.0

func (c *ChainClient) QueryAllBucketName(accountID []byte, block int32) ([]string, error)

QueryAllBucketName query user's all bucket names

  • accountID: user account
  • block: block number, less than 0 indicates the latest block

Return:

  • []string: all bucket names
  • error: error message

func (*ChainClient) QueryAllMiner added in v0.6.0

func (c *ChainClient) QueryAllMiner(block int32) ([]types.AccountID, error)

QueryAllMiner query all storage miner accounts

  • accountID: storage miner account
  • block: block number, less than 0 indicates the latest block

Return:

  • []types.AccountID: all storage miner accounts
  • error: error message

func (*ChainClient) QueryAllNominators added in v0.6.0

func (c *ChainClient) QueryAllNominators(block int32) ([]StakingNominations, error)

QueryAllNominators query all nominators info

  • block: block number, less than 0 indicates the latest block

Return:

  • []StakingNominations: all nominators info
  • error: error message

func (*ChainClient) QueryAllOss added in v0.6.0

func (c *ChainClient) QueryAllOss(block int32) ([]OssInfo, error)

QueryAllOss query all oss info

  • block: block number, less than 0 indicates the latest block

Return:

  • []OssInfo: all oss info
  • error: error message

func (*ChainClient) QueryAllOssPeerId added in v0.6.0

func (c *ChainClient) QueryAllOssPeerId(block int32) ([]string, error)

QueryAllOssPeerId query all oss's peer id

  • block: block number, less than 0 indicates the latest block

Return:

  • []string: all oss's peer id
  • error: error message

func (*ChainClient) QueryAllRestoralOrder added in v0.6.0

func (c *ChainClient) QueryAllRestoralOrder(block int32) ([]RestoralOrderInfo, error)

QueryAllRestoralOrder query all file restoral order

  • block: block number, less than 0 indicates the latest block

Return:

  • []RestoralOrderInfo: all restoral order info
  • error: error message

func (*ChainClient) QueryAllRestoralTarget added in v0.6.0

func (c *ChainClient) QueryAllRestoralTarget(block int32) ([]RestoralTargetInfo, error)

QueryAllRestoralTarget query the data recovery information of all exited storage miner

  • block: block number, less than 0 indicates the latest block

Return:

  • []RestoralTargetInfo: all the data recovery information
  • error: error message

func (*ChainClient) QueryAllWorkers added in v0.6.0

func (c *ChainClient) QueryAllWorkers(block int32) ([]WorkerInfo, error)

QueryAllWorkers query all tee work info

  • block: block number, less than 0 indicates the latest block

Return:

  • []WorkerInfo: all tee worker info
  • error: error message

func (*ChainClient) QueryAuthorities added in v0.6.0

func (c *ChainClient) QueryAuthorities(block int32) ([]ConsensusRrscAppPublic, error)

QueryAuthorities query consensus rrsc public

  • block: block number, less than 0 indicates the latest block

Return:

  • []ConsensusRrscAppPublic: all consensus rrsc public
  • error: error message

func (*ChainClient) QueryAuthorityList added in v0.6.0

func (c *ChainClient) QueryAuthorityList(accountID []byte, block int32) ([]types.AccountID, error)

QueryAuthorityList query authorised all accounts

  • accountID: account to be queried
  • block: block number, less than 0 indicates the latest block

Return:

  • []types.AccountID: authorised all accounts
  • error: error message

func (*ChainClient) QueryBlockNumber added in v0.6.0

func (c *ChainClient) QueryBlockNumber(blockhash string) (uint32, error)

QueryBlockNumber query the block number based on the block hash

  • blockhash: hex-encoded block hash, if empty query the latest block number

Return:

  • uint32: block number
  • error: error message

func (*ChainClient) QueryBucket added in v0.6.0

func (c *ChainClient) QueryBucket(accountID []byte, bucketName string, block int32) (BucketInfo, error)

QueryBucket query user's bucket information

  • accountID: user account
  • bucketName: bucket name
  • block: block number, less than 0 indicates the latest block

Return:

  • BucketInfo: bucket info
  • error: error message

func (*ChainClient) QueryChallengeSnapShot added in v0.6.0

func (c *ChainClient) QueryChallengeSnapShot(accountID []byte, block int32) (bool, ChallengeInfo, error)

QueryChallengeSnapShot query challenge snapshot data

  • accountID: signature account of the storage miner
  • block: block number, less than 0 indicates the latest block

Return:

  • bool: is there a value
  • ChallengeInfo: challenge snapshot data
  • error: error message

func (*ChainClient) QueryCompleteMinerSnapShot added in v0.6.0

func (c *ChainClient) QueryCompleteMinerSnapShot(puk []byte, block int32) (MinerCompleteInfo, error)

QueryCompleteMinerSnapShot query CompleteMinerSnapShot

  • puk: account id
  • block: block number, less than 0 indicates the latest block

Return:

  • MinerCompleteInfo: CompleteMinerSnapShot
  • error: error message

func (*ChainClient) QueryCompleteSnapShot added in v0.6.0

func (c *ChainClient) QueryCompleteSnapShot(era uint32, block int32) (uint32, uint64, error)

QueryCompleteSnapShot query the number of storage miners and storage miner power in each era

  • era: era id
  • block: block number, less than 0 indicates the latest block

Return:

  • uint32: the number of storage miners in current era
  • uint64: all storage miners power in current era
  • error: error message

func (*ChainClient) QueryConsignment added in v0.6.0

func (c *ChainClient) QueryConsignment(token types.H256, block int32) (ConsignmentInfo, error)

QueryConsignment query consignment info

  • token: territory key
  • block: block number, less than 0 indicates the latest block

Return:

  • ConsignmentInfo: consignment info
  • error: error message

func (*ChainClient) QueryCountedClear added in v0.6.0

func (c *ChainClient) QueryCountedClear(accountID []byte, block int32) (uint8, error)

QueryCounterdClear query the number of times to clear the challenge failure count

  • accountID: signature account of the storage miner
  • block: block number, less than 0 indicates the latest block

Return:

  • uint8: cleanup count
  • error: error message

func (*ChainClient) QueryCountedServiceFailed added in v0.6.0

func (c *ChainClient) QueryCountedServiceFailed(accountID []byte, block int32) (uint32, error)

QueryCountedServiceFailed query the number of failed service data challenge

  • accountID: signature account of the storage miner
  • block: block number, less than 0 indicates the latest block

Return:

  • uint32: Is there a value
  • error: error message

func (*ChainClient) QueryCounterForMinerItems added in v0.6.0

func (c *ChainClient) QueryCounterForMinerItems(block int32) (uint32, error)

QueryCounterForMinerItems query all storage miner count

  • block: block number, less than 0 indicates the latest block

Return:

  • uint32: all storage miner count
  • error: error message

func (*ChainClient) QueryCounterForValidators added in v0.6.0

func (c *ChainClient) QueryCounterForValidators(block int32) (uint32, error)

QueryCounterForValidators query validator number (waiting nodes included)

  • block: block number, less than 0 indicates the latest block

Return:

  • uint32: validator number
  • error: error message

func (*ChainClient) QueryCurrencyReward added in v0.6.0

func (c *ChainClient) QueryCurrencyReward(block int32) (string, error)

QueryCurrencyReward query the currency rewards

  • block: block number, less than 0 indicates the latest block

Return:

  • string: currency rewards
  • error: error message

func (*ChainClient) QueryCurrentCounters added in v0.6.0

func (c *ChainClient) QueryCurrentCounters(accountId []byte, block int32) (SchedulerCounterEntry, error)

QueryCurrentCounters query the validator's credit score

  • accountId: validator's account id
  • block: block number, less than 0 indicates the latest block

Return:

  • SchedulerCounterEntry: validator's credit score
  • error: error message

func (*ChainClient) QueryCurrentEra added in v0.5.1

func (c *ChainClient) QueryCurrentEra(block int32) (uint32, error)

QueryCurrentEra query the current era id

  • block: block number, less than 0 indicates the latest block

Return:

  • uint32: era id
  • error: error message

func (*ChainClient) QueryDealMap added in v0.6.0

func (c *ChainClient) QueryDealMap(fid string, block int32) (StorageOrder, error)

QueryDealMap query file storage order

  • fid: file identification
  • block: block number, less than 0 indicates the latest block

Return:

  • StorageOrder: file storage order
  • error: error message

func (*ChainClient) QueryDealMapList added in v0.6.2

func (c *ChainClient) QueryDealMapList(block int32) ([]StorageOrder, error)

QueryDealMapList query file storage order list

  • block: block number, less than 0 indicates the latest block

Return:

  • []StorageOrder: file storage order list
  • error: error message

func (*ChainClient) QueryEndpoints added in v0.6.0

func (c *ChainClient) QueryEndpoints(puk WorkerPublicKey, block int32) (string, error)

QueryEndpoints query tee's endpoint

  • puk: tee's work public key
  • block: block number, less than 0 indicates the latest block

Return:

  • string: tee's endpoint
  • error: error message

func (*ChainClient) QueryEraReward added in v0.6.0

func (c *ChainClient) QueryEraReward(block int32) (string, error)

QueryEraReward query the rewards in era

  • block: block number, less than 0 indicates the latest block

Return:

  • string: rewards in era
  • error: error message

func (*ChainClient) QueryEraValidatorReward added in v0.5.1

func (c *ChainClient) QueryEraValidatorReward(era uint32, block int32) (string, error)

QueryEraValidatorReward query the total rewards for each era

  • era: era id
  • block: block number, less than 0 indicates the latest block

Return:

  • string: total rewards
  • error: error message

func (*ChainClient) QueryErasRewardPoints added in v0.6.0

func (c *ChainClient) QueryErasRewardPoints(era uint32, block int32) (StakingEraRewardPoints, error)

QueryErasRewardPoints query the rewards of consensus nodes in each era

  • era: era id
  • block: block number, less than 0 indicates the latest block

Return:

  • StakingEraRewardPoints: the rewards of consensus nodes
  • error: error message

func (*ChainClient) QueryErasTotalStake added in v0.5.1

func (c *ChainClient) QueryErasTotalStake(era uint32, block int32) (string, error)

QueryErasTotalStake query the total number of staking for each era

  • era: era id
  • block: block number, less than 0 indicates the latest block

Return:

  • string: the total number of staking
  • error: error message

func (*ChainClient) QueryExpenders added in v0.5.1

func (c *ChainClient) QueryExpenders(block int32) (ExpendersInfo, error)

QueryExpenders query expenders (idle data specification)

  • block: block number, less than 0 indicates the latest block

Return:

  • ExpendersInfo: idle data specification
  • error: error message

func (*ChainClient) QueryFile added in v0.6.0

func (c *ChainClient) QueryFile(fid string, block int32) (FileMetadata, error)

QueryFile query file metadata

  • fid: file identification
  • block: block number, less than 0 indicates the latest block

Return:

  • FileMetadata: file metadata
  • error: error message

func (*ChainClient) QueryInactiveIssuance added in v0.6.0

func (c *ChainClient) QueryInactiveIssuance(block int32) (string, error)

QueryInactiveIssuance query the amount of inactive token issuance

  • block: block number, less than 0 indicates the latest block

Return:

  • string: the amount of inactive token issuance
  • error: error message

func (*ChainClient) QueryLedger added in v0.6.0

func (c *ChainClient) QueryLedger(accountID []byte, block int32) (StakingLedger, error)

QueryLedger query the staking ledger

  • accountID: account id
  • block: block number, less than 0 indicates the latest block

Return:

  • StakingLedger: staking ledger
  • error: error message

func (*ChainClient) QueryMasterPubKey added in v0.6.0

func (c *ChainClient) QueryMasterPubKey(block int32) ([]byte, error)

QueryMasterPubKey query master public key

  • block: block number, less than 0 indicates the latest block

Return:

  • []byte: master public key
  • error: error message

func (*ChainClient) QueryMinerItems added in v0.6.0

func (c *ChainClient) QueryMinerItems(accountID []byte, block int32) (MinerInfo, error)

QueryMinerItems query storage miner info

  • accountID: storage miner account
  • block: block number, less than 0 indicates the latest block

Return:

  • MinerInfo: storage miner info
  • error: error message

func (*ChainClient) QueryNominatorCount added in v0.5.1

func (c *ChainClient) QueryNominatorCount(block int32) (uint32, error)

QueryNominatorCount query nominator number

  • block: block number, less than 0 indicates the latest block

Return:

  • uint32: nominator number
  • error: error message

func (*ChainClient) QueryOss added in v0.6.0

func (c *ChainClient) QueryOss(accountID []byte, block int32) (OssInfo, error)

QueryOss query oss info

  • accountID: oss's account
  • block: block number, less than 0 indicates the latest block

Return:

  • OssInfo: oss info
  • error: error message

func (*ChainClient) QueryPendingReplacements added in v0.5.1

func (c *ChainClient) QueryPendingReplacements(accountID []byte, block int32) (types.U128, error)

QueryPendingReplacements query the size of the storage miner's replaceable idle data

  • accountID: storage miner account
  • block: block number, less than 0 indicates the latest block

Return:

  • types.U128: the size of replaceable idle data
  • error: error message

func (*ChainClient) QueryPurchasedSpace added in v0.5.1

func (c *ChainClient) QueryPurchasedSpace(block int32) (uint64, error)

QueryPurchasedSpace query all purchased space size

  • block: block number, less than 0 indicates the latest block

Return:

  • uint64: all purchased space size
  • error: error message

func (*ChainClient) QueryReserveReward added in v0.6.0

func (c *ChainClient) QueryReserveReward(block int32) (string, error)

QueryReserveReward query the reserve rewards

  • block: block number, less than 0 indicates the latest block

Return:

  • string: reserve rewards
  • error: error message

func (*ChainClient) QueryRestoralOrder added in v0.5.1

func (c *ChainClient) QueryRestoralOrder(fragmentHash string, block int32) (RestoralOrderInfo, error)

QueryRestoralOrder query file restoral order

  • fragmentHash: fragment hash
  • block: block number, less than 0 indicates the latest block

Return:

  • RestoralOrderInfo: restoral order info
  • error: error message

func (*ChainClient) QueryRestoralTarget added in v0.5.1

func (c *ChainClient) QueryRestoralTarget(accountID []byte, block int32) (RestoralTargetInfo, error)

QueryRestoralTarget query the data recovery information of exited storage miner

  • accountID: storage miner account
  • block: block number, less than 0 indicates the latest block

Return:

  • RestoralTargetInfo: the data recovery information
  • error: error message

func (*ChainClient) QueryRewardMap added in v0.6.0

func (c *ChainClient) QueryRewardMap(accountID []byte, block int32) (MinerReward, error)

QueryRewardMap query all reward information for storage miner

  • block: block number, less than 0 indicates the latest block

Return:

  • MinerReward: all reward information
  • error: error message

func (*ChainClient) QueryRoundReward added in v0.6.0

func (c *ChainClient) QueryRoundReward(era uint32, block int32) (string, error)

QueryRoundReward querie the rewards in each era

  • era: era id
  • block: block number, less than 0 indicates the latest block

Return:

  • string: rewards in an era
  • error: error message

func (*ChainClient) QueryStakingStartBlock added in v0.6.0

func (c *ChainClient) QueryStakingStartBlock(accountID []byte, block int32) (uint32, error)

QueryStakingStartBlock query storage miner's starting staking block

  • accountID: storage miner account
  • block: block number, less than 0 indicates the latest block

Return:

  • uint32: starting staking block
  • error: error message

func (*ChainClient) QueryTerritory added in v0.6.0

func (c *ChainClient) QueryTerritory(accountId []byte, name string, block int32) (TerritoryInfo, error)

QueryTerritory query territory info

  • accountId: account id
  • name: territory name
  • block: block number, less than 0 indicates the latest block

Return:

  • TerritoryInfo: territory info
  • error: error message

func (*ChainClient) QueryTotalIdleSpace added in v0.5.1

func (c *ChainClient) QueryTotalIdleSpace(block int32) (uint64, error)

QueryTotalIdleSpace query the size of all idle space

  • block: block number, less than 0 indicates the latest block

Return:

  • uint64: the size of all idle space
  • error: error message

func (*ChainClient) QueryTotalIssuance added in v0.5.1

func (c *ChainClient) QueryTotalIssuance(block int32) (string, error)

QueryTotalIssuance query the total amount of token issuance

  • block: block number, less than 0 indicates the latest block

Return:

  • string: the total amount of token issuance
  • error: error message

func (*ChainClient) QueryTotalServiceSpace added in v0.5.1

func (c *ChainClient) QueryTotalServiceSpace(block int32) (uint64, error)

QueryTotalServiceSpace query the size of all service space

  • block: block number, less than 0 indicates the latest block

Return:

  • uint64: the size of all service space
  • error: error message

func (*ChainClient) QueryUnitPrice added in v0.6.0

func (c *ChainClient) QueryUnitPrice(block int32) (string, error)

QueryUnitPrice query price per GiB space

  • block: block number, less than 0 indicates the latest block

Return:

  • string: price per GiB space
  • error: error message

func (*ChainClient) QueryUserFidList added in v0.6.0

func (c *ChainClient) QueryUserFidList(accountID []byte, block int32) ([]string, error)

QueryUserFidList query user's all fid

  • accountID: user account
  • block: block number, less than 0 indicates the latest block

Return:

  • []string: all fid
  • error: error message

func (*ChainClient) QueryUserHoldFileList added in v0.6.0

func (c *ChainClient) QueryUserHoldFileList(accountID []byte, block int32) ([]UserFileSliceInfo, error)

QueryUserHoldFileList query user's all files

  • accountID: user account
  • block: block number, less than 0 indicates the latest block

Return:

  • []UserFileSliceInfo: file list
  • error: error message

func (*ChainClient) QueryValidatorCommission added in v0.5.1

func (c *ChainClient) QueryValidatorCommission(accountID []byte, block int32) (uint8, error)

QueryValidatorCommission query validator commission

  • accountID: validator account
  • block: block number, less than 0 indicates the latest block

Return:

  • uint8: validator commission
  • error: error message

func (*ChainClient) QueryValidators added in v0.6.0

func (c *ChainClient) QueryValidators(block int32) ([]types.AccountID, error)

QueryValidators query validators account (waiting nodes not included)

  • block: block number, less than 0 indicates the latest block

Return:

  • []types.AccountID: validators account
  • error: error message

func (*ChainClient) QueryValidatorsCount added in v0.5.1

func (c *ChainClient) QueryValidatorsCount(block int32) (uint32, error)

QueryValidatorsCount query validator number (waiting nodes not included)

  • block: block number, less than 0 indicates the latest block

Return:

  • uint32: validator number
  • error: error message

func (*ChainClient) QueryWorkerAddedAt added in v0.5.1

func (c *ChainClient) QueryWorkerAddedAt(puk WorkerPublicKey, block int32) (uint32, error)

QueryWorkerAddedAt query tee work registered block

  • puk: tee's work public key
  • block: block number, less than 0 indicates the latest block

Return:

  • uint32: tee work registered block
  • error: error message

func (*ChainClient) QueryWorkers added in v0.6.0

func (c *ChainClient) QueryWorkers(puk WorkerPublicKey, block int32) (WorkerInfo, error)

QueryWorkers query tee work info

  • puk: tee's work public key
  • block: block number, less than 0 indicates the latest block

Return:

  • WorkerInfo: tee worker info
  • error: error message

func (*ChainClient) QueryeAllErasStakersPaged added in v0.6.0

func (c *ChainClient) QueryeAllErasStakersPaged(era uint32, accountId []byte) ([]StakingExposurePaged, error)

QueryeAllErasStakersPaged query all the staking exposure

  • era: era id
  • accountId: account id

Return:

  • []QueryeErasStakersPaged: all staking exposure
  • error: error message

func (*ChainClient) QueryeErasStakers added in v0.6.0

func (c *ChainClient) QueryeErasStakers(era uint32, accountId []byte) (StakingExposure, error)

QueryeErasStakers query the staking exposure

  • era: era id
  • accountId: account id

Return:

  • StakingExposure: staking exposure
  • error: error message

func (*ChainClient) QueryeErasStakersOverview added in v0.6.0

func (c *ChainClient) QueryeErasStakersOverview(era uint32, accountId []byte) (PagedExposureMetadata, error)

QueryeErasStakersOverview query the PagedExposureMetadata

  • era: era id
  • accountId: account id

Return:

  • PagedExposureMetadata: PagedExposureMetadata
  • error: error message

func (*ChainClient) QueryeNominators added in v0.6.0

func (c *ChainClient) QueryeNominators(accountId []byte, block int32) (StakingNominations, error)

QueryeNominators query the nominator info

  • accountId: account id
  • block: block number, less than 0 indicates the latest block

Return:

  • StakingNominations: nominator info
  • error: error message

func (*ChainClient) ReactivateTerritory added in v0.6.0

func (c *ChainClient) ReactivateTerritory(territory_name string, days_count uint32) (string, error)

ReactivateTerritory reactivate expired territories

  • territory_name: territory name
  • days_count: number of days activated

Return:

  • string: block hash
  • error: error message

func (*ChainClient) ReceiveReward added in v0.6.0

func (c *ChainClient) ReceiveReward() (string, string, error)

ReceiveReward to receive rewards

Return:

  • string: block hash
  • string: earnings account for receiving payments
  • error: error message

Note:

  • for storage miner only
  • pass at least one idle and service challenge at the same time to get the reward

func (*ChainClient) ReconnectRpc added in v0.6.0

func (c *ChainClient) ReconnectRpc() error

ReconnectRpc reconnect rpc

func (*ChainClient) RegisterOss added in v0.6.0

func (c *ChainClient) RegisterOss(peerId []byte, domain string) (string, error)

RegisterOss registered as oss role

  • peerId: peer id
  • domain: domain name, can be empty

Return:

  • string: block hash
  • error: error message

func (*ChainClient) RegisterPoisKey added in v0.6.0

func (c *ChainClient) RegisterPoisKey(poisKey PoISKeyInfo, teeSignWithAcc, teeSign types.Bytes, teePuk WorkerPublicKey) (string, error)

RegisterPoisKey register pois key, storage miner registration requires two stages, this is the second one.

  • poisKey: pois key
  • teeSignWithAcc: tee's sign with account
  • teeSign: tee's sign
  • teePuk: tee's work public key

Return:

  • string: block hash
  • error: error message

Note:

  • storage miners must complete the first stage to register for the second stage

func (*ChainClient) RegnstkAssignStaking added in v0.6.0

func (c *ChainClient) RegnstkAssignStaking(earnings string, peerId []byte, stakingAcc string, tibCount uint32) (string, error)

RegnstkAssignStaking is registered as a storage miner, unlike RegnstkSminer, needs to be actively staking by the staking account, which is the first stage of storage miner registration.

  • earnings: earnings account
  • peerId: peer id
  • stakingAcc: staking account
  • tibCount: the size of declaration space, in TiB

Return:

  • string: block hash
  • error: error message

func (*ChainClient) RegnstkSminer added in v0.6.0

func (c *ChainClient) RegnstkSminer(earnings string, peerId []byte, staking uint64, tibCount uint32) (string, error)

RegnstkSminer registers as a storage miner, which is the first stage of storage miner registration.

  • earnings: earnings account
  • peerId: peer id
  • staking: number of staking, the unit is CESS
  • tibCount: the size of declaration space, in TiB

Return:

  • string: block hash
  • error: error message

func (*ChainClient) RenewalTerritory added in v0.6.0

func (c *ChainClient) RenewalTerritory(territory_name string, days_count uint32) (string, error)

RenewalTerritory renewal of territory validity period

  • territory_name: territory name
  • days_count: renewal days

Return:

  • string: block hash
  • error: error message

func (*ChainClient) ReplaceIdleSpace added in v0.5.1

func (c *ChainClient) ReplaceIdleSpace(spaceProofInfo SpaceProofInfo, teeSignWithAcc, teeSign types.Bytes, teePuk WorkerPublicKey) (string, error)

ReplaceIdleSpace replaces idle files with service files

  • spaceProofInfo: space proof info
  • teeSignWithAcc: tee sign with account
  • teeSign: tee sign
  • teePuk: tee work public key

Return:

  • string: block hash
  • error: error message

Note:

  • for storage miner use only

func (*ChainClient) RestoralOrderComplete added in v0.6.0

func (c *ChainClient) RestoralOrderComplete(fragmentHash string) (string, error)

RestoralOrderComplete submits the restored completed order

  • fragmentHash: fragment hash

Return:

  • string: block hash
  • error: error message

Note:

  • for storage miner use only

func (*ChainClient) RetrieveAllEventName added in v0.6.0

func (c *ChainClient) RetrieveAllEventName(blockhash types.Hash) ([]string, error)

func (*ChainClient) RetrieveEvent added in v0.6.0

func (c *ChainClient) RetrieveEvent(blockhash types.Hash, extrinsic_name, event_name, signer string) error

func (*ChainClient) RetrieveEvent_Sminer_Receive added in v0.5.1

func (c *ChainClient) RetrieveEvent_Sminer_Receive(blockhash types.Hash) (Event_Receive, error)

func (*ChainClient) RetrieveExtrinsicsAndEvents added in v0.6.0

func (c *ChainClient) RetrieveExtrinsicsAndEvents(blockhash types.Hash) ([]string, map[string][]string, error)

func (*ChainClient) SendEvmCall added in v0.6.0

func (c *ChainClient) SendEvmCall(source types.H160, target types.H160, input types.Bytes, value types.U256, gasLimit types.U64, maxFeePerGas types.U256, accessList []AccessInfo) (string, error)

func (*ChainClient) SetBalances added in v0.6.0

func (c *ChainClient) SetBalances(balance uint64)

SetBalances update current account balance, the unit is CESS

func (*ChainClient) SetRpcState added in v0.6.0

func (c *ChainClient) SetRpcState(state bool)

SetChainState set the rpc connection status flag, when the rpc connection is normal, set it to true, otherwise set it to false.

func (*ChainClient) Sign added in v0.5.1

func (c *ChainClient) Sign(msg []byte) ([]byte, error)

Sign with the mnemonic of your current account

func (*ChainClient) SubmitIdleProof added in v0.5.1

func (c *ChainClient) SubmitIdleProof(idleProof []types.U8) (string, error)

SubmitIdleProof submit idle data proof to the chain

  • idleProof: idle data proof

Return:

  • string: block hash
  • error: error message

func (*ChainClient) SubmitServiceProof added in v0.5.1

func (c *ChainClient) SubmitServiceProof(serviceProof []types.U8) (string, error)

SubmitServiceProof submit service data proof to the chain

  • serviceProof: service data proof

Return:

  • string: block hash
  • error: error message

func (*ChainClient) SubmitVerifyIdleResult added in v0.6.0

func (c *ChainClient) SubmitVerifyIdleResult(totalProofHash []types.U8, front, rear types.U64, accumulator Accumulator, result types.Bool, sig types.Bytes, teePuk WorkerPublicKey) (string, error)

SubmitVerifyIdleResult submit validation result of idle data proof to the chain

  • totalProofHash: total idle data proof hash value
  • front: idle data pre-offset
  • rear: back offset of idle data
  • accumulator: accumulator value
  • result: validation result of idle data proof
  • sig: signature from tee
  • teePuk: tee's work public key

Return:

  • string: block hash
  • error: error message

func (*ChainClient) SubmitVerifyServiceResult added in v0.6.0

func (c *ChainClient) SubmitVerifyServiceResult(result types.Bool, sign types.Bytes, bloomFilter BloomFilter, teePuk WorkerPublicKey) (string, error)

SubmitVerifyServiceResult submit validation result of service data proof to the chain

  • result: validation result of idle data proof
  • sig: signature from tee
  • bloomFilter: bloom filter value
  • teePuk: tee's work public key

Return:

  • string: block hash
  • error: error message

func (*ChainClient) SystemChain added in v0.6.0

func (c *ChainClient) SystemChain() (string, error)

SystemProperties query system properties

Return:

  • string: system chain
  • error: error message

func (*ChainClient) SystemProperties added in v0.6.0

func (c *ChainClient) SystemProperties() (SysProperties, error)

SystemProperties query system properties

Return:

  • SysProperties: system properties
  • error: error message

func (*ChainClient) SystemSyncState added in v0.6.0

func (c *ChainClient) SystemSyncState() (SysSyncState, error)

SystemSyncState query system sync state

Return:

  • SysSyncState: system sync state
  • error: error message

func (*ChainClient) SystemVersion added in v0.6.0

func (c *ChainClient) SystemVersion() (string, error)

SystemVersion query system version

Return:

  • string: system version
  • error: error message

func (*ChainClient) TerritoryConsignment added in v0.6.0

func (c *ChainClient) TerritoryConsignment(territory_name string) (string, error)

TerritoryConsignment consignment territory

  • territory_name: territory name

Return:

  • string: block hash
  • error: error message

Tip:

  • The territory must be in an active state
  • Remaining lease term greater than 1 day

func (*ChainClient) TerritoryFileDelivery added in v0.6.2

func (c *ChainClient) TerritoryFileDelivery(user []byte, fid string, target_territory string) (string, error)

TerritoryFileDelivery transfer files to another territory

  • user: file owner account
  • fid: file id
  • target_territory: transfer to the target territory

Return:

  • string: block hash
  • error: error message

func (*ChainClient) TransferReport added in v0.6.0

func (c *ChainClient) TransferReport(index uint8, fid string) (string, error)

TransferReport is used by miners to report that a file has been transferred

  • index: index of the file fragment
  • fid: file identification

Return:

  • string: block hash
  • error: error message

Note:

  • for storage miner use only

func (*ChainClient) TransferToken added in v0.5.1

func (c *ChainClient) TransferToken(dest string, amount string) (string, error)

TransferToken transfers to other accounts

  • dest: target account
  • amount: transfer amount, It is the smallest unit. If you need to use CESS as the unit, you need to add 18 zeros. For example, if you transfer 1 CESS, you need to fill in "1000000000000000000"

Return:

  • string: block hash
  • error: error message

func (*ChainClient) UpdateBeneficiary added in v0.6.0

func (c *ChainClient) UpdateBeneficiary(earnings string) (string, error)

UpdateBeneficiary updates earnings account for storage miner

  • earnings: earnings account

Return:

  • string: block hash
  • error: error message

func (*ChainClient) UpdateOss added in v0.6.0

func (c *ChainClient) UpdateOss(peerId string, domain string) (string, error)

UpdateOss update oss's peerId or domain

  • peerId: peer id
  • domain: domain name

Return:

  • string: block hash
  • error: error message

func (*ChainClient) UpdateSminerPeerId added in v0.5.1

func (c *ChainClient) UpdateSminerPeerId(peerid PeerId) (string, error)

UpdateSminerPeerId update peer id for storage miner

  • peerid: peer id

Return:

  • string: block hash
  • error: error message

func (*ChainClient) UploadDeclaration added in v0.5.1

func (c *ChainClient) UploadDeclaration(fid string, segment []SegmentList, user UserBrief, filesize uint64) (string, error)

GenerateStorageOrder generate a file storage order

  • fid: file identification
  • segment: segment info
  • user: UserBrief
  • filename: file name
  • filesize: file size

Return:

  • string: block hash
  • error: error message

func (*ChainClient) Verify added in v0.5.1

func (c *ChainClient) Verify(msg []byte, sig []byte) (bool, error)

Verify the signature with your current account's mnemonic

type Chainer added in v0.6.0

type Chainer interface {
	// Audit
	QueryChallengeSnapShot(accountID []byte, block int32) (bool, ChallengeInfo, error)
	QueryCountedClear(accountID []byte, block int32) (uint8, error)
	QueryCountedServiceFailed(accountID []byte, block int32) (uint32, error)
	SubmitIdleProof(idleProof []types.U8) (string, error)
	SubmitServiceProof(serviceProof []types.U8) (string, error)

	// Babe
	QueryAuthorities(block int32) ([]ConsensusRrscAppPublic, error)

	// Balances
	QueryTotalIssuance(block int32) (string, error)
	QueryInactiveIssuance(block int32) (string, error)
	TransferToken(dest string, amount string) (string, error)

	// Oss
	QueryOss(accountID []byte, block int32) (OssInfo, error)
	QueryAllOss(block int32) ([]OssInfo, error)
	QueryAllOssPeerId(block int32) ([]string, error)
	QueryAuthorityList(accountID []byte, block int32) ([]types.AccountID, error)
	Authorize(accountID []byte) (string, error)
	CancelAuthorize(accountID []byte) (string, error)
	RegisterOss(peerId []byte, domain string) (string, error)
	UpdateOss(peerId string, domain string) (string, error)
	DestroyOss() (string, error)

	// EVM
	SendEvmCall(source types.H160, target types.H160, input types.Bytes, value types.U256, gasLimit types.U64, maxFeePerGas types.U256, accessList []AccessInfo) (string, error)

	// FileBank
	QueryBucket(accountID []byte, bucketName string, block int32) (BucketInfo, error)
	QueryDealMap(fid string, block int32) (StorageOrder, error)
	QueryDealMapList(block int32) ([]StorageOrder, error)
	QueryFile(fid string, block int32) (FileMetadata, error)
	QueryRestoralOrder(fragmentHash string, block int32) (RestoralOrderInfo, error)
	QueryAllRestoralOrder(block int32) ([]RestoralOrderInfo, error)
	QueryAllBucketName(accountID []byte, block int32) ([]string, error)
	QueryUserHoldFileList(accountID []byte, block int32) ([]UserFileSliceInfo, error)
	QueryUserFidList(accountID []byte, block int32) ([]string, error)
	PlaceStorageOrder(fid, file_name, bucket_name, territory_name string, segment []SegmentDataInfo, owner []byte, file_size uint64) (string, error)
	UploadDeclaration(fid string, segment []SegmentList, user UserBrief, filesize uint64) (string, error)
	CreateBucket(owner []byte, bucketName string) (string, error)
	DeleteBucket(owner []byte, bucketName string) (string, error)
	DeleteFile(owner []byte, fid string) (string, error)
	TransferReport(index uint8, fid string) (string, error)
	GenerateRestoralOrder(fid, fragmentHash string) (string, error)
	ClaimRestoralOrder(fragmentHash string) (string, error)
	ClaimRestoralNoExistOrder(puk []byte, fid, fragmentHash string) (string, error)
	RestoralOrderComplete(fragmentHash string) (string, error)
	CertIdleSpace(spaceProofInfo SpaceProofInfo, teeSignWithAcc, teeSign types.Bytes, teePuk WorkerPublicKey) (string, error)
	ReplaceIdleSpace(spaceProofInfo SpaceProofInfo, teeSignWithAcc, teeSign types.Bytes, teePuk WorkerPublicKey) (string, error)
	CalculateReport(teeSig types.Bytes, tagSigInfo TagSigInfo) (string, error)
	TerritoryFileDelivery(user []byte, fid string, target_territory string) (string, error)

	// SchedulerCredit
	QueryCurrentCounters(accountId []byte, block int32) (SchedulerCounterEntry, error)

	// Session
	QueryValidators(block int32) ([]types.AccountID, error)

	// Sminer
	QueryExpenders(block int32) (ExpendersInfo, error)
	QueryMinerItems(accountID []byte, block int32) (MinerInfo, error)
	QueryStakingStartBlock(accountID []byte, block int32) (uint32, error)
	QueryAllMiner(block int32) ([]types.AccountID, error)
	QueryCounterForMinerItems(block int32) (uint32, error)
	QueryRewardMap(accountID []byte, block int32) (MinerReward, error)
	QueryRestoralTarget(accountID []byte, block int32) (RestoralTargetInfo, error)
	QueryAllRestoralTarget(block int32) ([]RestoralTargetInfo, error)
	QueryPendingReplacements(accountID []byte, block int32) (types.U128, error)
	QueryCompleteSnapShot(era uint32, block int32) (uint32, uint64, error)
	QueryCompleteMinerSnapShot(puk []byte, block int32) (MinerCompleteInfo, error)
	IncreaseCollateral(accountID []byte, token string) (string, error)
	IncreaseDeclarationSpace(tibCount uint32) (string, error)
	MinerExitPrep() (string, error)
	MinerWithdraw() (string, error)
	ReceiveReward() (string, string, error)
	RegisterPoisKey(poisKey PoISKeyInfo, teeSignWithAcc, teeSign types.Bytes, teePuk WorkerPublicKey) (string, error)
	RegnstkSminer(earnings string, peerId []byte, staking uint64, tibCount uint32) (string, error)
	RegnstkAssignStaking(earnings string, peerId []byte, stakingAcc string, tibCount uint32) (string, error)
	UpdateBeneficiary(earnings string) (string, error)
	UpdateSminerPeerId(peerid PeerId) (string, error)

	// Staking
	QueryCounterForValidators(block int32) (uint32, error)
	QueryValidatorsCount(block int32) (uint32, error)
	QueryNominatorCount(block int32) (uint32, error)
	QueryErasTotalStake(era uint32, block int32) (string, error)
	QueryCurrentEra(block int32) (uint32, error)
	QueryErasRewardPoints(era uint32, block int32) (StakingEraRewardPoints, error)
	QueryAllNominators(block int32) ([]StakingNominations, error)
	QueryAllBonded(block int32) ([]types.AccountID, error)
	QueryValidatorCommission(accountID []byte, block int32) (uint8, error)
	QueryEraValidatorReward(era uint32, block int32) (string, error)
	QueryLedger(accountID []byte, block int32) (StakingLedger, error)
	QueryeErasStakers(era uint32, accountId []byte) (StakingExposure, error)
	QueryeAllErasStakersPaged(era uint32, accountId []byte) ([]StakingExposurePaged, error)
	QueryeErasStakersOverview(era uint32, accountId []byte) (PagedExposureMetadata, error)
	QueryeNominators(accountId []byte, block int32) (StakingNominations, error)

	// StorageHandler
	QueryUnitPrice(block int32) (string, error)
	QueryTotalIdleSpace(block int32) (uint64, error)
	QueryTotalServiceSpace(block int32) (uint64, error)
	QueryPurchasedSpace(block int32) (uint64, error)
	QueryTerritory(accountId []byte, name string, block int32) (TerritoryInfo, error)
	QueryConsignment(token types.H256, block int32) (ConsignmentInfo, error)
	MintTerritory(gib_count uint32, territory_name string, days uint32) (string, error)
	ExpandingTerritory(territory_name string, gib_count uint32) (string, error)
	RenewalTerritory(territory_name string, days_count uint32) (string, error)
	ReactivateTerritory(territory_name string, days_count uint32) (string, error)
	TerritoryConsignment(territory_name string) (string, error)
	CancelConsignment(territory_name string) (string, error)
	BuyConsignment(token types.H256, territory_name string) (string, error)
	CancelPurchaseAction(token types.H256) (string, error)

	// System
	QueryBlockNumber(blockhash string) (uint32, error)
	QueryAccountInfo(account string, block int32) (types.AccountInfo, error)
	QueryAccountInfoByAccountID(accountID []byte, block int32) (types.AccountInfo, error)
	QueryAllAccountInfo(block int32) ([]types.AccountInfo, error)

	// TeeWorker
	QueryMasterPubKey(block int32) ([]byte, error)
	QueryWorkers(puk WorkerPublicKey, block int32) (WorkerInfo, error)
	QueryAllWorkers(block int32) ([]WorkerInfo, error)
	QueryEndpoints(puk WorkerPublicKey, block int32) (string, error)
	QueryWorkerAddedAt(puk WorkerPublicKey, block int32) (uint32, error)

	// CessTreasury
	QueryCurrencyReward(block int32) (string, error)
	QueryEraReward(block int32) (string, error)
	QueryReserveReward(block int32) (string, error)
	QueryRoundReward(era uint32, block int32) (string, error)

	// rpc_call
	ChainGetBlock(hash types.Hash) (types.SignedBlock, error)
	ChainGetBlockHash(block uint32) (types.Hash, error)
	ChainGetFinalizedHead() (types.Hash, error)
	NetListening() (bool, error)
	SystemProperties() (SysProperties, error)
	SystemChain() (string, error)
	SystemSyncState() (SysSyncState, error)
	SystemVersion() (string, error)

	// chain_client
	GetSDKName() string
	GetCurrentRpcAddr() string
	GetRpcState() bool
	SetRpcState(state bool)
	GetSignatureAcc() string
	GetSignatureAccPulickey() []byte
	GetSubstrateAPI() *gsrpc.SubstrateAPI
	GetMetadata() *types.Metadata
	GetTokenSymbol() string
	GetNetworkEnv() string
	GetURI() string
	GetBalances() uint64
	SetBalances(balance uint64)
	Sign(msg []byte) ([]byte, error)
	Verify(msg []byte, sig []byte) (bool, error)
	ReconnectRpc() error
	Close()

	// extrinsics
	InitExtrinsicsName() error
	InitExtrinsicsNameForMiner() error
	InitExtrinsicsNameForOSS() error
	ParseBlockData(blocknumber uint64) (BlockData, error)

	// event
	RetrieveAllEventName(blockhash types.Hash) ([]string, error)
	RetrieveEvent(blockhash types.Hash, extrinsic_name, event_name, signer string) error
	RetrieveExtrinsicsAndEvents(blockhash types.Hash) ([]string, map[string][]string, error)
}

chain client interface

type ChallengeElement added in v0.6.0

type ChallengeElement struct {
	Start        types.U32
	IdleSlip     types.U32
	ServiceSlip  types.U32
	VerifySlip   types.U32
	SpaceParam   SpaceChallengeParam
	ServiceParam QElement
}

type ChallengeInfo added in v0.6.0

type ChallengeInfo struct {
	MinerSnapshot    MinerSnapShot
	ChallengeElement ChallengeElement
	ProveInfo        ProveInfo
}

Audit

type CompleteInfo added in v0.6.0

type CompleteInfo struct {
	Index types.U8
	Miner types.AccountID
}

type CompleteSnapShotType added in v0.6.0

type CompleteSnapShotType struct {
	MinerCount types.U32
	TotalPower types.U128
}

type ConsensusRrscAppPublic added in v0.6.0

type ConsensusRrscAppPublic struct {
	Public  RrscAppPublic
	Unknown types.U64
}

babe

type ConsignmentInfo added in v0.6.0

type ConsignmentInfo struct {
	User   types.AccountID
	Price  types.U128
	Buyers types.OptionAccountID
	Exec   types.OptionU32
	Locked types.Bool
}

type CreateBucketInfo added in v0.6.0

type CreateBucketInfo struct {
	ExtrinsicHash string
	Owner         string
	BucketName    string
}

type DeleteBucketInfo added in v0.6.0

type DeleteBucketInfo struct {
	ExtrinsicHash string
	Owner         string
	BucketName    string
}

type DeleteFileInfo added in v0.6.0

type DeleteFileInfo struct {
	ExtrinsicHash string
	Owner         string
	Fid           string
}

type DigestInfo added in v0.6.0

type DigestInfo struct {
	Fragment  FileHash
	TeePubkey WorkerPublicKey
}

type EcdhPublicKey added in v0.6.0

type EcdhPublicKey [EcdhPublicKeyLen]types.U8

type ElectionCompute added in v0.6.0

type ElectionCompute struct {
	Index types.U8
	Value types.U8
}

type ElectionScore added in v0.6.0

type ElectionScore struct {
	/// The minimal winner, in terms of total backing stake.
	///
	/// This parameter should be maximized.
	Minimal_stake types.U128
	/// The sum of the total backing of all winners.
	///
	/// This parameter should maximized
	Sum_stake types.U128
	/// The sum squared of the total backing of all winners, aka. the variance.
	///
	/// Ths parameter should be minimized.
	Sum_stake_squared types.U128
}

*******************************************************

type EraPaid added in v0.6.0

type EraPaid struct {
	HaveValue       bool
	EraIndex        uint32
	ValidatorPayout string
	Remainder       string
}

type Event_AlreadyFrozen added in v0.6.0

type Event_AlreadyFrozen struct {
	Phase  types.Phase
	Acc    types.AccountID
	Topics []types.Hash
}

type Event_Authorize added in v0.6.0

type Event_Authorize struct {
	Phase    types.Phase
	Acc      types.AccountID
	Operator types.AccountID
	Topics   []types.Hash
}

type Event_BuySpace added in v0.6.0

type Event_BuySpace struct {
	Phase            types.Phase
	Acc              types.AccountID
	Storage_capacity types.U128
	Spend            types.U128
	Topics           []types.Hash
}

------------------------StorageHandler--------------------------------

type Event_CalculateEnd added in v0.6.0

type Event_CalculateEnd struct {
	Phase     types.Phase
	File_hash FileHash
	Topics    []types.Hash
}

type Event_CalculateReport added in v0.6.0

type Event_CalculateReport struct {
	Phase    types.Phase
	Miner    types.AccountID
	FileHash FileHash
	Topics   []types.Hash
}

type Event_CallDone added in v0.6.0

type Event_CallDone struct {
	Phase      types.Phase
	Who        types.AccountID
	CallResult Result
	Topics     []types.Hash
}

type Event_CancelAuthorize added in v0.6.0

type Event_CancelAuthorize struct {
	Phase  types.Phase
	Acc    types.AccountID
	Topics []types.Hash
}

type Event_ClaimRestoralOrder added in v0.6.0

type Event_ClaimRestoralOrder struct {
	Phase   types.Phase
	Miner   types.AccountID
	OrderId FileHash
	Topics  []types.Hash
}

type Event_CreateBucket added in v0.6.0

type Event_CreateBucket struct {
	Phase      types.Phase
	Acc        types.AccountID
	Owner      types.AccountID
	BucketName types.Bytes
	Topics     []types.Hash
}

type Event_DeleteBucket added in v0.6.0

type Event_DeleteBucket struct {
	Phase      types.Phase
	Acc        types.AccountID
	Owner      types.AccountID
	BucketName types.Bytes
	Topics     []types.Hash
}

type Event_DeleteFile added in v0.6.0

type Event_DeleteFile struct {
	Phase    types.Phase
	Operator types.AccountID
	Owner    types.AccountID
	Filehash []FileHash
	Topics   []types.Hash
}

------------------------FileBank----------------------

type Event_Deposit added in v0.6.0

type Event_Deposit struct {
	Phase   types.Phase
	Balance types.U128
	Topics  []types.Hash
}

type Event_DrawFaucetMoney added in v0.6.0

type Event_DrawFaucetMoney struct {
	Phase  types.Phase
	Topics []types.Hash
}

type Event_ElectionFinalized added in v0.6.0

type Event_ElectionFinalized struct {
	Phase   types.Phase
	Compute types.U8
	Score   ElectionScore
	Topics  []types.Hash
}

------------------------system------------------------

type Event_Exit added in v0.6.0

type Event_Exit struct {
	Phase  types.Phase
	Acc    types.AccountID
	Topics []types.Hash
}

------------------------TEE Worker--------------------

type Event_ExpansionSpace added in v0.6.0

type Event_ExpansionSpace struct {
	Phase           types.Phase
	Acc             types.AccountID
	Expansion_space types.U128
	Fee             types.U128
	Topics          []types.Hash
}

type Event_FaucetTopUpMoney added in v0.6.0

type Event_FaucetTopUpMoney struct {
	Phase  types.Phase
	Acc    types.AccountID
	Topics []types.Hash
}

type Event_FillerDelete added in v0.6.0

type Event_FillerDelete struct {
	Phase      types.Phase
	Acc        types.AccountID
	FillerHash FileHash
	Topics     []types.Hash
}

type Event_FillerUpload added in v0.6.0

type Event_FillerUpload struct {
	Phase    types.Phase
	Acc      types.AccountID
	Filesize types.U64
	Topics   []types.Hash
}

type Event_GenerateChallenge added in v0.6.0

type Event_GenerateChallenge struct {
	Phase  types.Phase
	Topics []types.Hash
}

type Event_GenerateRestoralOrder added in v0.6.0

type Event_GenerateRestoralOrder struct {
	Phase        types.Phase
	Miner        types.AccountID
	FragmentHash FileHash
	Topics       []types.Hash
}

type Event_IdleSpaceCert added in v0.6.0

type Event_IdleSpaceCert struct {
	Phase  types.Phase
	Acc    types.AccountID
	Space  types.U128
	Topics []types.Hash
}

type Event_IncreaseCollateral added in v0.6.0

type Event_IncreaseCollateral struct {
	Phase   types.Phase
	Acc     types.AccountID
	Balance types.U128
	Topics  []types.Hash
}

type Event_IncreaseDeclarationSpace added in v0.6.0

type Event_IncreaseDeclarationSpace struct {
	Phase  types.Phase
	Miner  types.AccountID
	Space  types.U128
	Topics []types.Hash
}

type Event_KeyfairyAdded added in v0.6.0

type Event_KeyfairyAdded struct {
	Phase  types.Phase
	Pubkey WorkerPublicKey
	Topics []types.Hash
}

type Event_LeaseExpireIn24Hours added in v0.6.0

type Event_LeaseExpireIn24Hours struct {
	Phase  types.Phase
	Acc    types.AccountID
	Size   types.U128
	Topics []types.Hash
}

type Event_LeaseExpired added in v0.6.0

type Event_LeaseExpired struct {
	Phase  types.Phase
	Acc    types.AccountID
	Size   types.U128
	Topics []types.Hash
}

type Event_LessThan24Hours added in v0.6.0

type Event_LessThan24Hours struct {
	Phase  types.Phase
	Last   types.U32
	Now    types.U32
	Topics []types.Hash
}

type Event_Locked added in v0.6.0

type Event_Locked struct {
	Phase  types.Phase
	Who    types.AccountID
	Amount types.U128
	Topics []types.Hash
}

type Event_MasterKeyLaunched added in v0.6.0

type Event_MasterKeyLaunched struct {
	Phase  types.Phase
	Topics []types.Hash
}

type Event_MasterKeyRotated added in v0.6.0

type Event_MasterKeyRotated struct {
	Phase        types.Phase
	RotationId   types.U64
	MasterPubkey WorkerPublicKey
	Topics       []types.Hash
}

type Event_MasterKeyRotationFailed added in v0.6.0

type Event_MasterKeyRotationFailed struct {
	Phase              types.Phase
	RotationLock       types.Option[types.U64]
	KeyfairyRotationId types.U64
	Topics             []types.Hash
}

type Event_MinerClaim added in v0.6.0

type Event_MinerClaim struct {
	Phase  types.Phase
	Acc    types.AccountID
	Topics []types.Hash
}

type Event_MinerExit added in v0.6.0

type Event_MinerExit struct {
	Phase  types.Phase
	Acc    types.AccountID
	Topics []types.Hash
}

type Event_MinerExitPrep added in v0.6.0

type Event_MinerExitPrep struct {
	Phase  types.Phase
	Miner  types.AccountID
	Topics []types.Hash
}

type Event_MinimumCesealVersionChangedTo added in v0.6.0

type Event_MinimumCesealVersionChangedTo struct {
	Phase  types.Phase
	Elem1  types.U32
	Elem2  types.U32
	Elem3  types.U32
	Topics []types.Hash
}

type Event_OssDestroy added in v0.6.0

type Event_OssDestroy struct {
	Phase  types.Phase
	Acc    types.AccountID
	Topics []types.Hash
}

type Event_OssRegister added in v0.6.0

type Event_OssRegister struct {
	Phase    types.Phase
	Acc      types.AccountID
	Endpoint PeerId
	Topics   []types.Hash
}

------------------------Oss---------------------------

type Event_OssUpdate added in v0.6.0

type Event_OssUpdate struct {
	Phase       types.Phase
	Acc         types.AccountID
	NewEndpoint PeerId
	Topics      []types.Hash
}

type Event_PhaseTransitioned added in v0.6.0

type Event_PhaseTransitioned struct {
	Phase  types.Phase
	From   Signed
	To     Unsigneds
	Round  types.U32
	Topics []types.Hash
}

type Event_Receive added in v0.6.0

type Event_Receive struct {
	Phase  types.Phase
	Acc    string
	Reward types.U128
	Topics []types.Hash
}

type Event_RecoveryCompleted added in v0.6.0

type Event_RecoveryCompleted struct {
	Phase   types.Phase
	Miner   types.AccountID
	OrderId FileHash
	Topics  []types.Hash
}

type Event_RegisterPoisKey added in v0.6.0

type Event_RegisterPoisKey struct {
	Phase  types.Phase
	Miner  types.AccountID
	Topics []types.Hash
}

type Event_Registered added in v0.6.0

type Event_Registered struct {
	Phase  types.Phase
	Acc    types.AccountID
	Topics []types.Hash
}

------------------------Sminer------------------------

type Event_RenewalSpace added in v0.6.0

type Event_RenewalSpace struct {
	Phase        types.Phase
	Acc          types.AccountID
	Renewal_days types.U32
	Fee          types.U128
	Topics       []types.Hash
}

type Event_ReplaceFiller added in v0.6.0

type Event_ReplaceFiller struct {
	Phase       types.Phase
	Acc         types.AccountID
	Filler_list []FileHash
	Topics      []types.Hash
}

type Event_ReplaceIdleSpace added in v0.6.0

type Event_ReplaceIdleSpace struct {
	Phase  types.Phase
	Acc    types.AccountID
	Space  types.U128
	Topics []types.Hash
}

type Event_ServiceFeePaid added in v0.6.0

type Event_ServiceFeePaid struct {
	Phase       types.Phase
	Who         types.AccountID
	ActualFee   types.U128
	ExpectedFee types.U128
	Topics      []types.Hash
}

type Event_SolutionStored added in v0.6.0

type Event_SolutionStored struct {
	Phase       types.Phase
	Compute     ElectionCompute
	Origin      types.Option[types.AccountID]
	PrevEjected types.Bool
	Topics      []types.Hash
}

type Event_StorageCompleted added in v0.6.0

type Event_StorageCompleted struct {
	Phase    types.Phase
	FileHash FileHash
	Topics   []types.Hash
}

type Event_SubmitIdleProof added in v0.6.0

type Event_SubmitIdleProof struct {
	Phase  types.Phase
	Miner  types.AccountID
	Topics []types.Hash
}

type Event_SubmitIdleVerifyResult added in v0.6.0

type Event_SubmitIdleVerifyResult struct {
	Phase  types.Phase
	Tee    WorkerPublicKey
	Miner  types.AccountID
	Result types.Bool
	Topics []types.Hash
}

type Event_SubmitProof added in v0.6.0

type Event_SubmitProof struct {
	Phase  types.Phase
	Miner  types.AccountID
	Topics []types.Hash
}

type Event_SubmitServiceProof added in v0.6.0

type Event_SubmitServiceProof struct {
	Phase  types.Phase
	Miner  types.AccountID
	Topics []types.Hash
}

type Event_SubmitServiceVerifyResult added in v0.6.0

type Event_SubmitServiceVerifyResult struct {
	Phase  types.Phase
	Tee    WorkerPublicKey
	Miner  types.AccountID
	Result types.Bool
	Topics []types.Hash
}

type Event_TerritorFileDelivery added in v0.6.0

type Event_TerritorFileDelivery struct {
	Phase        types.Phase
	Filehash     FileHash
	NewTerritory types.Bytes
	Topics       []types.Hash
}

type Event_TransactionFeePaid added in v0.6.0

type Event_TransactionFeePaid struct {
	Phase     types.Phase
	Who       types.AccountID
	ActualFee types.U128
	Tip       types.U128
	Topics    []types.Hash
}

type Event_TransferReport added in v0.6.0

type Event_TransferReport struct {
	Phase    types.Phase
	Acc      types.AccountID
	DealHash FileHash
	Topics   []types.Hash
}

type Event_UpdateBeneficiary added in v0.6.0

type Event_UpdateBeneficiary struct {
	Phase  types.Phase
	Acc    types.AccountID
	New    types.AccountID
	Topics []types.Hash
}

type Event_UpdatePeerId added in v0.6.0

type Event_UpdatePeerId struct {
	Phase  types.Phase
	Acc    types.AccountID
	Old    PeerId
	New    PeerId
	Topics []types.Hash
}

type Event_UploadDeclaration added in v0.6.0

type Event_UploadDeclaration struct {
	Phase     types.Phase
	Operator  types.AccountID
	Owner     types.AccountID
	Deal_hash FileHash
	Topics    []types.Hash
}

type Event_ValidatorPrefsSet added in v0.6.0

type Event_ValidatorPrefsSet struct {
	Phase  types.Phase
	Stash  types.AccountID
	Prefs  ValidatorPrefs
	Topics []types.Hash
}

type Event_VerifyProof added in v0.6.0

type Event_VerifyProof struct {
	Phase     types.Phase
	TeeWorker WorkerPublicKey
	Miner     types.AccountID
	Topics    []types.Hash
}

------------------------Audit-------------------

type Event_Withdraw added in v0.6.0

type Event_Withdraw struct {
	Phase  types.Phase
	Acc    types.AccountID
	Topics []types.Hash
}

type Event_WorkerAdded added in v0.6.0

type Event_WorkerAdded struct {
	Phase               types.Phase
	Pubkey              WorkerPublicKey
	AttestationProvider types.Option[types.U8]
	ConfidenceLevel     types.U8
	Topics              []types.Hash
}

type Event_WorkerUpdated added in v0.6.0

type Event_WorkerUpdated struct {
	Phase               types.Phase
	Pubkey              WorkerPublicKey
	AttestationProvider types.Option[types.U8]
	ConfidenceLevel     types.U8
	Topics              []types.Hash
}

type ExpendersInfo added in v0.6.0

type ExpendersInfo struct {
	K types.U64
	N types.U64
	D types.U64
}

type ExtrinsicsInfo added in v0.6.0

type ExtrinsicsInfo struct {
	Name    string
	Signer  string
	Hash    string
	FeePaid string
	Result  bool
	Events  []string
}

type FileHash added in v0.6.0

type FileHash [FileHashLen]types.U8

func BytesToFileHash added in v0.6.0

func BytesToFileHash(val []byte) (FileHash, error)

type FileMetadata added in v0.6.0

type FileMetadata struct {
	SegmentList []SegmentInfo
	Owner       []UserBrief
	FileSize    types.U128
	Completion  types.U32
	State       types.U8
}

type FragmentInfo added in v0.6.0

type FragmentInfo struct {
	Hash  FileHash
	Avail types.Bool
	Tag   types.Option[types.U32]
	Miner types.AccountID
}

type GatewayReg added in v0.6.0

type GatewayReg struct {
	ExtrinsicHash string
	Account       string
}

type IdleFileMeta added in v0.6.0

type IdleFileMeta struct {
	BlockNum uint32
	MinerAcc []byte
	Hash     string
}

--------------------customer-----------------

type IdleProveInfo added in v0.6.0

type IdleProveInfo struct {
	TeePubkey    WorkerPublicKey
	IdleProve    types.Bytes
	VerifyResult types.Option[bool]
}

type IdleSignInfo added in v0.6.0

type IdleSignInfo struct {
	Miner              types.AccountID
	Rear               types.U64
	Front              types.U64
	Accumulator        Accumulator
	LastOperationBlock types.U32
	PoisKey            PoISKeyInfo
}

type Individual added in v0.6.0

type Individual struct {
	Acc    types.AccountID
	Reward types.U32
}

type KeyOwnerParam added in v0.6.0

type KeyOwnerParam struct {
	PublicType AppPublicType
	Public     types.Bytes
}

Session

type MasterPublicKey added in v0.6.0

type MasterPublicKey [MasterPublicKeyLen]types.U8

type MinerCompleteInfo added in v0.6.0

type MinerCompleteInfo struct {
	EraIndex    types.U32
	Issued      types.Bool
	FinishBlock types.U32
	Power       types.U128
}

type MinerInfo added in v0.6.0

type MinerInfo struct {
	BeneficiaryAccount types.AccountID
	StakingAccount     types.AccountID
	PeerId             PeerId
	Collaterals        types.U128
	Debt               types.U128
	State              types.Bytes // positive, exit, frozen, lock
	DeclarationSpace   types.U128
	IdleSpace          types.U128
	ServiceSpace       types.U128
	LockSpace          types.U128
	SpaceProofInfo     types.Option[SpaceProofInfo]
	ServiceBloomFilter BloomFilter
	TeeSig             TeeSig
}

Sminer

type MinerRegInfo added in v0.6.0

type MinerRegInfo struct {
	ExtrinsicHash string
	Account       string
}

type MinerRegPoiskey added in v0.6.0

type MinerRegPoiskey struct {
	ExtrinsicHash string
	Miner         string
}

type MinerReward added in v0.6.0

type MinerReward struct {
	TotalReward  types.U128
	RewardIssued types.U128
	OrderList    []RewardOrder
}

type MinerSnapShot added in v0.6.0

type MinerSnapShot struct {
	IdleSpace          types.U128
	ServiceSpace       types.U128
	ServiceBloomFilter BloomFilter
	SpaceProofInfo     SpaceProofInfo
	TeeSig             TeeSig
}

type MinerSnapshot added in v0.6.0

type MinerSnapshot struct {
	Miner         string
	Idle_space    string
	Service_space string
}

type MintTerritory added in v0.6.0

type MintTerritory struct {
	ExtrinsicHash  string
	Account        string
	TerritoryToken string
	TerritoryName  string
	TerritorySize  uint64
}

type NetSnapshot added in v0.6.0

type NetSnapshot struct {
	Start               uint32
	Life                uint32
	Total_reward        string
	Total_idle_space    string
	Total_service_space string
	Random_index_list   []uint32
	Random              [][]byte
}

type OssInfo added in v0.6.0

type OssInfo struct {
	Peerid PeerId
	Domain types.Bytes
}

type OtherStakingExposure added in v0.6.0

type OtherStakingExposure struct {
	Who   types.AccountID
	Value types.UCompact
}

type PagedExposureMetadata added in v0.6.0

type PagedExposureMetadata struct {
	Total          types.UCompact
	Own            types.UCompact
	NominatorCount types.U32
	PageCount      types.U32
}

type PeerId added in v0.6.0

type PeerId [PeerIdPublicKeyLen]types.U8

type PoISKeyInfo added in v0.6.0

type PoISKeyInfo struct {
	G PoISKey_G
	N PoISKey_N
}

func BytesToPoISKeyInfo added in v0.6.0

func BytesToPoISKeyInfo(g, n []byte) (PoISKeyInfo, error)

type PoISKey_G added in v0.6.0

type PoISKey_G [PoISKeyLen]types.U8

type PoISKey_N added in v0.6.0

type PoISKey_N [PoISKeyLen]types.U8

type ProveInfo added in v0.6.0

type ProveInfo struct {
	Assign       types.U8
	IdleProve    types.Option[IdleProveInfo]
	ServiceProve types.Option[ServiceProveInfo]
}

type Punishment added in v0.6.0

type Punishment struct {
	ExtrinsicName string
	ExtrinsicHash string
	From          string
	To            string
	Amount        string
}

type QElement added in v0.6.0

type QElement struct {
	Index []types.U32
	Value []Random
}

type Random added in v0.6.0

type Random [RandomLen]types.U8

type RestoralOrderInfo added in v0.6.0

type RestoralOrderInfo struct {
	Count        types.U32
	Miner        types.AccountID
	OriginMiner  types.AccountID
	FragmentHash FileHash
	FileHash     FileHash
	GenBlock     types.U32
	Deadline     types.U32
}

type RestoralTargetInfo added in v0.6.0

type RestoralTargetInfo struct {
	Miner         types.AccountID
	ServiceSpace  types.U128
	RestoredSpace types.U128
	CoolingBlock  types.U32
}

type Result added in v0.6.0

type Result struct {
	Index    types.U8
	ResultOk ResultOk
}

type ResultOk added in v0.6.0

type ResultOk struct {
	ActualWeight types.Option[ActualWeightType]
	PaysFee      types.U8
}

type RewardOrder added in v0.6.0

type RewardOrder struct {
	ReceiveCount     types.U8
	MaxCount         types.U8
	Atonce           types.Bool
	OrderReward      types.U128
	EachAmount       types.U128
	LastReceiveBlock types.U32
}

type RewardsType added in v0.6.0

type RewardsType struct {
	Total   string
	Claimed string
}

type RoundRewardType added in v0.6.0

type RoundRewardType struct {
	TotalReward types.U128
	OtherReward types.U128
}

type RrscAppPublic added in v0.6.0

type RrscAppPublic [RrscAppPublicLen]types.U8

type SchedulerCounterEntry added in v0.6.0

type SchedulerCounterEntry struct {
	ProceedBlockSize uint64
	PunishmentCount  uint32
}

SchedulerCredit

type SegmentDataInfo added in v0.6.0

type SegmentDataInfo struct {
	SegmentHash  string
	FragmentHash []string
}

type SegmentInfo added in v0.6.0

type SegmentInfo struct {
	Hash         FileHash
	FragmentList []FragmentInfo
}

type SegmentList added in v0.6.0

type SegmentList struct {
	SegmentHash  FileHash
	FragmentHash []FileHash
}

type ServiceProveInfo added in v0.6.0

type ServiceProveInfo struct {
	TeePubkey    WorkerPublicKey
	ServiceProve types.Bytes
	VerifyResult types.Option[bool]
}

type Signed added in v0.6.0

type Signed struct {
	Index types.U8
	Value types.U32
}

type SpaceChallengeParam added in v0.6.0

type SpaceChallengeParam [SpaceChallengeParamLen]types.U64

type SpaceProofInfo added in v0.6.0

type SpaceProofInfo struct {
	Miner       types.AccountID
	Front       types.U64
	Rear        types.U64
	PoisKey     PoISKeyInfo
	Accumulator Accumulator
}

type StakingEraRewardPoints added in v0.6.0

type StakingEraRewardPoints struct {
	Total      types.U32
	Individual []Individual
}

Staking

type StakingExposure added in v0.6.0

type StakingExposure struct {
	Total  types.UCompact
	Own    types.UCompact
	Others []OtherStakingExposure
}

type StakingExposurePaged added in v0.6.0

type StakingExposurePaged struct {
	PageTotal types.UCompact
	Others    []OtherStakingExposure
}

type StakingLedger added in v0.6.0

type StakingLedger struct {
	Stash          types.AccountID
	Total          types.UCompact
	Active         types.UCompact
	Unlocking      []UnlockChunk
	ClaimedRewards []types.U32
}

type StakingNominations added in v0.6.0

type StakingNominations struct {
	Targets     []types.AccountID
	SubmittedIn types.U32
	Suppressed  types.Bool
}

type StakingPayout added in v0.6.0

type StakingPayout struct {
	EraIndex      uint32
	ExtrinsicHash string
	ClaimedAcc    string
	Amount        string
}

type StakingValidatorPrefs added in v0.6.0

type StakingValidatorPrefs struct {
	Commission types.U32
	Blocked    types.Bool
}

type StorageOrder added in v0.6.0

type StorageOrder struct {
	FileSize     types.U128
	SegmentList  []SegmentList
	User         UserBrief
	CompleteList []CompleteInfo
}

FileBank

type SubmitIdleProve added in v0.6.0

type SubmitIdleProve struct {
	ExtrinsicHash string
	Miner         string
}

type SubmitIdleResult added in v0.6.0

type SubmitIdleResult struct {
	ExtrinsicHash string
	Miner         string
	Result        bool
}

type SubmitServiceProve added in v0.6.0

type SubmitServiceProve struct {
	ExtrinsicHash string
	Miner         string
}

type SubmitServiceResult added in v0.6.0

type SubmitServiceResult struct {
	ExtrinsicHash string
	Miner         string
	Result        bool
}

type SysProperties added in v0.6.0

type SysProperties struct {
	IsEthereum    types.Bool
	Ss58Format    types.U32
	TokenDecimals types.U8
	TokenSymbol   types.Text
}

System

type SysSyncState added in v0.6.0

type SysSyncState struct {
	StartingBlock types.U32
	CurrentBlock  types.U32
	HighestBlock  types.U32
}

type TagSigInfo added in v0.6.0

type TagSigInfo struct {
	Miner    types.AccountID
	Digest   []DigestInfo
	Filehash FileHash
}

type TeeInfo added in v0.6.0

type TeeInfo struct {
	Pubkey              string
	EcdhPubkey          string
	Version             uint32
	LastUpdated         uint64
	StashAccount        string
	AttestationProvider uint8
	ConfidenceLevel     uint8
	Features            []uint32
	WorkerRole          uint8 // 0:Full 1:Verifier 2:Marker
}

type TeeSig added in v0.6.0

type TeeSig [TeeSigLen]types.U8

type TeeSignature added in v0.6.0

type TeeSignature [TeeSignatureLen]types.U8

type TerritoryInfo added in v0.6.0

type TerritoryInfo struct {
	Token          types.H256
	TotalSpace     types.U128
	UsedSpace      types.U128
	LockedSpace    types.U128
	RemainingSpace types.U128
	Start          types.U32
	Deadline       types.U32
	State          types.U8 //0: Active 1: Frozen 2: Expired 3: OnConsignment
}

type TransferInfo added in v0.6.0

type TransferInfo struct {
	ExtrinsicName string
	ExtrinsicHash string
	From          string
	To            string
	Amount        string
	Result        bool
}

type Unbonded added in v0.6.0

type Unbonded struct {
	ExtrinsicHash string
	Account       string
	Amount        string
}

type UnlockChunk added in v0.6.0

type UnlockChunk struct {
	Value types.UCompact
	Era   types.BlockNumber
}

type UnsignedValue added in v0.6.0

type UnsignedValue struct {
	Bool types.Bool
	Bn   types.U32
}

type Unsigneds added in v0.6.0

type Unsigneds struct {
	Index         types.U8
	UnsignedValue []UnsignedValue
}

type UploadDecInfo added in v0.6.0

type UploadDecInfo struct {
	ExtrinsicHash string
	Owner         string
	Fid           string
}

type UserBrief added in v0.6.0

type UserBrief struct {
	User          types.AccountID
	FileName      types.Bytes
	BucketName    types.Bytes
	TerriortyName types.Bytes
}

type UserFileSliceInfo added in v0.6.0

type UserFileSliceInfo struct {
	TerritoryName types.Bytes
	Filehash      FileHash
	FileSize      types.U128
}

type UserInfo added in v0.6.0

type UserInfo struct {
	UserAccount string
	FileName    string
	BucketName  string
	FileSize    uint64
}

type UserSpaceSt added in v0.6.0

type UserSpaceSt struct {
	TotalSpace     string
	UsedSpace      string
	LockedSpace    string
	RemainingSpace string
	State          string
	Start          uint32
	Deadline       uint32
}

type ValidatorPrefs added in v0.6.0

type ValidatorPrefs struct {
	Commission types.U32
	Blocked    types.Bool
}

type WorkerInfo added in v0.6.0

type WorkerInfo struct {
	Pubkey              WorkerPublicKey
	EcdhPubkey          EcdhPublicKey
	Version             types.U32
	LastUpdated         types.U64
	StashAccount        types.Option[types.AccountID]
	AttestationProvider types.Option[types.U8]
	ConfidenceLevel     types.U8
	Features            []types.U32
	Role                types.U8 // 0:Full 1:Verifier 2:Marker
}

TeeWorker

type WorkerPublicKey added in v0.6.0

type WorkerPublicKey [WorkerPublicKeyLen]types.U8

func BytesToWorkPublickey added in v0.6.0

func BytesToWorkPublickey(val []byte) (WorkerPublicKey, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL