MCPcopy Create free account
hub / github.com/CashScript/cashscript / createOpReturnOutput

Function createOpReturnOutput

packages/cashscript/src/utils.ts:251–260  ·  view source on GitHub ↗
(
  opReturnData: string[],
)

Source from the content-addressed store, hash-verified

249}
250
251export function createOpReturnOutput(
252 opReturnData: string[],
253): Output {
254 const script = [
255 Op.OP_RETURN,
256 ...opReturnData.map((output: string) => toBin(output)),
257 ];
258
259 return { to: encodeNullDataScript(script), amount: 0n };
260}
261
262function toBin(output: string): Uint8Array {
263 const data = output.replace(/^0x/, '');

Callers 3

P2PKH.test.tsFile · 0.85
addOpReturnOutputMethod · 0.85

Calls 2

encodeNullDataScriptFunction · 0.90
toBinFunction · 0.85

Tested by

no test coverage detected