Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"typescript-eslint": "8.32.1"
},
"resolutions": {
"@metamask/snaps-sdk": "^10.3.0"
"@metamask/snaps-sdk": "^11.0.0"
},
"packageManager": "yarn@4.9.1",
"engines": {
Expand Down
4 changes: 4 additions & 0 deletions packages/site/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Bump `@metamask/keyring-api` from `^21.3.0` to `^22.0.0` ([#608](https://github.com/MetaMask/snap-bitcoin-wallet/pull/608))

## [1.10.1]

## [1.0.0]
Expand Down
2 changes: 1 addition & 1 deletion packages/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
]
},
"dependencies": {
"@metamask/keyring-api": "^21.3.0",
"@metamask/keyring-api": "^22.0.0",
"@metamask/providers": "^22.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/snap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Show a confirmation dialog before signing a PSBT from KeyringHandler and sending a transfer ([#591](https://github.com/MetaMask/snap-bitcoin-wallet/pull/591))
- Add `resolveAccountAddress` method to KeyringHandler for dApp connectivity ([#590](https://github.com/MetaMask/snap-bitcoin-wallet/pull/590))
- Bump `@metamask/keyring-api` from `^21.3.0` to `^22.0.0` ([#608](https://github.com/MetaMask/snap-bitcoin-wallet/pull/608))
- Bump `@metamask/keyring-snap-sdk` from `^7.1.1` to `^8.0.0` ([#608](https://github.com/MetaMask/snap-bitcoin-wallet/pull/608))
- Bump `@metamask/snaps-sdk` from `^10.3.0` to `^11.0.0` ([#608](https://github.com/MetaMask/snap-bitcoin-wallet/pull/608))

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
"@metamask/auto-changelog": "^3.4.4",
"@metamask/bitcoindevkit": "^0.1.13",
"@metamask/key-tree": "^10.1.1",
"@metamask/keyring-api": "^21.3.0",
"@metamask/keyring-snap-sdk": "^7.1.1",
"@metamask/keyring-api": "^22.0.0",
"@metamask/keyring-snap-sdk": "^8.0.0",
Comment thread
cursor[bot] marked this conversation as resolved.
"@metamask/slip44": "^4.2.0",
"@metamask/snaps-cli": "^8.3.0",
"@metamask/snaps-jest": "^9.8.0",
"@metamask/snaps-sdk": "^10.3.0",
"@metamask/snaps-sdk": "^11.0.0",
"@metamask/utils": "^11.9.0",
"bip322-js": "^3.0.0",
"concurrently": "^9.2.1",
Expand Down
3 changes: 1 addition & 2 deletions packages/snap/src/entities/confirmation.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { Network, Psbt } from '@metamask/bitcoindevkit';
import type { CurrencyRate } from '@metamask/snaps-sdk';

import type { BitcoinAccount } from './account';
import type { CurrencyUnit } from './currency';
import type { CurrencyRate, CurrencyUnit } from './currency';

export type SignMessageConfirmationContext = {
message: string;
Expand Down
6 changes: 6 additions & 0 deletions packages/snap/src/entities/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export enum CurrencyUnit {
Fiat = 'fiat', // Can also be cryptos like ETH, but will be fiat for 99% of users
}

export type CurrencyRate = {
conversionRate: number;
conversionDate: number;
currency: string;
};

export const networkToCurrencyUnit: Record<Network, CurrencyUnit> = {
bitcoin: CurrencyUnit.Bitcoin,
testnet: CurrencyUnit.Testnet,
Expand Down
3 changes: 1 addition & 2 deletions packages/snap/src/entities/send-flow.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Network } from '@metamask/bitcoindevkit';
import type { CurrencyRate } from '@metamask/snaps-sdk';

import type { CurrencyUnit } from './currency';
import type { CurrencyRate, CurrencyUnit } from './currency';
import type { CodifiedError } from './error';

// TODO: This context will be adjusted to the needs
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/src/infra/jsx/format.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Network } from '@metamask/bitcoindevkit';
import { Amount, BdkErrorCode } from '@metamask/bitcoindevkit';
import type { CaipAccountId, CurrencyRate } from '@metamask/snaps-sdk';
import type { CaipAccountId } from '@metamask/snaps-sdk';

import type { CurrencyUnit, Messages } from '../../entities';
import type { CurrencyRate, CurrencyUnit, Messages } from '../../entities';
import { networkToScope } from '../../handlers';

export const displayAmount = (
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/store/JSXConfirmationRepository.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { Psbt } from '@metamask/bitcoindevkit';
import { Address as BdkAddress } from '@metamask/bitcoindevkit';
import { getCurrentUnixTimestamp } from '@metamask/keyring-snap-sdk';
import type { CurrencyRate } from '@metamask/snaps-sdk';

import type {
AssetRatesClient,
BitcoinAccount,
BlockchainClient,
ConfirmationRepository,
ConfirmSendFormContext,
CurrencyRate,
Logger,
SignMessageConfirmationContext,
SignPsbtConfirmationContext,
Expand Down
3 changes: 2 additions & 1 deletion packages/snap/src/use-cases/SendFlowUseCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import {
type Transaction,
} from '@metamask/bitcoindevkit';
import { getCurrentUnixTimestamp } from '@metamask/keyring-snap-sdk';
import type { CurrencyRate, InputChangeEvent } from '@metamask/snaps-sdk';
import type { InputChangeEvent } from '@metamask/snaps-sdk';

import type {
AssetRatesClient,
BitcoinAccount,
BitcoinAccountRepository,
BlockchainClient,
CodifiedError,
CurrencyRate,
Logger,
ConfirmSendFormContext,
ReviewTransactionContext,
Expand Down
58 changes: 29 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3076,12 +3076,12 @@ __metadata:
"@metamask/auto-changelog": "npm:^3.4.4"
"@metamask/bitcoindevkit": "npm:^0.1.13"
"@metamask/key-tree": "npm:^10.1.1"
"@metamask/keyring-api": "npm:^21.3.0"
"@metamask/keyring-snap-sdk": "npm:^7.1.1"
"@metamask/keyring-api": "npm:^22.0.0"
"@metamask/keyring-snap-sdk": "npm:^8.0.0"
"@metamask/slip44": "npm:^4.2.0"
"@metamask/snaps-cli": "npm:^8.3.0"
"@metamask/snaps-jest": "npm:^9.8.0"
"@metamask/snaps-sdk": "npm:^10.3.0"
"@metamask/snaps-sdk": "npm:^11.0.0"
"@metamask/utils": "npm:^11.9.0"
bip322-js: "npm:^3.0.0"
concurrently: "npm:^9.2.1"
Expand All @@ -3100,7 +3100,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@metamask/bitcoin-wallet-test-dapp@workspace:packages/site"
dependencies:
"@metamask/keyring-api": "npm:^21.3.0"
"@metamask/keyring-api": "npm:^22.0.0"
"@metamask/providers": "npm:^22.1.0"
"@svgr/webpack": "npm:^8.1.0"
"@testing-library/dom": "npm:^8.17.1"
Expand Down Expand Up @@ -3286,43 +3286,43 @@ __metadata:
languageName: node
linkType: hard

"@metamask/keyring-api@npm:^21.3.0":
version: 21.3.0
resolution: "@metamask/keyring-api@npm:21.3.0"
"@metamask/keyring-api@npm:^22.0.0":
version: 22.0.0
resolution: "@metamask/keyring-api@npm:22.0.0"
dependencies:
"@metamask/keyring-utils": "npm:^3.1.0"
"@metamask/keyring-utils": "npm:^3.2.0"
"@metamask/superstruct": "npm:^3.1.0"
"@metamask/utils": "npm:^11.1.0"
bitcoin-address-validation: "npm:^2.2.3"
checksum: 10/5d1f2705d76d8cfc70378f740e054fca163735b7b77b86b092cfd311d1befb27fac16f81b210ef2c719ce32010e1db55916b7b78d1f7a84239e47b771e5d84cc
checksum: 10/ff1e9537c7219fb906b61d6755de28890239ec44f634732bd8571801c662e8b801671e98961a1c5047e079cef314353297499a52f7091a2b5391325d575ec4f9
languageName: node
linkType: hard

"@metamask/keyring-snap-sdk@npm:^7.1.1":
version: 7.1.1
resolution: "@metamask/keyring-snap-sdk@npm:7.1.1"
"@metamask/keyring-snap-sdk@npm:^8.0.0":
version: 8.0.0
resolution: "@metamask/keyring-snap-sdk@npm:8.0.0"
dependencies:
"@metamask/keyring-utils": "npm:^3.1.0"
"@metamask/snaps-sdk": "npm:^9.0.0"
"@metamask/keyring-utils": "npm:^3.2.0"
"@metamask/snaps-sdk": "npm:^11.0.0"
"@metamask/superstruct": "npm:^3.1.0"
"@metamask/utils": "npm:^11.1.0"
webextension-polyfill: "npm:^0.12.0"
peerDependencies:
"@metamask/keyring-api": ^21.2.0
"@metamask/keyring-api": ^22.0.0
"@metamask/providers": ^19.0.0
checksum: 10/ac4ce050f4647096ef66ebd04d99d1423c002ca0fb05bd83e11caec59754b56d73bb8a95ac3a76f64472713256205e889d6785003dfe2c35f5f1d67c2f2efd12
checksum: 10/271b4f84d214813c0312ffbbe3fb6201b66172210da4d06a155c3ddb359403ed1fa4c7afa424cd34fa9db04e3c876f30f69afb676bb7a905d392552d871ebd57
languageName: node
linkType: hard

"@metamask/keyring-utils@npm:^3.1.0":
version: 3.1.0
resolution: "@metamask/keyring-utils@npm:3.1.0"
"@metamask/keyring-utils@npm:^3.2.0":
version: 3.2.0
resolution: "@metamask/keyring-utils@npm:3.2.0"
dependencies:
"@ethereumjs/tx": "npm:^5.4.0"
"@metamask/superstruct": "npm:^3.1.0"
"@metamask/utils": "npm:^11.1.0"
bitcoin-address-validation: "npm:^2.2.3"
checksum: 10/d7325bb72e47bd3d81b1bce55203d8343408c0d37dd2862203c21bb68c6a1e32a1cfa7ca46a4f6fe1f14e757084bbc45db8db3eedbefc90ce81805ce22d335e8
checksum: 10/e71aa1b9ec9a24c72ea6d4864a10f11e68e5b77789728067230ec40cee2e85ad69073404d2fa62c760f014fd910fb68b3305a08f906f2534b9119e2a26d06a2b
languageName: node
linkType: hard

Expand Down Expand Up @@ -3667,17 +3667,17 @@ __metadata:
languageName: node
linkType: hard

"@metamask/snaps-sdk@npm:^10.3.0":
version: 10.3.0
resolution: "@metamask/snaps-sdk@npm:10.3.0"
"@metamask/snaps-sdk@npm:^11.0.0":
version: 11.1.1
resolution: "@metamask/snaps-sdk@npm:11.1.1"
dependencies:
"@metamask/key-tree": "npm:^10.1.1"
"@metamask/providers": "npm:^22.1.1"
"@metamask/rpc-errors": "npm:^7.0.3"
"@metamask/superstruct": "npm:^3.2.1"
"@metamask/utils": "npm:^11.8.1"
"@metamask/utils": "npm:^11.11.0"
luxon: "npm:^3.5.0"
checksum: 10/24efa7af91557d2365cd2199e0572566675efadbcc51a350938cb57e4b5c0861188c30d26a9ec3a42cb9059b37bba0f44a5486ec3ed32ac2e956cf48213d6485
checksum: 10/8419625775b83045d98c4ed920002ad884471e2303f6650104c97457c238f095ff35030663ddf111ebb6ce8f4cd915f57b7b9a5597d00288093701dbb79e787c
languageName: node
linkType: hard

Expand Down Expand Up @@ -3762,9 +3762,9 @@ __metadata:
languageName: node
linkType: hard

"@metamask/utils@npm:^11.0.1, @metamask/utils@npm:^11.1.0, @metamask/utils@npm:^11.4.0, @metamask/utils@npm:^11.4.2, @metamask/utils@npm:^11.8.1, @metamask/utils@npm:^11.9.0":
version: 11.9.0
resolution: "@metamask/utils@npm:11.9.0"
"@metamask/utils@npm:^11.0.1, @metamask/utils@npm:^11.1.0, @metamask/utils@npm:^11.11.0, @metamask/utils@npm:^11.4.0, @metamask/utils@npm:^11.4.2, @metamask/utils@npm:^11.8.1, @metamask/utils@npm:^11.9.0":
version: 11.11.0
resolution: "@metamask/utils@npm:11.11.0"
dependencies:
"@ethereumjs/tx": "npm:^4.2.0"
"@metamask/superstruct": "npm:^3.1.0"
Expand All @@ -3777,7 +3777,7 @@ __metadata:
pony-cause: "npm:^2.1.10"
semver: "npm:^7.5.4"
uuid: "npm:^9.0.1"
checksum: 10/f8f5e99ba6c6de0395ed4e0acc82ee9c0dca26991ea6a8f10b3896e72745790966a8eded8c42be905d9f01fa99c1fd29a7f68541e2ef9854fc14984a0b514ad3
checksum: 10/c4381b9e451a9616bde84ac659bc0d1848ef06b6e605f877bfa065b78c8ed5015706683ea88a3387de5eaeb3a50d1af9af0994f04f9e06258d992598fe2be3bf
languageName: node
linkType: hard

Expand Down
Loading