Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
814bd26
feat: implement keyring_createAccounts for batch creation (MUL-1782)
gantunesr Apr 28, 2026
40ffbc1
chore: update manifest
gantunesr Apr 28, 2026
0df7c66
chore: update manifest
gantunesr Apr 28, 2026
e3948cf
chore: update shasum
gantunesr Apr 28, 2026
94cfdd6
chore: update CHANGELOG
gantunesr Apr 28, 2026
b2337de
chore: update CHANGELOG
gantunesr Apr 28, 2026
6dac972
fix: lint
gantunesr Apr 28, 2026
ba86c3f
chore: update manifest
gantunesr Apr 28, 2026
75cfc13
chore: update manifest
gantunesr Apr 29, 2026
6a72002
fix: revert version change
gantunesr Apr 29, 2026
401d822
fix: revert manifest change
gantunesr Apr 29, 2026
fa702f3
chore: align keyring-api
gantunesr Apr 29, 2026
deaea5a
feat: speed optimization
gantunesr Apr 30, 2026
112cb8e
feat: speed optimization
gantunesr Apr 30, 2026
38cc8b5
chore: add logs
gantunesr Apr 30, 2026
15eea66
refactor: batch account creation
gantunesr May 6, 2026
487302f
chore: add debug logs
gantunesr May 6, 2026
0595736
Merge branch 'main' of https://github.com/MetaMask/snap-bitcoin-walle…
gantunesr May 6, 2026
37ad402
Revert "chore: add debug logs"
gantunesr May 6, 2026
d66fa0d
add performance log
gantunesr May 6, 2026
811268a
fix log
gantunesr May 6, 2026
e8b9ff2
improve logs
gantunesr May 6, 2026
063ba19
add performance logs
gantunesr May 7, 2026
e706b82
fix: remove event emission
gantunesr May 7, 2026
b88ce08
add internal batching
gantunesr May 7, 2026
e83f11e
experiment
gantunesr May 8, 2026
947d0ea
chore: remove logs
gantunesr May 13, 2026
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/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
6 changes: 6 additions & 0 deletions packages/snap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add support for `keyring_createAccounts` method to enable batch account creation ([#601](https://github.com/MetaMask/snap-bitcoin-wallet/pull/601))

### Changed

- 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` ([#601](https://github.com/MetaMask/snap-bitcoin-wallet/pull/601))
- Bump `@metamask/keyring-snap-sdk` from `^7.1.1` to `^8.0.0` ([#601](https://github.com/MetaMask/snap-bitcoin-wallet/pull/601))

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"@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",
"@metamask/slip44": "^4.2.0",
"@metamask/snaps-cli": "^8.3.0",
"@metamask/snaps-jest": "^9.8.0",
Expand Down
17 changes: 17 additions & 0 deletions packages/snap/src/entities/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,16 @@ export type BitcoinAccountRepository = {
*/
getByDerivationPath(derivationPath: string[]): Promise<BitcoinAccount | null>;

/**
* Get accounts by derivation path.
*
* @param derivationPaths - derivation paths.
* @returns the accounts or null if they do not exist, in input order
*/
getByDerivationPaths(
derivationPaths: string[][],
): Promise<(BitcoinAccount | null)[]>;

/**
* Create a new account, without persisting it.
*
Expand All @@ -283,6 +293,13 @@ export type BitcoinAccountRepository = {
*/
insert(account: BitcoinAccount): Promise<BitcoinAccount>;

/**
* Insert accounts.
*
* @param accounts - Bitcoin accounts.
*/
insertMany(accounts: BitcoinAccount[]): Promise<BitcoinAccount[]>;

/**
* Update an account.
*
Expand Down
17 changes: 15 additions & 2 deletions 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 { AddressType, Network, WalletTx } from '@metamask/bitcoindevkit';
import type { JsonSLIP10Node, SLIP10Node } from '@metamask/key-tree';
import type {
ComponentOrElement,
Expand All @@ -13,7 +13,7 @@ import type { Inscription } from './meta-protocols';

export type SnapState = {
// accountId -> account state. This is the main state of the snap.
accounts: Record<string, AccountState>;
accounts: Record<string, AccountState | null>;
// derivationPath -> accountId. Only needed for fast lookup.
derivationPaths: Record<string, string>;
};
Expand All @@ -25,6 +25,19 @@ export type AccountState = {
wallet: string;
// Wallet inscriptions for meta protocols (ordinals, etc.)
inscriptions: Inscription[];
// Metadata used by keyring account responses without loading the BDK wallet.
metadata?: AccountMetadata;
};

export type AccountMetadata = {
// Public receive address at account address index 0.
address: string;
// Account address type.
addressType: AddressType;
// Bitcoin network.
network: Network;
// Public descriptor for read-only descriptor requests.
publicDescriptor: string;
};

export type SyncResult = {
Expand Down
Loading
Loading