Skip to content

Commit da1b65f

Browse files
committed
fixup! feat: discover shared wallet by metadata label
1 parent 100556f commit da1b65f

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

packages/cardano-services-client/src/SharedWalletProvider/BlockfrostSharedWalletProvider.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as Crypto from '@cardano-sdk/crypto';
22
import { BlockfrostClient, BlockfrostProvider, fetchSequentially } from '../blockfrost';
3-
import { Cardano, Serialization } from '@cardano-sdk/core';
3+
import { Cardano, MULTISIG_CIP_ID, Serialization } from '@cardano-sdk/core';
44
import { Logger } from 'ts-log';
55
import { MultiSigRegistration, MultiSigTransaction, SharedWalletProvider } from './types';
66
import type { Responses } from '@blockfrost/blockfrost-js';
77

8-
const MULTI_SIG_LABEL = 1854;
8+
const MULTI_SIG_LABEL = MULTISIG_CIP_ID;
99

1010
const isMultiSigRegistration = (metadata: unknown): metadata is MultiSigRegistration =>
1111
!!metadata && typeof metadata === 'object' && 'participants' in metadata;

packages/core/src/const.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const MULTISIG_CIP_ID = 1854;
2+
export const HD_WALLET_CIP_ID = 1852;

packages/core/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export * as Serialization from './Serialization';
44
export * from './Provider';
55
export * from './util';
66
export * from './errors';
7+
export * from './const';
78
export * from './CardanoNode';

packages/key-management/src/types.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { Cardano, HD_WALLET_CIP_ID, HandleResolution, MULTISIG_CIP_ID, Serialization } from '@cardano-sdk/core';
12
import type * as Crypto from '@cardano-sdk/crypto';
2-
import type { Cardano, HandleResolution, Serialization } from '@cardano-sdk/core';
33
import type { Cip30DataSignature } from '@cardano-sdk/dapp-connector';
44
import type { Cip30SignDataRequest, Cip8SignDataContext } from './cip8';
55
import type { HexBlob, OpaqueString, Shutdown } from '@cardano-sdk/util';
@@ -40,8 +40,8 @@ export enum KeyRole {
4040
}
4141

4242
export enum KeyPurpose {
43-
STANDARD = 1852,
44-
MULTI_SIG = 1854
43+
STANDARD = HD_WALLET_CIP_ID,
44+
MULTI_SIG = MULTISIG_CIP_ID
4545
}
4646
export interface AccountKeyDerivationPath {
4747
role: KeyRole;

0 commit comments

Comments
 (0)