@dynamic-labs-wallet/btc 0.0.354 → 0.1.0-request-signing

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/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/btc",
3
- "version": "0.0.354",
3
+ "version": "0.1.0-request-signing",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "dependencies": {
8
- "@dynamic-labs/sdk-api-core": "^0.0.984",
9
- "@dynamic-labs-wallet/browser": "0.0.354",
10
- "@dynamic-labs-wallet/btc-utils": "0.0.354",
8
+ "@dynamic-labs/sdk-api-core": "0.193.0",
9
+ "@dynamic-labs-wallet/browser": "0.1.0-request-signing",
10
+ "@dynamic-labs-wallet/btc-utils": "0.1.0-request-signing",
11
11
  "@bitcoinerlab/secp256k1": "^1.2.0",
12
- "bitcoinjs-lib": "^7.0.0"
12
+ "bitcoinjs-lib": "^7.0.2"
13
13
  },
14
14
  "publishConfig": {
15
15
  "access": "public"
@@ -1,12 +1,11 @@
1
- import { BitcoinAddressType, BitcoinNetwork, DynamicWalletClient, type BIP340KeygenResult, type BitcoinConfig, type DynamicWalletClientInternalOptions, type DynamicWalletClientProps, type EcdsaPublicKey, type ThresholdSignatureScheme, type RequestWithElevatedAccessToken } from '@dynamic-labs-wallet/browser';
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, type ApprovalQuorumRequestContext, type ExportApprovalQuorumRequest } from '@dynamic-labs-wallet/browser';
3
2
  export declare class DynamicBtcWalletClient extends DynamicWalletClient {
4
3
  readonly chainName = "BTC";
5
4
  /**
6
5
  * Creates a new instance of DynamicBtcWalletClient
7
6
  * @param props - The client properties
8
7
  */
9
- constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug, featureFlags, authMode, sdkVersion, forwardMPCClient, logger, }: DynamicWalletClientProps, internalOptions?: DynamicWalletClientInternalOptions);
8
+ constructor(props: DynamicWalletClientProps, internalOptions?: DynamicWalletClientInternalOptions);
10
9
  /**
11
10
  * Creates a Bitcoin wallet account
12
11
  * @param thresholdSignatureScheme - The threshold signature scheme to use for the wallet
@@ -16,12 +15,13 @@ export declare class DynamicBtcWalletClient extends DynamicWalletClient {
16
15
  * @param addressType - The type of address to use for the wallet
17
16
  * @returns The account address, public key hex, and raw public key
18
17
  */
19
- createWalletAccount({ thresholdSignatureScheme, password, onError, signedSessionId, bitcoinConfig, }: {
18
+ createWalletAccount({ thresholdSignatureScheme, password, onError, signedSessionId, bitcoinConfig, businessAccountId, }: {
20
19
  thresholdSignatureScheme: ThresholdSignatureScheme;
21
20
  password?: string;
22
21
  onError?: (error: Error) => void;
23
22
  signedSessionId: string;
24
23
  bitcoinConfig?: BitcoinConfig;
24
+ businessAccountId?: string;
25
25
  }): Promise<{
26
26
  accountAddress: string;
27
27
  publicKeyHex: string;
@@ -44,6 +44,27 @@ export declare class DynamicBtcWalletClient extends DynamicWalletClient {
44
44
  }): {
45
45
  accountAddress: string;
46
46
  };
47
+ /**
48
+ * Raw digest signing.
49
+ *
50
+ * Overridden so BTC can supply what getMPCChainConfig needs. The address
51
+ * type selects the derivation path and the signing algorithm, and taproot
52
+ * additionally needs the BIP-341 tweak: BIP340 signs under the tweaked
53
+ * output key, so a signature produced from the internal key alone would not
54
+ * verify against the wallet's own address. Computing it needs the derived
55
+ * public key, which only this layer has, so callers cannot supply it and the
56
+ * generic implementation cannot derive it.
57
+ *
58
+ * @param params - Raw sign parameters; bitcoinConfig is resolved here
59
+ * @returns The signature, Schnorr for taproot and ECDSA otherwise
60
+ */
61
+ sign(params: {
62
+ accountAddress: string;
63
+ message: string | Uint8Array;
64
+ chainName: string;
65
+ isFormatted?: boolean;
66
+ bitcoinConfig?: BitcoinConfig;
67
+ } & BaseSignParams): Promise<EcdsaSignature | Uint8Array>;
47
68
  /**
48
69
  * Signs a message (BIP-322)
49
70
  * @param message - The message to sign
@@ -56,17 +77,17 @@ export declare class DynamicBtcWalletClient extends DynamicWalletClient {
56
77
  * @param onError - Error callback
57
78
  * @returns The BIP-322 signature
58
79
  */
59
- signMessage({ message, accountAddress, network, password, signedSessionId, mfaToken, elevatedAccessToken, context, onError, }: {
80
+ signMessage({ message, accountAddress, network, password, signedSessionId, mfaToken, elevatedAccessToken, context, approvalQuorum, onError, }: {
60
81
  message: string;
61
82
  accountAddress: string;
62
83
  network: BitcoinNetwork;
63
- password?: string;
64
- signedSessionId: string;
65
- mfaToken?: string;
66
- elevatedAccessToken?: string;
67
- context?: SignMessageContext;
68
- onError?: (error: Error) => void;
84
+ } & BaseSignParams): Promise<string>;
85
+ prepareSignMessage({ accountAddress, message, network, }: {
86
+ accountAddress: string;
87
+ message: string;
88
+ network: BitcoinNetwork;
69
89
  }): Promise<string>;
90
+ private prepareBip322SignMessage;
70
91
  /**
71
92
  * Verifies that the derived address matches the expected address
72
93
  * @param rawPublicKey - The raw public key
@@ -84,11 +105,26 @@ export declare class DynamicBtcWalletClient extends DynamicWalletClient {
84
105
  * @param network - The network to use for the private key
85
106
  * @returns The private key
86
107
  */
87
- exportPrivateKey({ accountAddress, password, signedSessionId, mfaToken, elevatedAccessToken, }: RequestWithElevatedAccessToken<{
108
+ /**
109
+ * Builds the export Intent for a BTC wallet.
110
+ *
111
+ * Overridden so BTC can supply the address type the signer needs. It selects
112
+ * the derivation path, so without it the export id cannot be computed. It is
113
+ * resolved from the wallet exactly as `exportPrivateKey` does, so the Intent
114
+ * binds the same export id the export itself will compute.
115
+ */
116
+ prepareExportIntent(params: Parameters<DynamicWalletClient['prepareExportIntent']>[0]): Promise<import("@dynamic-labs-wallet/browser").ExportIntent>;
117
+ exportPrivateKey({ accountAddress, password, signedSessionId, mfaToken, elevatedAccessToken, approvalQuorum, proposalId, bitcoinConfig, }: RequestWithElevatedAccessToken<{
88
118
  accountAddress: string;
89
119
  password?: string;
90
120
  signedSessionId: string;
91
121
  mfaToken?: string;
122
+ /** The initiator's signed export Intent, from `prepareExportIntent`. */
123
+ approvalQuorum?: ExportApprovalQuorumRequest;
124
+ /** The approved export proposal being redeemed, from the consent error the export call raised. */
125
+ proposalId?: string;
126
+ /** `bitcoinConfig.network` selects the WIF encoding. Defaults to mainnet. */
127
+ bitcoinConfig?: BitcoinConfig;
92
128
  }>): Promise<string>;
93
129
  /**
94
130
  * Imports a private key and creates a Bitcoin wallet account
@@ -129,6 +165,14 @@ export declare class DynamicBtcWalletClient extends DynamicWalletClient {
129
165
  /**
130
166
  * Sign a Bitcoin Transaction (PSBT)
131
167
  *
168
+ * ECDSA wallets can also co-sign P2WSH multisig inputs, but only opt-in: pass the
169
+ * hex-encoded witnessScripts you constructed via `allowedWitnessScripts`. An input
170
+ * is signed when its witnessScript is allowlisted, hashes to the scriptPubKey
171
+ * commitment, and is a canonical multisig containing this wallet's public key.
172
+ * Omitting `allowedWitnessScripts` disables P2WSH signing entirely. The returned
173
+ * PSBT carries this wallet's partialSig and is NOT finalized — remaining
174
+ * co-signers add their signatures before finalizing.
175
+ *
132
176
  * @param transaction - The PSBT to sign in hex format
133
177
  * @param senderAddress - The address of the sender
134
178
  * @param password - The password to use for the transaction
@@ -137,18 +181,22 @@ export declare class DynamicBtcWalletClient extends DynamicWalletClient {
137
181
  * @param mfaToken - The MFA token to use for the transaction
138
182
  * @param context - The context to use for the transaction
139
183
  * @param onError - The error handler
184
+ * @param signingIndexes - Optional subset of PSBT input indexes to sign (must belong to senderAddress)
185
+ * @param allowedSighash - Optional allow-list of sighash types. The type itself is read
186
+ * from the PSBT; this only restricts which declared types are accepted. An empty
187
+ * array permits nothing; omit the parameter to permit any declared type
140
188
  * @returns The signed PSBT
141
189
  */
142
- signTransaction({ transaction, senderAddress, network, password, signedSessionId, mfaToken, elevatedAccessToken, context, onError, }: {
190
+ signTransaction({ transaction, senderAddress, network, password, signedSessionId, mfaToken, elevatedAccessToken, context, approvalQuorum, onError, signingIndexes, allowedSighash, allowedWitnessScripts, }: {
143
191
  transaction: string;
144
192
  senderAddress: string;
145
193
  network: BitcoinNetwork;
146
- password?: string;
147
- signedSessionId: string;
148
- mfaToken?: string;
149
- elevatedAccessToken?: string;
150
- context?: SignMessageContext;
151
- onError?: (error: Error) => void;
194
+ signingIndexes?: number[];
195
+ allowedSighash?: number[];
196
+ /** Hex-encoded witnessScripts the wallet may co-sign (P2WSH opt-in). */
197
+ allowedWitnessScripts?: string[];
198
+ } & Omit<BaseSignParams, 'approvalQuorum'> & {
199
+ approvalQuorum?: ApprovalQuorumRequestContext;
152
200
  }): Promise<string>;
153
201
  /**
154
202
  * Creates a PSBT for a transaction
@@ -156,20 +204,27 @@ export declare class DynamicBtcWalletClient extends DynamicWalletClient {
156
204
  * @param amount - The amount to send in satoshis
157
205
  * @param senderAddress - The address to send funds from
158
206
  * @param network - The network to use (mainnet/testnet)
159
- * @param feeRateLevel - The fee rate level to use (fast, medium, slow)
207
+ * @param feeRateLevel - The fee rate level to use (fast, medium, slow). Ignored when feeRate is set
208
+ * @param feeRate - Explicit fee rate in sat/vByte; skips the fee lookup entirely
209
+ * @param rpcUrl - Custom Esplora-compatible API base URL (e.g. a self-hosted Esplora/electrs/mempool)
210
+ * used for fee rates, UTXOs and raw transactions instead of mempool.space. Must be https
211
+ * (http only for localhost). Fee rates use `/v1/fees/recommended`, falling back to `/fee-estimates`
160
212
  * @returns The PSBT in hex format
161
213
  */
162
- createTransaction({ receiverAddress, amount, senderAddress, network, feeRateLevel, }: {
214
+ createTransaction({ receiverAddress, amount, senderAddress, network, feeRateLevel, feeRate: feeRateOverride, rpcUrl, }: {
163
215
  receiverAddress: string;
164
216
  amount: string;
165
217
  senderAddress: string;
166
218
  network: BitcoinNetwork;
167
219
  feeRateLevel?: 'fast' | 'medium' | 'slow';
220
+ feeRate?: number;
221
+ rpcUrl?: string;
168
222
  }): Promise<string>;
169
223
  /**
170
224
  * Fetches the raw transaction hex for a given transaction ID
171
225
  * @param txid - The transaction ID
172
226
  * @param network - The network
227
+ * @param rpcUrl - Optional custom Esplora-compatible API base URL
173
228
  * @returns The transaction hex
174
229
  */
175
230
  private getTxHex;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EAOnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,kCAAkC,EACvC,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EAEnB,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AA2BrE,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;IAE3B;;;OAGG;gBAED,EACE,aAAa,EACb,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,YAAY,EACZ,QAA0B,EAC1B,UAAU,EACV,gBAAgB,EAChB,MAAM,GACP,EAAE,wBAAwB,EAC3B,eAAe,CAAC,EAAE,kCAAkC;IAuBtD;;;;;;;;OAQG;IACG,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,EACpB,OAAO,EACP,eAAe,EACf,aAAa,GACd,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjC,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,CAAC,EAAE,aAAa,CAAC;KAC/B,GAAG,OAAO,CAAC;QACV,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;IA0GnB;;;;;;OAMG;YACW,QAAQ;IAWtB;;;OAGG;IACG,iBAAiB;CAKxB"}
package/src/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './client/client.js';
2
+ export { prepareBtcTransactionSigningOperation } from './signingIntent.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,qCAAqC,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { BitcoinConfig, PreparedBtcTransactionSigningIntent } from '@dynamic-labs-wallet/browser';
2
+ /**
3
+ * Describes a PSBT for a signing-quorum intent: its txid, fee, outputs and the
4
+ * sighashes of the inputs the wallet signs, so one approval covers a signature
5
+ * for each of them.
6
+ *
7
+ * The inputs are chosen as `signTransaction` chooses them: the ones that belong
8
+ * to `accountAddress`, narrowed to `signingIndexes` when given. P2WSH co-signing
9
+ * is not part of the intent, so `allowedWitnessScripts` is rejected.
10
+ */
11
+ export declare const prepareBtcTransactionSigningOperation: ({ transaction, accountAddress, bitcoinConfig, signingIndexes, allowedSighash, allowedWitnessScripts, }: {
12
+ transaction: string;
13
+ accountAddress: string;
14
+ bitcoinConfig?: BitcoinConfig;
15
+ signingIndexes?: number[];
16
+ allowedSighash?: number[];
17
+ allowedWitnessScripts?: string[];
18
+ }) => PreparedBtcTransactionSigningIntent;
19
+ //# sourceMappingURL=signingIntent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signingIntent.d.ts","sourceRoot":"","sources":["../../packages/src/signingIntent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,mCAAmC,EAAE,MAAM,8BAA8B,CAAC;AAuBvG;;;;;;;;GAQG;AACH,eAAO,MAAM,qCAAqC,2GAO/C;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC,KAAG,mCA8CH,CAAC"}