forked from cashubtc/cashu-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into development
- Loading branch information
Showing
17 changed files
with
557 additions
and
360 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
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,106 @@ | ||
# Version 1.0.0 Migration guide | ||
|
||
⚠️ Upgrading to version 1.0.0 will come with breaking changes! Please follow the migration guide for a smooth transition to the new version. | ||
|
||
## Context | ||
|
||
In Version 1.0.0 the api version of mints has been upgraded to `v1`. Please read the `v1` [v1 cleanup PR](https://github.com/cashubtc/nuts/pull/55) to understand more about how the API has changed. | ||
|
||
## Breaking changes | ||
|
||
### ⚠️ Important! When upgrading to this version, the `hash2curve` function and the `default secret format` have changed. This means deterministic secret derivation will produce NOT THE SAME SECRETS as before. When upgrading to this version, wallets that have been using deterministic secrets (seed phrase) must reset counters and then `self spend`/`refresh` all proofs, so that the backups continue working. | ||
|
||
--- | ||
|
||
### Decoding LN invoices | ||
|
||
**Removed LN invoice decode:** | ||
Decoding LN invoices is no longer used inside the lib. | ||
|
||
**How to fix:** If you need to decode LN invoices, you can use | ||
|
||
> npm i [@gandlaf21/bolt11-decode](https://www.npmjs.com/package/@gandlaf21/bolt11-decode) | ||
--- | ||
|
||
### `CashuWallet` interface changes | ||
|
||
**optional function AND constructor parameters are now in an onpional `options?` Object** | ||
|
||
Utility functions now have an `options` object for optional parameters, instead of passing them directly | ||
|
||
**`requestMint(amount: number)` --> `getMintQuote(amount: number)`** | ||
Now returns the following: | ||
|
||
```typescript | ||
type MintQuoteResponse = { | ||
request: string; | ||
quote: string; | ||
}; | ||
``` | ||
|
||
where `request` is the invoice to be paid, and `quote` is the identifier used to pass to `mintTokens()`. | ||
|
||
**`requestTokens()` --> `mintTokens()`** | ||
|
||
--- | ||
|
||
**`getMeltQuote(invoice: string)`** is now used to get fee estimation and conversion quotes instead of `getFee()` and returns: | ||
|
||
```typescript | ||
type MeltQuoteResponse = { | ||
quote: string; | ||
amount: number; | ||
fee_reserve: number; | ||
}; | ||
``` | ||
|
||
where `quote` is the identifier to pass to `meltTokens()` | ||
|
||
--- | ||
|
||
### Model changes | ||
|
||
**`MintKeys`--> `Keys`**: | ||
`MintKeys` now include the `keys`, `id` and `unit` | ||
|
||
```typescript | ||
type MintKeys = { | ||
id: string; | ||
unit: string; | ||
keys: Keys; | ||
}; | ||
|
||
type Keys = { [amount: number]: string }; | ||
``` | ||
|
||
--- | ||
|
||
**`MintKeyset`**: | ||
Used to be a string array, but now contains the additional fields `active` and `unit` | ||
|
||
```typescript | ||
type MintKeyset = { | ||
id: string; | ||
unit: string; | ||
active: boolean; | ||
}; | ||
``` | ||
|
||
--- | ||
|
||
**`BlindedMessages`:** now include the field `id`, corresponding with the mints `keysetId` | ||
|
||
```typescript | ||
type BlindedMessage { | ||
amount: number; | ||
B_: ProjPointType<bigint>; | ||
id: string; | ||
} | ||
``` | ||
|
||
--- | ||
|
||
### Pattern changes | ||
|
||
**removed `newKeys` from returns**: Functions no longer return `newKeys`. Wallets now specify the keyset they use in the BlindedMessage via the `id` field. |
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
Oops, something went wrong.