@dynamic-labs-wallet/btc 1.1.11 → 1.1.13
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 +5 -2
- package/index.esm.js +5 -2
- package/package.json +3 -3
- package/src/client/client.d.ts +6 -26
- package/src/client/client.d.ts.map +1 -1
package/index.cjs
CHANGED
|
@@ -233,7 +233,7 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
233
233
|
* @param context - Additional context
|
|
234
234
|
* @param onError - Error callback
|
|
235
235
|
* @returns The BIP-322 signature
|
|
236
|
-
*/ async signMessage({ message, accountAddress, network, password = undefined, signedSessionId, mfaToken, elevatedAccessToken, context, onError }) {
|
|
236
|
+
*/ async signMessage({ message, accountAddress, network, password = undefined, signedSessionId, mfaToken, elevatedAccessToken, context, approvalQuorum, onError }) {
|
|
237
237
|
await this.verifyPassword({
|
|
238
238
|
accountAddress,
|
|
239
239
|
password,
|
|
@@ -304,6 +304,7 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
304
304
|
btcMessage: message
|
|
305
305
|
},
|
|
306
306
|
bitcoinConfig: completeBitcoinConfig,
|
|
307
|
+
approvalQuorum,
|
|
307
308
|
onError
|
|
308
309
|
});
|
|
309
310
|
// Encode Final Result
|
|
@@ -553,7 +554,7 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
553
554
|
* from the PSBT; this only restricts which declared types are accepted. An empty
|
|
554
555
|
* array permits nothing; omit the parameter to permit any declared type
|
|
555
556
|
* @returns The signed PSBT
|
|
556
|
-
*/ async signTransaction({ transaction, senderAddress, network, password, signedSessionId, mfaToken, elevatedAccessToken, context, onError, signingIndexes, allowedSighash, allowedWitnessScripts }) {
|
|
557
|
+
*/ async signTransaction({ transaction, senderAddress, network, password, signedSessionId, mfaToken, elevatedAccessToken, context, approvalQuorum, onError, signingIndexes, allowedSighash, allowedWitnessScripts }) {
|
|
557
558
|
try {
|
|
558
559
|
await this.verifyPassword({
|
|
559
560
|
accountAddress: senderAddress,
|
|
@@ -652,6 +653,7 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
652
653
|
}
|
|
653
654
|
}),
|
|
654
655
|
bitcoinConfig: completeBitcoinConfig,
|
|
656
|
+
approvalQuorum,
|
|
655
657
|
onError
|
|
656
658
|
});
|
|
657
659
|
const sigBuffer = btcUtils.convertSignatureToTaprootBuffer(signature, sigHashType);
|
|
@@ -692,6 +694,7 @@ class DynamicBtcWalletClient extends browser.DynamicWalletClient {
|
|
|
692
694
|
}
|
|
693
695
|
}),
|
|
694
696
|
bitcoinConfig: completeBitcoinConfig,
|
|
697
|
+
approvalQuorum,
|
|
695
698
|
onError
|
|
696
699
|
});
|
|
697
700
|
const derSignature = btcUtils.convertSignatureToDER(signature, sigHashType);
|
package/index.esm.js
CHANGED
|
@@ -212,7 +212,7 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
212
212
|
* @param context - Additional context
|
|
213
213
|
* @param onError - Error callback
|
|
214
214
|
* @returns The BIP-322 signature
|
|
215
|
-
*/ async signMessage({ message, accountAddress, network, password = undefined, signedSessionId, mfaToken, elevatedAccessToken, context, onError }) {
|
|
215
|
+
*/ async signMessage({ message, accountAddress, network, password = undefined, signedSessionId, mfaToken, elevatedAccessToken, context, approvalQuorum, onError }) {
|
|
216
216
|
await this.verifyPassword({
|
|
217
217
|
accountAddress,
|
|
218
218
|
password,
|
|
@@ -283,6 +283,7 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
283
283
|
btcMessage: message
|
|
284
284
|
},
|
|
285
285
|
bitcoinConfig: completeBitcoinConfig,
|
|
286
|
+
approvalQuorum,
|
|
286
287
|
onError
|
|
287
288
|
});
|
|
288
289
|
// Encode Final Result
|
|
@@ -532,7 +533,7 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
532
533
|
* from the PSBT; this only restricts which declared types are accepted. An empty
|
|
533
534
|
* array permits nothing; omit the parameter to permit any declared type
|
|
534
535
|
* @returns The signed PSBT
|
|
535
|
-
*/ async signTransaction({ transaction, senderAddress, network, password, signedSessionId, mfaToken, elevatedAccessToken, context, onError, signingIndexes, allowedSighash, allowedWitnessScripts }) {
|
|
536
|
+
*/ async signTransaction({ transaction, senderAddress, network, password, signedSessionId, mfaToken, elevatedAccessToken, context, approvalQuorum, onError, signingIndexes, allowedSighash, allowedWitnessScripts }) {
|
|
536
537
|
try {
|
|
537
538
|
await this.verifyPassword({
|
|
538
539
|
accountAddress: senderAddress,
|
|
@@ -631,6 +632,7 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
631
632
|
}
|
|
632
633
|
}),
|
|
633
634
|
bitcoinConfig: completeBitcoinConfig,
|
|
635
|
+
approvalQuorum,
|
|
634
636
|
onError
|
|
635
637
|
});
|
|
636
638
|
const sigBuffer = convertSignatureToTaprootBuffer(signature, sigHashType);
|
|
@@ -671,6 +673,7 @@ class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
671
673
|
}
|
|
672
674
|
}),
|
|
673
675
|
bitcoinConfig: completeBitcoinConfig,
|
|
676
|
+
approvalQuorum,
|
|
674
677
|
onError
|
|
675
678
|
});
|
|
676
679
|
const derSignature = convertSignatureToDER(signature, sigHashType);
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/btc",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@dynamic-labs/sdk-api-core": "^0.16.0",
|
|
9
|
-
"@dynamic-labs-wallet/browser": "1.1.
|
|
10
|
-
"@dynamic-labs-wallet/btc-utils": "1.1.
|
|
9
|
+
"@dynamic-labs-wallet/browser": "1.1.13",
|
|
10
|
+
"@dynamic-labs-wallet/btc-utils": "1.1.13",
|
|
11
11
|
"@bitcoinerlab/secp256k1": "^1.2.0",
|
|
12
12
|
"bitcoinjs-lib": "^7.0.0"
|
|
13
13
|
},
|
package/src/client/client.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BitcoinAddressType, BitcoinNetwork, DynamicWalletClient, type BIP340KeygenResult, type BitcoinConfig, type DynamicWalletClientInternalOptions, type DynamicWalletClientProps, type EcdsaPublicKey, type EcdsaSignature, type ThresholdSignatureScheme, type RequestWithElevatedAccessToken, type
|
|
2
|
-
import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
|
|
1
|
+
import { BitcoinAddressType, BitcoinNetwork, DynamicWalletClient, type BIP340KeygenResult, type BitcoinConfig, type DynamicWalletClientInternalOptions, type DynamicWalletClientProps, type EcdsaPublicKey, type EcdsaSignature, type ThresholdSignatureScheme, type RequestWithElevatedAccessToken, type BaseSignParams } from '@dynamic-labs-wallet/browser';
|
|
3
2
|
export declare class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
4
3
|
readonly chainName = "BTC";
|
|
5
4
|
/**
|
|
@@ -63,16 +62,9 @@ export declare class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
63
62
|
accountAddress: string;
|
|
64
63
|
message: string | Uint8Array;
|
|
65
64
|
chainName: string;
|
|
66
|
-
password?: string;
|
|
67
65
|
isFormatted?: boolean;
|
|
68
|
-
signedSessionId: string;
|
|
69
|
-
mfaToken?: string;
|
|
70
|
-
elevatedAccessToken?: string;
|
|
71
|
-
context?: SignMessageContext;
|
|
72
|
-
onError?: (error: Error) => void;
|
|
73
|
-
traceContext?: TraceContext;
|
|
74
66
|
bitcoinConfig?: BitcoinConfig;
|
|
75
|
-
}): Promise<EcdsaSignature | Uint8Array>;
|
|
67
|
+
} & BaseSignParams): Promise<EcdsaSignature | Uint8Array>;
|
|
76
68
|
/**
|
|
77
69
|
* Signs a message (BIP-322)
|
|
78
70
|
* @param message - The message to sign
|
|
@@ -85,17 +77,11 @@ export declare class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
85
77
|
* @param onError - Error callback
|
|
86
78
|
* @returns The BIP-322 signature
|
|
87
79
|
*/
|
|
88
|
-
signMessage({ message, accountAddress, network, password, signedSessionId, mfaToken, elevatedAccessToken, context, onError, }: {
|
|
80
|
+
signMessage({ message, accountAddress, network, password, signedSessionId, mfaToken, elevatedAccessToken, context, approvalQuorum, onError, }: {
|
|
89
81
|
message: string;
|
|
90
82
|
accountAddress: string;
|
|
91
83
|
network: BitcoinNetwork;
|
|
92
|
-
|
|
93
|
-
signedSessionId: string;
|
|
94
|
-
mfaToken?: string;
|
|
95
|
-
elevatedAccessToken?: string;
|
|
96
|
-
context?: SignMessageContext;
|
|
97
|
-
onError?: (error: Error) => void;
|
|
98
|
-
}): Promise<string>;
|
|
84
|
+
} & BaseSignParams): Promise<string>;
|
|
99
85
|
/**
|
|
100
86
|
* Verifies that the derived address matches the expected address
|
|
101
87
|
* @param rawPublicKey - The raw public key
|
|
@@ -180,21 +166,15 @@ export declare class DynamicBtcWalletClient extends DynamicWalletClient {
|
|
|
180
166
|
* array permits nothing; omit the parameter to permit any declared type
|
|
181
167
|
* @returns The signed PSBT
|
|
182
168
|
*/
|
|
183
|
-
signTransaction({ transaction, senderAddress, network, password, signedSessionId, mfaToken, elevatedAccessToken, context, onError, signingIndexes, allowedSighash, allowedWitnessScripts, }: {
|
|
169
|
+
signTransaction({ transaction, senderAddress, network, password, signedSessionId, mfaToken, elevatedAccessToken, context, approvalQuorum, onError, signingIndexes, allowedSighash, allowedWitnessScripts, }: {
|
|
184
170
|
transaction: string;
|
|
185
171
|
senderAddress: string;
|
|
186
172
|
network: BitcoinNetwork;
|
|
187
|
-
password?: string;
|
|
188
|
-
signedSessionId: string;
|
|
189
|
-
mfaToken?: string;
|
|
190
|
-
elevatedAccessToken?: string;
|
|
191
|
-
context?: SignMessageContext;
|
|
192
|
-
onError?: (error: Error) => void;
|
|
193
173
|
signingIndexes?: number[];
|
|
194
174
|
allowedSighash?: number[];
|
|
195
175
|
/** Hex-encoded witnessScripts the wallet may co-sign (P2WSH opt-in). */
|
|
196
176
|
allowedWitnessScripts?: string[];
|
|
197
|
-
}): Promise<string>;
|
|
177
|
+
} & BaseSignParams): Promise<string>;
|
|
198
178
|
/**
|
|
199
179
|
* Creates a PSBT for a transaction
|
|
200
180
|
* @param receiverAddress - The address to send funds to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EAQnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,kCAAkC,EACvC,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EAQnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,kCAAkC,EACvC,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAgCtC,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;IAE3B;;;OAGG;gBACS,KAAK,EAAE,wBAAwB,EAAE,eAAe,CAAC,EAAE,kCAAkC;IAOjG;;;;;;;;OAQG;IACG,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,EACpB,OAAO,EACP,eAAe,EACf,aAAa,EACb,iBAAiB,GAClB,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC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