Skip to content

domain.create()

[Source]

Create a new permissioned domain.

Signature

domain.create(
  params: DomainCreateParams,
  options?: DomainWriteOptions,
): Promise<SubmissionResult<DomainIntent>>

Parameters

ParameterTypeRequiredDescription
credListAcceptedCredential[]YesThe credentials the domain accepts (at least one).

Each AcceptedCredential is:

FieldTypeRequiredDescription
issuerstringYesThe issuer r-address.
credTypestringYesThe credential type, as a plain string (hex-encoded on the ledger).

Options

options is an optional second argument that sets the source account and overrides the fee.

OptionTypeRequiredDescription
fromAccountSelectorNoThe account to act as — an r-address string, or an object { address } or { signer, account? }. Defaults to the primary signer's primary account. (For IOU operations, this is the issuer.)
feeFeeIntentNoFee override — a priority tier and/or a maxFeeDrops cap.
idempotencyKeystringNoA prior submission's idempotencyKey, to retry to the same intent instead of creating a duplicate. Auto-generated when omitted.

Returns

Resolves to a SubmissionResult<DomainIntent>.

Every simpleXRPL write resolves to a SubmissionResult<T> — a union tagged by source, with the backend's raw response preserved verbatim. Its common fields are:

FieldTypeDescription
intentTThe operation-specific output — see the operation's own return fields.
source'xrpld' | 'custody' | 'palisade'Which backend produced the result; discriminates response.
responseTxResponse | custody record | Palisade recordThe backend's raw response, preserved verbatim.
txHashstring (optional)The XRPL transaction hash, once the transaction is on-ledger.
intentIdstring (optional)The custodian intent id, when the path produced one. Hold onto this to resume via client.intent.
idempotencyKeystring (optional)The UUIDv7 this submission carried. Pass it back as a later call's idempotencyKey to retry to the same intent rather than creating a duplicate.

Return fields

For Domain.create, the intent (DomainIntent) carries:

FieldTypeDescription
domainIDstringThe id of the newly created domain, discovered from the transaction result.

Underlying XRPL transactor

Builds and submits a single PermissionedDomainSet transaction (with no domain id, creating a new domain).

Example

const { intent } = await client.domain.create({
  credList: [{ issuer: 'rIssuer...', credType: 'KYC' }],
})

console.log(intent.domainID)