MCPcopy Index your code
hub / github.com/CashScript/cashscript / randomToken

Function randomToken

packages/cashscript/src/utils.ts:383–389  ·  view source on GitHub ↗
(defaults?: Partial<TokenDetails>)

Source from the content-addressed store, hash-verified

381 * @returns Synthetic token details (no NFT commitment) with a random category and amount.
382 */
383export const randomToken = (defaults?: Partial<TokenDetails>): TokenDetails => ({
384 ...{
385 category: binToHex(sha256(bigIntToVmNumber(randomInt()))),
386 amount: 100_000n + randomInt(),
387 },
388 ...defaults,
389});
390
391/**
392 * Generate random NFT `TokenDetails` (`amount: 0n`, random commitment, `none` capability) for

Calls 2

sha256Function · 0.90
randomIntFunction · 0.85

Tested by

no test coverage detected