chore: migrate bitcoin wallet snap into merged-packages/#22
Merged
Conversation
* 0.2.5 * chore: update changelog * chore: update Snap manifest * chore: update changelog * chore: update `packages/snap/CHANGELOG.md` Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net> * chore: update `packages/snap/CHANGELOG.md` Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net> --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Daniel Rocha <68558152+danroc@users.noreply.github.com> Co-authored-by: Daniel Rocha <daniel.rocha@consensys.net> Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
* chore: refactor get fee rate * chore: update lint style * chore: update code import * chore: update FeeRatio to FeeRate
* chore: consolidate account address verify logic * chore: update snap function doc * Update account.ts
* feat: add fee api * chore: do not throw error if insufficient fund for estimate fee * chore: fix lint style * chore: update test case * chore: move tx amount struct to resuable * chore: add reusable error * chore: remove duplicate method after rebase * chore: update estimate fee struct * chore: update error msg * chore: add unit test for estimate fee * chore: fix lint style * chore: add estimate fee unit test in wallet * chore: update superstruct test case * chore: update estimate fee api name * fix: estimate fee UI * chore: increase test coverage * chore: increase test coverage * chore: update lint style * chore: update merge main * chore: update wording * chore: add getAndCheckFeeRate * chore: update getAndCheckFeeRate * chore: update getAndCheckFeeRate to getFeeRate * chore: update estimate fee doc * chore: use getFeeRate utils in estimateFee rpc * chore: update Fee Estimate API to use FeeRate and verifyIfAccountValid * chore: update jsdoc * chore: re wording * chore: add waring message if estimate fee is inaccurate * chore: add comment
* 0.3.0 * chore: update changelog * chore: yarn build --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
* chore(deps): pin Bitcoin and cryptographic dependencies * chore: update `yarn.lock`
* 0.4.0 * chore: yarn build * chore: update changelog * chore: update changelog Co-authored-by: Gustavo Antunes <17601467+gantunesr@users.noreply.github.com> * chore: prettier --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net> Co-authored-by: Gustavo Antunes <17601467+gantunesr@users.noreply.github.com>
* feat: add fee api * chore: do not throw error if insufficient fund for estimate fee * chore: fix lint style * chore: update test case * chore: move tx amount struct to resuable * chore: add reusable error * chore: remove duplicate method after rebase * chore: update estimate fee struct * chore: update error msg * chore: add unit test for estimate fee * chore: fix lint style * chore: add estimate fee unit test in wallet * chore: update superstruct test case * chore: update estimate fee api name * feat: add getMaxSpendableBalance api * chore: add ui for get max spendable balance * fix: incorrect permission in snap * fix: lint style in ui * chore: update max spendable balance to use verifyIfAccountValid and getFeeRate * chore: use Config.defaultFeeRate * chore: update example dapp for missing component * chore: add document * chore: update comment * chore: update unit test * chore: use big int * chore: update var name * chore: update test case * chore: update comment * chore: fix review comment * chore: update big int floor * chore: update test comment * chore: fix missing closing on the unit test
* 0.5.0 * chore: update changelog * chore: update Snap manifest --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
…wn in RPC - `SendMany` (#236) * chore: add tx warning when insufficient funds error occur in send many * chore: refine comment * chore: update test * chore: update test * chore: address comment
* 0.6.0 * chore: update manifest * chore: update changelog --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
* chore: add rpc test helper * chore: lint * chore: update testhelper var name * chore: update test * chore: fix estimate fee test * chore: update jest config * fix: address comment * Update packages/snap/src/utils/account.ts Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net> --------- Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
* feat: add quicknode client * chore: add quicknode unit test * chore: rename quick node client instance * chore: refine qn test * chore: refine test * chore: increase test coverage * chore: fix pr comment * chore: fix lint * chore: address review comment and refactor QN client * chore: fix QN lint * chore: use config value for btc confirmation
* chore: bump keyring-api to ^8.1.3 * chore: yarn.lock
* 0.6.1 * chore: update changelog + snap manifest --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
* fix: update quicknode api response handle * Update packages/snap/src/bitcoin/chain/clients/quicknode.ts Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net> --------- Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
…t` (#250) * feat: add quicknode client * chore: add quicknode unit test * chore: rename quick node client instance * chore: refine qn test * chore: refine test * chore: increase test coverage * chore: adopt quicknode * chore: refine qn test * chore: increase test coverage * chore: adopt quicknode * chore: update env variable names * chore: update SnapChainConfig type * chore: fix unit test and increase test coverage * chore: update comment * chore: fix QN send tx response * chore: fix QN send tx response mock * fix: remove duplicate method * chore: address comment * Update packages/snap/src/bitcoin/chain/clients/quicknode.test.ts Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net> --------- Co-authored-by: gantunesr <17601467+gantunesr@users.noreply.github.com> Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
* fix: fix unit conversion + use bignumber.js instead of big.js The `btcToSats` function was a bit fragile. It was checking the input as a string to make sure were not having more than 8 digits after the decimal point. However, the `.toString()` methods might be using scientific notation when converting some numbers, which would be an error with the previous check we made. Instead, we now use `BigNumber` which also supports integers and we use this to make sure BTC numbers are within range. * fix(quicknode): fix fee estimation (kvB -> vB) * chore: lint * chore: update bitcoin core comments Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com> * refactor: add big prefix when using BigNumber(s) * refactor: btcSatsFactor > satsIn1Btc * fix(unit): check if kvb can be safely converted to vb + round up * test: add tests for satsKVBToVB --------- Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>
* 0.7.0 * chore: update changelog + snap manifest * chore: fix changelog --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
* refactor: better naming for KVB/KB/VB * refactor: update remaining KVB/KB/VB names
…artfee` returns data unavailable (#269) * feat(QuickNode): add feerate fallback solution * fix(QuickNode): correct comment wording * fix(QuickNode): fee rate unit test * chore(QuickNode): update `prepareEstimateFeeRateMock` to `mockEstimateFeeRate ` * chore(QuickNode): update `DefaultTxMinFeeRateInBtcPerKvb` comment * chore(QuickNode): update test title * refactor: better naming for KVB/KB/VB * refactor: update remaining KVB/KB/VB names * chore(QuickNode): update PR comment * chore: address comment * chore: address PR comment * chore: update gas fee estimation error handle --------- Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
* fix: upate configs to support dynamic ui * feat: initial send ui * fix: manifest * fix: drynrun off * fix: address validation * refactor: send flow * fix: remove old screen * fix: total * fix: hardcode to replaceable * refactor: send flow event handler * fix: loader style * fix: permissions * refactor: using new components * fix: working initial screen * feat: add validations * fix: onUserInput validation * refactor: estimate * fix: formValidation amount check * feat: currency switcher * fix: lint * fix: store fee in request * feat: Transaction summary screen (#252) * [WIP] TX summary screen * basic Review screen implementation * fix rebase * refactor: to use updateSendFlow * refactor: to store all transaction params in request state * fix: header alignment * fix: remove unused * chore: bump snaps sdk * fix: back and cancel * fix: disable dryrun * refactor: form errors * fix: clear button * fix: show jazzicon if the recipient is valid * fix: loading screen not appearing after setting a valid amount the first time * fix: send flow error handling * feat(deps): add jest-transform-stub, bitcoin-address-validation * refactor: types and move renders to a separate file * fix: remove number type in input * fix: set empty string as address if its not set in the formState * test: add send-many-controller test * feat: add max button * refactor: create startTransactionFlow * test: add start-send-transaction-flow tests * fix: tests * test: add utils test * fix: revert site changes * fix: remove unused bignumber and remove resolution * fix: undo static log level * chore: remove logs and fix lint * fix: check if total exceeds balance * fix: total amount omitting fee * chore: bump snaps deps * fix: lint issue from provider type * Apply suggestions from code review Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net> * fix: remove start request from keyring * refactor: CaipToNetowrkName to Caip2ChainIdToNetworkName * chore: remove log * deps: remove unused deps * refactor: resolveInterface to a method * refactor: rename variable and refactor ternary to getAmountFrom * fix: lint and variable name * chore: fix lint * refactor: create TransactionStatus enum * Update packages/snap/src/ui/components/SendFlowHeader.tsx Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net> * fix: create utility func getAssetTypeFromScope * fix: remove jazzicon dep * Apply suggestions from code review Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net> * refactor: max send to a method * fix: remove unused account type * fix: add comment and fix lint error * fix: remove unused btc_initiateSendMany * fix: remove truncate in favor of shorten * fix: refactor sendMany case into another method * fix: manifest * fix: add getNetworkNameFromScope helper * fix: remove request on rejection * refactor: generateDefaultSendFlowParams into transaction utils * refactor: rates mock into a separate file * chore: add comment * Apply suggestions from code review Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net> Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com> * refactor: errors enum * refactor: merge defaultSendManyParams and sendStateToSendManyParams * fix: lint * refactor: createSendUIDialog, and rename functions * refactor: rates and balances call to getRatesAndBalances * refactor: create generateSendFlowRequest helper * fix: balances value * Apply suggestions from code review Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com> * fix: rename to createRatesAndBalancesMock * fix: tests * fix: nit * fix: remove duplicate * fix: validate startSEndTransactionFlowParamsStruct * fix: move dep to devdep * fix: naming * fix: remove dep * chore: remove dep * fix: tests * fix: test names * fix: add try catch in handleSendMany * fix: remove request if there is an error during sendmany * fix: remove rejected * fix: isSnapException. * fix: lint --------- Co-authored-by: Guillaume Roux <guillaumeroux123@gmail.com> Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net> Co-authored-by: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com>
* fix: warn on self-sends in sendTransfer confirmation
The dApp-initiated sendTransfer flow built ConfirmSendFormContext
without checking whether the recipient address belonged to the
sending account, so UnifiedSendFormView rendered self-sends as
ordinary outgoing transfers. The signPsbt flow already runs
account.isMine on each output. Bring sendTransfer to parity:
derive isMine from the recipient's script_pubkey in
JSXConfirmationRepository and surface a warning banner in the
confirmation modal when it's true.
* fix: extend self-send warning to in-app send flow and all locales
Address codex audit findings on the previous commit:
- isMine was optional and only populated by the dApp keyring path; the
in-app SendFlowUseCases.confirmSendFlow renders the same
UnifiedSendFormView and was missing the warning. Make isMine required
on ConfirmSendFormContext and derive it from the recipient script in
both producers.
- The new self-send copy was only added to en.json, so non-English
locales would render the raw {key} placeholder. Add the keys to every
locale file with the English text as a placeholder until translations
land.
- Adjust the warning copy to acknowledge that self-sends still pay
network fees.
- Regenerate the snap manifest shasum after the source changes.
* docs: add changelog entry for self-send confirmation warning
Also regenerates snap.manifest.json shasum to match the current
bundle output.
---------
Co-authored-by: Jeremy <261848901+jeremy-consensys@users.noreply.github.com>
* fix: show filled PSBT in signPsbt confirmation The signPsbt confirmation dialog was previously rendered from the unfilled template PSBT supplied by the dApp, while the PSBT that actually got signed was filled with the dApp-supplied feeRate. A malicious dApp could therefore display a benign template to the user and sign a divergent transaction. Fill the PSBT before opening the confirmation, then sign with fill: false so the displayed and signed transactions match. * chore: add changelog entry for signPsbt confirmation fix --------- Co-authored-by: Jeremy <261848901+jeremy-consensys@users.noreply.github.com>
* 1.12.0 * docs: update CHANGELOG.md --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Jeremy <261848901+jeremy-consensys@users.noreply.github.com>
This reverts commit 7943839. Co-authored-by: Jeremy <261848901+jeremy-consensys@users.noreply.github.com>
* 1.12.0 * docs: clean up auto-generated changelog entries --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Jeremy <261848901+jeremy-consensys@users.noreply.github.com>
…update (#620) * chore(deps): bump the npm_and_yarn group across 2 directories with 1 update Bumps the npm_and_yarn group with 1 update in the /packages/site directory: [uuid](https://github.com/uuidjs/uuid). Bumps the npm_and_yarn group with 1 update in the /packages/snap directory: [uuid](https://github.com/uuidjs/uuid). Updates `uuid` from 11.1.1 to 14.0.0 - [Release notes](https://github.com/uuidjs/uuid/releases) - [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md) - [Commits](uuidjs/uuid@v11.1.1...v14.0.0) Updates `uuid` from 11.1.1 to 14.0.0 - [Release notes](https://github.com/uuidjs/uuid/releases) - [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md) - [Commits](uuidjs/uuid@v11.1.1...v14.0.0) --- updated-dependencies: - dependency-name: uuid dependency-version: 14.0.0 dependency-type: direct:production - dependency-name: uuid dependency-version: 14.0.0 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * fix: update yarn.lock with uuid package Signed-off-by: Frederic HENG <frederic.heng@consensys.net> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Frederic HENG <frederic.heng@consensys.net> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Frederic HENG <frederic.heng@consensys.net>
… signing (#626)
Introduces a no-prompt signing RPC gated by strict message format and address binding, which is security-sensitive though aligned with existing signRewardsMessage patterns.
Overview
Adds a new signProofOfOwnership RPC that returns a silent BIP-322 signature (no user confirmation) for plaintext messages metamask:proof-of-ownership:{nonce}:{address}.
The handler parses and validates the message, canonicalizes bech32 addresses (lowercase) before network validation and equality checks against the signing account, then calls signMessage with skipConfirmation: true. New helpers parseProofOfOwnershipMessage and canonicalizeBitcoinAddress back this flow, with unit and handler tests. Changelog documents the method; snap.manifest.json updates bundle shasum and platformVersion to 11.1.1 (package version stays 1.13.0).
* 1.14.0 * fix: update CHANGELOG * fix: revert site release * fix: remove dev entry from CHANGELOG * fix: update manifest --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Mathieu Artu <mathieu.artu@consensys.net>
* fix: guard against unavailable WebAssembly in BdkAccountAdapter Adds an explicit WebAssembly availability check in BdkAccountAdapter.create() and BdkAccountAdapter.load() to handle environments where WebAssembly is disabled (e.g. iOS Lockdown Mode), converting an obscure crash into a clear WalletError with an actionable message. Fixes METAMASK-MOBILE-524Y * fix: remove TODO * docs: update changelog for WebAssembly guard fix * docs: fix PR number in changelog * Update packages/snap/CHANGELOG.md Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com> * fix: refactor assertWebAssemblyAvailable() outside of BdkAccountAdapter class * fix: update CHANGELOD.md --------- Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>
* 1.14.1 * fix: update CHANGELOG.md * fix: remove snap site update * fix: update CHANGELOG.md * fix: revert site package.json version --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Frederic HENG <frederic.heng@consensys.net>
* fix: handle non-url origins * fix: review
* chore: emitTrackingError any error in HandlerMiddleware * chore: update trace and tracking handling tests * chore: skip tracking canceled confirmations * fix: lint errors * chore: track JSX confirmation repository errors (#633) * chore: track error batch (#635) * chore: track errors in AssetsUseCases * chore: track errors in SendFlowUseCases * chore: track errors in Assets, Cron, Keyring, and Rpc handlers * chore: comment suppressed errors intent in mappings
* fix: signAndSendTransaction new expected params struct * chore: update changelog
This reverts commit 792ae2a.
* 1.14.2 * chore: remove site release * fix: changelog * Update packages/snap/CHANGELOG.md Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com> --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Julien Fontanel <julien.fontanel@consensys.net> Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>
* Reapply "fix: handle non-url origins (#634)" (#637) This reverts commit ce41d40. * fix: changelog * fix: changelog * fix: changelog
* 1.15.0 * chore: remove site changelog --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Andrew Taran <andrew.taran@consensys.net>
…bitcoin-wallet-snap
merged-packages/
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation
Migrate the snap-bitcoin-wallet git history into merged-packages/
References
Checklist