@dynamic-labs-wallet/btc 0.0.228 → 0.0.230
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 +1135 -2
- package/index.esm.js +1117 -2
- package/package.json +8 -2
- package/src/client/client.d.ts +158 -0
- package/src/client/client.d.ts.map +1 -0
- package/src/index.d.ts +1 -1
- package/src/index.d.ts.map +1 -1
- package/src/types/index.d.ts +0 -21
- package/src/types/index.d.ts.map +1 -1
- package/src/utils/calculateBip322Hash/calculateBip322Hash.d.ts +16 -0
- package/src/utils/calculateBip322Hash/calculateBip322Hash.d.ts.map +1 -0
- package/src/utils/calculateBip322Hash/index.d.ts +2 -0
- package/src/utils/calculateBip322Hash/index.d.ts.map +1 -0
- package/src/utils/convertSignatureToDER/convertSignatureToDER.d.ts +9 -0
- package/src/utils/convertSignatureToDER/convertSignatureToDER.d.ts.map +1 -0
- package/src/utils/convertSignatureToDER/index.d.ts +2 -0
- package/src/utils/convertSignatureToDER/index.d.ts.map +1 -0
- package/src/utils/createLegacyAddress/createLegacyAddress.d.ts +10 -0
- package/src/utils/createLegacyAddress/createLegacyAddress.d.ts.map +1 -0
- package/src/utils/createLegacyAddress/index.d.ts +2 -0
- package/src/utils/createLegacyAddress/index.d.ts.map +1 -0
- package/src/utils/createNativeSegWitAddress/createNativeSegWitAddress.d.ts +10 -0
- package/src/utils/createNativeSegWitAddress/createNativeSegWitAddress.d.ts.map +1 -0
- package/src/utils/createNativeSegWitAddress/index.d.ts +2 -0
- package/src/utils/createNativeSegWitAddress/index.d.ts.map +1 -0
- package/src/utils/createSegWitAddress/createSegWitAddress.d.ts +10 -0
- package/src/utils/createSegWitAddress/createSegWitAddress.d.ts.map +1 -0
- package/src/utils/createSegWitAddress/index.d.ts +2 -0
- package/src/utils/createSegWitAddress/index.d.ts.map +1 -0
- package/src/utils/createTaprootAddress/createTaprootAddress.d.ts +10 -0
- package/src/utils/createTaprootAddress/createTaprootAddress.d.ts.map +1 -0
- package/src/utils/createTaprootAddress/index.d.ts +2 -0
- package/src/utils/createTaprootAddress/index.d.ts.map +1 -0
- package/src/utils/encodeBip322Signature/encodeBip322Signature.d.ts +13 -0
- package/src/utils/encodeBip322Signature/encodeBip322Signature.d.ts.map +1 -0
- package/src/utils/encodeBip322Signature/index.d.ts +2 -0
- package/src/utils/encodeBip322Signature/index.d.ts.map +1 -0
- package/src/utils/getAddressTypeFromDerivationPath/getAddressTypeFromDerivationPath.d.ts +9 -0
- package/src/utils/getAddressTypeFromDerivationPath/getAddressTypeFromDerivationPath.d.ts.map +1 -0
- package/src/utils/getAddressTypeFromDerivationPath/index.d.ts +2 -0
- package/src/utils/getAddressTypeFromDerivationPath/index.d.ts.map +1 -0
- package/src/utils/getBitcoinNetwork/getBitcoinNetwork.d.ts +10 -0
- package/src/utils/getBitcoinNetwork/getBitcoinNetwork.d.ts.map +1 -0
- package/src/utils/getBitcoinNetwork/index.d.ts +2 -0
- package/src/utils/getBitcoinNetwork/index.d.ts.map +1 -0
- package/src/utils/getDefaultRpcUrl/getDefaultRpcUrl.d.ts +9 -0
- package/src/utils/getDefaultRpcUrl/getDefaultRpcUrl.d.ts.map +1 -0
- package/src/utils/getDefaultRpcUrl/index.d.ts +2 -0
- package/src/utils/getDefaultRpcUrl/index.d.ts.map +1 -0
- package/src/utils/getFeeRates/getFeeRates.d.ts +18 -0
- package/src/utils/getFeeRates/getFeeRates.d.ts.map +1 -0
- package/src/utils/getFeeRates/index.d.ts +2 -0
- package/src/utils/getFeeRates/index.d.ts.map +1 -0
- package/src/utils/getUTXOs/getUTXOs.d.ts +15 -0
- package/src/utils/getUTXOs/getUTXOs.d.ts.map +1 -0
- package/src/utils/getUTXOs/index.d.ts +2 -0
- package/src/utils/getUTXOs/index.d.ts.map +1 -0
- package/src/utils/index.d.ts +12 -0
- package/src/utils/index.d.ts.map +1 -0
- package/src/utils/initEccLib/index.d.ts +2 -0
- package/src/utils/initEccLib/index.d.ts.map +1 -0
- package/src/utils/initEccLib/initEccLib.d.ts +5 -0
- package/src/utils/initEccLib/initEccLib.d.ts.map +1 -0
- package/src/utils/normalizeForCompressed/index.d.ts +2 -0
- package/src/utils/normalizeForCompressed/index.d.ts.map +1 -0
- package/src/utils/normalizeForCompressed/normalizeForCompressed.d.ts +9 -0
- package/src/utils/normalizeForCompressed/normalizeForCompressed.d.ts.map +1 -0
- package/src/utils/normalizeForTaproot/index.d.ts +2 -0
- package/src/utils/normalizeForTaproot/index.d.ts.map +1 -0
- package/src/utils/normalizeForTaproot/normalizeForTaproot.d.ts +9 -0
- package/src/utils/normalizeForTaproot/normalizeForTaproot.d.ts.map +1 -0
- package/src/utils/normalizePublicKey/index.d.ts +2 -0
- package/src/utils/normalizePublicKey/index.d.ts.map +1 -0
- package/src/utils/normalizePublicKey/normalizePublicKey.d.ts +14 -0
- package/src/utils/normalizePublicKey/normalizePublicKey.d.ts.map +1 -0
- package/src/utils/privateKeyToWIF/index.d.ts +2 -0
- package/src/utils/privateKeyToWIF/index.d.ts.map +1 -0
- package/src/utils/privateKeyToWIF/privateKeyToWIF.d.ts +24 -0
- package/src/utils/privateKeyToWIF/privateKeyToWIF.d.ts.map +1 -0
- package/src/utils/publicKeyToBitcoinAddress/index.d.ts +2 -0
- package/src/utils/publicKeyToBitcoinAddress/index.d.ts.map +1 -0
- package/src/utils/publicKeyToBitcoinAddress/publicKeyToBitcoinAddress.d.ts +12 -0
- package/src/utils/publicKeyToBitcoinAddress/publicKeyToBitcoinAddress.d.ts.map +1 -0
- package/src/utils/selectUTXOs/index.d.ts +2 -0
- package/src/utils/selectUTXOs/index.d.ts.map +1 -0
- package/src/utils/selectUTXOs/selectUTXOs.d.ts +19 -0
- package/src/utils/selectUTXOs/selectUTXOs.d.ts.map +1 -0
- package/src/utils/toBuffer/index.d.ts +2 -0
- package/src/utils/toBuffer/index.d.ts.map +1 -0
- package/src/utils/toBuffer/toBuffer.d.ts +8 -0
- package/src/utils/toBuffer/toBuffer.d.ts.map +1 -0
package/package.json
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/btc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.230",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@dynamic-labs-
|
|
8
|
+
"@dynamic-labs/sdk-api-core": "^0.0.828",
|
|
9
|
+
"@dynamic-labs-wallet/browser": "0.0.230",
|
|
10
|
+
"@bitcoinerlab/secp256k1": "^1.2.0",
|
|
11
|
+
"bitcoinjs-lib": "^7.0.0",
|
|
12
|
+
"bip322-js": "^3.0.0",
|
|
13
|
+
"@noble/hashes": "1.7.1",
|
|
14
|
+
"bs58": "^6.0.0"
|
|
9
15
|
},
|
|
10
16
|
"nx": {
|
|
11
17
|
"sourceRoot": "packages/btc/src",
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { type DynamicWalletClientProps, type BIP340KeygenResult, type EcdsaPublicKey, type ThresholdSignatureScheme, DynamicWalletClient, type BitcoinConfig, BitcoinAddressType, BitcoinNetwork } from '@dynamic-labs-wallet/browser';
|
|
2
|
+
import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
|
|
3
|
+
export declare class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
4
|
+
readonly chainName = "BTC";
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new instance of DynamicBtcWalletClient
|
|
7
|
+
* @param props - The client properties
|
|
8
|
+
*/
|
|
9
|
+
constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug, featureFlags, authMode, sdkVersion, forwardMPCClient, }: DynamicWalletClientProps);
|
|
10
|
+
/**
|
|
11
|
+
* Creates a Bitcoin wallet account
|
|
12
|
+
* @param thresholdSignatureScheme - The threshold signature scheme to use for the wallet
|
|
13
|
+
* @param password - The password to use for the wallet
|
|
14
|
+
* @param onError - The function to call if an error occurs
|
|
15
|
+
* @param signedSessionId - The signed session ID to use for the wallet
|
|
16
|
+
* @param addressType - The type of address to use for the wallet
|
|
17
|
+
* @returns The account address, public key hex, and raw public key
|
|
18
|
+
*/
|
|
19
|
+
createWalletAccount({ thresholdSignatureScheme, password, onError, signedSessionId, bitcoinConfig, }: {
|
|
20
|
+
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
21
|
+
password?: string;
|
|
22
|
+
onError?: (error: Error) => void;
|
|
23
|
+
signedSessionId: string;
|
|
24
|
+
bitcoinConfig: BitcoinConfig;
|
|
25
|
+
}): Promise<{
|
|
26
|
+
accountAddress: string;
|
|
27
|
+
publicKeyHex: string;
|
|
28
|
+
rawPublicKey: EcdsaPublicKey | BIP340KeygenResult | Uint8Array | string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Automatically determines the chain config based on address type
|
|
32
|
+
* @param rawPublicKey - The raw public key from the server
|
|
33
|
+
* @returns The public key hex
|
|
34
|
+
*/
|
|
35
|
+
private extractPublicKeyHex;
|
|
36
|
+
/**
|
|
37
|
+
* Derives the Bitcoin account address
|
|
38
|
+
* - BIP340 keys (32 bytes x-only): Only for Taproot addresses
|
|
39
|
+
* - ECDSA keys (33/65 bytes): For all other address types (Legacy, SegWit, Native SegWit)
|
|
40
|
+
* - Algorithm selection is automatic based on addressType
|
|
41
|
+
* @param rawPublicKey - The raw public key to derive the account address from
|
|
42
|
+
* @param addressType - The address type to derive the account address for
|
|
43
|
+
* @param network - The network to derive the account address for
|
|
44
|
+
* @returns The account address
|
|
45
|
+
*/
|
|
46
|
+
deriveAccountAddress({ rawPublicKey, addressType, network, }: {
|
|
47
|
+
rawPublicKey: any;
|
|
48
|
+
addressType: BitcoinAddressType;
|
|
49
|
+
network: BitcoinNetwork;
|
|
50
|
+
}): {
|
|
51
|
+
accountAddress: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Signs a message (BIP-322)
|
|
55
|
+
* @param message - The message to sign
|
|
56
|
+
* @param accountAddress - The account address
|
|
57
|
+
* @param network - The network (mainnet/testnet)
|
|
58
|
+
* @param password - The wallet password (optional)
|
|
59
|
+
* @param signedSessionId - The signed session ID
|
|
60
|
+
* @param mfaToken - The MFA token (optional)
|
|
61
|
+
* @param context - Additional context
|
|
62
|
+
* @param onError - Error callback
|
|
63
|
+
* @returns The BIP-322 signature
|
|
64
|
+
*/
|
|
65
|
+
signMessage({ message, accountAddress, network, password, signedSessionId, mfaToken, context, onError, }: {
|
|
66
|
+
message: string;
|
|
67
|
+
accountAddress: string;
|
|
68
|
+
network: BitcoinNetwork;
|
|
69
|
+
password?: string;
|
|
70
|
+
signedSessionId: string;
|
|
71
|
+
mfaToken?: string;
|
|
72
|
+
context?: SignMessageContext;
|
|
73
|
+
onError?: (error: Error) => void;
|
|
74
|
+
}): Promise<string>;
|
|
75
|
+
/**
|
|
76
|
+
* Verifies that the derived address matches the expected address
|
|
77
|
+
* @param rawPublicKey - The raw public key
|
|
78
|
+
* @param addressType - The address type
|
|
79
|
+
* @param network - The network
|
|
80
|
+
* @param expectedAddress - The expected address
|
|
81
|
+
*/
|
|
82
|
+
private verifyWalletAddress;
|
|
83
|
+
/**
|
|
84
|
+
* Exports the private key for a given account
|
|
85
|
+
* @param accountAddress - The account address to export the private key for
|
|
86
|
+
* @param password - The password to use for the private key
|
|
87
|
+
* @param signedSessionId - The signed session ID to use for the private key
|
|
88
|
+
* @param mfaToken - The MFA token to use for the private key
|
|
89
|
+
* @param network - The network to use for the private key
|
|
90
|
+
* @returns The private key
|
|
91
|
+
*/
|
|
92
|
+
exportPrivateKey({ accountAddress, password, signedSessionId, mfaToken, }: {
|
|
93
|
+
accountAddress: string;
|
|
94
|
+
password?: string;
|
|
95
|
+
signedSessionId: string;
|
|
96
|
+
mfaToken?: string;
|
|
97
|
+
}): Promise<string>;
|
|
98
|
+
/**
|
|
99
|
+
* Converts MPC private key to Bitcoin WIF (Wallet Import Format)
|
|
100
|
+
* Uses the utility function from utils.ts for the core conversion logic
|
|
101
|
+
* @param privateKey - The private key to convert to a Bitcoin WIF format
|
|
102
|
+
* @param network - The network to convert the private key to a Bitcoin WIF format for
|
|
103
|
+
* @returns The Bitcoin WIF format
|
|
104
|
+
*/
|
|
105
|
+
private convertPrivateKeyToBitcoinFormat;
|
|
106
|
+
/**
|
|
107
|
+
* Sign a Bitcoin Transaction (PSBT)
|
|
108
|
+
*
|
|
109
|
+
* @param transaction - The PSBT to sign in hex format
|
|
110
|
+
* @param senderAddress - The address of the sender
|
|
111
|
+
* @param password - The password to use for the transaction
|
|
112
|
+
* @param signedSessionId - The signed session ID to use for the transaction
|
|
113
|
+
* @param authToken - The auth token to use for the transaction
|
|
114
|
+
* @param mfaToken - The MFA token to use for the transaction
|
|
115
|
+
* @param context - The context to use for the transaction
|
|
116
|
+
* @param onError - The error handler
|
|
117
|
+
* @returns The signed PSBT
|
|
118
|
+
*/
|
|
119
|
+
signTransaction({ transaction, senderAddress, network, password, signedSessionId, mfaToken, context, onError, }: {
|
|
120
|
+
transaction: string;
|
|
121
|
+
senderAddress: string;
|
|
122
|
+
network: BitcoinNetwork;
|
|
123
|
+
password?: string;
|
|
124
|
+
signedSessionId: string;
|
|
125
|
+
mfaToken?: string;
|
|
126
|
+
context?: SignMessageContext;
|
|
127
|
+
onError?: (error: Error) => void;
|
|
128
|
+
}): Promise<string>;
|
|
129
|
+
/**
|
|
130
|
+
* Creates a PSBT for a transaction
|
|
131
|
+
* @param receiverAddress - The address to send funds to
|
|
132
|
+
* @param amount - The amount to send in satoshis
|
|
133
|
+
* @param senderAddress - The address to send funds from
|
|
134
|
+
* @param network - The network to use (mainnet/testnet)
|
|
135
|
+
* @param feeRateLevel - The fee rate level to use (fast, medium, slow)
|
|
136
|
+
* @returns The PSBT in hex format
|
|
137
|
+
*/
|
|
138
|
+
createTransaction({ receiverAddress, amount, senderAddress, network, feeRateLevel, }: {
|
|
139
|
+
receiverAddress: string;
|
|
140
|
+
amount: string;
|
|
141
|
+
senderAddress: string;
|
|
142
|
+
network: BitcoinNetwork;
|
|
143
|
+
feeRateLevel?: 'fast' | 'medium' | 'slow';
|
|
144
|
+
}): Promise<string>;
|
|
145
|
+
/**
|
|
146
|
+
* Fetches the raw transaction hex for a given transaction ID
|
|
147
|
+
* @param txid - The transaction ID
|
|
148
|
+
* @param network - The network
|
|
149
|
+
* @returns The transaction hex
|
|
150
|
+
*/
|
|
151
|
+
private getTxHex;
|
|
152
|
+
/**
|
|
153
|
+
* Gets the Bitcoin wallets
|
|
154
|
+
* @returns The Bitcoin wallets
|
|
155
|
+
*/
|
|
156
|
+
getBitcoinWallets(): Promise<any>;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"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"}
|
package/src/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './client/client.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
package/src/types/index.d.ts
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enum representing supported Bitcoin address types.
|
|
3
|
-
*/
|
|
4
|
-
export declare enum BitcoinAddressType {
|
|
5
|
-
/**
|
|
6
|
-
* Legacy address (P2PKH). Starts with "1".
|
|
7
|
-
*/
|
|
8
|
-
LEGACY = "legacy",
|
|
9
|
-
/**
|
|
10
|
-
* Nested SegWit address (P2SH-P2WPKH). Starts with "3".
|
|
11
|
-
*/
|
|
12
|
-
SEGWIT = "segwit",
|
|
13
|
-
/**
|
|
14
|
-
* Native SegWit address (P2WPKH). Starts with "bc1q".
|
|
15
|
-
*/
|
|
16
|
-
NATIVE_SEGWIT = "native_segwit",
|
|
17
|
-
/**
|
|
18
|
-
* Taproot address (P2TR). Starts with "bc1p".
|
|
19
|
-
*/
|
|
20
|
-
TAPROOT = "taproot"
|
|
21
|
-
}
|
|
22
1
|
/**
|
|
23
2
|
* Supported Bitcoin networks.
|
|
24
3
|
*/
|
package/src/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG;IACjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE;QACZ;;WAEG;QACH,MAAM,EAAE,UAAU,CAAC;QACnB;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BitcoinAddressType } from '@dynamic-labs-wallet/browser';
|
|
2
|
+
import type { BitcoinNetwork } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Calculates the hash to be signed for a BIP-322 message verification
|
|
5
|
+
*
|
|
6
|
+
* @param message - The message to sign
|
|
7
|
+
* @param pubKey - The public key of the signer
|
|
8
|
+
* @param addressType - The address type (e.g. TAPROOT, SEGWIT)
|
|
9
|
+
* @param network - The Bitcoin network
|
|
10
|
+
* @returns The formatted message hash and the PSBT to be signed
|
|
11
|
+
*/
|
|
12
|
+
export declare const calculateBip322Hash: (message: string, pubKey: any, addressType: BitcoinAddressType, network: BitcoinNetwork) => {
|
|
13
|
+
formattedMessage: Uint8Array;
|
|
14
|
+
toSignPsbt: any;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=calculateBip322Hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculateBip322Hash.d.ts","sourceRoot":"","sources":["../../../src/utils/calculateBip322Hash/calculateBip322Hash.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,YACrB,MAAM,UACP,GAAG,eACE,kBAAkB,WACtB,cAAc,KACtB;IAAE,gBAAgB,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,GAAG,CAAA;CAoEjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/calculateBip322Hash/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EcdsaSignature } from '@dynamic-labs-wallet/browser';
|
|
2
|
+
/**
|
|
3
|
+
* Converts an ECDSA signature to DER format
|
|
4
|
+
*
|
|
5
|
+
* @param signature - The ECDSA signature
|
|
6
|
+
* @returns The DER encoded signature
|
|
7
|
+
*/
|
|
8
|
+
export declare const convertSignatureToDER: (signature: EcdsaSignature) => Uint8Array;
|
|
9
|
+
//# sourceMappingURL=convertSignatureToDER.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertSignatureToDER.d.ts","sourceRoot":"","sources":["../../../src/utils/convertSignatureToDER/convertSignatureToDER.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,cAAe,cAAc,eA8B9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/convertSignatureToDER/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BitcoinNetwork } from "../../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a legacy P2PKH address
|
|
4
|
+
*
|
|
5
|
+
* @param pubKey - The public key
|
|
6
|
+
* @param networkName - The network name
|
|
7
|
+
* @returns The legacy P2PKH address
|
|
8
|
+
*/
|
|
9
|
+
export declare const createLegacyAddress: (pubKey: Buffer, networkName: BitcoinNetwork) => string;
|
|
10
|
+
//# sourceMappingURL=createLegacyAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLegacyAddress.d.ts","sourceRoot":"","sources":["../../../src/utils/createLegacyAddress/createLegacyAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,WAAY,MAAM,eAAe,cAAc,KAAG,MAmBjF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/createLegacyAddress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BitcoinNetwork } from "../../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a native SegWit P2WPKH address
|
|
4
|
+
*
|
|
5
|
+
* @param pubKey - The public key
|
|
6
|
+
* @param networkName - The network name
|
|
7
|
+
* @returns The native SegWit address
|
|
8
|
+
*/
|
|
9
|
+
export declare const createNativeSegWitAddress: (pubKey: Buffer, networkName: BitcoinNetwork) => string;
|
|
10
|
+
//# sourceMappingURL=createNativeSegWitAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createNativeSegWitAddress.d.ts","sourceRoot":"","sources":["../../../src/utils/createNativeSegWitAddress/createNativeSegWitAddress.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI3D;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,WAAY,MAAM,eAAe,cAAc,KAAG,MAwBvF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/createNativeSegWitAddress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BitcoinNetwork } from "../../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a SegWit P2SH-P2WPKH address
|
|
4
|
+
*
|
|
5
|
+
* @param pubKey - The public key
|
|
6
|
+
* @param networkName - The network name
|
|
7
|
+
* @returns The SegWit address
|
|
8
|
+
*/
|
|
9
|
+
export declare const createSegWitAddress: (pubKey: Buffer, networkName: BitcoinNetwork) => string;
|
|
10
|
+
//# sourceMappingURL=createSegWitAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSegWitAddress.d.ts","sourceRoot":"","sources":["../../../src/utils/createSegWitAddress/createSegWitAddress.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI3D;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,WAAY,MAAM,eAAe,cAAc,KAAG,MAyBjF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/createSegWitAddress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BitcoinNetwork } from '../../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a Taproot P2TR address
|
|
4
|
+
*
|
|
5
|
+
* @param pubKey - The public key
|
|
6
|
+
* @param networkName - The network name
|
|
7
|
+
* @returns The Taproot address
|
|
8
|
+
*/
|
|
9
|
+
export declare const createTaprootAddress: (pubKey: Buffer, networkName: BitcoinNetwork) => string;
|
|
10
|
+
//# sourceMappingURL=createTaprootAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTaprootAddress.d.ts","sourceRoot":"","sources":["../../../src/utils/createTaprootAddress/createTaprootAddress.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,WACvB,MAAM,eACD,cAAc,KAC1B,MAkBF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/createTaprootAddress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BitcoinAddressType } from '@dynamic-labs-wallet/browser';
|
|
2
|
+
import type { EcdsaSignature } from '@dynamic-labs-wallet/browser';
|
|
3
|
+
/**
|
|
4
|
+
* Encodes the signature into the BIP-322 witness format
|
|
5
|
+
*
|
|
6
|
+
* @param toSignPsbt - The PSBT that was signed
|
|
7
|
+
* @param pubKey - The public key of the signer
|
|
8
|
+
* @param signature - The signature produced by the signer
|
|
9
|
+
* @param addressType - The address type
|
|
10
|
+
* @returns The base64 encoded BIP-322 signature
|
|
11
|
+
*/
|
|
12
|
+
export declare const encodeBip322Signature: (toSignPsbt: any, pubKey: any, signature: EcdsaSignature | Uint8Array, addressType: BitcoinAddressType) => string;
|
|
13
|
+
//# sourceMappingURL=encodeBip322Signature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encodeBip322Signature.d.ts","sourceRoot":"","sources":["../../../src/utils/encodeBip322Signature/encodeBip322Signature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,eACpB,GAAG,UACP,GAAG,aACA,cAAc,GAAG,UAAU,eACzB,kBAAkB,KAC9B,MAgDF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/encodeBip322Signature/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BitcoinAddressType } from '@dynamic-labs-wallet/browser';
|
|
2
|
+
/**
|
|
3
|
+
* Infers the Bitcoin address type from a BIP-44 derivation path
|
|
4
|
+
*
|
|
5
|
+
* @param derivationPathStr - The derivation path string (e.g. "m/44'/0'/0'/0/0" as JSON or string)
|
|
6
|
+
* @returns The inferred BitcoinAddressType
|
|
7
|
+
*/
|
|
8
|
+
export declare const getAddressTypeFromDerivationPath: (derivationPathStr: string) => BitcoinAddressType;
|
|
9
|
+
//# sourceMappingURL=getAddressTypeFromDerivationPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAddressTypeFromDerivationPath.d.ts","sourceRoot":"","sources":["../../../src/utils/getAddressTypeFromDerivationPath/getAddressTypeFromDerivationPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,sBACxB,MAAM,KACxB,kBAyBF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/getAddressTypeFromDerivationPath/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BitcoinNetwork } from '../../types/index.js';
|
|
2
|
+
import * as bitcoin from 'bitcoinjs-lib';
|
|
3
|
+
/**
|
|
4
|
+
* Maps a BitcoinNetwork string to a bitcoinjs-lib Network object.
|
|
5
|
+
*
|
|
6
|
+
* @param network - The network identifier ('mainnet' or 'testnet').
|
|
7
|
+
* @returns The corresponding bitcoinjs-lib Network object. Defaults to bitcoin mainnet if the network is not recognized.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getBitcoinNetwork(network: BitcoinNetwork): bitcoin.networks.Network;
|
|
10
|
+
//# sourceMappingURL=getBitcoinNetwork.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBitcoinNetwork.d.ts","sourceRoot":"","sources":["../../../src/utils/getBitcoinNetwork/getBitcoinNetwork.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAMnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/getBitcoinNetwork/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BitcoinNetwork } from "../../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Helper to get the default RPC URL
|
|
4
|
+
*
|
|
5
|
+
* @param network - The Bitcoin network
|
|
6
|
+
* @returns The default RPC URL
|
|
7
|
+
*/
|
|
8
|
+
export declare const getDefaultRpcUrl: (network: BitcoinNetwork) => string;
|
|
9
|
+
//# sourceMappingURL=getDefaultRpcUrl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDefaultRpcUrl.d.ts","sourceRoot":"","sources":["../../../src/utils/getDefaultRpcUrl/getDefaultRpcUrl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,YAAa,cAAc,KAAG,MAI1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/getDefaultRpcUrl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BitcoinNetwork } from "../../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Fetches current fee rates from mempool.space
|
|
4
|
+
* Returns fees in sat/vByte
|
|
5
|
+
*
|
|
6
|
+
* @param network - The Bitcoin network (default: 'mainnet')
|
|
7
|
+
* @param rpcUrl - Optional custom RPC URL
|
|
8
|
+
* @returns The fee rates for fast, medium, and slow transactions
|
|
9
|
+
*/
|
|
10
|
+
export declare const getFeeRates: ({ network, rpcUrl }: {
|
|
11
|
+
network?: BitcoinNetwork;
|
|
12
|
+
rpcUrl?: string;
|
|
13
|
+
}) => Promise<{
|
|
14
|
+
fast: number;
|
|
15
|
+
medium: number;
|
|
16
|
+
slow: number;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=getFeeRates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFeeRates.d.ts","sourceRoot":"","sources":["../../../src/utils/getFeeRates/getFeeRates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,wBAGrB;IACD,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,KAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAczD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/getFeeRates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BitcoinNetwork, UTXO } from "../../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Fetches UTXOs for a given address using mempool.space API
|
|
4
|
+
*
|
|
5
|
+
* @param address - The address to fetch UTXOs for
|
|
6
|
+
* @param network - The Bitcoin network (default: 'mainnet')
|
|
7
|
+
* @param rpcUrl - Optional custom RPC URL
|
|
8
|
+
* @returns The list of UTXOs
|
|
9
|
+
*/
|
|
10
|
+
export declare const getUTXOs: ({ address, network, rpcUrl, }: {
|
|
11
|
+
address: string;
|
|
12
|
+
network?: BitcoinNetwork;
|
|
13
|
+
rpcUrl?: string;
|
|
14
|
+
}) => Promise<UTXO[]>;
|
|
15
|
+
//# sourceMappingURL=getUTXOs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUTXOs.d.ts","sourceRoot":"","sources":["../../../src/utils/getUTXOs/getUTXOs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGjE;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,kCAIlB;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,KAAG,OAAO,CAAC,IAAI,EAAE,CAmBjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/getUTXOs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { publicKeyToBitcoinAddress } from './publicKeyToBitcoinAddress/index.js';
|
|
2
|
+
export { normalizePublicKey } from './normalizePublicKey/index.js';
|
|
3
|
+
export { getAddressTypeFromDerivationPath } from './getAddressTypeFromDerivationPath/index.js';
|
|
4
|
+
export { calculateBip322Hash } from './calculateBip322Hash/index.js';
|
|
5
|
+
export { encodeBip322Signature } from './encodeBip322Signature/index.js';
|
|
6
|
+
export { privateKeyToWIF } from './privateKeyToWIF/index.js';
|
|
7
|
+
export { convertSignatureToDER } from './convertSignatureToDER/index.js';
|
|
8
|
+
export { getUTXOs } from './getUTXOs/index.js';
|
|
9
|
+
export { selectUTXOs } from './selectUTXOs/index.js';
|
|
10
|
+
export { getFeeRates } from './getFeeRates/index.js';
|
|
11
|
+
export { getDefaultRpcUrl } from './getDefaultRpcUrl/index.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/initEccLib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initEccLib.d.ts","sourceRoot":"","sources":["../../../src/utils/initEccLib/initEccLib.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,UAAU,YAItB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/normalizeForCompressed/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes a public key buffer for Compressed formats (Legacy, SegWit, Native SegWit).
|
|
3
|
+
* Ensures the result is a 33-byte compressed key.
|
|
4
|
+
*
|
|
5
|
+
* @param buffer - The public key buffer
|
|
6
|
+
* @returns The 33-byte compressed public key buffer
|
|
7
|
+
*/
|
|
8
|
+
export declare const normalizeForCompressed: (buffer: Buffer) => Buffer;
|
|
9
|
+
//# sourceMappingURL=normalizeForCompressed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeForCompressed.d.ts","sourceRoot":"","sources":["../../../src/utils/normalizeForCompressed/normalizeForCompressed.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,WAAY,MAAM,KAAG,MAoBvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/normalizeForTaproot/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes a public key buffer for Taproot (P2TR).
|
|
3
|
+
* Ensures the result is a 32-byte x-only key.
|
|
4
|
+
*
|
|
5
|
+
* @param buffer - The public key buffer
|
|
6
|
+
* @returns The 32-byte x-only public key buffer
|
|
7
|
+
*/
|
|
8
|
+
export declare const normalizeForTaproot: (buffer: Buffer) => Buffer;
|
|
9
|
+
//# sourceMappingURL=normalizeForTaproot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeForTaproot.d.ts","sourceRoot":"","sources":["../../../src/utils/normalizeForTaproot/normalizeForTaproot.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,WAAY,MAAM,KAAG,MAOpD,CAAC"}
|