Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit 6b0c542

Browse files
authored
Merge pull request #188 from Bitcoin-com/stage
v3.3.2
2 parents cd2c8b5 + 44c5f3b commit 6b0c542

2 files changed

Lines changed: 22 additions & 34 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "developer.bitcoin.com",
33
"description": "Bitcoin.com developer resources and documentation",
4-
"version": "3.3.1",
4+
"version": "3.3.2",
55
"author": "Peter <peter@bitcoin.com> and Gabriel Cardona <gabriel@bitcoin.com>",
66
"dependencies": {
77
"badger-components-react": "^0.1.3",

src/data/docs/slp/utils.md

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -222,60 +222,48 @@ Validate that txid is an SLP transaction
222222

223223
#### Arguments
224224

225-
1. txid : `String` required. The transaction id to validate
226-
2. network : `String` required. mainnet or testnet
227-
3. getRawTransactions: `Function` optional.
225+
1. txid : `String` or `Array` required. The transaction id(s) to validate
228226

229227
#### Result
230228

231-
isValid : `Boolean`
229+
validated : `Array`
232230

233231
#### Examples
234232

235-
// validate SLP txid
233+
// validate single SLP txid
236234
(async () => {
237235
try {
238-
let isValid = await SLP.Utils.validateTxid(
239-
"df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb",
240-
"mainnet"
236+
let validated = await SLP.Utils.validateTxid(
237+
"df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb"
241238
);
242-
console.log(isValid);
239+
console.log(validated);
243240
} catch (error) {
244241
console.error(error);
245242
}
246243
})();
247244

248245
// returns
249-
true
250-
251-
### `createValidator`
252-
253-
Create and return a local validator
254-
255-
#### Arguments
256-
257-
1. network : `String` required. mainnet or testnet
258-
2. getRawTransactions: `Function` optional.
246+
[ { txid:
247+
'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb',
248+
valid: true } ]
259249

260-
#### Result
261-
262-
slpValidator : `slpValidator`
263-
264-
#### Examples
265-
266-
// create validator
250+
// validate multiple SLP txids
267251
(async () => {
268252
try {
269-
const slpValidator = SLP.Utils.createValidator(
270-
process.env.NETWORK,
271-
getRawTransactionsFromNode.bind(this)
272-
)
273-
const isValid = await slpValidator.isValidSlpTxid(txid)
274-
console.log(isvalid)
253+
let validated = await SLP.Utils.validateTxid([
254+
"df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb",
255+
"00ea27261196a411776f81029c0ebe34362936b4a9847deb1f7a40a02b3a1476"
256+
]);
257+
console.log(validated);
275258
} catch (error) {
276259
console.error(error);
277260
}
278261
})();
279262

280263
// returns
281-
// true
264+
[ { txid:
265+
'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb',
266+
valid: true },
267+
{ txid:
268+
'00ea27261196a411776f81029c0ebe34362936b4a9847deb1f7a40a02b3a1476',
269+
valid: true } ]

0 commit comments

Comments
 (0)