-
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.
Merge pull request #87 from gandlafbtc/dev/upgrade-cashu
Dev/upgrade cashu
- Loading branch information
Showing
32 changed files
with
322 additions
and
183 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ services: | |
- /tmp/nutstash/nutstash-data:/app/data | ||
|
||
volumes: | ||
nutstash-data: | ||
nutstash-data: |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { deriveKeysetId, type MintKeys } from '@cashu/cashu-ts'; | ||
import type { Mint } from '../model/mint'; | ||
import { mints } from '../stores/mints'; | ||
import { get } from 'svelte/store'; | ||
import { toast } from '../stores/toasts'; | ||
|
||
// export const send = async () => { | ||
|
||
// } | ||
|
||
// export const mint = async () => { | ||
|
||
// } | ||
|
||
// export const receive = async () => { | ||
|
||
// } | ||
|
||
// export const melt = async () => { | ||
|
||
// } | ||
|
||
export const updateMintKeys = (mint: Mint, newKeys: MintKeys) => { | ||
const allMints = [...get(mints)]; | ||
const toBeUpdated = allMints.find((m) => mint.mintURL === m.mintURL); | ||
if (!toBeUpdated) { | ||
toast( | ||
'error', | ||
'the keys of this mint have changed, but could not be updated in the wallet', | ||
'Error' | ||
); | ||
throw new Error('could not update mint keys'); | ||
} | ||
toBeUpdated.keys = newKeys; | ||
const newKeyset = deriveKeysetId(newKeys); | ||
toBeUpdated.keysets = [newKeyset, ...toBeUpdated.keysets]; | ||
mints.set(allMints); | ||
toast('info', 'the new keyset ID is: ' + newKeyset, 'The keys of this mint have rotated'); | ||
}; |
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
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.
a0a075c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
cashu-wallet – ./
cashu-wallet-git-main-gandlaf21.vercel.app
wallet.nutstash.app
cashu-wallet-gandlaf21.vercel.app
cashu-wallet.vercel.app