Methods
(async) create(params) → {Entity|Error}
Create a new `Entity`. Calls out to the Rlay Server
Parameters:
| Name | Type | Description |
|---|---|---|
params |
object |
- Source:
Returns:
- Type
- Entity | Error
(async) find(cid, fetchBoolean) → {Entity|null}
Find an `Entity` by its `CID`. Calls out to the Rlay Server.
Returns an `Entity` instance.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
cid |
string | The `CID` that should be looked for | |
fetchBoolean |
boolean | true | If .fetch() should be called on the new entity |
- Source:
Returns:
- Return `null` if no entity was found
- Type
- Entity | null
Example
Find an Entity
```javascript
const entity = await Entity.find('123...789');
(entity && entity instanceof Entity) // returns true
// assuming that the CID `123...789` belongs to a DataPropertyAssertion
(entity instanceof Rlay_DataPropertyAssertion) // returns true
```