You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
results=`\n\n===Error===\n\n${JSON.stringify(tx.result.meta.TransactionResult,null,2)}: Check codes at https://xrpl.org/docs/references/protocol/transactions/types/permissioneddomainset#error-cases`
67
68
}
68
-
}else{
69
-
results=`\n\n===Error===\n\n${JSON.stringify(tx.result.meta.TransactionResult,null,2)}: Check codes at https://xrpl.org/docs/references/protocol/transactions/types/permissioneddomainset#error-cases`
description: Create a permissioned domain to restrict access to financial services that meet compliance requirements.
4
+
labels:
5
+
- Decentralized Finance
6
+
- Permissioned Domains
7
+
---
8
+
# Create Permissioned Domains
9
+
10
+
Permissioned domains are controlled environments within the broader ecosystem of the XRP Ledger blockchain. Domains restrict access to other features such as Permissioned DEXes and Lending Protocols, only allowing access to them for accounts with specific credentials.
11
+
12
+
This example shows how to:
13
+
14
+
1. Issue a credential to an account.
15
+
2. Create a permissioned domain with the issued credential.
16
+
3. Delete the permissioned domain.
17
+
18
+
[](/docs/img/create-permissioned-domain-1.png)
19
+
20
+
Download the [Modular Tutorials](https://github.com/XRPLF/xrpl-dev-portal/tree/master/_code-samples/modular-tutorials/) folder.
21
+
22
+
{% admonition type="info" name="Note" %}
23
+
Without the Modular Tutorial Samples, you will not be able to try the examples that follow.
24
+
{% /admonition %}
25
+
26
+
## Get Accounts
27
+
28
+
To get test accounts:
29
+
30
+
1. Open `create-permissioned-domains.html` in a browser.
31
+
2. Get test accounts.
32
+
- If you copied the gathered information from another tutorial:
33
+
1. Paste the gathered information to the **Result** field.
34
+
2. Click **Distribute Account Info**.
35
+
- If you have an existing account seed:
36
+
1. Paste the account seed to the **Account 1 Seed** or **Account 2 Seed** field.
37
+
2. Click **Get Account 1 from Seed** or **Get Account 2 from Seed**.
Gather the issuer information, subject, and credential type. Convert the credential type value to a hex string if not already in hex. Wrap the code in a `try-catch` block to handle errors.
Gather issuer information, credential type, and domain ID. Format the transaction depending on if the optional domain ID field is included. Wrap the code in a `try-catch` block to handle errors.
Submit the `PermissionedDomainSet` transaction and report the results. The metadata is formed differently if a domain ID was included; parse the response accordingly.
0 commit comments