Proxy
Calls
addProxy
Register a proxy account for the sender that is able to make calls on its behalf.
The dispatch origin for this call must be Signed.
Parameters:
proxy
: The account that thecaller
would like to make a proxy.proxy_type
: The permissions allowed for this proxy account.delay
: The announcement period required of the initial proxy. Will generally be zero.
Namespace
Type
announce
Publish the hash of a proxy-call that will be made in the future.
This must be called some number of blocks before the corresponding proxy
is attempted if the delay associated with the proxy relationship is greater than zero.
No more than MaxPending
announcements may be made at any one time.
This will take a deposit of AnnouncementDepositFactor
as well as AnnouncementDepositBase
if there are no other pending announcements.
The dispatch origin for this call must be Signed and a proxy of real
.
Parameters:
real
: The account that the proxy will make a call on behalf of.call_hash
: The hash of the call to be made by thereal
account.
Namespace
Type
createPure
Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and initialize it with a proxy of proxy_type
for origin
sender.
Requires a Signed
origin.
proxy_type
: The type of the proxy that the sender will be registered as over the new account. This will almost always be the most permissiveProxyType
possible to allow for maximum flexibility.index
: A disambiguation index, in case this is called multiple times in the same transaction (e.g. withutility::batch
). Unless you're usingbatch
you probably just want to use0
.delay
: The announcement period required of the initial proxy. Will generally be zero.
Fails with Duplicate
if this has already been called in this transaction, from the same sender, with the same parameters.
Fails if there are insufficient funds to pay for deposit.
Namespace
Type
killPure
Removes a previously spawned pure proxy.
WARNING: All access to this account will be lost. Any funds held in it will be inaccessible.
Requires a Signed
origin and the sender account must have been created by a call to pure
with corresponding parameters.
spawner
: The account that was originally calledpure
to create this account.index
: The disambiguation index originally passed topure
. Probably0
.proxy_type
: The proxy type originally passed topure
.height
: The height of the chain when the call topure
was processed.ext_index
: The extrinsic index in which the call topure
was processed.
Fails with NoPermission
in case the caller is not a previously created pure account whose pure
call has corresponding parameters.
Namespace
Type
proxy
Dispatch the given call
from an account that the sender is authorised for through add_proxy
.
Removes any corresponding announcement(s).
The dispatch origin for this call must be Signed.
Parameters:
real
: The account that the proxy will make a call on behalf of.force_proxy_type
: Specify the exact proxy type to be used and checked for this call.call
: The call to be made by thereal
account.
Namespace
Type
proxyAnnounced
Dispatch the given call
from an account that the sender is authorized for through add_proxy
.
Removes any corresponding announcement(s).
The dispatch origin for this call must be Signed.
Parameters:
real
: The account that the proxy will make a call on behalf of.force_proxy_type
: Specify the exact proxy type to be used and checked for this call.call
: The call to be made by thereal
account.
Namespace
Type
rejectAnnouncement
Remove the given announcement of a delegate.
May be called by a target (proxied) account to remove a call that one of their delegates (delegate
) has announced they want to execute. The deposit is returned.
The dispatch origin for this call must be Signed.
Parameters:
delegate
: The account that previously announced the call.call_hash
: The hash of the call to be made.
Namespace
Type
removeAnnouncement
Remove a given announcement.
May be called by a proxy account to remove a call they previously announced and return the deposit.
The dispatch origin for this call must be Signed.
Parameters:
real
: The account that the proxy will make a call on behalf of.call_hash
: The hash of the call to be made by thereal
account.
Namespace
Type
removeProxies
Unregister all proxy accounts for the sender.
The dispatch origin for this call must be Signed.
WARNING: This may be called on accounts created by pure
, however, if done, then the unreserved fees will be inaccessible. All access to this account will be lost.
Namespace
Type
removeProxy
Unregister a proxy account for the sender.
The dispatch origin for this call must be Signed.
Parameters:
proxy
: The account that thecaller
would like to remove as a proxy.proxy_type
: The permissions currently enabled for the removed proxy account.
Namespace
Type
Storage
announcements
The announcements made by the proxy (key).
Namespace
Type
proxies
The set of account proxies. Maps the account which has delegated to the accounts which are being delegated to, together with the amount held on deposit.
Namespace
Type
Events
Announced
An announcement was placed to make a call in the future.
Namespace
Type
ProxyAdded
A proxy was added.
Namespace
Type
ProxyExecuted
A proxy was executed correctly, with the given.
Namespace
Type
ProxyRemoved
A proxy was removed.
Namespace
Type
PureCreated
A pure account has been created by new proxy with given disambiguation index and proxy type.
Namespace
Type
Errors
Duplicate
Account is already a proxy.
Namespace
NoPermission
Call may not be made by proxy because it may escalate its privileges.
Namespace
NoSelfProxy
Cannot add self as proxy.
Namespace
NotFound
Proxy registration not found.
Namespace
NotProxy
Sender is not a proxy of the account to be proxied.
Namespace
TooMany
There are too many proxies registered or too many announcements pending.
Namespace
Unannounced
Announcement, if made at all, was made too recently.
Namespace
Unproxyable
A call which is incompatible with the proxy type's filter was attempted.
Namespace
Constants
announcementDepositBase
The base amount of currency needed to reserve for creating an announcement.
This is held when a new storage item holding a Balance
is created (typically 16 bytes).
Namespace
Type
announcementDepositFactor
The amount of currency needed per announcement made.
This is held for adding an AccountId
, Hash
and BlockNumber
(typically 68 bytes) into a pre-existing storage value.
Namespace
Type
maxPending
The maximum amount of time-delayed announcements that are allowed to be pending.
Namespace
Type
maxProxies
The maximum amount of proxies allowed for a single account.
Namespace
Type
proxyDepositBase
The base amount of currency needed to reserve for creating a proxy.
This is held for an additional storage item whose value size is sizeof(Balance)
bytes and whose key size is sizeof(AccountId)
bytes.
Namespace
Type
proxyDepositFactor
The amount of currency needed per proxy added.
This is held for adding 32 bytes plus an instance of ProxyType
more into a pre-existing storage value. Thus, when configuring ProxyDepositFactor
one should take into account 32 + proxy_type.encode().len()
bytes of data.
Namespace
Type
Last updated