@dynamic-labs-wallet/btc 0.0.250 → 0.0.252
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +43 -40
- package/index.esm.js +44 -41
- package/package.json +2 -2
- package/src/client/client.d.ts +1 -1
- package/src/client/client.d.ts.map +1 -1
- package/src/utils/index.d.ts +1 -0
- package/src/utils/index.d.ts.map +1 -1
- package/src/utils/parseDerivationPath/index.d.ts +2 -0
- package/src/utils/parseDerivationPath/index.d.ts.map +1 -0
- package/src/utils/parseDerivationPath/parseDerivationPath.d.ts +10 -0
- package/src/utils/parseDerivationPath/parseDerivationPath.d.ts.map +1 -0
package/index.cjs.js
CHANGED
|
@@ -37,16 +37,6 @@ function _extends() {
|
|
|
37
37
|
return _extends.apply(this, arguments);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
/**
|
|
41
|
-
* Helper to handle Buffer/Uint8Array compatibility issues
|
|
42
|
-
*
|
|
43
|
-
* @param data - The data to convert to a Buffer
|
|
44
|
-
* @returns The Buffer representation of the data
|
|
45
|
-
*/ const toBuffer = (data)=>{
|
|
46
|
-
if (Buffer.isBuffer(data)) return data;
|
|
47
|
-
return Buffer.from(data);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
40
|
/**
|
|
51
41
|
* Maps a BitcoinNetwork string to a bitcoinjs-lib Network object.
|
|
52
42
|
*
|
|
@@ -63,6 +53,16 @@ function _extends() {
|
|
|
63
53
|
}
|
|
64
54
|
}
|
|
65
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Helper to handle Buffer/Uint8Array compatibility issues
|
|
58
|
+
*
|
|
59
|
+
* @param data - The data to convert to a Buffer
|
|
60
|
+
* @returns The Buffer representation of the data
|
|
61
|
+
*/ const toBuffer = (data)=>{
|
|
62
|
+
if (Buffer.isBuffer(data)) return data;
|
|
63
|
+
return Buffer.from(data);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
66
|
/**
|
|
67
67
|
* Creates a native SegWit P2WPKH address
|
|
68
68
|
*
|
|
@@ -753,6 +753,20 @@ initEccLib();
|
|
|
753
753
|
}
|
|
754
754
|
};
|
|
755
755
|
|
|
756
|
+
/**
|
|
757
|
+
* Parses the derivation path string into a Uint32Array
|
|
758
|
+
* Handles empty strings and empty array strings by returning an empty Uint32Array
|
|
759
|
+
*
|
|
760
|
+
* @param derivationPath - The derivation path as a JSON string (e.g., '{"0":44,"1":0,"2":0}' or '[]' or '')
|
|
761
|
+
* @returns The derivation path as a Uint32Array
|
|
762
|
+
* @throws Error if the derivation path is invalid JSON
|
|
763
|
+
*/ const parseDerivationPath = (derivationPath)=>{
|
|
764
|
+
if (derivationPath === '[]' || derivationPath === '') {
|
|
765
|
+
return new Uint32Array([]);
|
|
766
|
+
}
|
|
767
|
+
return new Uint32Array(Object.values(JSON.parse(derivationPath)));
|
|
768
|
+
};
|
|
769
|
+
|
|
756
770
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
|
757
771
|
class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
758
772
|
/**
|
|
@@ -783,10 +797,6 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
783
797
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
784
798
|
ceremonyCompleteResolver = resolve;
|
|
785
799
|
});
|
|
786
|
-
// Validate address type is provided
|
|
787
|
-
if (!addressType) {
|
|
788
|
-
throw new Error('Address type is required for BTC');
|
|
789
|
-
}
|
|
790
800
|
const buildBitcoinConfig = {
|
|
791
801
|
addressType,
|
|
792
802
|
network
|
|
@@ -802,9 +812,8 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
802
812
|
},
|
|
803
813
|
onCeremonyComplete: (accountAddress, walletId)=>{
|
|
804
814
|
const chainConfig = browser.getMPCChainConfig(this.chainName, bitcoinConfig);
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
accountAddress: accountAddress,
|
|
815
|
+
this.initializeWalletMapEntry({
|
|
816
|
+
accountAddress,
|
|
808
817
|
walletId,
|
|
809
818
|
chainName: this.chainName,
|
|
810
819
|
thresholdSignatureScheme,
|
|
@@ -812,13 +821,9 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
812
821
|
index,
|
|
813
822
|
value
|
|
814
823
|
]))),
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
this.logger.debug('[BTC Client] Updated walletMap in onCeremonyComplete', {
|
|
819
|
-
accountAddress: accountAddress,
|
|
820
|
-
walletId,
|
|
821
|
-
addressType: addressType
|
|
824
|
+
additionalProps: {
|
|
825
|
+
addressType
|
|
826
|
+
}
|
|
822
827
|
});
|
|
823
828
|
// Resolve the promise when ceremony is complete
|
|
824
829
|
ceremonyCompleteResolver(undefined);
|
|
@@ -921,7 +926,7 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
921
926
|
throw new Error('Wallet not found in walletMap');
|
|
922
927
|
}
|
|
923
928
|
const derivationPath = walletProperties.derivationPath;
|
|
924
|
-
if (
|
|
929
|
+
if (derivationPath === undefined || derivationPath === null) {
|
|
925
930
|
throw new Error('Derivation path missing in walletMap');
|
|
926
931
|
}
|
|
927
932
|
let addressType = walletProperties.addressType;
|
|
@@ -938,10 +943,11 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
938
943
|
addressType,
|
|
939
944
|
network
|
|
940
945
|
};
|
|
946
|
+
const walletDerivationPath = parseDerivationPath(derivationPath);
|
|
941
947
|
const derivedPublicKey = await this.derivePublicKey({
|
|
942
948
|
chainName: this.chainName,
|
|
943
949
|
keyShare: clientKeyShares[0],
|
|
944
|
-
derivationPath:
|
|
950
|
+
derivationPath: walletDerivationPath,
|
|
945
951
|
bitcoinConfig
|
|
946
952
|
});
|
|
947
953
|
if (!derivedPublicKey) {
|
|
@@ -1023,7 +1029,7 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
1023
1029
|
throw new Error('Wallet not found in walletMap');
|
|
1024
1030
|
}
|
|
1025
1031
|
const derivationPath = walletProperties.derivationPath;
|
|
1026
|
-
if (
|
|
1032
|
+
if (derivationPath === undefined || derivationPath === null) {
|
|
1027
1033
|
throw new Error('Derivation path missing in walletMap');
|
|
1028
1034
|
}
|
|
1029
1035
|
let addressType = walletProperties.addressType;
|
|
@@ -1102,21 +1108,17 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
1102
1108
|
},
|
|
1103
1109
|
onCeremonyComplete: (accountAddress, walletId)=>{
|
|
1104
1110
|
ceremonyAccountAddress = accountAddress;
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
});
|
|
1109
|
-
this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress] || {}, {
|
|
1111
|
+
// For imported BTC wallets, use empty derivation path
|
|
1112
|
+
// The server returns "[]" for imported wallets (raw key, not derived)
|
|
1113
|
+
this.initializeWalletMapEntry({
|
|
1110
1114
|
accountAddress,
|
|
1111
1115
|
walletId,
|
|
1112
1116
|
chainName: this.chainName,
|
|
1113
1117
|
thresholdSignatureScheme,
|
|
1114
|
-
derivationPath: JSON.stringify(
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
addressType: addressTypeEnum,
|
|
1119
|
-
clientKeySharesBackupInfo: browser.getClientKeyShareBackupInfo()
|
|
1118
|
+
derivationPath: JSON.stringify([]),
|
|
1119
|
+
additionalProps: {
|
|
1120
|
+
addressType: addressTypeEnum
|
|
1121
|
+
}
|
|
1120
1122
|
});
|
|
1121
1123
|
this.logger.debug('walletMap updated for wallet', {
|
|
1122
1124
|
context: {
|
|
@@ -1223,7 +1225,7 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
1223
1225
|
throw new Error('Wallet not found in walletMap');
|
|
1224
1226
|
}
|
|
1225
1227
|
const derivationPath = walletProperties.derivationPath;
|
|
1226
|
-
if (
|
|
1228
|
+
if (derivationPath === undefined || derivationPath === null) {
|
|
1227
1229
|
throw new Error('Derivation path missing in walletMap');
|
|
1228
1230
|
}
|
|
1229
1231
|
let addressType = walletProperties.addressType;
|
|
@@ -1241,10 +1243,11 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
1241
1243
|
if (!clientKeyShares || clientKeyShares.length === 0) {
|
|
1242
1244
|
throw new Error('No key shares found');
|
|
1243
1245
|
}
|
|
1246
|
+
const walletDerivationPath = parseDerivationPath(derivationPath);
|
|
1244
1247
|
const derivedPublicKey = await this.derivePublicKey({
|
|
1245
1248
|
chainName: this.chainName,
|
|
1246
1249
|
keyShare: clientKeyShares[0],
|
|
1247
|
-
derivationPath:
|
|
1250
|
+
derivationPath: walletDerivationPath,
|
|
1248
1251
|
bitcoinConfig
|
|
1249
1252
|
});
|
|
1250
1253
|
if (!derivedPublicKey) {
|
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BitcoinAddressType, DynamicWalletClient, BitcoinNetwork, getMPCChainConfig,
|
|
1
|
+
import { BitcoinAddressType, DynamicWalletClient, BitcoinNetwork, getMPCChainConfig, ERROR_CREATE_WALLET_ACCOUNT, WalletOperation, ERROR_ACCOUNT_ADDRESS_REQUIRED, ERROR_SIGN_MESSAGE, ERROR_IMPORT_PRIVATE_KEY, AuthMode } from '@dynamic-labs-wallet/browser';
|
|
2
2
|
import * as bitcoin from 'bitcoinjs-lib';
|
|
3
3
|
import { payments, initEccLib as initEccLib$1 } from 'bitcoinjs-lib';
|
|
4
4
|
import ecc from '@bitcoinerlab/secp256k1';
|
|
@@ -17,16 +17,6 @@ function _extends() {
|
|
|
17
17
|
return _extends.apply(this, arguments);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* Helper to handle Buffer/Uint8Array compatibility issues
|
|
22
|
-
*
|
|
23
|
-
* @param data - The data to convert to a Buffer
|
|
24
|
-
* @returns The Buffer representation of the data
|
|
25
|
-
*/ const toBuffer = (data)=>{
|
|
26
|
-
if (Buffer.isBuffer(data)) return data;
|
|
27
|
-
return Buffer.from(data);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
20
|
/**
|
|
31
21
|
* Maps a BitcoinNetwork string to a bitcoinjs-lib Network object.
|
|
32
22
|
*
|
|
@@ -43,6 +33,16 @@ function _extends() {
|
|
|
43
33
|
}
|
|
44
34
|
}
|
|
45
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Helper to handle Buffer/Uint8Array compatibility issues
|
|
38
|
+
*
|
|
39
|
+
* @param data - The data to convert to a Buffer
|
|
40
|
+
* @returns The Buffer representation of the data
|
|
41
|
+
*/ const toBuffer = (data)=>{
|
|
42
|
+
if (Buffer.isBuffer(data)) return data;
|
|
43
|
+
return Buffer.from(data);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
46
|
/**
|
|
47
47
|
* Creates a native SegWit P2WPKH address
|
|
48
48
|
*
|
|
@@ -733,6 +733,20 @@ initEccLib();
|
|
|
733
733
|
}
|
|
734
734
|
};
|
|
735
735
|
|
|
736
|
+
/**
|
|
737
|
+
* Parses the derivation path string into a Uint32Array
|
|
738
|
+
* Handles empty strings and empty array strings by returning an empty Uint32Array
|
|
739
|
+
*
|
|
740
|
+
* @param derivationPath - The derivation path as a JSON string (e.g., '{"0":44,"1":0,"2":0}' or '[]' or '')
|
|
741
|
+
* @returns The derivation path as a Uint32Array
|
|
742
|
+
* @throws Error if the derivation path is invalid JSON
|
|
743
|
+
*/ const parseDerivationPath = (derivationPath)=>{
|
|
744
|
+
if (derivationPath === '[]' || derivationPath === '') {
|
|
745
|
+
return new Uint32Array([]);
|
|
746
|
+
}
|
|
747
|
+
return new Uint32Array(Object.values(JSON.parse(derivationPath)));
|
|
748
|
+
};
|
|
749
|
+
|
|
736
750
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
|
737
751
|
class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
738
752
|
/**
|
|
@@ -763,10 +777,6 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
763
777
|
const ceremonyCompletePromise = new Promise((resolve)=>{
|
|
764
778
|
ceremonyCompleteResolver = resolve;
|
|
765
779
|
});
|
|
766
|
-
// Validate address type is provided
|
|
767
|
-
if (!addressType) {
|
|
768
|
-
throw new Error('Address type is required for BTC');
|
|
769
|
-
}
|
|
770
780
|
const buildBitcoinConfig = {
|
|
771
781
|
addressType,
|
|
772
782
|
network
|
|
@@ -782,9 +792,8 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
782
792
|
},
|
|
783
793
|
onCeremonyComplete: (accountAddress, walletId)=>{
|
|
784
794
|
const chainConfig = getMPCChainConfig(this.chainName, bitcoinConfig);
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
accountAddress: accountAddress,
|
|
795
|
+
this.initializeWalletMapEntry({
|
|
796
|
+
accountAddress,
|
|
788
797
|
walletId,
|
|
789
798
|
chainName: this.chainName,
|
|
790
799
|
thresholdSignatureScheme,
|
|
@@ -792,13 +801,9 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
792
801
|
index,
|
|
793
802
|
value
|
|
794
803
|
]))),
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
this.logger.debug('[BTC Client] Updated walletMap in onCeremonyComplete', {
|
|
799
|
-
accountAddress: accountAddress,
|
|
800
|
-
walletId,
|
|
801
|
-
addressType: addressType
|
|
804
|
+
additionalProps: {
|
|
805
|
+
addressType
|
|
806
|
+
}
|
|
802
807
|
});
|
|
803
808
|
// Resolve the promise when ceremony is complete
|
|
804
809
|
ceremonyCompleteResolver(undefined);
|
|
@@ -901,7 +906,7 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
901
906
|
throw new Error('Wallet not found in walletMap');
|
|
902
907
|
}
|
|
903
908
|
const derivationPath = walletProperties.derivationPath;
|
|
904
|
-
if (
|
|
909
|
+
if (derivationPath === undefined || derivationPath === null) {
|
|
905
910
|
throw new Error('Derivation path missing in walletMap');
|
|
906
911
|
}
|
|
907
912
|
let addressType = walletProperties.addressType;
|
|
@@ -918,10 +923,11 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
918
923
|
addressType,
|
|
919
924
|
network
|
|
920
925
|
};
|
|
926
|
+
const walletDerivationPath = parseDerivationPath(derivationPath);
|
|
921
927
|
const derivedPublicKey = await this.derivePublicKey({
|
|
922
928
|
chainName: this.chainName,
|
|
923
929
|
keyShare: clientKeyShares[0],
|
|
924
|
-
derivationPath:
|
|
930
|
+
derivationPath: walletDerivationPath,
|
|
925
931
|
bitcoinConfig
|
|
926
932
|
});
|
|
927
933
|
if (!derivedPublicKey) {
|
|
@@ -1003,7 +1009,7 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
1003
1009
|
throw new Error('Wallet not found in walletMap');
|
|
1004
1010
|
}
|
|
1005
1011
|
const derivationPath = walletProperties.derivationPath;
|
|
1006
|
-
if (
|
|
1012
|
+
if (derivationPath === undefined || derivationPath === null) {
|
|
1007
1013
|
throw new Error('Derivation path missing in walletMap');
|
|
1008
1014
|
}
|
|
1009
1015
|
let addressType = walletProperties.addressType;
|
|
@@ -1082,21 +1088,17 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
1082
1088
|
},
|
|
1083
1089
|
onCeremonyComplete: (accountAddress, walletId)=>{
|
|
1084
1090
|
ceremonyAccountAddress = accountAddress;
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
});
|
|
1089
|
-
this.walletMap[accountAddress] = _extends({}, this.walletMap[accountAddress] || {}, {
|
|
1091
|
+
// For imported BTC wallets, use empty derivation path
|
|
1092
|
+
// The server returns "[]" for imported wallets (raw key, not derived)
|
|
1093
|
+
this.initializeWalletMapEntry({
|
|
1090
1094
|
accountAddress,
|
|
1091
1095
|
walletId,
|
|
1092
1096
|
chainName: this.chainName,
|
|
1093
1097
|
thresholdSignatureScheme,
|
|
1094
|
-
derivationPath: JSON.stringify(
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
addressType: addressTypeEnum,
|
|
1099
|
-
clientKeySharesBackupInfo: getClientKeyShareBackupInfo()
|
|
1098
|
+
derivationPath: JSON.stringify([]),
|
|
1099
|
+
additionalProps: {
|
|
1100
|
+
addressType: addressTypeEnum
|
|
1101
|
+
}
|
|
1100
1102
|
});
|
|
1101
1103
|
this.logger.debug('walletMap updated for wallet', {
|
|
1102
1104
|
context: {
|
|
@@ -1203,7 +1205,7 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
1203
1205
|
throw new Error('Wallet not found in walletMap');
|
|
1204
1206
|
}
|
|
1205
1207
|
const derivationPath = walletProperties.derivationPath;
|
|
1206
|
-
if (
|
|
1208
|
+
if (derivationPath === undefined || derivationPath === null) {
|
|
1207
1209
|
throw new Error('Derivation path missing in walletMap');
|
|
1208
1210
|
}
|
|
1209
1211
|
let addressType = walletProperties.addressType;
|
|
@@ -1221,10 +1223,11 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
1221
1223
|
if (!clientKeyShares || clientKeyShares.length === 0) {
|
|
1222
1224
|
throw new Error('No key shares found');
|
|
1223
1225
|
}
|
|
1226
|
+
const walletDerivationPath = parseDerivationPath(derivationPath);
|
|
1224
1227
|
const derivedPublicKey = await this.derivePublicKey({
|
|
1225
1228
|
chainName: this.chainName,
|
|
1226
1229
|
keyShare: clientKeyShares[0],
|
|
1227
|
-
derivationPath:
|
|
1230
|
+
derivationPath: walletDerivationPath,
|
|
1228
1231
|
bitcoinConfig
|
|
1229
1232
|
});
|
|
1230
1233
|
if (!derivedPublicKey) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/btc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.252",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@dynamic-labs/sdk-api-core": "^0.0.828",
|
|
9
|
-
"@dynamic-labs-wallet/browser": "0.0.
|
|
9
|
+
"@dynamic-labs-wallet/browser": "0.0.252",
|
|
10
10
|
"@bitcoinerlab/secp256k1": "^1.2.0",
|
|
11
11
|
"bitcoinjs-lib": "^7.0.0",
|
|
12
12
|
"bip322-js": "^3.0.0",
|
package/src/client/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BitcoinAddressType, BitcoinNetwork, DynamicWalletClient, type BIP340KeygenResult, type BitcoinConfig, type DynamicWalletClientProps, type EcdsaPublicKey, type ThresholdSignatureScheme } from '@dynamic-labs-wallet/browser';
|
|
2
2
|
import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
|
|
3
3
|
export declare class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
4
4
|
readonly chainName = "BTC";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EAOnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EAEnB,KAAK,wBAAwB,EAC9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAwBrE,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;IAE3B;;;OAGG;gBACS,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,YAAY,EACZ,QAA0B,EAC1B,UAAU,EACV,gBAAgB,GACjB,EA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C;QACtB,OAAO,EAAE,cAAc,CAAC;QACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,kBAAkB,CAAC;QAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;KAClC,GAAG,OAAO,CAAC,MAAM,CAAC;IA6MnB;;;;;;;;OAQG;IACG,iBAAiB,CAAC,EACtB,eAAe,EACf,MAAM,EACN,aAAa,EACb,OAAO,EACP,YAAuB,GACxB,EAAE;QACD,eAAe,EAAE,MAAM,CAAC;QACxB,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,OAAO,EAAE,cAAc,CAAC;QACxB,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;KAC3C,GAAG,OAAO,CAAC,MAAM,CAAC;IA6GnB;;;;;OAKG;YACW,QAAQ;IActB;;;OAGG;IACG,iBAAiB;CAOxB"}
|
package/src/utils/index.d.ts
CHANGED
|
@@ -15,4 +15,5 @@ export { calculateTaprootTweak } from './calculateTaprootTweak/index.js';
|
|
|
15
15
|
export { convertSignatureToTaprootBuffer } from './convertSignatureToTaprootBuffer/index.js';
|
|
16
16
|
export { collectPSBTInputData } from './collectPSBTInputData/index.js';
|
|
17
17
|
export { doesInputBelongToAddress } from './doesInputBelongToAddress/index.js';
|
|
18
|
+
export { parseDerivationPath } from './parseDerivationPath/index.js';
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
package/src/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC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,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/parseDerivationPath/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses the derivation path string into a Uint32Array
|
|
3
|
+
* Handles empty strings and empty array strings by returning an empty Uint32Array
|
|
4
|
+
*
|
|
5
|
+
* @param derivationPath - The derivation path as a JSON string (e.g., '{"0":44,"1":0,"2":0}' or '[]' or '')
|
|
6
|
+
* @returns The derivation path as a Uint32Array
|
|
7
|
+
* @throws Error if the derivation path is invalid JSON
|
|
8
|
+
*/
|
|
9
|
+
export declare const parseDerivationPath: (derivationPath: string) => Uint32Array;
|
|
10
|
+
//# sourceMappingURL=parseDerivationPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseDerivationPath.d.ts","sourceRoot":"","sources":["../../../src/utils/parseDerivationPath/parseDerivationPath.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,mBAAoB,MAAM,KAAG,WAK5D,CAAC"}
|