# FuturePass

### Calls

#### create

Create a [FuturePass](https://the-root-network.gitbook.io/intro/learn/glossary) account for the delegator who is able to make calls on behalf of FuturePass.

The dispatch origin for this call must be *Signed*.

Parameters:

* `account`: The delegated account for the FuturePass.

**Namespace**

```
api.tx.futurepass.create
```

**Type**

```typescript
function create(
  account: SeedPrimitivesSignatureAccountId20
)
```

#### migrateEvmFuturepass

This extrinsic migrates EVM-based FuturePass assets to the Substrate-based FuturePass (native).

Parameters:

* `owner` - The account ID of the owner of the EVM-based FuturePass.
* `evm_futurepass` - The account ID of the EVM-based FuturePass.
* `asset_ids` - A vector of asset IDs representing the assets to be migrated.
* `collection_ids` - A vector of collection IDs representing the NFTs collections to be migrated.

**Namespace**

```
api.tx.futurepass.migrateEvmFuturepass
```

**Type**

```typescript
function migrateEvmFuturepass(
  owner: SeedPrimitivesSignatureAccountId20,
  evm_futurepass: SeedPrimitivesSignatureAccountId20,
  asset_ids: Vec<u32>,
  collection_ids: Vec<u32>
)
```

#### proxyExtrinsic

Dispatch the given call through FuturePass account. Transaction fees will be paid by the FuturePass. The dispatch origin for this call must be *Signed*

Parameters:

* `futurepass`: The FuturePass account through which the call is dispatched
* `call`: The Call that needs to be dispatched through the FuturePass account

**Namespace**

```
api.tx.futurepass.proxyExtrinsic
```

**Type**

```typescript
function proxyExtrinsic(
  futurepass: SeedPrimitivesSignatureAccountId20,
  call: Call
)
```

#### registerDelegateWithSignature

Register a delegator to an existing FuturePass account given message parameters for a respective signature.

{% hint style="info" %}
**Note**:&#x20;

* Only FuturePass owner account can add more delegates.&#x20;
* The signer is recovered from the signature given the message parameters (which are used to reconstruct the message).
  {% endhint %}

You can assume the message is constructed like so:

\--- `solidity bytes32 message = keccak256(abi.encodePacked(futurepass, delegate, proxyType, deadline)); ethSignedMessage = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", message));`

***

The dispatch origin for this call must be *Signed*.

Parameters:

* `futurepass`: FuturePass account to register the account as delegate; 20 bytes.
* `delegate`: The delegated account for the futurepass; 20 bytes.
* `proxy_type`: Delegate permission level; 1 byte.
* `deadline`: Deadline for the signature; 4 bytes.
* `signature`: Signature of the message parameters.

**Namespace**

```
api.tx.futurepass.registerDelegateWithSignature
```

**Type**

```typescript
function registerDelegateWithSignature(
  futurepass: SeedPrimitivesSignatureAccountId20,
  delegate: SeedPrimitivesSignatureAccountId20,
  proxy_type: SeedRuntimeImplsProxyType,
  deadline: u32,
  signature: [u8;65]
)
```

#### setFuturepassMigrator

Update FuturePass native assets migrator admin account.

The dispatch origin for this call must be sudo/root origin.

Parameters:

* `migrator`: The new account that will become the FuturePass asset migrator.

**Namespace**

```
api.tx.futurepass.setFuturepassMigrator
```

**Type**

```typescript
function setFuturepassMigrator(
  migrator: SeedPrimitivesSignatureAccountId20
)
```

#### transferFuturepass

Transfer ownership of a FuturePass to a new account. The new owner must not already own a FuturePass. This removes all delegates from the FuturePass. The new owner will be the only delegate; they can add more delegates.

The dispatch origin for this call must be *Signed* and must be the current owner of the FuturePass.

Parameters:

* `current_owner`: The current owner of the FuturePass.
* `new_owner`: The new account that will become the owner of the FuturePass.

**Namespace**

```
api.tx.futurepass.transferFuturepass
```

**Type**

```typescript
function transferFuturepass(
  current_owner: SeedPrimitivesSignatureAccountId20,
  new_owner: Option<SeedPrimitivesSignatureAccountId20>
)
```

#### unregisterDelegate

Unregister a delegate from a FuturePass account.

The dispatch origin for this call must be *Signed*.

Parameters:

* `futurepass`: FuturePass account to unregister the delegate from.
* `delegate`: The delegated account for the FuturePass.&#x20;

{% hint style="info" %}
**Note**: If the caller is the FuturePass holder (owner), they can remove any delegate, including themselves. However, if the caller is not the owner, they must be the delegate and can only remove themselves.
{% endhint %}

**Namespace**

```
api.tx.futurepass.unregisterDelegate
```

**Type**

```typescript
function unregisterDelegate(
  futurepass: SeedPrimitivesSignatureAccountId20,
  delegate: SeedPrimitivesSignatureAccountId20
)
```

### Storage

#### defaultProxy

Accounts which have set FuturePass as default proxied on-chain account (delegate -> FuturePass)

**Namespace**

```
api.query.futurepass.defaultProxy
```

**Type**

```typescript
function defaultProxy(
  SeedPrimitivesSignatureAccountId20
): Option<SeedPrimitivesSignatureAccountId20>
```

#### holders

FuturePass holders (account -> futurepass)

**Namespace**

```
api.query.futurepass.holders
```

**Type**

```typescript
function holders(
  SeedPrimitivesSignatureAccountId20
): Option<SeedPrimitivesSignatureAccountId20>
```

#### migrationAdmin

Migration data for the user (root) and collections they can migrate

**Namespace**

```
api.query.futurepass.migrationAdmin
```

**Type**

```typescript
function migrationAdmin(

): Option<SeedPrimitivesSignatureAccountId20>
```

#### nextFuturepassId

The next available incrementing futurepass id

**Namespace**

```
api.query.futurepass.nextFuturepassId
```

**Type**

```typescript
function nextFuturepassId(

): u128
```

### Events

#### DefaultFuturepassSet

FuturePass set as default proxy

**Namespace**

```
api.events.futurepass.DefaultFuturepassSet
```

**Type**

```typescript
type DefaultFuturepassSet = {
  delegate: SeedPrimitivesSignatureAccountId20,
  futurepass: Option<SeedPrimitivesSignatureAccountId20>
}
```

#### DelegateRegistered

Delegate registration to FuturePass account

**Namespace**

```
api.events.futurepass.DelegateRegistered
```

**Type**

```typescript
type DelegateRegistered = {
  futurepass: SeedPrimitivesSignatureAccountId20,
  delegate: SeedPrimitivesSignatureAccountId20,
  proxy_type: SeedRuntimeImplsProxyType
}
```

#### DelegateUnregistered

Delegate unregistration from FuturePass account

**Namespace**

```
api.events.futurepass.DelegateUnregistered
```

**Type**

```typescript
type DelegateUnregistered = {
  futurepass: SeedPrimitivesSignatureAccountId20,
  delegate: SeedPrimitivesSignatureAccountId20
}
```

#### FuturepassAssetsMigrated

Migration of FuturePass assets

**Namespace**

```
api.events.futurepass.FuturepassAssetsMigrated
```

**Type**

```typescript
type FuturepassAssetsMigrated = {
  evm_futurepass: SeedPrimitivesSignatureAccountId20,
  futurepass: SeedPrimitivesSignatureAccountId20,
  assets: Vec<u32>,
  collections: Vec<u32>
}
```

#### FuturepassCreated

FuturePass creation

**Namespace**

```
api.events.futurepass.FuturepassCreated
```

**Type**

```typescript
type FuturepassCreated = {
  futurepass: SeedPrimitivesSignatureAccountId20,
  delegate: SeedPrimitivesSignatureAccountId20
}
```

#### FuturepassMigratorSet

Updating FuturePass migrator account

**Namespace**

```
api.events.futurepass.FuturepassMigratorSet
```

**Type**

```typescript
type FuturepassMigratorSet = {
  migrator: SeedPrimitivesSignatureAccountId20
}
```

#### FuturepassTransferred

FuturePass transfer

**Namespace**

```
api.events.futurepass.FuturepassTransferred
```

**Type**

```typescript
type FuturepassTransferred = {
  old_owner: SeedPrimitivesSignatureAccountId20,
  new_owner: Option<SeedPrimitivesSignatureAccountId20>,
  futurepass: SeedPrimitivesSignatureAccountId20
}
```

#### ProxyExecuted

A proxy call was executed with the given call

**Namespace**

```
api.events.futurepass.ProxyExecuted
```

**Type**

```typescript
type ProxyExecuted = {
  delegate: SeedPrimitivesSignatureAccountId20,
  result: Result<Null, SpRuntimeDispatchError>
}
```

### Errors

#### AccountAlreadyRegistered

Account is already FuturePass holder

**Namespace**

```
api.errors.futurepass.AccountAlreadyRegistered
```

#### AccountParsingFailure

AccountParsingFailure

**Namespace**

```
api.errors.futurepass.AccountParsingFailure
```

#### DelegateAlreadyExists

Account already exists as a delegate

**Namespace**

```
api.errors.futurepass.DelegateAlreadyExists
```

#### DelegateNotRegistered

Account is not FuturePass delegate

**Namespace**

```
api.errors.futurepass.DelegateNotRegistered
```

#### ExpiredDeadline

ExpiredDeadline

**Namespace**

```
api.errors.futurepass.ExpiredDeadline
```

#### InvalidDeadline

Invalid deadline

**Namespace**

```
api.errors.futurepass.InvalidDeadline
```

#### InvalidProxyType

Invalid proxy type

**Namespace**

```
api.errors.futurepass.InvalidProxyType
```

#### InvalidSignature

Invalid signature

**Namespace**

```
api.errors.futurepass.InvalidSignature
```

#### MigratorNotSet

FuturePass migrator admin account is not set

**Namespace**

```
api.errors.futurepass.MigratorNotSet
```

#### NotFuturepassOwner

Account is not FuturePass owner

**Namespace**

```
api.errors.futurepass.NotFuturepassOwner
```

#### OwnerCannotUnregister

FuturePass owner cannot remove themselves

**Namespace**

```
api.errors.futurepass.OwnerCannotUnregister
```

#### PermissionDenied

Account does not have permission to call this function

**Namespace**

```
api.errors.futurepass.PermissionDenied
```

#### RegisterDelegateSignerMismatch

RegisterDelegateSignerMismatch

**Namespace**

```
api.errors.futurepass.RegisterDelegateSignerMismatch
```

undefined
