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 thecallerwould 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
api.tx.proxy.addProxyType
function addProxy(
delegate: SeedPrimitivesSignatureAccountId20,
proxy_type: SeedRuntimeImplsProxyType,
delay: u32
)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 therealaccount.
Namespace
api.tx.proxy.announceType
function announce(
real: SeedPrimitivesSignatureAccountId20,
call_hash: H256
)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 permissiveProxyTypepossible 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 usingbatchyou 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
api.tx.proxy.createPureType
function createPure(
proxy_type: SeedRuntimeImplsProxyType,
delay: u32,
index: u16
)killPure
Removes a previously spawned pure proxy.
WARNING
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 calledpureto 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 topurewas processed.ext_index: The extrinsic index in which the call topurewas processed.
Fails with NoPermission in case the caller is not a previously created pure account whose pure call has corresponding parameters.
Namespace
api.tx.proxy.killPureType
function killPure(
spawner: SeedPrimitivesSignatureAccountId20,
proxy_type: SeedRuntimeImplsProxyType,
index: u16,
height: Compact<u32>,
ext_index: Compact<u32>
)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 therealaccount.
Namespace
api.tx.proxy.proxyType
function proxy(
real: SeedPrimitivesSignatureAccountId20,
force_proxy_type: Option<SeedRuntimeImplsProxyType>,
call: Call
)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 therealaccount.
Namespace
api.tx.proxy.proxyAnnouncedType
function proxyAnnounced(
delegate: SeedPrimitivesSignatureAccountId20,
real: SeedPrimitivesSignatureAccountId20,
force_proxy_type: Option<SeedRuntimeImplsProxyType>,
call: Call
)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
api.tx.proxy.rejectAnnouncementType
function rejectAnnouncement(
delegate: SeedPrimitivesSignatureAccountId20,
call_hash: H256
)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 therealaccount.
Namespace
api.tx.proxy.removeAnnouncementType
function removeAnnouncement(
real: SeedPrimitivesSignatureAccountId20,
call_hash: H256
)removeProxies
Unregister all proxy accounts for the sender.
The dispatch origin for this call must be Signed.
WARNING
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
api.tx.proxy.removeProxiesType
function removeProxies(
)removeProxy
Unregister a proxy account for the sender.
The dispatch origin for this call must be Signed.
Parameters:
proxy: The account that thecallerwould like to remove as a proxy.proxy_type: The permissions currently enabled for the removed proxy account.
Namespace
api.tx.proxy.removeProxyType
function removeProxy(
delegate: SeedPrimitivesSignatureAccountId20,
proxy_type: SeedRuntimeImplsProxyType,
delay: u32
)Storage
announcements
The announcements made by the proxy (key).
Namespace
api.query.proxy.announcementsType
function announcements(
SeedPrimitivesSignatureAccountId20
): (Vec<PalletProxyAnnouncement>,u128)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
api.query.proxy.proxiesType
function proxies(
SeedPrimitivesSignatureAccountId20
): (Vec<PalletProxyProxyDefinition>,u128)Events
Announced
An announcement was placed to make a call in the future.
Namespace
api.events.proxy.AnnouncedType
type Announced = {
real: SeedPrimitivesSignatureAccountId20,
proxy: SeedPrimitivesSignatureAccountId20,
call_hash: H256
}ProxyAdded
A proxy was added.
Namespace
api.events.proxy.ProxyAddedType
type ProxyAdded = {
delegator: SeedPrimitivesSignatureAccountId20,
delegatee: SeedPrimitivesSignatureAccountId20,
proxy_type: SeedRuntimeImplsProxyType,
delay: u32
}ProxyExecuted
A proxy was executed correctly, with the given.
Namespace
api.events.proxy.ProxyExecutedType
type ProxyExecuted = {
result: Result<Null, SpRuntimeDispatchError>
}ProxyRemoved
A proxy was removed.
Namespace
api.events.proxy.ProxyRemovedType
type ProxyRemoved = {
delegator: SeedPrimitivesSignatureAccountId20,
delegatee: SeedPrimitivesSignatureAccountId20,
proxy_type: SeedRuntimeImplsProxyType,
delay: u32
}PureCreated
A pure account has been created by new proxy with given disambiguation index and proxy type.
Namespace
api.events.proxy.PureCreatedType
type PureCreated = {
pure: SeedPrimitivesSignatureAccountId20,
who: SeedPrimitivesSignatureAccountId20,
proxy_type: SeedRuntimeImplsProxyType,
disambiguation_index: u16
}Errors
Duplicate
Account is already a proxy.
Namespace
api.errors.proxy.DuplicateNoPermission
Call may not be made by proxy because it may escalate its privileges.
Namespace
api.errors.proxy.NoPermissionNoSelfProxy
Cannot add self as proxy.
Namespace
api.errors.proxy.NoSelfProxyNotFound
Proxy registration not found.
Namespace
api.errors.proxy.NotFoundNotProxy
Sender is not a proxy of the account to be proxied.
Namespace
api.errors.proxy.NotProxyTooMany
There are too many proxies registered or too many announcements pending.
Namespace
api.errors.proxy.TooManyUnannounced
Announcement, if made at all, was made too recently.
Namespace
api.errors.proxy.UnannouncedUnproxyable
A call which is incompatible with the proxy type's filter was attempted.
Namespace
api.errors.proxy.UnproxyableConstants
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
api.consts.proxy.announcementDepositBaseType
type announcementDepositBase = u128announcementDepositFactor
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
api.consts.proxy.announcementDepositFactorType
type announcementDepositFactor = u128maxPending
The maximum amount of time-delayed announcements that are allowed to be pending.
Namespace
api.consts.proxy.maxPendingType
type maxPending = u32maxProxies
The maximum amount of proxies allowed for a single account.
Namespace
api.consts.proxy.maxProxiesType
type maxProxies = u32proxyDepositBase
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
api.consts.proxy.proxyDepositBaseType
type proxyDepositBase = u128proxyDepositFactor
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
api.consts.proxy.proxyDepositFactorType
type proxyDepositFactor = u128