---
updatedAt: 2025-05-19T20:52:13.000Z
agentTools:
  projectIndex: https://docs.arianee.org/llms.txt
---

# Create & Manage Digital Passport

Methods related to digital passports management.

## Reserve Digital Passport

> ⚠️
>
> Your wallet must own at least 1 `certificate` credit. The credit is spent once the digital passport has been minted and claimed by another wallet.

#### Method

```javascript Method
creator.reserveSmartAssetId(smartAssetId?, overrideTransaction?:NonPayableOverrides)
```

<Table>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Required
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `smartAssetId`
      </td>

      <td>
        Number
      </td>

      <td>
        ❌
      </td>

      <td>
        If ID defined → Checked if ID is free.\
        If ID undefined → Get a free ID.
      </td>
    </tr>

    <tr>
      <td>
        `overrides`
      </td>

      <td>
        `gasPrice`, `gasLimit`, `maxFeePerGas`, `maxPriorityPerGas`
      </td>

      <td>
         ❌
      </td>

      <td>
        Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed.
      </td>
    </tr>
  </tbody>
</Table>

#### Return Payload

`promise` returns reserved `smartAssetId` is returned.

***

## Check if a digital passport ID is available for reservation or creation

Method to check if the passed digital passport ID is available.

#### Method

```javascript Method
creator.isSmartAssetIdAvailable(id)
```

| Parameter | Type   | Required | Description                                           |
| --------- | ------ | -------- | ----------------------------------------------------- |
| `id`      | String | ✅        | Digital passport identification number to be checked. |

#### Return Payload

`promise` returns `boolean`.

| Boolean | Description                                 |
| :------ | :------------------------------------------ |
| `true`  | ID available.                               |
| `false` | ID is already linked to a digital passport. |

***

## Get a random available ID

### Smart Asset

#### Method

```javascript Method
creator.getAvailableSmartAssetId()
```

#### Return Payload

`promise` returns `number` corresponding to the `smarAssetId`.

### All types

#### Method

```javascript Method
creator.getAvailableId(idType)
```

| Parameter | Type                             | Required | Description          |
| :-------- | :------------------------------- | :------- | :------------------- |
| `idType`  | `smartAsset`, `message`, `event` | ✅        | Type of ID required. |

#### Return Payload

`promise` returns `number` corresponding to the `id`.

***

## Create & Hydrate Digital Passport

Create a digital passport and store its content on the [Arianee Privacy Gateway](https://docs.arianee.org/docs/updated-arianee-privacy-gateway-copy).

#### Method

```javascript Method
creator.createAndStoreSmartAsset(data:hydrateTokenParameters, overrideTransaction?:NonPayableOverrides)
```

**Option 1 → You have a registered & verified identity:**

<Table>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Required
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `smartAssetId`
      </td>

      <td>
        Number
      </td>

      <td>
        ❌
      </td>

      <td>
        Digital passport identitication number.
      </td>
    </tr>

    <tr>
      <td>
        `tokenAccess`
      </td>

      <td>
        String
      </td>

      <td>
        ❌
      </td>

      <td>
        Wallet address generated through the passphrase.
      </td>
    </tr>

    <tr>
      <td>
        `tokenRecoveryTimestamp`
      </td>

      <td>
        Number
      </td>

      <td>
        ❌
      </td>

      <td>
        Period during which the digital passport can be recovered by its issuer.\
        Default value if empty: 5 years.
      </td>
    </tr>

    <tr>
      <td>
        `sameRequestOwnershipPassphrase`
      </td>

      <td>
        Boolean
      </td>

      <td>
        ❌
      </td>

      <td>
        `true`: Transferable digital passport\
        `false`: Non-transferable digital passport
      </td>
    </tr>

    <tr>
      <td>
        `content`
      </td>

      <td>
        Object
      </td>

      <td>
        ✅
      </td>

      <td>
        Content mandatory if no `uri` and `imprint`.
      </td>
    </tr>

    <tr>
      <td>
        `uri`
      </td>

      <td>
        String
      </td>

      <td>
        ✅
      </td>

      <td>
        Digital passport uri. Mandatory with `imprint` if no `content`.
      </td>
    </tr>

    <tr>
      <td>
        `imprint`
      </td>

      <td>
        String
      </td>

      <td>
        ✅
      </td>

      <td>
        Digital passport imprint. Mandatory with `uri` if no `content`.
      </td>
    </tr>

    <tr>
      <td>
        `overrides`
      </td>

      <td>
        `gasPrice`, `gasLimit`, `maxFeePerGas`, `maxPriorityPerGas`
      </td>

      <td>
        ❌
      </td>

      <td>
        Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed.
      </td>
    </tr>
  </tbody>
</Table>

**Option 2 → You have not a registered & verified identity:**

| Parameter | Type   | Required | Description           |
| --------- | ------ | -------- | --------------------- |
| `uri`     | String | ✅        | Digital passport uri. |

#### Return Payload

`promise` returns `LinkObject`. The digital passport has been created, as well as the `deeplink`, `smartAssetId` and `passphrase`.

```json Example
{
	deeplink:"https://test.arianee.net/440105186,v6lsj4vhg5dx", // except if address was provided instead of passphrase
	smartAssetId:"440105186",
	passphrase:"v6lsj4vhg5dx" // except if address was provided instead of passphrase
}
```

#### Errors

| Error type                           | Description                                                                                                       |
| :----------------------------------- | :---------------------------------------------------------------------------------------------------------------- |
| `UnavailableSmartAssetIdError`       | The digital passport identification number is not available.                                                      |
| `InsufficientSmartAssetCreditsError` | The core address does not have enough smart asset credits.                                                        |
| `NoIdentityError`                    | The core address does not have an identity URI.                                                                   |
| `ArianeePrivacyGatewayError`         | An error occurred while interacting with the [Arianee Privacy Gateway](https://docs.arianee.org/docs/updated-arianee-privacy-gateway-copy). |

***

## Create digital passport without content storing

Create a digital passport without storing the content on the Arianee Privacy Gateway.

#### Method - For test purposes only

```javascript Method
creator.createSmartAsset(smartAssetId, overrideTransaction?:NonPayableOverrides) 
```

<Table>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Required
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `smartAssetId`
      </td>

      <td>
        Number
      </td>

      <td>
        ❌
      </td>

      <td>
        Digital passport identification number.
      </td>
    </tr>

    <tr>
      <td>
        `tokenAccess`
      </td>

      <td>
        String
      </td>

      <td>
        ❌
      </td>

      <td>
        Wallet address generated through the passphrase.
      </td>
    </tr>

    <tr>
      <td>
        `tokenRecoveryTimestamp`
      </td>

      <td>
        Number
      </td>

      <td>
        ❌
      </td>

      <td>
        Period during which the digital passport can be recovered by its issuer.\
        Default value if empty: 5 years.
      </td>
    </tr>

    <tr>
      <td>
        `sameRequestOwnershipPassphrase`
      </td>

      <td>
        Boolean
      </td>

      <td>
        ❌
      </td>

      <td>
        `true`: Transferable digital passport\
        `false`: Non-transferable digital passport
      </td>
    </tr>

    <tr>
      <td>
        `content`
      </td>

      <td>
        Object
      </td>

      <td>
        ✅
      </td>

      <td>
        Content mandatory if no `uri` and `imprint`.
      </td>
    </tr>

    <tr>
      <td>
        `uri`
      </td>

      <td>
        String
      </td>

      <td>
        ✅
      </td>

      <td>
        Digital passport uri. Mandatory with `imprint` if no `content`.
      </td>
    </tr>

    <tr>
      <td>
        `overrides`
      </td>

      <td>
        `gasPrice`, `gasLimit`, `maxFeePerGas`, `maxPriorityPerGas`
      </td>

      <td>
        ❌
      </td>

      <td>
        Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed.
      </td>
    </tr>
  </tbody>
</Table>

#### Return Payload

`promise` returns `LinkObject`. The digital passport has been created, as well as the `deeplink`, `smartAssetId` and `passphrase`.

```json Example
{
	deeplink:"https://test.arianee.net/440105186,v6lsj4vhg5dx", 
	smartAssetId:"440105186",
	passphrase:"v6lsj4vhg5dx"
}
```

#### Errors

| Error type                           | Description                                                  |
| :----------------------------------- | :----------------------------------------------------------- |
| `UnavailableSmartAssetIdError`       | The digital passport identification number is not available. |
| `InsufficientSmartAssetCreditsError` | The core address does not have enough smart asset credits.   |

***

## Recover digital passport

The digital passport issuer can <Glossary>recover</Glossary> a distributed digital passport, in other words, the issuer gets back the ownership of the digital passport.

> ⚠️
>
> * The wallet must be the digital passport issuer.
> * The `tokenRecoveryTimestamp` must not be outdated.

#### Method

```javascript Method
creator.recoverSmartAsset(id, overrideTransaction?:NonPayableOverrides) 
```

| Parameter   | Type                                                        | Required | Description                                                                                                  |
| ----------- | ----------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `id`        | Number                                                      | ✅        | ID of the digital passport to recover.                                                                       |
| `overrides` | `gasPrice`, `gasLimit`, `maxFeePerGas`, `maxPriorityPerGas` | ❌        | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |

#### Return Payload

The receipt of the transaction is returned.

***

## Destroy digital passport

> ⚠️
>
> The destroy process transfers the given digital passport ID to the wallet address `0x000000000000000000000000000000000000dead`.

#### Method

```javascript Method
creator.destroySmartAsset(id, overrideTransaction?:NonPayableOverrides)
```

| Parameter   | Type                                                        | Required | Description                                                                                                  |
| ----------- | ----------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `id`        | String                                                      | ✅        | ID of the digital passport to destroy.                                                                       |
| `overrides` | `gasPrice`, `gasLimit`, `maxFeePerGas`, `maxPriorityPerGas` | ❌        | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |

#### Return Payload

The receipt of the transaction is returned.

***

## Set token access

Method to set the token access,`requestKey`or`viewKey`, of a smart asset owned by the core wallet address.

#### Method

```javascript Method
creator.setTokenAccess(smartAssetId, tokenAccessType, tokenAccess?, overrrides?)
```

| Parameter         | Type                                                        | Required | Description                                                                                                  |
| :---------------- | :---------------------------------------------------------- | :------- | :----------------------------------------------------------------------------------------------------------- |
| `smartAssetId`    | Number                                                      | ✅        | Arianee token ID of the digital passport.                                                                    |
| `tokenAccessType` | - `0 `- `viewKey` - `1` - `requestKey`                      | ✅        | Type of key.                                                                                                 |
| `tokenAccess`     | String                                                      | ❌        | Wallet address generated through the passphrase.                                                             |
| `overrrides`      | `gasPrice`, `gasLimit`, `maxFeePerGas`, `maxPriorityPerGas` | ❌        | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |

#### Return Payload

The token type has been set on the given `smartAssetId`.

#### Error

| Error type   | Description                                                       |
| :----------- | :---------------------------------------------------------------- |
| `NotOwnerOf` | The core wallet address is not the owner of the digital passport. |

***

## Set request key

Method to set the `requestKey` of a smart asset owned by the core wallet address.

#### Method

```javascript Method
creator.setRequestKey(smartAssetId, tokenAccess?, overrrides?)
```

| Parameter      | Type                                                        | Required | Description                                                                                                  |
| :------------- | :---------------------------------------------------------- | :------- | :----------------------------------------------------------------------------------------------------------- |
| `smartAssetId` | Number                                                      | ✅        | Arianee token ID of the digital passport.                                                                    |
| `tokenAccess`  | String                                                      | ❌        | Wallet address generated through the passphrase.                                                             |
| `overrrides`   | `gasPrice`, `gasLimit`, `maxFeePerGas`, `maxPriorityPerGas` | ❌        | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |

#### Return Payload

The `requestKey` is set on the given `smartAssetId`.

#### Errors

| Error type   | Description                                                       |
| :----------- | :---------------------------------------------------------------- |
| `NotOwnerOf` | The core wallet address is not the owner of the digital passport. |

***

## Update token URI

#### Method

```javascript Method
creator.updateTokenURI(smartAssetId, uri, overrides)
```

| Parameter      | Type                                                        | Required | Description                                                                                                  |
| :------------- | :---------------------------------------------------------- | :------- | :----------------------------------------------------------------------------------------------------------- |
| `smartAssetId` | Number                                                      | ✅        | Arianee token ID of the digital passport.                                                                    |
| `uri`          | String                                                      | ✅        | Digital passport uri.                                                                                        |
| `overrrides`   | `gasPrice`, `gasLimit`, `maxFeePerGas`, `maxPriorityPerGas` | ❌        | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |

#### Return Payload

The token URI is updated.

#### Errors

| Error type        | Description                                                   |
| :---------------- | :------------------------------------------------------------ |
| `NotIssuerError`  | The wallet core address is not the issuer of the smart asset. |
| `InvalidURIError` | The uri is not valid.                                         |

***

## Update digital passport

Update the content of a digital passport in the [Arianee Privacy Gateway](https://docs.arianee.org/docs/updated-arianee-privacy-gateway-copy) and update its imprint on-chain. Returns the imprint of the new content.

> ⚠️
>
> The wallet core address requires an Identity URI.

#### Method

```javascript Method
creator.updateSmartAsset(smartAssetId, content, overrides)
```

| Parameter      | Type                                                        | Required | Description                                                                                                  |
| :------------- | :---------------------------------------------------------- | :------- | :----------------------------------------------------------------------------------------------------------- |
| `smartAssetId` | Number                                                      | ✅        | Arianee token ID of the digital passport.                                                                    |
| `content`      | Object                                                      | ✅        | Content of the digital passport.                                                                             |
| `overrrides`   | `gasPrice`, `gasLimit`, `maxFeePerGas`, `maxPriorityPerGas` | ❌        | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |

#### Return Payload

The digital passport has been updated.

#### Errors

| Error type                       | Description                                                                                                       |
| :------------------------------- | :---------------------------------------------------------------------------------------------------------------- |
| `InsufficientUpdateCreditsError` | The wallet core address does not have enough update credits.                                                      |
| `NoIdentityError`                | The wallet core address does not have an identity URI.                                                            |
| `ArianeePrivacyGatewayError`     | An error occurred while interacting with the [Arianee Privacy Gateway](https://docs.arianee.org/docs/updated-arianee-privacy-gateway-copy). |

***

## Fetch digital passport owner

Retrieve the owner of a given digital passport.

#### Method

```javascript Method
creator.getSmartAssetOwner(id)
```

| Parameter | Type   | Required | Description                               |
| :-------- | :----- | :------- | :---------------------------------------- |
| `id`      | Number | ✅        | Arianee token ID of the digital passport. |

#### Return Payload

`promise` returns `string` corresponding to the wallet owner.

***

## Fetch digital passport issuer

Retrieve the issuer of a given digital passport.

#### Method

```javascript Method
creator.getSmartAssetIssuer(id: string)
```

| Parameter | Type   | Required | Description                               |
| :-------- | :----- | :------- | :---------------------------------------- |
| `id`      | Number | ✅        | Arianee token ID of the digital passport. |

#### Return Payload

`promise` returns `string` corresponding to the digital passport wallet issuer.