@bsv/wallet-toolbox 1.2.45 → 1.2.47
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/out/src/CWIStyleWalletManager.d.ts.map +1 -1
- package/out/src/CWIStyleWalletManager.js +7 -4
- package/out/src/CWIStyleWalletManager.js.map +1 -1
- package/out/src/Wallet.js +1 -1
- package/out/src/Wallet.js.map +1 -1
- package/out/src/WalletPermissionsManager.d.ts.map +1 -1
- package/out/src/WalletPermissionsManager.js +12 -3
- package/out/src/WalletPermissionsManager.js.map +1 -1
- package/out/src/signer/methods/signAction.d.ts +2 -2
- package/out/src/signer/methods/signAction.d.ts.map +1 -1
- package/out/src/signer/methods/signAction.js +12 -1
- package/out/src/signer/methods/signAction.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/CWIStyleWalletManager.ts +7 -3
- package/src/Wallet.ts +1 -1
- package/src/WalletPermissionsManager.ts +12 -3
- package/src/signer/methods/signAction.ts +12 -1
package/package.json
CHANGED
|
@@ -360,7 +360,11 @@ export class OverlayUMPTokenInteractor implements UMPTokenInteractor {
|
|
|
360
360
|
description: oldTokenToConsume ? 'Renew UMP token (consume old, create new)' : 'Create new UMP token',
|
|
361
361
|
inputs,
|
|
362
362
|
outputs,
|
|
363
|
-
inputBEEF: inputToken?.beef
|
|
363
|
+
inputBEEF: inputToken?.beef,
|
|
364
|
+
options: {
|
|
365
|
+
randomizeOutputs: false,
|
|
366
|
+
acceptDelayedBroadcast: false
|
|
367
|
+
}
|
|
364
368
|
},
|
|
365
369
|
adminOriginator
|
|
366
370
|
)
|
|
@@ -1398,7 +1402,7 @@ export class CWIStyleWalletManager implements WalletInterface {
|
|
|
1398
1402
|
const currentActiveId = this.activeProfileId
|
|
1399
1403
|
let walletToUse: WalletInterface | undefined = this.underlying
|
|
1400
1404
|
|
|
1401
|
-
if (currentActiveId.every(x => x === 0)) {
|
|
1405
|
+
if (!currentActiveId.every(x => x === 0)) {
|
|
1402
1406
|
console.log('Temporarily switching to default profile to update UMP token...')
|
|
1403
1407
|
await this.switchProfile(DEFAULT_PROFILE_ID) // This rebuilds this.underlying
|
|
1404
1408
|
walletToUse = this.underlying
|
|
@@ -1411,7 +1415,7 @@ export class CWIStyleWalletManager implements WalletInterface {
|
|
|
1411
1415
|
// Publish the new token on-chain, consuming the old one
|
|
1412
1416
|
try {
|
|
1413
1417
|
newTokenData.currentOutpoint = await this.UMPTokenInteractor.buildAndSend(
|
|
1414
|
-
walletToUse,
|
|
1418
|
+
walletToUse,
|
|
1415
1419
|
this.adminOriginator,
|
|
1416
1420
|
newTokenData,
|
|
1417
1421
|
oldTokenToConsume // Consume the previous token
|
package/src/Wallet.ts
CHANGED
|
@@ -708,7 +708,7 @@ export class Wallet implements WalletInterface, ProtoWallet {
|
|
|
708
708
|
sdk.validateOriginator(originator)
|
|
709
709
|
|
|
710
710
|
const { auth, vargs } = this.validateAuthAndArgs(args, sdk.validateSignActionArgs)
|
|
711
|
-
const r = await signAction(this, auth, vargs)
|
|
711
|
+
const r = await signAction(this, auth, vargs, args.options || {})
|
|
712
712
|
|
|
713
713
|
if (!vargs.isDelayed) throwIfAnyUnsuccessfulSignActions(r)
|
|
714
714
|
|
|
@@ -1289,7 +1289,10 @@ export class WalletPermissionsManager implements WalletInterface {
|
|
|
1289
1289
|
basket: basketName,
|
|
1290
1290
|
tags
|
|
1291
1291
|
}
|
|
1292
|
-
]
|
|
1292
|
+
],
|
|
1293
|
+
options: {
|
|
1294
|
+
acceptDelayedBroadcast: false
|
|
1295
|
+
}
|
|
1293
1296
|
},
|
|
1294
1297
|
this.adminOriginator
|
|
1295
1298
|
)
|
|
@@ -1347,7 +1350,10 @@ export class WalletPermissionsManager implements WalletInterface {
|
|
|
1347
1350
|
basket: BASKET_MAP[r.type],
|
|
1348
1351
|
tags
|
|
1349
1352
|
}
|
|
1350
|
-
]
|
|
1353
|
+
],
|
|
1354
|
+
options: {
|
|
1355
|
+
acceptDelayedBroadcast: false
|
|
1356
|
+
}
|
|
1351
1357
|
},
|
|
1352
1358
|
this.adminOriginator
|
|
1353
1359
|
)
|
|
@@ -1743,7 +1749,10 @@ export class WalletPermissionsManager implements WalletInterface {
|
|
|
1743
1749
|
unlockingScriptLength: 73, // length of signature
|
|
1744
1750
|
inputDescription: `Consume old permission token`
|
|
1745
1751
|
}
|
|
1746
|
-
]
|
|
1752
|
+
],
|
|
1753
|
+
options: {
|
|
1754
|
+
acceptDelayedBroadcast: false
|
|
1755
|
+
}
|
|
1747
1756
|
},
|
|
1748
1757
|
this.adminOriginator
|
|
1749
1758
|
)
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
Beef,
|
|
6
6
|
Transaction as BsvTransaction,
|
|
7
7
|
SendWithResult,
|
|
8
|
+
SignActionOptions,
|
|
8
9
|
SignActionResult,
|
|
9
10
|
SignActionSpend,
|
|
10
11
|
TXIDHexString
|
|
@@ -23,12 +24,15 @@ export interface SignActionResultX extends SignActionResult {
|
|
|
23
24
|
export async function signAction(
|
|
24
25
|
wallet: Wallet,
|
|
25
26
|
auth: sdk.AuthId,
|
|
26
|
-
vargs: sdk.ValidSignActionArgs
|
|
27
|
+
vargs: sdk.ValidSignActionArgs,
|
|
28
|
+
options: SignActionOptions
|
|
27
29
|
): Promise<SignActionResultX> {
|
|
28
30
|
const prior = wallet.pendingSignActions[vargs.reference]
|
|
29
31
|
if (!prior)
|
|
30
32
|
throw new sdk.WERR_NOT_IMPLEMENTED('recovery of out-of-session signAction reference data is not yet implemented.')
|
|
31
33
|
if (!prior.dcr.inputBeef) throw new sdk.WERR_INTERNAL('prior.dcr.inputBeef must be valid')
|
|
34
|
+
|
|
35
|
+
mergePriorOptions(prior.args, vargs, options)
|
|
32
36
|
|
|
33
37
|
prior.tx = await completeSignedTransaction(prior, vargs.spends, wallet)
|
|
34
38
|
|
|
@@ -106,3 +110,10 @@ export async function completeSignedTransaction(
|
|
|
106
110
|
|
|
107
111
|
return prior.tx
|
|
108
112
|
}
|
|
113
|
+
|
|
114
|
+
function mergePriorOptions(caVargs: sdk.ValidCreateActionArgs, saVargs: sdk.ValidSignActionArgs, saOptions: SignActionOptions ) {
|
|
115
|
+
if (saOptions.acceptDelayedBroadcast === undefined) saOptions.acceptDelayedBroadcast = caVargs.options.acceptDelayedBroadcast
|
|
116
|
+
if (saOptions.returnTXIDOnly === undefined) saOptions.returnTXIDOnly = caVargs.options.returnTXIDOnly
|
|
117
|
+
if (saOptions.noSend === undefined) saOptions.noSend = caVargs.options.noSend
|
|
118
|
+
if (saOptions.sendWith === undefined) saOptions.sendWith = caVargs.options.sendWith
|
|
119
|
+
}
|