Skip to content

Commit

Permalink
docs: add spendNotes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlwn123 committed Dec 5, 2024
1 parent c7d09ee commit 66bbbab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
5 changes: 4 additions & 1 deletion docs/.vitepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ const FedimintWalletSidebar = [
{
text: 'MintService',
base: '/core/FedimintWallet/MintService/',
items: [{ text: 'redeemEcash()', link: 'redeemEcash' }],
items: [
{ text: 'redeemEcash()', link: 'redeemEcash' },
{ text: 'spendNotes()', link: 'spendNotes' },
],
},
{
text: 'FederationService',
Expand Down
1 change: 0 additions & 1 deletion docs/core/FedimintWallet/MintService/redeemEcash.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Redeem a set of ecash notes.
```ts twoslash
// @esModuleInterop
import { FedimintWallet } from '@fedimint/core-web'
import type { LnReceiveState } from '@fedimint/core-web'

const wallet = new FedimintWallet()
wallet.open()
Expand Down
16 changes: 8 additions & 8 deletions docs/core/FedimintWallet/MintService/spendNotes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Redeem Ecash
# Spend Ecash

### `mint.redeemEcash(notes: string)`
### `mint.spendNotes(amountMsats: number)`

Redeem a set of ecash notes.
Generates ecash notes for spending.

```ts twoslash
// @esModuleInterop
Expand All @@ -12,9 +12,9 @@ import type { LnReceiveState } from '@fedimint/core-web'
const wallet = new FedimintWallet()
wallet.open()

try {
await wallet.mint.redeemEcash('01...') // [!code focus]
} catch (error) {
console.error('Failed to redeem ecash', error)
}
const amountMsats = 10_000 // [!code focus]
const result = await wallet.mint.spendNotes(amountMsats) // [!code focus]

console.log(result.notes)
console.log(result.operation_id)
```

0 comments on commit 66bbbab

Please sign in to comment.