Preimage
Calls
notePreimage
Register a preimage on-chain.
If the preimage was previously requested, no fees or deposits are taken for providing the preimage. Otherwise, a deposit is taken proportional to the size of the preimage.
Namespace
api.tx.preimage.notePreimageType
function notePreimage(
bytes: Bytes
)requestPreimage
Request a preimage be uploaded to the chain without paying any fees or deposits.
If the preimage requests has already been provided on-chain, we unreserve any deposit a user may have paid, and take the control of the preimage out of their hands.
Namespace
api.tx.preimage.requestPreimageType
function requestPreimage(
hash: H256
)unnotePreimage
Clear an unrequested preimage from the runtime storage.
Namespace
api.tx.preimage.unnotePreimageType
function unnotePreimage(
hash: H256
)unrequestPreimage
Clear a previously made request for a preimage.
IMPORTANT: This must not be called onhashmore times thanrequest_preimage.
Namespace
api.tx.preimage.unrequestPreimageType
function unrequestPreimage(
hash: H256
)Storage
preimageFor
The preimages stored by this pallet.
Namespace
api.query.preimage.preimageForType
function preimageFor(
H256
): Option<Bytes>statusFor
The request status of a given hash.
Namespace
api.query.preimage.statusForType
function statusFor(
H256
): Option<PalletPreimageRequestStatus>Events
Cleared
A preimage has ben cleared.
Namespace
api.events.preimage.ClearedType
type Cleared = {
hash: H256
}Noted
A preimage has been noted.
Namespace
api.events.preimage.NotedType
type Noted = {
hash: H256
}Requested
A preimage has been requested.
Namespace
api.events.preimage.RequestedType
type Requested = {
hash: H256
}Errors
AlreadyNoted
Preimage has already been noted on-chain.
Namespace
api.errors.preimage.AlreadyNotedNotAuthorized
The user is not authorized to perform this action.
Namespace
api.errors.preimage.NotAuthorizedNotNoted
The preimage cannot be removed since it has not yet been noted.
Namespace
api.errors.preimage.NotNotedNotRequested
The preimage request cannot be removed since no outstanding requests exist.
Namespace
api.errors.preimage.NotRequestedRequested
A preimage may not be removed when there are outstanding requests.
Namespace
api.errors.preimage.RequestedTooLarge
Preimage is too large to store on-chain.
Namespace
api.errors.preimage.TooLargeundefined