-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: improve docs & replace typedoc comments with links to docs page * docs: add redeemEcash * chore: improve lightning service return types * chore: refactor to avoid explicit return types for functions * docs: add spendNotes * docs: add parseNotes * docs: add FederationService docs * chore: removed redundant initialize docs page
- Loading branch information
1 parent
c5236d8
commit a3b69ff
Showing
19 changed files
with
257 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Redeem Ecash | ||
|
||
### `federation.getConfig()` | ||
|
||
Access configuration details about a connected federation. | ||
|
||
```ts twoslash | ||
// @esModuleInterop | ||
import { FedimintWallet } from '@fedimint/core-web' | ||
|
||
const wallet = new FedimintWallet() | ||
wallet.open() | ||
|
||
const config = await wallet.federation.getConfig() // [!code focus] | ||
``` |
15 changes: 15 additions & 0 deletions
15
docs/core/FedimintWallet/FederationService/getFederationId.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Redeem Ecash | ||
|
||
### `federation.getFederationId()` | ||
|
||
Access the `federationId` of the connected Federation. | ||
|
||
```ts twoslash | ||
// @esModuleInterop | ||
import { FedimintWallet } from '@fedimint/core-web' | ||
|
||
const wallet = new FedimintWallet() | ||
wallet.open() | ||
|
||
const config = await wallet.federation.getFederationId() // [!code focus] | ||
``` |
17 changes: 17 additions & 0 deletions
17
docs/core/FedimintWallet/FederationService/getInviteCode.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Redeem Ecash | ||
|
||
### `federation.getInviteCode()` | ||
|
||
Access the invite code for the connected federation. | ||
|
||
```ts twoslash | ||
// @esModuleInterop | ||
import { FedimintWallet } from '@fedimint/core-web' | ||
|
||
const wallet = new FedimintWallet() | ||
wallet.open() | ||
|
||
const peerId = 0 // Index of the guardian to ask for the invite code // [!code focus] | ||
|
||
const inviteCode = await wallet.federation.getInviteCode(peerId) // [!code focus] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Spend Ecash | ||
|
||
### `mint.parseNotes(oobNotes: string)` | ||
|
||
Parses an ecash note string without redeeming it. Use [`redeemEcash()`](./redeemEcash) to redeem the notes. | ||
|
||
```ts twoslash | ||
// @esModuleInterop | ||
import { FedimintWallet } from '@fedimint/core-web' | ||
|
||
const wallet = new FedimintWallet() | ||
wallet.open() | ||
|
||
const longEcashNoteString = '01A...' | ||
|
||
const valueMsats = await wallet.mint.parseNotes(longEcashNoteString) // [!code focus] | ||
|
||
// later... | ||
|
||
await wallet.mint.redeemEcash(longEcashNoteString) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Redeem Ecash | ||
|
||
### `mint.redeemEcash(notes: string)` | ||
|
||
Redeem a set of ecash notes. | ||
|
||
```ts twoslash | ||
// @esModuleInterop | ||
import { FedimintWallet } 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) | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Spend Ecash | ||
|
||
### `mint.spendNotes(amountMsats: number)` | ||
|
||
Generates ecash notes for spending. | ||
|
||
```ts twoslash | ||
// @esModuleInterop | ||
import { FedimintWallet } from '@fedimint/core-web' | ||
|
||
const wallet = new FedimintWallet() | ||
wallet.open() | ||
|
||
const amountMsats = 10_000 // [!code focus] | ||
const result = await wallet.mint.spendNotes(amountMsats) // [!code focus] | ||
|
||
console.log(result.notes) // ecash notes | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.