Skip to content

FederationLike.lightning ​

ts
lightning(): LightningLike | undefined

Gives the Lightning facade. Synchronous.

Parameters. None.

Returns. LightningLike | undefined. The facade, or undefined when the federation has no Lightning module.

Throws. None.

Example

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

declare const fed: FederationLike

const ln = fed.lightning() 
if (!ln) throw new Error('This federation has no Lightning module.')

Used in. Receive, step 03, Send, step 04, Send, step 05