@bsv/sdk 1.3.23 → 1.3.24
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/dist/cjs/package.json +1 -1
- package/dist/cjs/src/script/templates/PushDrop.js +6 -4
- package/dist/cjs/src/script/templates/PushDrop.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/script/templates/PushDrop.js +7 -4
- package/dist/esm/src/script/templates/PushDrop.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/script/templates/PushDrop.d.ts +3 -1
- package/dist/types/src/script/templates/PushDrop.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/overlay-tools.md +3 -3
- package/docs/script.md +5 -2
- package/package.json +1 -1
- package/src/script/templates/PushDrop.ts +7 -4
package/docs/overlay-tools.md
CHANGED
|
@@ -262,7 +262,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
262
262
|
| [HTTPSOverlayLookupFacilitator](#class-httpsoverlaylookupfacilitator) |
|
|
263
263
|
| [LookupResolver](#class-lookupresolver) |
|
|
264
264
|
| [OverlayAdminTokenTemplate](#class-overlayadmintokentemplate) |
|
|
265
|
-
| [
|
|
265
|
+
| [SHIPBroadcaster](#class-shipbroadcaster) |
|
|
266
266
|
|
|
267
267
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
268
268
|
|
|
@@ -430,12 +430,12 @@ Argument Details
|
|
|
430
430
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
431
431
|
|
|
432
432
|
---
|
|
433
|
-
### Class:
|
|
433
|
+
### Class: SHIPBroadcaster
|
|
434
434
|
|
|
435
435
|
Represents a SHIP transaction broadcaster.
|
|
436
436
|
|
|
437
437
|
```ts
|
|
438
|
-
export default class
|
|
438
|
+
export default class SHIPBroadcaster implements Broadcaster {
|
|
439
439
|
constructor(topics: string[], config?: SHIPBroadcasterConfig)
|
|
440
440
|
async broadcast(tx: Transaction): Promise<BroadcastResponse | BroadcastFailure>
|
|
441
441
|
}
|
package/docs/script.md
CHANGED
|
@@ -211,11 +211,12 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
211
211
|
```ts
|
|
212
212
|
export default class PushDrop implements ScriptTemplate {
|
|
213
213
|
wallet: WalletInterface;
|
|
214
|
+
originator?: string;
|
|
214
215
|
static decode(script: LockingScript): {
|
|
215
216
|
lockingPublicKey: PublicKey;
|
|
216
217
|
fields: number[][];
|
|
217
218
|
}
|
|
218
|
-
constructor(wallet: WalletInterface)
|
|
219
|
+
constructor(wallet: WalletInterface, originator?: string)
|
|
219
220
|
async lock(fields: number[][], protocolID: [
|
|
220
221
|
SecurityLevel,
|
|
221
222
|
string
|
|
@@ -237,7 +238,7 @@ See also: [LockingScript](./script.md#class-lockingscript), [PublicKey](./primit
|
|
|
237
238
|
Constructs a new instance of the PushDrop class.
|
|
238
239
|
|
|
239
240
|
```ts
|
|
240
|
-
constructor(wallet: WalletInterface)
|
|
241
|
+
constructor(wallet: WalletInterface, originator?: string)
|
|
241
242
|
```
|
|
242
243
|
See also: [WalletInterface](./wallet.md#interface-walletinterface)
|
|
243
244
|
|
|
@@ -245,6 +246,8 @@ Argument Details
|
|
|
245
246
|
|
|
246
247
|
+ **wallet**
|
|
247
248
|
+ The wallet interface used for creating signatures and accessing public keys.
|
|
249
|
+
+ **originator**
|
|
250
|
+
+ — The originator to use with Wallet requests
|
|
248
251
|
|
|
249
252
|
#### Method decode
|
|
250
253
|
|
package/package.json
CHANGED
|
@@ -57,6 +57,7 @@ const createMinimallyEncodedScriptChunk = (
|
|
|
57
57
|
|
|
58
58
|
export default class PushDrop implements ScriptTemplate {
|
|
59
59
|
wallet: WalletInterface
|
|
60
|
+
originator?: string
|
|
60
61
|
|
|
61
62
|
/**
|
|
62
63
|
* Decodes a PushDrop script back into its token fields and the locking public key. If a signature was present, it will be the last field returned.
|
|
@@ -105,9 +106,11 @@ export default class PushDrop implements ScriptTemplate {
|
|
|
105
106
|
* Constructs a new instance of the PushDrop class.
|
|
106
107
|
*
|
|
107
108
|
* @param {WalletInterface} wallet - The wallet interface used for creating signatures and accessing public keys.
|
|
109
|
+
* @param {string} originator — The originator to use with Wallet requests
|
|
108
110
|
*/
|
|
109
|
-
constructor(wallet: WalletInterface) {
|
|
111
|
+
constructor(wallet: WalletInterface, originator?: string) {
|
|
110
112
|
this.wallet = wallet
|
|
113
|
+
this.originator = originator
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
/**
|
|
@@ -135,7 +138,7 @@ export default class PushDrop implements ScriptTemplate {
|
|
|
135
138
|
keyID,
|
|
136
139
|
counterparty,
|
|
137
140
|
forSelf
|
|
138
|
-
})
|
|
141
|
+
}, this.originator)
|
|
139
142
|
const lockChunks: Array<{ op: number, data?: number[] }> = []
|
|
140
143
|
const pushDropChunks: Array<{ op: number, data?: number[] }> = []
|
|
141
144
|
lockChunks.push({
|
|
@@ -150,7 +153,7 @@ export default class PushDrop implements ScriptTemplate {
|
|
|
150
153
|
protocolID,
|
|
151
154
|
keyID,
|
|
152
155
|
counterparty
|
|
153
|
-
})
|
|
156
|
+
}, this.originator)
|
|
154
157
|
fields.push(signature)
|
|
155
158
|
}
|
|
156
159
|
for (const field of fields) {
|
|
@@ -263,7 +266,7 @@ export default class PushDrop implements ScriptTemplate {
|
|
|
263
266
|
protocolID,
|
|
264
267
|
keyID,
|
|
265
268
|
counterparty
|
|
266
|
-
})
|
|
269
|
+
}, this.originator)
|
|
267
270
|
const signature = Signature.fromDER([...bareSignature])
|
|
268
271
|
const txSignature = new TransactionSignature(
|
|
269
272
|
signature.r,
|