Skip to content

EcashLike.receive ​

ts
receive(notes: NotesLike): Promise<EcashReceiveOperationLike>

Redeems ecash notes.

Parameters

NameTypeDescription
notesNotesLikeThe notes to redeem. Get them from Notes.parse.

Returns. EcashReceiveOperationLike. The redeem operation. Follow it with updates() or awaitFinal().

Throws. InvalidInput, Recovering, NotSupported, FederationUnreachable, Timeout, Storage, FederationClosed. InvalidInput means malformed notes, or notes from another federation.

Example

example.ts
ts
import { Notes, type EcashLike } from '@fedimint/react-native'

declare const ecash: EcashLike
declare const pasted: string

const operation = await ecash.receive(Notes.parse(pasted.trim())) 
console.log((await operation.awaitFinal()).tag)

Used in. Receive, step 02