Skip to content

Errors ​

Adapters throw Errors whose message is a code: reason:detail.

  • denied: the person or the signer said no.
  • unavailable: something isn't there.
  • invalid: something came back wrong.

sigport turns codes into sentences before putting them in state.error. A message that isn't a code is shown as written. Network failures become "The signer did not answer. Check that it is open, then try again."

CodeSentence
invalid:personThat is not an identity. Paste an npub, nprofile, NIP-05 address, or 64-character hex key.
invalid:pairing-codeThat is not a pairing code. Copy the whole code from your signer app and paste it again.
invalid:password-mismatchThe two passwords differ.
denied:passkey-cancelledThe passkey was not used.
denied:passkey-mismatchThat passkey belongs to a different identity.
unavailable:passkey-secretThis passkey cannot sign here. Try another one, or another way to sign in.
unavailable:wallet-missingThe wallet is not in this browser any more.
unavailable:wallet-cannot-encryptThe wallet cannot encrypt messages.
unavailable:snap-unconfiguredMetaMask sign-in is not set up on this site.
invalid:wallet-key, invalid:wallet-signatureThe wallet answered with something that does not check out.
denied:plaintext-key-persistenceThis identity cannot be remembered.

Override any of them, or add your own:

ts
createSigport({
  adapters,
  messages: {
    'denied:passkey-cancelled': 'No worries — try again when you are ready.',
    'denied:my-wallet-locked': 'Unlock My Wallet first.',
  },
});

MIT licensed.