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

Commit be56aac

Browse files
authored
Merge pull request #160 from Bitcoin-com/slp-docs
Update validation example
2 parents b450a70 + ca50837 commit be56aac

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

src/data/docs/slp/utils.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,19 @@ slpValidator : `slpValidator`
260260

261261
#### Examples
262262

263-
// validate SLP txid
263+
// create validator
264264
(async () => {
265265
try {
266-
let slpValidator = await SLP.Utils.createValidator(
267-
"mainnet"
268-
);
269-
console.log(slpValidator);
266+
const slpValidator = SLP.Utils.createValidator(
267+
process.env.NETWORK,
268+
getRawTransactionsFromNode.bind(this)
269+
)
270+
const isValid = await slpValidator.isValidSlpTxid(txid)
271+
console.log(isvalid)
270272
} catch (error) {
271273
console.error(error);
272274
}
273275
})();
276+
277+
// returns
278+
// true

0 commit comments

Comments
 (0)