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 packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"test:integration": "./integration-test/run-integration.sh"
},
"devDependencies": {
"@bitcoindevkit/bdk-wallet-web": "^0.2.0",
"@jest/globals": "^30.0.5",
"@metamask/bitcoindevkit": "^0.1.13",
"@metamask/key-tree": "^10.1.1",
"@metamask/keyring-api": "^21.3.0",
"@metamask/keyring-snap-sdk": "^7.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snap-bitcoin-wallet.git"
},
"source": {
"shasum": "vRba/rR8D/OA3+XJO4+chU8zDYgLkdA18wSnehkisn8=",
"shasum": "GZ/lj1EdHkXvtnKCFuiHc3lnb5bL9zCOpyMafwnFuZ8=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-restricted-globals */

import type { AddressType } from '@metamask/bitcoindevkit';
import type { AddressType } from '@bitcoindevkit/bdk-wallet-web';

import { LogLevel, type SnapConfig } from './entities';

Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/entities/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
Amount,
ScriptBuf,
Address,
} from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';

import type { Inscription } from './meta-protocols';
import type { TransactionBuilder } from './transaction';
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/entities/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {
FeeEstimates,
Network,
Transaction,
} from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';

import type { BitcoinAccount } from './account';

Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/entities/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AddressType, Network } from '@metamask/bitcoindevkit';
import type { AddressType, Network } from '@bitcoindevkit/bdk-wallet-web';

import type { LogLevel } from './logger';

Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/entities/confirmation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Network } from '@metamask/bitcoindevkit';
import type { Network } from '@bitcoindevkit/bdk-wallet-web';

import type { BitcoinAccount } from './account';

Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/entities/currency.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Network } from '@metamask/bitcoindevkit';
import type { Network } from '@bitcoindevkit/bdk-wallet-web';

export enum CurrencyUnit {
Bitcoin = 'BTC',
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/entities/send-flow.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Network } from '@metamask/bitcoindevkit';
import type { Network } from '@bitcoindevkit/bdk-wallet-web';
import type { CurrencyRate } from '@metamask/snaps-sdk';

import type { CurrencyUnit } from './currency';
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/entities/snap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WalletTx } from '@metamask/bitcoindevkit';
import type { WalletTx } from '@bitcoindevkit/bdk-wallet-web';
import type { JsonSLIP10Node, SLIP10Node } from '@metamask/key-tree';
import type {
ComponentOrElement,
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/entities/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Amount, Psbt, ScriptBuf } from '@metamask/bitcoindevkit';
import type { Amount, Psbt, ScriptBuf } from '@bitcoindevkit/bdk-wallet-web';

/**
* A Bitcoin transaction builder.
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/handlers/AssetsHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Network } from '@metamask/bitcoindevkit';
import type { Network } from '@bitcoindevkit/bdk-wallet-web';
import { getCurrentUnixTimestamp } from '@metamask/keyring-snap-sdk';
import type {
CaipAssetType,
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/handlers/CronHandler.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WalletTx } from '@metamask/bitcoindevkit';
import type { WalletTx } from '@bitcoindevkit/bdk-wallet-web';
import { getSelectedAccounts } from '@metamask/keyring-snap-sdk';
import type { SnapsProvider, JsonRpcRequest } from '@metamask/snaps-sdk';
import { mock } from 'jest-mock-extended';
Expand Down
6 changes: 3 additions & 3 deletions packages/snap/src/handlers/KeyringHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import type {
WalletTx,
AddressType,
ScriptBuf,
} from '@metamask/bitcoindevkit';
import { Address } from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';
import { Address } from '@bitcoindevkit/bdk-wallet-web';
import type {
DiscoveredAccount,
KeyringResponse,
Expand Down Expand Up @@ -42,7 +42,7 @@ jest.mock('superstruct', () => ({

// TODO: enable when this is merged: https://github.com/rustwasm/wasm-bindgen/issues/1818
/* eslint-disable @typescript-eslint/naming-convention */
jest.mock('@metamask/bitcoindevkit', () => {
jest.mock('@bitcoindevkit/bdk-wallet-web', () => {
return {
Address: {
from_script: jest.fn(),
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/handlers/KeyringHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AddressType } from '@metamask/bitcoindevkit';
import type { AddressType } from '@bitcoindevkit/bdk-wallet-web';
import {
BtcAccountType,
BtcScope,
Expand Down
7 changes: 6 additions & 1 deletion packages/snap/src/handlers/KeyringRequestHandler.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import type { Txid, Psbt, Amount, LocalOutput } from '@metamask/bitcoindevkit';
import type {
Txid,
Psbt,
Amount,
LocalOutput,
} from '@bitcoindevkit/bdk-wallet-web';
import type { KeyringRequest } from '@metamask/keyring-api';
import { mock } from 'jest-mock-extended';
import { assert } from 'superstruct';
Expand Down
6 changes: 3 additions & 3 deletions packages/snap/src/handlers/RpcHandler.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Psbt, Address, Amount } from '@metamask/bitcoindevkit';
import type { Transaction, Txid } from '@metamask/bitcoindevkit';
import { Psbt, Address, Amount } from '@bitcoindevkit/bdk-wallet-web';
import type { Transaction, Txid } from '@bitcoindevkit/bdk-wallet-web';
import type { Transaction as KeyringTransaction } from '@metamask/keyring-api';
import { BtcScope, FeeType } from '@metamask/keyring-api';
import type { JsonRpcRequest } from '@metamask/snaps-sdk';
Expand All @@ -15,7 +15,7 @@ import { mapPsbtToTransaction } from './mappings';
const mockPsbt = mock<Psbt>();
// TODO: enable when this is merged: https://github.com/rustwasm/wasm-bindgen/issues/1818
/* eslint-disable @typescript-eslint/naming-convention */
jest.mock('@metamask/bitcoindevkit', () => ({
jest.mock('@bitcoindevkit/bdk-wallet-web', () => ({
Psbt: { from_string: jest.fn() },
Address: {
from_string: jest.fn(),
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/handlers/caip.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AddressType, Network } from '@metamask/bitcoindevkit';
import type { AddressType, Network } from '@bitcoindevkit/bdk-wallet-web';
import { BtcAccountType, BtcScope } from '@metamask/keyring-api';

const reverseMapping = <
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/handlers/icons.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Network } from '@metamask/bitcoindevkit';
import type { Network } from '@bitcoindevkit/bdk-wallet-web';

export const networkToIcon: Record<Network, string> = {
bitcoin:
Expand Down
6 changes: 3 additions & 3 deletions packages/snap/src/handlers/mappings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type {
ScriptBuf,
Amount,
Txid,
} from '@metamask/bitcoindevkit';
import { Address } from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';
import { Address } from '@bitcoindevkit/bdk-wallet-web';
import { TransactionStatus, FeeType } from '@metamask/keyring-api';
import { mock } from 'jest-mock-extended';

Expand All @@ -15,7 +15,7 @@ import { mapPsbtToTransaction } from './mappings';

// Mock the entire bitcoindevkit module
/* eslint-disable @typescript-eslint/naming-convention */
jest.mock('@metamask/bitcoindevkit', () => ({
jest.mock('@bitcoindevkit/bdk-wallet-web', () => ({
Address: {
from_script: jest.fn(),
},
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/src/handlers/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type {
Transaction,
TxOut,
WalletTx,
} from '@metamask/bitcoindevkit';
import { Address } from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';
import { Address } from '@bitcoindevkit/bdk-wallet-web';
import type {
DiscoveredAccount,
KeyringAccount,
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/handlers/parsers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Psbt } from '@metamask/bitcoindevkit';
import { Psbt } from '@bitcoindevkit/bdk-wallet-web';

import { FormatError } from '../entities';

Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/handlers/validation.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { parseRewardsMessage } from './validation';

/* eslint-disable @typescript-eslint/naming-convention */
jest.mock('@metamask/bitcoindevkit', () => ({
jest.mock('@bitcoindevkit/bdk-wallet-web', () => ({
Address: {
from_string: jest.fn(),
},
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/src/handlers/validation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Network, AddressType } from '@metamask/bitcoindevkit';
import { Address, Amount } from '@metamask/bitcoindevkit';
import type { Network, AddressType } from '@bitcoindevkit/bdk-wallet-web';
import { Address, Amount } from '@bitcoindevkit/bdk-wallet-web';
import { CaipAssetTypeStruct } from '@metamask/utils';
import type { Infer } from 'superstruct';
import {
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/src/infra/BdkAccountAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import type {
Amount,
ScriptBuf,
Address,
} from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';
import {
FeeRate,
UnconfirmedTx,
SignOptions,
Txid,
Wallet,
OutPoint,
} from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';

import {
AccountCapability,
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/src/infra/BdkTxBuilderAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import type {
Psbt,
ScriptBuf,
TxBuilder,
} from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';
import {
TxOrdering,
OutPoint,
Address,
Amount,
FeeRate,
Recipient,
} from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';

import {
type CodifiedError,
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/src/infra/EsploraClientAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type {
FeeEstimates,
Network,
Transaction,
} from '@metamask/bitcoindevkit';
import { EsploraClient } from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';
import { EsploraClient } from '@bitcoindevkit/bdk-wallet-web';

import {
type BitcoinAccount,
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/infra/SnapClientAdapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WalletTx } from '@metamask/bitcoindevkit';
import type { WalletTx } from '@bitcoindevkit/bdk-wallet-web';
import type { JsonSLIP10Node } from '@metamask/key-tree';
import { SLIP10Node } from '@metamask/key-tree';
import { KeyringEvent } from '@metamask/keyring-api';
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/infra/jsx/components/AssetIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Network } from '@metamask/bitcoindevkit';
import type { Network } from '@bitcoindevkit/bdk-wallet-web';
import type { SnapComponent } from '@metamask/snaps-sdk/jsx';
import { Box, Image } from '@metamask/snaps-sdk/jsx';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Network } from '@metamask/bitcoindevkit';
import type { Network } from '@bitcoindevkit/bdk-wallet-web';
import type { SnapComponent } from '@metamask/snaps-sdk/jsx';
import { Image } from '@metamask/snaps-sdk/jsx';

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,5 +1,5 @@
import type { Network } from '@metamask/bitcoindevkit';
import { Amount, BdkErrorCode } from '@metamask/bitcoindevkit';
import type { Network } from '@bitcoindevkit/bdk-wallet-web';
import { Amount, BdkErrorCode } from '@bitcoindevkit/bdk-wallet-web';
import type { CaipAccountId, CurrencyRate } from '@metamask/snaps-sdk';

import type { CurrencyUnit, Messages } from '../../entities';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Psbt } from '@metamask/bitcoindevkit';
import { Psbt } from '@bitcoindevkit/bdk-wallet-web';
import type { SnapComponent } from '@metamask/snaps-sdk/jsx';
import {
Box,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Psbt } from '@metamask/bitcoindevkit';
import { Psbt } from '@bitcoindevkit/bdk-wallet-web';
import type { SnapComponent } from '@metamask/snaps-sdk/jsx';
import {
Address,
Expand Down
6 changes: 3 additions & 3 deletions packages/snap/src/store/BdkAccountRepository.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// TODO: enable when this is merged: https://github.com/rustwasm/wasm-bindgen/issues/1818
/* eslint-disable camelcase */

import type { DescriptorPair } from '@metamask/bitcoindevkit';
import type { DescriptorPair } from '@bitcoindevkit/bdk-wallet-web';
import {
ChangeSet,
xpriv_to_descriptor,
xpub_to_descriptor,
} from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';
import type { SLIP10Node } from '@metamask/key-tree';
import { mock } from 'jest-mock-extended';

Expand All @@ -21,7 +21,7 @@ import { BdkAccountRepository } from './BdkAccountRepository';

// TODO: enable when this is merged: https://github.com/rustwasm/wasm-bindgen/issues/1818
/* eslint-disable @typescript-eslint/naming-convention */
jest.mock('@metamask/bitcoindevkit', () => {
jest.mock('@bitcoindevkit/bdk-wallet-web', () => {
return {
ChangeSet: {
from_json: jest.fn(),
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/src/store/BdkAccountRepository.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// TODO: enable when this is merged: https://github.com/rustwasm/wasm-bindgen/issues/1818
/* eslint-disable camelcase */

import type { AddressType, Network } from '@metamask/bitcoindevkit';
import type { AddressType, Network } from '@bitcoindevkit/bdk-wallet-web';
import {
ChangeSet,
slip10_to_extended,
xpriv_to_descriptor,
xpub_to_descriptor,
} from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';
import { v4 } from 'uuid';

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Address } from '@metamask/bitcoindevkit';
import type { Address } from '@bitcoindevkit/bdk-wallet-web';
import type { GetPreferencesResult } from '@metamask/snaps-sdk';
import { mock } from 'jest-mock-extended';

Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/use-cases/AccountUseCases.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
Network,
Psbt,
Address,
} from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';
import type { JsonSLIP10Node } from '@metamask/key-tree';
import { mock } from 'jest-mock-extended';

Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/use-cases/AccountUseCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
Transaction,
Txid,
WalletTx,
} from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';
import { getCurrentUnixTimestamp } from '@metamask/keyring-snap-sdk';
import { Signer } from 'bip322-js';
import { encode } from 'wif';
Expand Down
6 changes: 3 additions & 3 deletions packages/snap/src/use-cases/SendFlowUseCases.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type {
FeeEstimates,
Network,
Transaction,
} from '@metamask/bitcoindevkit';
import { Psbt, Address, Amount } from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';
import { Psbt, Address, Amount } from '@bitcoindevkit/bdk-wallet-web';
import type { GetPreferencesResult } from '@metamask/snaps-sdk';
import { mock } from 'jest-mock-extended';

Expand Down Expand Up @@ -32,7 +32,7 @@ import type { AccountUseCases } from './AccountUseCases';

// TODO: enable when this is merged: https://github.com/rustwasm/wasm-bindgen/issues/1818
/* eslint-disable @typescript-eslint/naming-convention */
jest.mock('@metamask/bitcoindevkit', () => {
jest.mock('@bitcoindevkit/bdk-wallet-web', () => {
return {
Address: {
from_string: jest.fn(),
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/use-cases/SendFlowUseCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Amount,
Psbt,
type Transaction,
} from '@metamask/bitcoindevkit';
} from '@bitcoindevkit/bdk-wallet-web';
import { getCurrentUnixTimestamp } from '@metamask/keyring-snap-sdk';
import type { CurrencyRate, InputChangeEvent } from '@metamask/snaps-sdk';

Expand Down
Loading