Skip to content

InviteCode.parse ​

ts
InviteCode.parse(code: string): InviteCodeLike

Checks an invite code string and gives you a checked invite code. Synchronous.

Parameters

NameTypeDescription
codestringThe fed1... string.

Returns. InviteCodeLike. A checked invite code.

Throws. InvalidInput. InvalidInput means a malformed value. The error does not echo the string back.

Example

example.ts
ts
import { InviteCode } from '@fedimint/react-native'

declare const pasted: string

const invite = InviteCode.parse(pasted.trim()) 
console.log(invite.federationId())

Used in. Join, step 01, Quickstart, step 02, Errors, step 01, Restore, step 03, Receive (prose)