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

Function getInputSize

packages/cashscript/src/utils.ts:203–207  ·  view source on GitHub ↗
(inputScript: Uint8Array)

Source from the content-addressed store, hash-verified

201
202// ////////// SIZE CALCULATIONS ///////////////////////////////////////////////
203export function getInputSize(inputScript: Uint8Array): number {
204 const scriptSize = inputScript.byteLength;
205 const varIntSize = scriptSize > 252 ? 3 : 1;
206 return 32 + 4 + varIntSize + scriptSize + 4;
207}
208
209export function getTxSizeWithoutInputs(outputs: Output[]): number {
210 // Transaction format:

Callers 1

util.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected