minca
ApiCoreInterfaces

Interface: NodeContacts

Defined in: packages/core/src/node/types.ts:869

The account's contacts: each a private space for two, listed in the contacts space

Methods

accept()

accept(spaceId, requestKey): Promise<ContactView>;

Defined in: packages/core/src/node/types.ts:899

Joins the space for two a knock invites you to, and puts whoever asked on your list

Parameters

ParameterType
spaceIdstring
requestKeystring

Returns

Promise<ContactView>


ask()

ask(
   spaceId, 
   did, 
   options?
): Promise<{
  carried: boolean;
  request: string;
  space: string;
}>;

Defined in: packages/core/src/node/types.ts:891

Asks someone in a shared space to add you: a space for two, its invite sealed to them as a std.contact-request. carried: whether a carrier held it first.

Parameters

ParameterType
spaceIdstring
didstring
options?{ note?: string; }
options.note?string

Returns

Promise<{ carried: boolean; request: string; space: string; }>


block()

block(did): Promise<void>;

Defined in: packages/core/src/node/types.ts:886

Leaves your space for two, and hides their knocks from now on

Parameters

ParameterType
didstring

Returns

Promise<void>


get()

get(did): Promise<ContactView | null>;

Defined in: packages/core/src/node/types.ts:875

One person on the list, or null

Parameters

ParameterType
didstring

Returns

Promise<ContactView | null>


invite()

invite(
   did, 
   spaceId, 
   options?
): Promise<void>;

Defined in: packages/core/src/node/types.ts:907

Invites a contact into one of your spaces: an invite for role (as spaces.invite makes one), left in your space for two with them. Only a contact who has joined that space can be invited.

Parameters

ParameterType
didstring
spaceIdstring
options?{ role?: string; }
options.role?string

Returns

Promise<void>


invites()

invites(): Promise<readonly SpaceInviteView[]>;

Defined in: packages/core/src/node/types.ts:912

Invites your contacts left for you, to spaces you don't hold yet, newest first. Also closes invites of yours a contact has used, and deletes them.

Returns

Promise<readonly SpaceInviteView[]>


join()

join(pairSpace, key): Promise<SpaceSummary>;

Defined in: packages/core/src/node/types.ts:914

Joins the space an invite from a contact is for; its maker closes the invite once they see you there

Parameters

ParameterType
pairSpacestring
keystring

Returns

Promise<SpaceSummary>


list()

list(): Promise<readonly ContactView[]>;

Defined in: packages/core/src/node/types.ts:873

Everyone in the list, blocked people too, by name

Returns

Promise<readonly ContactView[]>


others()

others(did): Promise<readonly string[]>;

Defined in: packages/core/src/node/types.ts:901

Accounts in your space for two besides the two of you

Parameters

ParameterType
didstring

Returns

Promise<readonly string[]>


put()

put(contact): Promise<ContactView>;

Defined in: packages/core/src/node/types.ts:877

Adds someone, or changes what the list says about them

Parameters

ParameterType
contact{ did: string; name: string; note?: string; space?: string | null; }
contact.didstring
contact.namestring
contact.note?string
contact.space?string | null

Returns

Promise<ContactView>


remove()

remove(did): Promise<void>;

Defined in: packages/core/src/node/types.ts:884

Takes them off the list and leaves your space for two. Nobody else's space is touched.

Parameters

ParameterType
didstring

Returns

Promise<void>


requests()

requests(spaceId): Promise<readonly ContactRequest[]>;

Defined in: packages/core/src/node/types.ts:897

Knocks left for this account in a space, except blocked and accepted ones

Parameters

ParameterType
spaceIdstring

Returns

Promise<readonly ContactRequest[]>


space()

space(): Promise<string | null>;

Defined in: packages/core/src/node/types.ts:871

The contacts space's id, or null for a node not given it

Returns

Promise<string | null>

On this page