Skip to content
Merged
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/account-api/src/api/selector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ describe('selector', () => {
},
{
tc: 'using method',
selector: { methods: [BtcMethod.SendBitcoin] },
selector: { methods: [BtcMethod.SendTransfer] },
expected: [
MOCK_WALLET_1_BTC_P2WPKH_ACCOUNT,
MOCK_WALLET_1_BTC_P2TR_ACCOUNT,
Expand Down
4 changes: 2 additions & 2 deletions packages/account-api/src/mocks/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const MOCK_SOL_ACCOUNT_1: Bip44Account<KeyringAccount> = {
export const MOCK_BTC_P2WPKH_ACCOUNT_1: Bip44Account<KeyringAccount> = {
id: 'b0f030d8-e101-4b5a-a3dd-13f8ca8ec1db',
type: BtcAccountType.P2wpkh,
methods: [BtcMethod.SendBitcoin],
methods: Object.values(BtcMethod),
address: 'bc1qx8ls07cy8j8nrluy2u0xwn7gh8fxg0rg4s8zze',
options: {
entropy: {
Expand All @@ -118,7 +118,7 @@ export const MOCK_BTC_P2WPKH_ACCOUNT_1: Bip44Account<KeyringAccount> = {
export const MOCK_BTC_P2TR_ACCOUNT_1: Bip44Account<KeyringAccount> = {
id: 'a20c2e1a-6ff6-40ba-b8e0-ccdb6f9933bb',
type: BtcAccountType.P2tr,
methods: [BtcMethod.SendBitcoin],
methods: Object.values(BtcMethod),
address: 'tb1p5cyxnuxmeuwuvkwfem96lxx9wex9kkf4mt9ll6q60jfsnrzqg4sszkqjnh',
options: {
entropy: {
Expand Down
2 changes: 1 addition & 1 deletion packages/keyring-api/src/btc/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const BTC_P2TR_TESTNET_ADDRESS =
describe('types', () => {
const mockAccount = {
id: '55583f38-d81b-48f8-8494-fc543c2b5c95',
methods: [BtcMethod.SendBitcoin],
methods: Object.values(BtcMethod),
options: {},
scopes: [BtcScope.Mainnet],
};
Expand Down
13 changes: 10 additions & 3 deletions packages/keyring-api/src/btc/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,15 @@ export const BtcP2trAddressStruct = refine(
* Supported Bitcoin methods.
*/
export enum BtcMethod {
// General transaction methods
SendBitcoin = 'sendBitcoin',
SignPsbt = 'signPsbt',
ComputeFee = 'computeFee',
FillPsbt = 'fillPsbt',
BroadcastPsbt = 'broadcastPsbt',
SendTransfer = 'sendTransfer',
GetUtxo = 'getUtxo',
ListUtxos = 'listUtxos',
PublicDescriptor = 'publicDescriptor',
SignMessage = 'signMessage',
}

const BtcAccountStruct = object({
Expand All @@ -84,7 +91,7 @@ const BtcAccountStruct = object({
/**
* Account supported methods.
*/
methods: array(enums([`${BtcMethod.SendBitcoin}`])),
methods: array(enums(Object.values(BtcMethod))),
});

export const BtcP2pkhAccountStruct = object({
Expand Down
2 changes: 1 addition & 1 deletion packages/keyring-snap-client/src/KeyringClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ describe('KeyringClient', () => {
const request: JsonRpcRequest = {
id: '71621d8d-62a4-4bf4-97cc-fb8f243679b0',
jsonrpc: '2.0',
method: BtcMethod.SendBitcoin,
method: BtcMethod.SendTransfer,
params: {
recipients: {
address: '0.1',
Expand Down
4 changes: 2 additions & 2 deletions packages/keyring-snap-sdk/src/rpc-handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ describe('handleKeyringRequest', () => {
const signingRequest = {
id: '71621d8d-62a4-4bf4-97cc-fb8f243679b0',
jsonrpc: '2.0',
method: BtcMethod.SendBitcoin,
method: BtcMethod.SendTransfer,
params: {
recipients: {
address: '0.1',
Expand Down Expand Up @@ -290,7 +290,7 @@ describe('handleKeyringRequest', () => {
const signingRequest = {
id: '71621d8d-62a4-4bf4-97cc-fb8f243679b0',
jsonrpc: '2.0',
method: BtcMethod.SendBitcoin,
method: BtcMethod.SendTransfer,
params: {
recipients: {
address: '0.1',
Expand Down
Loading