Skip to content

Built-in adapters ​

Each adapter is a folder in packages/core/src/adapters/, importable on its own from @sigport/core/adapters/<id>.

extension ​

A browser extension that signs for pages (NIP-07).

ts
import { extension, EXTENSIONS } from '@sigport/core/adapters/extension';
extension({ catalog?, label?, note? });
  • Detection: finds a window.nostr that isn't OneKey's or OKX's (wallets put their provider there too).
  • Signing in: one click.
  • Catalog: the row's ⓘ opens a list of extensions. When none is installed, the row itself opens it. The list includes Alby, nos2x, nos2x-fox, Keys.band, Soapbox Signer, Flamingo and Nostash. Only Alby can be identified once installed (window.alby); the others all look like window.nostr.

remote ​

A signer on another device (NIP-46).

ts
import { remote, SIGNER_APPS, DEFAULT_PAIRING_RELAYS } from '@sigport/core/adapters/remote';
remote({ relays?, pool?, catalog?, scheme?, label?, note? });
  • Signing in: show a nostrconnect:// QR code and wait for the signer to accept, or paste the bunker:// code the signer gives.
  • relays: where the pairing code asks the signer to answer. Defaults to DEFAULT_PAIRING_RELAYS.
  • pool: an applesauce RelayPool to share. A new one is made otherwise.
  • Catalog: shown under the form. It includes Amber, Primal, Aegis, Clave, Nsec.app and Keycast.

metamask ​

MetaMask, through a Snap that holds a Nostr key.

ts
import { metamask } from '@sigport/core/adapters/metamask';
metamask({ snapId?, logo? });
  • Detection: MetaMask is found by EIP-6963 announcement, never through window.ethereum. Without snapId it is listed as "Not ready yet". If it is too old for Snaps, it shows "Needs an update".
  • Signing in: one click. MetaMask asks to install the Snap the first time.

onekey, okx ​

The OneKey wallet (window.$onekey.nostr) and OKX Wallet (window.okxwallet.nostr).

ts
import { onekey } from '@sigport/core/adapters/onekey';
import { okx } from '@sigport/core/adapters/okx';
  • Signing in: one click.
  • Checks: every key and signature the wallet returns is verified before it is trusted.
  • Remembering: by public key only.

passkey ​

A key from the device's screen lock. The passkey's secret (WebAuthn PRF) is turned into a Nostr key every time it is used, and nothing is written down.

ts
import { passkey, DEFAULT_DERIVATION } from '@sigport/core/adapters/passkey';
passkey({ salt?, info?, rpName?, defaultName? });
  • Detection: passkeys with secrets, without prompting.
  • Signing in: Use my passkey, or Make a new passkey.
  • Remembering: a remembered passkey account is locked until its passkey is used again.

WARNING

salt and info decide every key. Set them once, and never change them.

local ​

A new key, made here and encrypted with a password (NIP-49).

ts
import { local } from '@sigport/core/adapters/local';
local({ minPassword? }); // 12 by default

A remembered local account asks for its password before it signs.

readonly ​

Watch as anyone, sign nothing. Accepts hex, npub, nprofile or a NIP-05 address.

ts
import { readonly, locatePerson } from '@sigport/core/adapters/readonly';

guest ​

A throwaway key that lives in memory and is gone when the tab closes. It is never saved.

ts
import { guest } from '@sigport/core/adapters/guest';
guest({ label?, note?, name? });

MIT licensed.