@bsv/sdk 1.3.27 → 1.3.28

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/docs/auth.md CHANGED
@@ -1139,10 +1139,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
1139
1139
  Creates a nonce derived from a wallet
1140
1140
 
1141
1141
  ```ts
1142
- export async function createNonce(wallet: WalletInterface, counterparty: WalletCounterparty = "self"): Promise<string>
1142
+ export async function createNonce(wallet: WalletInterface, counterparty: WalletCounterparty = "self"): Promise<Base64String>
1143
1143
  ```
1144
1144
 
1145
- See also: [WalletCounterparty](./wallet.md#type-walletcounterparty), [WalletInterface](./wallet.md#interface-walletinterface)
1145
+ See also: [Base64String](./wallet.md#type-base64string), [WalletCounterparty](./wallet.md#type-walletcounterparty), [WalletInterface](./wallet.md#interface-walletinterface)
1146
1146
 
1147
1147
  Returns
1148
1148
 
@@ -1161,10 +1161,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
1161
1161
  Verifies a nonce derived from a wallet
1162
1162
 
1163
1163
  ```ts
1164
- export async function verifyNonce(nonce: string, wallet: WalletInterface, counterparty: WalletCounterparty = "self"): Promise<boolean>
1164
+ export async function verifyNonce(nonce: Base64String, wallet: WalletInterface, counterparty: WalletCounterparty = "self"): Promise<boolean>
1165
1165
  ```
1166
1166
 
1167
- See also: [WalletCounterparty](./wallet.md#type-walletcounterparty), [WalletInterface](./wallet.md#interface-walletinterface)
1167
+ See also: [Base64String](./wallet.md#type-base64string), [WalletCounterparty](./wallet.md#type-walletcounterparty), [WalletInterface](./wallet.md#interface-walletinterface)
1168
1168
 
1169
1169
  Returns
1170
1170
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/sdk",
3
- "version": "1.3.27",
3
+ "version": "1.3.28",
4
4
  "type": "module",
5
5
  "description": "BSV Blockchain Software Development Kit",
6
6
  "main": "dist/cjs/mod.js",
@@ -405,7 +405,7 @@ export class AuthFetch {
405
405
  }
406
406
 
407
407
  const derivationPrefix = originalResponse.headers.get('x-bsv-payment-derivation-prefix')
408
- if (!derivationPrefix) {
408
+ if (typeof derivationPrefix !== 'string' || derivationPrefix.length < 1) {
409
409
  throw new Error('Missing x-bsv-payment-derivation-prefix response header.')
410
410
  }
411
411
 
@@ -426,8 +426,12 @@ export class AuthFetch {
426
426
  outputs: [{
427
427
  satoshis: satoshisRequired,
428
428
  lockingScript,
429
+ customInstructions: JSON.stringify({ derivationPrefix, derivationSuffix, payee: serverIdentityKey }),
429
430
  outputDescription: 'HTTP request payment'
430
- }]
431
+ }],
432
+ options: {
433
+ randomizeOutputs: false
434
+ }
431
435
  })
432
436
 
433
437
  // Attach the payment to the request headers