Documentation ¶
Index ¶
- Constants
- func OnDispatch(index int32) *wasmlib.ScExportMap
- type CoreRootEventHandlers
- func (h *CoreRootEventHandlers) CallHandler(topic string, dec *wasmtypes.WasmDecoder)
- func (h *CoreRootEventHandlers) ID() uint32
- func (h *CoreRootEventHandlers) OnCoreRootDeploy(handler func(e *EventDeploy))
- func (h *CoreRootEventHandlers) OnCoreRootGrant(handler func(e *EventGrant))
- func (h *CoreRootEventHandlers) OnCoreRootRevoke(handler func(e *EventRevoke))
- type DeployContractCall
- type EventDeploy
- type EventGrant
- type EventRevoke
- type FindContractCall
- type Funcs
- func (sc Funcs) DeployContract(ctx wasmlib.ScFuncClientContext) *DeployContractCall
- func (sc Funcs) FindContract(ctx wasmlib.ScViewClientContext) *FindContractCall
- func (sc Funcs) GetContractRecords(ctx wasmlib.ScViewClientContext) *GetContractRecordsCall
- func (sc Funcs) GrantDeployPermission(ctx wasmlib.ScFuncClientContext) *GrantDeployPermissionCall
- func (sc Funcs) RequireDeployPermissions(ctx wasmlib.ScFuncClientContext) *RequireDeployPermissionsCall
- func (sc Funcs) RevokeDeployPermission(ctx wasmlib.ScFuncClientContext) *RevokeDeployPermissionCall
- type GetContractRecordsCall
- type GrantDeployPermissionCall
- type ImmutableDeployContractParams
- type ImmutableFindContractParams
- type ImmutableFindContractResults
- type ImmutableGetContractRecordsResults
- type ImmutableGrantDeployPermissionParams
- type ImmutableRequireDeployPermissionsParams
- type ImmutableRevokeDeployPermissionParams
- type MapHnameToImmutableBytes
- type MapHnameToMutableBytes
- type MapStringToImmutableBytes
- type MapStringToMutableBytes
- type MutableDeployContractParams
- type MutableFindContractParams
- type MutableFindContractResults
- type MutableGetContractRecordsResults
- type MutableGrantDeployPermissionParams
- type MutableRequireDeployPermissionsParams
- type MutableRevokeDeployPermissionParams
- type RequireDeployPermissionsCall
- type RevokeDeployPermissionCall
Constants ¶
const ( ScName = "root" ScDescription = "Root Contract" HScName = wasmtypes.ScHname(0xcebf5908) )
const ( ParamDeployer = "dp" ParamDeployPermissionsEnabled = "de" ParamHname = "hn" ParamInitParams = "this" ParamName = "nm" ParamProgramHash = "ph" )
const ( ResultContractFound = "cf" ResultContractRecData = "dt" ResultContractRegistry = "r" )
const ( FuncDeployContract = "deployContract" FuncGrantDeployPermission = "grantDeployPermission" FuncRequireDeployPermissions = "requireDeployPermissions" FuncRevokeDeployPermission = "revokeDeployPermission" ViewFindContract = "findContract" ViewGetContractRecords = "getContractRecords" )
const ( HFuncDeployContract = wasmtypes.ScHname(0x28232c27) HFuncGrantDeployPermission = wasmtypes.ScHname(0xf440263a) HFuncRequireDeployPermissions = wasmtypes.ScHname(0xefff8d83) HFuncRevokeDeployPermission = wasmtypes.ScHname(0x850744f1) HViewFindContract = wasmtypes.ScHname(0xc145ca00) HViewGetContractRecords = wasmtypes.ScHname(0x078b3ef3) )
Variables ¶
This section is empty.
Functions ¶
func OnDispatch ¶ added in v1.0.3
func OnDispatch(index int32) *wasmlib.ScExportMap
Types ¶
type CoreRootEventHandlers ¶ added in v1.0.3
type CoreRootEventHandlers struct {
// contains filtered or unexported fields
}
func NewCoreRootEventHandlers ¶ added in v1.0.3
func NewCoreRootEventHandlers() *CoreRootEventHandlers
func (*CoreRootEventHandlers) CallHandler ¶ added in v1.0.3
func (h *CoreRootEventHandlers) CallHandler(topic string, dec *wasmtypes.WasmDecoder)
func (*CoreRootEventHandlers) ID ¶ added in v1.0.3
func (h *CoreRootEventHandlers) ID() uint32
func (*CoreRootEventHandlers) OnCoreRootDeploy ¶ added in v1.0.3
func (h *CoreRootEventHandlers) OnCoreRootDeploy(handler func(e *EventDeploy))
func (*CoreRootEventHandlers) OnCoreRootGrant ¶ added in v1.0.3
func (h *CoreRootEventHandlers) OnCoreRootGrant(handler func(e *EventGrant))
func (*CoreRootEventHandlers) OnCoreRootRevoke ¶ added in v1.0.3
func (h *CoreRootEventHandlers) OnCoreRootRevoke(handler func(e *EventRevoke))
type DeployContractCall ¶
type DeployContractCall struct { Func *wasmlib.ScFunc Params MutableDeployContractParams }
type EventDeploy ¶ added in v1.0.3
type EventGrant ¶ added in v1.0.3
type EventRevoke ¶ added in v1.0.3
type FindContractCall ¶
type FindContractCall struct { Func *wasmlib.ScView Params MutableFindContractParams Results ImmutableFindContractResults }
type Funcs ¶
type Funcs struct{}
var ScFuncs Funcs
func (Funcs) DeployContract ¶
func (sc Funcs) DeployContract(ctx wasmlib.ScFuncClientContext) *DeployContractCall
Deploys a non-EVM smart contract on the chain if the caller has deployment permission.
func (Funcs) FindContract ¶
func (sc Funcs) FindContract(ctx wasmlib.ScViewClientContext) *FindContractCall
Returns the record for a given smart contract
func (Funcs) GetContractRecords ¶
func (sc Funcs) GetContractRecords(ctx wasmlib.ScViewClientContext) *GetContractRecordsCall
Returns the list of all smart contracts deployed on the chain and their records.
func (Funcs) GrantDeployPermission ¶
func (sc Funcs) GrantDeployPermission(ctx wasmlib.ScFuncClientContext) *GrantDeployPermissionCall
Grants deploy permission to an agent.
func (Funcs) RequireDeployPermissions ¶ added in v0.3.0
func (sc Funcs) RequireDeployPermissions(ctx wasmlib.ScFuncClientContext) *RequireDeployPermissionsCall
Enable or disable deploy permission check
func (Funcs) RevokeDeployPermission ¶
func (sc Funcs) RevokeDeployPermission(ctx wasmlib.ScFuncClientContext) *RevokeDeployPermissionCall
Revokes deploy permission for an agent.
type GetContractRecordsCall ¶
type GetContractRecordsCall struct { Func *wasmlib.ScView Results ImmutableGetContractRecordsResults }
type GrantDeployPermissionCall ¶
type GrantDeployPermissionCall struct { Func *wasmlib.ScFunc Params MutableGrantDeployPermissionParams }
type ImmutableDeployContractParams ¶
func NewImmutableDeployContractParams ¶ added in v1.0.3
func NewImmutableDeployContractParams() ImmutableDeployContractParams
func (ImmutableDeployContractParams) InitParams ¶ added in v1.0.3
func (s ImmutableDeployContractParams) InitParams() MapStringToImmutableBytes
additional params for smart contract init function
func (ImmutableDeployContractParams) Name ¶
func (s ImmutableDeployContractParams) Name() wasmtypes.ScImmutableString
The name of the contract to be deployed, used to calculate the contract's hname. The hname must be unique among all contract hnames in the chain.
func (ImmutableDeployContractParams) ProgramHash ¶
func (s ImmutableDeployContractParams) ProgramHash() wasmtypes.ScImmutableHash
hash of blob that has been previously stored in blob contract
type ImmutableFindContractParams ¶
func NewImmutableFindContractParams ¶ added in v1.0.3
func NewImmutableFindContractParams() ImmutableFindContractParams
func (ImmutableFindContractParams) Hname ¶
func (s ImmutableFindContractParams) Hname() wasmtypes.ScImmutableHname
The smart contract’s Hname
type ImmutableFindContractResults ¶
func (ImmutableFindContractResults) ContractFound ¶
func (s ImmutableFindContractResults) ContractFound() wasmtypes.ScImmutableBool
whether the contract exists.
func (ImmutableFindContractResults) ContractRecData ¶
func (s ImmutableFindContractResults) ContractRecData() wasmtypes.ScImmutableBytes
encoded contract record (if exists)
type ImmutableGetContractRecordsResults ¶
func (ImmutableGetContractRecordsResults) ContractRegistry ¶
func (s ImmutableGetContractRecordsResults) ContractRegistry() MapHnameToImmutableBytes
contract records by Hname
type ImmutableGrantDeployPermissionParams ¶
func NewImmutableGrantDeployPermissionParams ¶ added in v1.0.3
func NewImmutableGrantDeployPermissionParams() ImmutableGrantDeployPermissionParams
func (ImmutableGrantDeployPermissionParams) Deployer ¶
func (s ImmutableGrantDeployPermissionParams) Deployer() wasmtypes.ScImmutableAgentID
agent to grant deploy permission to
type ImmutableRequireDeployPermissionsParams ¶ added in v0.3.0
func NewImmutableRequireDeployPermissionsParams ¶ added in v1.0.3
func NewImmutableRequireDeployPermissionsParams() ImmutableRequireDeployPermissionsParams
func (ImmutableRequireDeployPermissionsParams) DeployPermissionsEnabled ¶ added in v0.3.0
func (s ImmutableRequireDeployPermissionsParams) DeployPermissionsEnabled() wasmtypes.ScImmutableBool
turns permission check on or off
type ImmutableRevokeDeployPermissionParams ¶
func NewImmutableRevokeDeployPermissionParams ¶ added in v1.0.3
func NewImmutableRevokeDeployPermissionParams() ImmutableRevokeDeployPermissionParams
func (ImmutableRevokeDeployPermissionParams) Deployer ¶
func (s ImmutableRevokeDeployPermissionParams) Deployer() wasmtypes.ScImmutableAgentID
agent to revoke deploy permission for
type MapHnameToImmutableBytes ¶
func (MapHnameToImmutableBytes) GetBytes ¶
func (m MapHnameToImmutableBytes) GetBytes(key wasmtypes.ScHname) wasmtypes.ScImmutableBytes
type MapHnameToMutableBytes ¶
func (MapHnameToMutableBytes) Clear ¶
func (m MapHnameToMutableBytes) Clear()
func (MapHnameToMutableBytes) GetBytes ¶
func (m MapHnameToMutableBytes) GetBytes(key wasmtypes.ScHname) wasmtypes.ScMutableBytes
type MapStringToImmutableBytes ¶ added in v1.0.3
func (MapStringToImmutableBytes) GetBytes ¶ added in v1.0.3
func (m MapStringToImmutableBytes) GetBytes(key string) wasmtypes.ScImmutableBytes
type MapStringToMutableBytes ¶ added in v1.0.3
func (MapStringToMutableBytes) Clear ¶ added in v1.0.3
func (m MapStringToMutableBytes) Clear()
func (MapStringToMutableBytes) GetBytes ¶ added in v1.0.3
func (m MapStringToMutableBytes) GetBytes(key string) wasmtypes.ScMutableBytes
type MutableDeployContractParams ¶
func (MutableDeployContractParams) InitParams ¶ added in v1.0.3
func (s MutableDeployContractParams) InitParams() MapStringToMutableBytes
additional params for smart contract init function
func (MutableDeployContractParams) Name ¶
func (s MutableDeployContractParams) Name() wasmtypes.ScMutableString
The name of the contract to be deployed, used to calculate the contract's hname. The hname must be unique among all contract hnames in the chain.
func (MutableDeployContractParams) ProgramHash ¶
func (s MutableDeployContractParams) ProgramHash() wasmtypes.ScMutableHash
hash of blob that has been previously stored in blob contract
type MutableFindContractParams ¶
func (MutableFindContractParams) Hname ¶
func (s MutableFindContractParams) Hname() wasmtypes.ScMutableHname
The smart contract’s Hname
type MutableFindContractResults ¶
func NewMutableFindContractResults ¶ added in v1.0.3
func NewMutableFindContractResults() MutableFindContractResults
func (MutableFindContractResults) ContractFound ¶
func (s MutableFindContractResults) ContractFound() wasmtypes.ScMutableBool
whether the contract exists.
func (MutableFindContractResults) ContractRecData ¶
func (s MutableFindContractResults) ContractRecData() wasmtypes.ScMutableBytes
encoded contract record (if exists)
type MutableGetContractRecordsResults ¶
func NewMutableGetContractRecordsResults ¶ added in v1.0.3
func NewMutableGetContractRecordsResults() MutableGetContractRecordsResults
func (MutableGetContractRecordsResults) ContractRegistry ¶
func (s MutableGetContractRecordsResults) ContractRegistry() MapHnameToMutableBytes
contract records by Hname
type MutableGrantDeployPermissionParams ¶
func (MutableGrantDeployPermissionParams) Deployer ¶
func (s MutableGrantDeployPermissionParams) Deployer() wasmtypes.ScMutableAgentID
agent to grant deploy permission to
type MutableRequireDeployPermissionsParams ¶ added in v0.3.0
func (MutableRequireDeployPermissionsParams) DeployPermissionsEnabled ¶ added in v0.3.0
func (s MutableRequireDeployPermissionsParams) DeployPermissionsEnabled() wasmtypes.ScMutableBool
turns permission check on or off
type MutableRevokeDeployPermissionParams ¶
func (MutableRevokeDeployPermissionParams) Deployer ¶
func (s MutableRevokeDeployPermissionParams) Deployer() wasmtypes.ScMutableAgentID
agent to revoke deploy permission for
type RequireDeployPermissionsCall ¶ added in v0.3.0
type RequireDeployPermissionsCall struct { Func *wasmlib.ScFunc Params MutableRequireDeployPermissionsParams }
type RevokeDeployPermissionCall ¶
type RevokeDeployPermissionCall struct { Func *wasmlib.ScFunc Params MutableRevokeDeployPermissionParams }