Skip to content

EcashLike.send ​

ts
send(quote: EcashQuoteLike): Promise<EcashSendHandle>

Runs a quote and makes the notes to hand over.

Parameters

NameTypeDescription
quoteEcashQuoteLikeThe quote to run. A quote that was already sent fails with QuoteExpired.

Returns. EcashSendHandle. An object with the notes to hand over and the operation to follow. The balance drops when this call returns.

Throws. QuoteExpired, QuoteChanged, InsufficientBalance, Recovering, NotSupported, FederationUnreachable, Timeout, Storage, FederationClosed.

WARNING

The string is bearer money. Whoever has it can redeem it. Show it only to the recipient, and never log it, store it in plain text or send it to analytics.

Example

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

declare const ecash: EcashLike
declare const quote: EcashQuoteLike
declare function showToRecipient(text: string): void

const { notes, operation } = await ecash.send(quote) 
showToRecipient(notes.display())
const final = await operation.awaitFinal()

Used in. Send, step 02