Skip to content

Commit 1da0c45

Browse files
authored
Merge pull request #3 from bsv-blockchain/fixes/delayedBroadcast
fix: set acceptDelayedBroadcast: false on all createAction calls
2 parents d6d0cac + 504a9d7 commit 1da0c45

File tree

7 files changed

+31
-16
lines changed

7 files changed

+31
-16
lines changed

package-lock.json

Lines changed: 16 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bsv/simple",
3-
"version": "0.2.7",
3+
"version": "0.2.9",
44
"description": "Simplified, modular helper library for BSV blockchain development",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -59,6 +59,7 @@
5959
},
6060
"devDependencies": {
6161
"@types/node": "^20.0.0",
62+
"dotenv": "^17.3.1",
6263
"jest": "^30.2.0",
6364
"ts-standard": "^12.0.2",
6465
"typescript": "^5.3.0"

src/core/WalletCore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export abstract class WalletCore {
185185
const result = await client.createAction({
186186
description: options.description ?? this.defaults.description,
187187
outputs: actionOutputs,
188-
options: { randomizeOutputs: false }
188+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
189189
})
190190

191191
return {
@@ -267,7 +267,7 @@ export abstract class WalletCore {
267267
const result = await client.createAction({
268268
description: request.memo ?? `Fund server wallet (${request.satoshis} sats)`,
269269
outputs,
270-
options: { randomizeOutputs: false }
270+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
271271
})
272272

273273
return {

src/modules/credentials.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export class CredentialIssuer {
231231
basket: 'revocation-utxos',
232232
tags: ['revocation']
233233
}],
234-
options: { randomizeOutputs: false }
234+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
235235
})
236236

237237
if (result.txid == null || result.txid === '') {
@@ -355,7 +355,7 @@ export class CredentialIssuer {
355355
inputDescription: 'Spend revocation UTXO'
356356
}],
357357
outputs: [],
358-
options: { randomizeOutputs: false }
358+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
359359
})
360360

361361
if (result.txid == null || result.txid === '') {

src/modules/did.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ function _buildDIDMethods (core: WalletCore): {
291291
inputDescription: 'DID chain UTXO'
292292
}],
293293
outputs: newOutputs,
294-
options: { randomizeOutputs: false }
294+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
295295
} as any)
296296

297297
if ((response)?.signableTransaction == null) {
@@ -375,7 +375,7 @@ function _buildDIDMethods (core: WalletCore): {
375375
outputDescription: 'DID issuance marker'
376376
}
377377
],
378-
options: { randomizeOutputs: false }
378+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
379379
})
380380

381381
const issuanceTxid = issuanceResult.txid ?? ''

src/modules/overlay.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export function createOverlayMethods (core: WalletCore): {
207207
outputDescription: 'SHIP token',
208208
...(basket != null ? { basket } : {})
209209
}],
210-
options: { randomizeOutputs: false }
210+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
211211
})
212212
return {
213213
txid: result.txid ?? '',
@@ -230,7 +230,7 @@ export function createOverlayMethods (core: WalletCore): {
230230
outputDescription: 'SLAP token',
231231
...(basket != null ? { basket } : {})
232232
}],
233-
options: { randomizeOutputs: false }
233+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
234234
})
235235
return {
236236
txid: result.txid ?? '',
@@ -247,7 +247,7 @@ export function createOverlayMethods (core: WalletCore): {
247247
const result = await core.getClient().createAction({
248248
description: actionOptions.description ?? 'Overlay broadcast',
249249
outputs: actionOptions.outputs,
250-
options: { randomizeOutputs: false }
250+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
251251
})
252252
if (result.tx == null) throw new Error('No tx from createAction')
253253
const tx = Transaction.fromAtomicBEEF(result.tx)

src/modules/tokens.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function createTokenMethods (core: WalletCore): {
7272
tags: ['token'],
7373
outputDescription: `Token (${basket})`
7474
}],
75-
options: { randomizeOutputs: false }
75+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
7676
})
7777

7878
return {
@@ -231,7 +231,7 @@ export function createTokenMethods (core: WalletCore): {
231231
customInstructions: JSON.stringify({ protocolID, keyID: newKeyID, counterparty: newCounterparty }),
232232
tags: ['token', 'sent']
233233
}],
234-
options: { randomizeOutputs: false }
234+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
235235
} as any)
236236

237237
if ((response as any)?.signableTransaction == null) {
@@ -304,7 +304,7 @@ export function createTokenMethods (core: WalletCore): {
304304
unlockingScriptLength: 73
305305
}],
306306
outputs: [],
307-
options: { randomizeOutputs: false }
307+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
308308
} as any)
309309

310310
if ((response as any)?.signableTransaction == null) {
@@ -398,7 +398,7 @@ export function createTokenMethods (core: WalletCore): {
398398
lockingScript: newLockingScript.toHex(),
399399
outputDescription: 'Token for recipient'
400400
}],
401-
options: { randomizeOutputs: false }
401+
options: { randomizeOutputs: false, acceptDelayedBroadcast: false }
402402
} as any)
403403

404404
if ((response as any)?.signableTransaction == null) {

0 commit comments

Comments
 (0)