-
Notifications
You must be signed in to change notification settings - Fork 5
Cashu ts v4 #1108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gudnuf
wants to merge
8
commits into
master
Choose a base branch
from
cashu-ts-v4
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Cashu ts v4 #1108
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f9b3fe5
docs(migrations): cashu-ts v4 scope audit
orveth 664d8be
chore(cashu-ts): bump @cashu/cashu-ts to 4.5.0
orveth 0c38a4e
refactor(cashu): inline getEncodedToken, drop encodeToken wrapper
orveth 2970403
fix(cashu): drop unit arg from KeyChain.mintToCacheDTO
orveth 858c01e
fix(cashu): use bolt11 invoice expiry when mint omits quote expiry
orveth 67c2e77
test(cashu): adapt fixtures to v4 signatures
orveth b249564
fix(cashu): misc v4 adjustments
orveth a7626a8
refactor(cashu): boundary-convert Amount to number
orveth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -64,7 +64,15 @@ export class CashuReceiveQuoteRepository { | |
| description, | ||
| mintingFee, | ||
| cashuTokenMeltData: | ||
| receiveType === 'CASHU_TOKEN' ? params.meltData : undefined, | ||
| receiveType === 'CASHU_TOKEN' | ||
| ? { | ||
| ...params.meltData, | ||
| tokenProofs: params.meltData.tokenProofs.map((p) => ({ | ||
| ...p, | ||
| amount: p.amount.toNumber(), | ||
| })), | ||
|
Comment on lines
+70
to
+73
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: this is duplicated on a lot of places, maybe we should extract it in a helper export const toStoredProofs = (proofs: Proof[]) =>
proofs.map((p) => ({ ...p, amount: p.amount.toNumber() }));or maybe even the whole Up to you, not sure if it's worth it |
||
| } | ||
| : undefined, | ||
| totalFee, | ||
| } satisfies z.input<typeof CashuLightningReceiveDbDataSchema>); | ||
|
|
||
|
|
@@ -316,7 +324,10 @@ export class CashuReceiveQuoteRepository { | |
| */ | ||
| addedProofs: string[]; | ||
| }> { | ||
| const dataToEncrypt = proofs.flatMap((x) => [x.amount, x.secret]); | ||
| const dataToEncrypt = proofs.flatMap((x) => [ | ||
| x.amount.toNumber(), | ||
| x.secret, | ||
| ]); | ||
| const encryptedData = await this.encryption.encryptBatch(dataToEncrypt); | ||
| const encryptedProofs = proofs.map((x, index) => { | ||
| const encryptedDataIndex = index * 2; | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.