Skip to content

CreateEntityOptions

CreateEntityOptions = object

Defined in: src/actions/wallet/createEntity.ts:27

How an created entity lives: its lifetime, plus the flags and salt it is created with.

{ expiration: ExpirationTime.fromDays(30) }
Pin an absolute deadline, but never let it leave the entity with less than a day:
{
expiration: ExpirationTime.atDate(someDeadline, {
atLeast: ExpirationTime.fromDays(1), // ...but live at least a day regardless
}),
flags: { readonly: true },
}

expiration: Expiry

Defined in: src/actions/wallet/createEntity.ts:34

How long the entity should live, built with ExpirationTime.

ExpirationTime.fromDays(30) is the everyday form. atBlock / atDate pin an absolute deadline instead, and either can carry { atLeast } to guarantee a minimum life on top of it.


optional flags: CreationFlags

Defined in: src/actions/wallet/createEntity.ts:39

Properties fixed at creation: readonly and permissionlessExtension. No operation changes them afterwards, so an entity is whatever it was created as for life. Both default to false.


optional salt: SaltInput

Defined in: src/actions/wallet/createEntity.ts:47

The salt mixed into the entity key. Defaults to 128 random bits, which makes the key unpredictable to everyone but the creator.

Pass NO_SALT for a key derived from the owner and nonce alone — predictable by anyone, which is what you want only when a third party must be able to compute the key in advance.