Skip to main content

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 the caller 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

api.tx.proxy.addProxy

Type

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 the real account.

Namespace

api.tx.proxy.announce

Type

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 permissive ProxyType possible to allow for maximum flexibility.

  • index: A disambiguation index, in case this is called multiple times in the same transaction (e.g. with utility::batch). Unless you're using batch you probably just want to use 0.

  • 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.createPure

Type

function createPure(
proxy_type: SeedRuntimeImplsProxyType,
delay: u32,
index: u16
)

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 originally called pure to create this account.

  • index: The disambiguation index originally passed to pure. Probably 0.

  • proxy_type: The proxy type originally passed to pure.

  • height: The height of the chain when the call to pure was processed.

  • ext_index: The extrinsic index in which the call to pure was 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.killPure

Type

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 the real account.

Namespace

api.tx.proxy.proxy

Type

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 the real account.

Namespace

api.tx.proxy.proxyAnnounced

Type

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.rejectAnnouncement

Type

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 the real account.

Namespace

api.tx.proxy.removeAnnouncement

Type

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: 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.removeProxies

Type

function removeProxies(

)

removeProxy

Unregister a proxy account for the sender.

The dispatch origin for this call must be Signed.

Parameters:

  • proxy: The account that the caller would like to remove as a proxy.

  • proxy_type: The permissions currently enabled for the removed proxy account.

Namespace

api.tx.proxy.removeProxy

Type

function removeProxy(
delegate: SeedPrimitivesSignatureAccountId20,
proxy_type: SeedRuntimeImplsProxyType,
delay: u32
)

Storage

announcements

The announcements made by the proxy (key).

Namespace

api.query.proxy.announcements

Type

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.proxies

Type

function proxies(
SeedPrimitivesSignatureAccountId20
): (Vec<PalletProxyProxyDefinition>,u128)

Events

Announced

An announcement was placed to make a call in the future.

Namespace

api.events.proxy.Announced

Type

type Announced = {
real: SeedPrimitivesSignatureAccountId20,
proxy: SeedPrimitivesSignatureAccountId20,
call_hash: H256
}

ProxyAdded

A proxy was added.

Namespace

api.events.proxy.ProxyAdded

Type

type ProxyAdded = {
delegator: SeedPrimitivesSignatureAccountId20,
delegatee: SeedPrimitivesSignatureAccountId20,
proxy_type: SeedRuntimeImplsProxyType,
delay: u32
}

ProxyExecuted

A proxy was executed correctly, with the given.

Namespace

api.events.proxy.ProxyExecuted

Type

type ProxyExecuted = {
result: Result<Null, SpRuntimeDispatchError>
}

ProxyRemoved

A proxy was removed.

Namespace

api.events.proxy.ProxyRemoved

Type

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.PureCreated

Type

type PureCreated = {
pure: SeedPrimitivesSignatureAccountId20,
who: SeedPrimitivesSignatureAccountId20,
proxy_type: SeedRuntimeImplsProxyType,
disambiguation_index: u16
}

Errors

Duplicate

Account is already a proxy.

Namespace

api.errors.proxy.Duplicate

NoPermission

Call may not be made by proxy because it may escalate its privileges.

Namespace

api.errors.proxy.NoPermission

NoSelfProxy

Cannot add self as proxy.

Namespace

api.errors.proxy.NoSelfProxy

NotFound

Proxy registration not found.

Namespace

api.errors.proxy.NotFound

NotProxy

Sender is not a proxy of the account to be proxied.

Namespace

api.errors.proxy.NotProxy

TooMany

There are too many proxies registered or too many announcements pending.

Namespace

api.errors.proxy.TooMany

Unannounced

Announcement, if made at all, was made too recently.

Namespace

api.errors.proxy.Unannounced

Unproxyable

A call which is incompatible with the proxy type's filter was attempted.

Namespace

api.errors.proxy.Unproxyable

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

api.consts.proxy.announcementDepositBase

Type

type announcementDepositBase = u128

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

api.consts.proxy.announcementDepositFactor

Type

type announcementDepositFactor = u128

maxPending

The maximum amount of time-delayed announcements that are allowed to be pending.

Namespace

api.consts.proxy.maxPending

Type

type maxPending = u32

maxProxies

The maximum amount of proxies allowed for a single account.

Namespace

api.consts.proxy.maxProxies

Type

type maxProxies = u32

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

api.consts.proxy.proxyDepositBase

Type

type proxyDepositBase = u128

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

api.consts.proxy.proxyDepositFactor

Type

type proxyDepositFactor = u128