@bsv/wallet-toolbox 1.5.19 → 1.5.20

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/wallet-toolbox",
3
- "version": "1.5.19",
3
+ "version": "1.5.20",
4
4
  "description": "BRC100 conforming wallet, wallet storage and wallet signer components",
5
5
  "main": "./out/src/index.js",
6
6
  "types": "./out/src/index.d.ts",
@@ -1002,7 +1002,7 @@ export class WalletPermissionsManager implements WalletInterface {
1002
1002
  // We skip spending permission entirely
1003
1003
  return true
1004
1004
  }
1005
- const cacheKey = this.buildRequestKey({ type: 'spending', originator })
1005
+ const cacheKey = this.buildRequestKey({ type: 'spending', originator, spending: { satoshis } })
1006
1006
  if (this.isPermissionCached(cacheKey)) {
1007
1007
  return true
1008
1008
  }
@@ -1044,6 +1044,7 @@ export class WalletPermissionsManager implements WalletInterface {
1044
1044
  }
1045
1045
  }
1046
1046
 
1047
+
1047
1048
  /**
1048
1049
  * Ensures the originator has label usage permission.
1049
1050
  * If no valid (unexpired) permission token is found, triggers a permission request flow.
@@ -2908,15 +2909,15 @@ export class WalletPermissionsManager implements WalletInterface {
2908
2909
  * do not produce multiple user prompts.
2909
2910
  */
2910
2911
  private buildRequestKey(r: PermissionRequest): string {
2911
- switch (r.type) {
2912
- case 'protocol':
2913
- return `proto:${r.originator}:${!!r.privileged}:${r.protocolID?.join(',')}:${r.counterparty}`
2914
- case 'basket':
2915
- return `basket:${r.originator}:${r.basket}`
2916
- case 'certificate':
2917
- return `cert:${r.originator}:${!!r.privileged}:${r.certificate?.verifier}:${r.certificate?.certType}:${r.certificate?.fields.join('|')}`
2918
- case 'spending':
2919
- return `spend:${r.originator}`
2920
- }
2912
+ switch (r.type) {
2913
+ case 'protocol':
2914
+ return `proto:${r.originator}:${!!r.privileged}:${r.protocolID?.join(',')}:${r.counterparty}`
2915
+ case 'basket':
2916
+ return `basket:${r.originator}:${r.basket}`
2917
+ case 'certificate':
2918
+ return `cert:${r.originator}:${!!r.privileged}:${r.certificate?.verifier}:${r.certificate?.certType}:${r.certificate?.fields.join('|')}`
2919
+ case 'spending':
2920
+ return `spend:${r.originator}:${r.spending?.satoshis}`
2921
+ }
2921
2922
  }
2922
2923
  }