minca
ApiSessionFunctions

Function: offerToPhone()

function offerToPhone(params, onStage): Promise<PairingOffer>;

Defined in: packages/core/src/session/pairing.ts:81

Starts offering an account to a phone; the first relay goes in the link.

One offer serves one phone: the first that commits is the only one answered. The code stops working after ttlMs if no phone has used it, and as soon as one has.

Parameters

ParameterTypeDescription
params{ invites: () => Promise<readonly string[]>; link: string; relays: readonly string[]; seed: Uint8Array; transport?: (did) => PeerTransport; ttlMs?: number; }-
params.invites() => Promise<readonly string[]>An invite to every space the account holds. Invites carry everything a peer needs to open a space, the key of a private one included.
params.linkstring-
params.relaysreadonly string[]-
params.seedUint8Array-
params.transport?(did) => PeerTransport-
params.ttlMs?number-
onStage(stage) => void-

Returns

Promise<PairingOffer>

On this page