New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@cmdcode/tapscript

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cmdcode/tapscript - npm Package Compare versions

Comparing version
1.5.1
to
1.5.2
+6
-7
package.json
{
"name": "@cmdcode/tapscript",
"version": "1.5.1",
"version": "1.5.2",
"description": "A basic library for working with Tapscript, signatures and Bitcoin transactions.",

@@ -24,8 +24,7 @@ "type": "module",

"clean": "rm -rf dist/* coverage .nyc_output",
"start": "node --trace-deprecation --no-warnings --loader ts-node/esm",
"scratch": "yarn start test/scratch.ts",
"tape": "yarn start test/tape.ts",
"test": "yarn tape | tap-spec",
"types": "tsc",
"release": "yarn test && yarn clean && yarn types && yarn build"
"load": "NODE_OPTIONS='--no-warnings' tsx --tsconfig ./test/tsconfig.json",
"release": "yarn test && yarn clean && yarn build",
"scratch": "yarn load test/scratch.ts",
"test": "tsx --tsconfig ./test/tsconfig.json ./test/tape.ts | tap-spec"
},

@@ -71,4 +70,4 @@ "keywords": [

"tape": "^5.6.1",
"ts-node": "^10.9.1",
"tslib": "^2.6.2",
"tsx": "^4.19.2",
"typescript": "^5.1.6",

@@ -75,0 +74,0 @@ "zod": "^3.20.6"

export {};
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/class/Signature/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA"}
import Transaction from './Transaction.js';
import Input from './TxInput.js';
import Output from './TxOutput.js';
import Script from './TxScript.js';
import Sequence from './TxSequence.js';
import Witness from './TxWitness.js';
export { Transaction, Input, Output, Script, Sequence, Witness };
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/class/Transaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAC1C,OAAO,KAAK,MAAU,cAAc,CAAA;AACpC,OAAO,MAAM,MAAS,eAAe,CAAA;AACrC,OAAO,MAAM,MAAS,eAAe,CAAA;AACrC,OAAO,QAAQ,MAAO,iBAAiB,CAAA;AACvC,OAAO,OAAO,MAAQ,gBAAgB,CAAA;AAEtC,OAAO,EACL,WAAW,EACX,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,OAAO,EACR,CAAA"}
import { Buff } from '@cmdcode/buff-utils';
import TxInput from './TxInput.js';
import TxOutput from './TxOutput.js';
import TxLocktime from './TxLocktime.js';
import { TxData, TxTemplate } from '../../schema/types.js';
export default class Transaction {
readonly _data: TxData;
constructor(txdata: string | Uint8Array | TxTemplate);
get data(): TxData;
get version(): number;
get vin(): TxInput[];
get vout(): TxOutput[];
get locktime(): TxLocktime;
get base(): Buff;
get buff(): Buff;
get raw(): Uint8Array;
get hex(): string;
get size(): number;
get bsize(): number;
get weight(): number;
get vsize(): number;
get hash(): string;
get txid(): string;
export(): Promise<object>;
}
//# sourceMappingURL=Transaction.d.ts.map
{"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../../../src/class/Transaction/Transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAU,qBAAqB,CAAA;AAE9C,OAAO,OAAO,MAAW,cAAc,CAAA;AACvC,OAAO,QAAQ,MAAU,eAAe,CAAA;AACxC,OAAO,UAAU,MAAQ,iBAAiB,CAAA;AAI1C,OAAO,EACL,MAAM,EACN,UAAU,EACX,MAAM,uBAAuB,CAAA;AAE9B,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAA;gBAGrB,MAAM,EAAG,MAAM,GAAG,UAAU,GAAG,UAAU;IAc3C,IAAI,IAAI,IAAM,MAAM,CAEnB;IAED,IAAI,OAAO,IAAM,MAAM,CAEtB;IAED,IAAI,GAAG,IAAM,OAAO,EAAE,CAErB;IAED,IAAI,IAAI,IAAM,QAAQ,EAAE,CAEvB;IAED,IAAI,QAAQ,IAAM,UAAU,CAE3B;IAED,IAAI,IAAI,IAAM,IAAI,CAEjB;IAED,IAAI,IAAI,IAAM,IAAI,CAEjB;IAED,IAAI,GAAG,IAAM,UAAU,CAEtB;IAED,IAAI,GAAG,IAAM,MAAM,CAElB;IAED,IAAI,IAAI,IAAM,MAAM,CAEnB;IAED,IAAI,KAAK,IAAM,MAAM,CAEpB;IAED,IAAI,MAAM,IAAM,MAAM,CAErB;IAED,IAAI,KAAK,IAAM,MAAM,CAGpB;IAED,IAAI,IAAI,IAAM,MAAM,CAGnB;IAED,IAAI,IAAI,IAAM,MAAM,CAGnB;IAEK,MAAM,IAAM,OAAO,CAAC,MAAM,CAAC;CAMlC"}
import TxScript from './TxScript.js';
import TxSequence from './TxSequence.js';
import TxOutput from './TxOutput.js';
import TxWitness from './TxWitness.js';
import { HashConfig } from '../../lib/sig/types.js';
import { Bytes, InputData, InputType, TxData } from '../../schema/types.js';
export default class TxInput {
readonly _tx: TxData;
readonly idx: number;
constructor(txdata: TxData, index: number);
get data(): InputData;
get txid(): string;
get vout(): number;
get prevout(): TxOutput | undefined;
get scriptSig(): TxScript;
get sequence(): TxSequence;
get witness(): TxWitness;
get type(): InputType;
sign(seckey: Bytes, config: HashConfig): import("@cmdcode/buff-utils").Buff;
}
//# sourceMappingURL=TxInput.d.ts.map
{"version":3,"file":"TxInput.d.ts","sourceRoot":"","sources":["../../../../src/class/Transaction/TxInput.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAY,eAAe,CAAA;AAC1C,OAAO,UAAU,MAAU,iBAAiB,CAAA;AAC5C,OAAO,QAAQ,MAAY,eAAe,CAAA;AAC1C,OAAO,SAAS,MAAW,gBAAgB,CAAA;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAE3E,MAAM,CAAC,OAAO,OAAO,OAAO;IAC1B,QAAQ,CAAC,GAAG,EAAG,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAG,MAAM,CAAA;gBAER,MAAM,EAAG,MAAM,EAAE,KAAK,EAAG,MAAM;IAK5C,IAAI,IAAI,IAAM,SAAS,CAEtB;IAED,IAAI,IAAI,IAAM,MAAM,CAEnB;IAED,IAAI,IAAI,IAAM,MAAM,CAEnB;IAED,IAAI,OAAO,IAAM,QAAQ,GAAG,SAAS,CAIpC;IAED,IAAI,SAAS,IAAM,QAAQ,CAE1B;IAED,IAAI,QAAQ,IAAM,UAAU,CAE3B;IAED,IAAI,OAAO,IAAM,SAAS,CAEzB;IAED,IAAI,IAAI,IAAM,SAAS,CAmBtB;IAED,IAAI,CAAE,MAAM,EAAG,KAAK,EAAE,MAAM,EAAG,UAAU;CAe1C"}
import { LockData } from '../../schema/types.js';
export default class TxLocktime {
value: number;
constructor(value?: LockData);
get isTimelock(): boolean;
get timestamp(): number;
set timestamp(value: number);
get blockheight(): number;
set blockheight(value: number);
get estDate(): Date;
set estDate(date: Date);
toJSON(): number;
}
//# sourceMappingURL=TxLocktime.d.ts.map
{"version":3,"file":"TxLocktime.d.ts","sourceRoot":"","sources":["../../../../src/class/Transaction/TxLocktime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAO,uBAAuB,CAAA;AAIjD,MAAM,CAAC,OAAO,OAAO,UAAU;IACtB,KAAK,EAAG,MAAM,CAAA;gBAER,KAAK,GAAG,QAAY;IAIjC,IAAI,UAAU,IAAM,OAAO,CAE1B;IAED,IAAI,SAAS,IAAM,MAAM,CAIxB;IAED,IAAI,SAAS,CAAE,KAAK,EAAG,MAAM,EAE5B;IAED,IAAI,WAAW,IAAM,MAAM,CAI1B;IAED,IAAI,WAAW,CAAE,KAAK,EAAG,MAAM,EAE9B;IAED,IAAI,OAAO,IAAM,IAAI,CAIpB;IAED,IAAI,OAAO,CAAE,IAAI,EAAG,IAAI,EAEvB;IAED,MAAM,IAAM,MAAM;CAGnB"}
import TxScript from './TxScript.js';
import { OutputData, OutputType } from '../../schema/types.js';
export default class TxOutput {
value: bigint;
scriptPubKey: TxScript;
constructor(txout: OutputData);
get type(): OutputType;
}
//# sourceMappingURL=TxOutput.d.ts.map
{"version":3,"file":"TxOutput.d.ts","sourceRoot":"","sources":["../../../../src/class/Transaction/TxOutput.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AAEpC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAE9D,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,KAAK,EAAG,MAAM,CAAA;IACd,YAAY,EAAG,QAAQ,CAAA;gBAEV,KAAK,EAAG,UAAU;IAK/B,IAAI,IAAI,IAAM,UAAU,CAGvB;CACF"}
import { Buff } from '@cmdcode/buff-utils';
import { ScriptData } from '../../schema/types.js';
type ScriptFormat = 'p2sh' | 'p2w' | 'p2tr';
export default class TxScript {
readonly _buff: Buff;
constructor(script: ScriptData);
get raw(): Uint8Array;
get hex(): string;
get asm(): string[];
getHash(format: ScriptFormat, version?: number): string;
toJSON(): string[];
}
export {};
//# sourceMappingURL=TxScript.d.ts.map
{"version":3,"file":"TxScript.d.ts","sourceRoot":"","sources":["../../../../src/class/Transaction/TxScript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAc,qBAAqB,CAAA;AAGlD,OAAO,EAAE,UAAU,EAAE,MAAQ,uBAAuB,CAAA;AAIpD,KAAK,YAAY,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAA;AAE3C,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,QAAQ,CAAC,KAAK,EAAG,IAAI,CAAA;gBAGnB,MAAM,EAAG,UAAU;IAKrB,IAAI,GAAG,IAAM,UAAU,CAEtB;IAED,IAAI,GAAG,IAAM,MAAM,CAElB;IAED,IAAI,GAAG,IAAM,MAAM,EAAE,CAEpB;IAED,OAAO,CAAE,MAAM,EAAG,YAAY,EAAE,OAAQ,CAAC,EAAE,MAAM,GAAI,MAAM;IAa3D,MAAM,IAAK,MAAM,EAAE;CAGpB"}
import { SequenceData } from '../../schema/types.js';
export default class TxSequence {
value: number;
constructor(value: SequenceData);
get isReplaceable(): boolean;
get isLocked(): boolean;
get isTimelock(): boolean;
get timestamp(): number;
set timestamp(value: number);
get blockheight(): number;
set blockheight(value: number);
get estDate(): Date;
set estDate(date: Date);
toJSON(): number;
}
//# sourceMappingURL=TxSequence.d.ts.map
{"version":3,"file":"TxSequence.d.ts","sourceRoot":"","sources":["../../../../src/class/Transaction/TxSequence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAWpD,MAAM,CAAC,OAAO,OAAO,UAAU;IACtB,KAAK,EAAG,MAAM,CAAA;gBAER,KAAK,EAAG,YAAY;IAQjC,IAAI,aAAa,IAAM,OAAO,CAE7B;IAED,IAAI,QAAQ,IAAM,OAAO,CAExB;IAED,IAAI,UAAU,IAAM,OAAO,CAE1B;IAED,IAAI,SAAS,IAAM,MAAM,CAMxB;IAED,IAAI,SAAS,CAAE,KAAK,EAAG,MAAM,EAI5B;IAED,IAAI,WAAW,IAAM,MAAM,CAM1B;IAED,IAAI,WAAW,CAAE,KAAK,EAAG,MAAM,EAG9B;IAED,IAAI,OAAO,IAAM,IAAI,CAIpB;IAED,IAAI,OAAO,CAAE,IAAI,EAAG,IAAI,EAMvB;IAED,MAAM,IAAM,MAAM;CAGnB"}
import { Bytes, InputType, ScriptData, WitnessData } from '../../schema/types.js';
export default class TxWitness {
readonly format?: InputType;
readonly _data: ScriptData[];
readonly _meta: WitnessData;
constructor(data: ScriptData[], format?: InputType);
get length(): number;
get annex(): string | undefined;
get cblock(): string | undefined;
get script(): ScriptData | undefined;
get params(): Bytes[];
toJSON(): ScriptData[];
}
//# sourceMappingURL=TxWitness.d.ts.map
{"version":3,"file":"TxWitness.d.ts","sourceRoot":"","sources":["../../../../src/class/Transaction/TxWitness.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEjF,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,QAAQ,CAAC,MAAO,CAAC,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAK,UAAU,EAAE,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAK,WAAW,CAAA;gBAG5B,IAAI,EAAM,UAAU,EAAE,EACtB,MAAO,CAAC,EAAE,SAAS;IAOrB,IAAI,MAAM,IAAM,MAAM,CAErB;IAED,IAAI,KAAK,IAAM,MAAM,GAAG,SAAS,CAKhC;IAED,IAAI,MAAM,IAAM,MAAM,GAAG,SAAS,CAKjC;IAED,IAAI,MAAM,IAAM,UAAU,GAAG,SAAS,CAKrC;IAED,IAAI,MAAM,IAAM,KAAK,EAAE,CAEtB;IAED,MAAM,IAAM,UAAU,EAAE;CAGzB"}
export { Address } from './lib/addr/index.js';
export { Script } from './lib/script/index.js';
export { Signer } from './lib/sig/index.js';
export { Tap } from './lib/tap/index.js';
export { Tx } from './lib/tx/index.js';
export * from './class/Transaction/index.js';
export * from './schema/types.js';
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAO,uBAAuB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAO,oBAAoB,CAAA;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAU,oBAAoB,CAAA;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAW,mBAAmB,CAAA;AAE3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,mBAAmB,CAAA"}
import { Buff, Bytes } from '@cmdcode/buff-utils';
import { ScriptData } from '../../schema/types.js';
export declare function hash160pkh(pubkey: Bytes): Buff;
export declare function hash160sh(script: ScriptData): Buff;
export declare function sha256sh(script: ScriptData): Buff;
//# sourceMappingURL=hash.d.ts.map
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../../src/lib/addr/hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAGjD,OAAO,EAAE,UAAU,EAAE,MAAO,uBAAuB,CAAA;AAGnD,wBAAgB,UAAU,CAAE,MAAM,EAAG,KAAK,GAAI,IAAI,CAIjD;AAED,wBAAgB,SAAS,CAAE,MAAM,EAAG,UAAU,GAAI,IAAI,CAGrD;AAED,wBAAgB,QAAQ,CAAE,MAAM,EAAG,UAAU,GAAI,IAAI,CAGpD"}
import { decodeAddress, fromScriptPubKey, toScriptPubKey } from './utils.js';
export declare const Address: {
p2pkh: {
check: typeof import("./p2pkh.js").check;
encode: typeof import("./p2pkh.js").encode;
decode: typeof import("./p2pkh.js").decode;
hash: typeof import("./hash.js").hash160pkh;
scriptPubKey: typeof import("./p2pkh.js").scriptPubKey;
fromPubKey: typeof import("./p2pkh.js").fromPubKey;
};
p2sh: {
check: typeof import("./p2sh.js").check;
encode: typeof import("./p2sh.js").encode;
decode: typeof import("./p2sh.js").decode;
hash: typeof import("./hash.js").hash160sh;
scriptPubKey: typeof import("./p2sh.js").scriptPubKey;
fromScript: typeof import("./p2sh.js").fromScript;
};
p2wpkh: {
check: typeof import("./p2w-pkh.js").check;
encode: typeof import("./p2w-pkh.js").encode;
decode: typeof import("./p2w-pkh.js").decode;
hash: typeof import("./hash.js").hash160pkh;
scriptPubKey: typeof import("./p2w-pkh.js").scriptPubKey;
fromPubKey: typeof import("./p2w-pkh.js").fromPubKey;
};
p2wsh: {
check: typeof import("./p2w-sh.js").check;
encode: typeof import("./p2w-sh.js").encode;
decode: typeof import("./p2w-sh.js").decode;
hash: typeof import("./hash.js").sha256sh;
scriptPubKey: typeof import("./p2w-sh.js").scriptPubKey;
fromScript: typeof import("./p2w-sh.js").fromScript;
};
p2tr: {
check: typeof import("./p2tr.js").check;
encode: typeof import("./p2tr.js").encode;
decode: typeof import("./p2tr.js").decode;
scriptPubKey: typeof import("./p2tr.js").scriptPubKey;
fromPubKey: typeof import("./p2tr.js").fromPubKey;
};
decode: typeof decodeAddress;
fromScriptPubKey: typeof fromScriptPubKey;
toScriptPubKey: typeof toScriptPubKey;
};
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/addr/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,cAAc,EACf,MAAM,YAAY,CAAA;AAEnB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASnB,CAAA"}
import { Buff } from '@cmdcode/buff-utils';
import { Bytes, Networks } from '../../schema/types.js';
import { hash160pkh } from './hash.js';
export declare function check(address: string, network?: Networks): boolean;
export declare function encode(input: Bytes, network?: Networks): string;
export declare function decode(address: string, network?: Networks): Buff;
export declare function scriptPubKey(input: Bytes): string[];
export declare function fromPubKey(pubkey: Bytes, network?: Networks): string;
export declare const P2PKH: {
check: typeof check;
encode: typeof encode;
decode: typeof decode;
hash: typeof hash160pkh;
scriptPubKey: typeof scriptPubKey;
fromPubKey: typeof fromPubKey;
};
//# sourceMappingURL=p2pkh.d.ts.map
{"version":3,"file":"p2pkh.d.ts","sourceRoot":"","sources":["../../../../src/lib/addr/p2pkh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAiB,qBAAqB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAW,WAAW,CAAA;AAE3C,wBAAgB,KAAK,CACnB,OAAO,EAAG,MAAM,EAChB,OAAO,GAAG,QAAiB,GACzB,OAAO,CAQV;AAED,wBAAgB,MAAM,CACpB,KAAK,EAAK,KAAK,EACf,OAAO,GAAG,QAAiB,GACzB,MAAM,CAKT;AAED,wBAAgB,MAAM,CACpB,OAAO,EAAG,MAAM,EAChB,OAAO,GAAG,QAAiB,GACzB,IAAI,CAKP;AAED,wBAAgB,YAAY,CAAE,KAAK,EAAG,KAAK,GAAI,MAAM,EAAE,CAItD;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAK,KAAK,EAChB,OAAQ,CAAC,EAAE,QAAQ,GACjB,MAAM,CAGT;AAED,eAAO,MAAM,KAAK;;;;;;;CAAwE,CAAA"}
import { Buff } from '@cmdcode/buff-utils';
import { hash160sh } from './hash.js';
import { Bytes, Networks, ScriptData } from '../../schema/types.js';
export declare function check(address: string, network?: Networks): boolean;
export declare function encode(input: Bytes, network?: Networks): string;
export declare function decode(address: string, network?: Networks): Buff;
export declare function scriptPubKey(input: Bytes): string[];
export declare function fromScript(script: ScriptData, network?: Networks): string;
export declare const P2SH: {
check: typeof check;
encode: typeof encode;
decode: typeof decode;
hash: typeof hash160sh;
scriptPubKey: typeof scriptPubKey;
fromScript: typeof fromScript;
};
//# sourceMappingURL=p2sh.d.ts.map
{"version":3,"file":"p2sh.d.ts","sourceRoot":"","sources":["../../../../src/lib/addr/p2sh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAW,qBAAqB,CAAA;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEnE,wBAAgB,KAAK,CACnB,OAAO,EAAG,MAAM,EAChB,OAAO,GAAG,QAAiB,GACzB,OAAO,CASV;AAED,wBAAgB,MAAM,CACpB,KAAK,EAAK,KAAK,EACf,OAAO,GAAG,QAAiB,GACzB,MAAM,CAKT;AAED,wBAAgB,MAAM,CACpB,OAAO,EAAG,MAAM,EAChB,OAAO,GAAG,QAAiB,GACzB,IAAI,CAKP;AAED,wBAAgB,YAAY,CAAE,KAAK,EAAG,KAAK,GAAI,MAAM,EAAE,CAGtD;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAK,UAAU,EACrB,OAAQ,CAAC,EAAE,QAAQ,GACjB,MAAM,CAGT;AAED,eAAO,MAAM,IAAI;;;;;;;CAAuE,CAAA"}
import { Buff } from '@cmdcode/buff-utils';
import { Bytes, Networks } from '../../schema/types.js';
export declare function check(address: string): boolean;
export declare function encode(input: Bytes, network?: Networks): string;
export declare function decode(address: string): Buff;
export declare function scriptPubKey(input: Bytes): string[];
export declare function fromPubKey(pubkey: Bytes, network?: Networks): string;
export declare const P2TR: {
check: typeof check;
encode: typeof encode;
decode: typeof decode;
scriptPubKey: typeof scriptPubKey;
fromPubKey: typeof fromPubKey;
};
//# sourceMappingURL=p2tr.d.ts.map
{"version":3,"file":"p2tr.d.ts","sourceRoot":"","sources":["../../../../src/lib/addr/p2tr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAOvD,wBAAgB,KAAK,CAAE,OAAO,EAAG,MAAM,GAAI,OAAO,CAOjD;AAED,wBAAgB,MAAM,CACpB,KAAK,EAAK,KAAK,EACf,OAAO,GAAG,QAAiB,GACzB,MAAM,CAKT;AAED,wBAAgB,MAAM,CAAE,OAAO,EAAG,MAAM,GAAI,IAAI,CAK/C;AAED,wBAAgB,YAAY,CAAE,KAAK,EAAG,KAAK,GAAI,MAAM,EAAE,CAItD;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAK,KAAK,EAChB,OAAQ,CAAC,EAAE,QAAQ,GACjB,MAAM,CAGT;AAED,eAAO,MAAM,IAAI;;;;;;CAAsD,CAAA"}
import { Buff } from '@cmdcode/buff-utils';
import { Bytes, Networks } from '../../schema/types.js';
import { hash160pkh } from './hash.js';
export declare function check(address: string): boolean;
export declare function encode(input: Bytes, network?: Networks): string;
export declare function decode(address: string): Buff;
export declare function scriptPubKey(input: Bytes): string[];
export declare function fromPubKey(pubkey: Bytes, network?: Networks): string;
export declare const P2WPKH: {
check: typeof check;
encode: typeof encode;
decode: typeof decode;
hash: typeof hash160pkh;
scriptPubKey: typeof scriptPubKey;
fromPubKey: typeof fromPubKey;
};
//# sourceMappingURL=p2w-pkh.d.ts.map
{"version":3,"file":"p2w-pkh.d.ts","sourceRoot":"","sources":["../../../../src/lib/addr/p2w-pkh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAiB,qBAAqB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAW,WAAW,CAAA;AAI3C,wBAAgB,KAAK,CAAE,OAAO,EAAG,MAAM,GAAI,OAAO,CAOjD;AAED,wBAAgB,MAAM,CACpB,KAAK,EAAK,KAAK,EACf,OAAO,GAAG,QAAiB,GACzB,MAAM,CAKT;AAED,wBAAgB,MAAM,CAAE,OAAO,EAAG,MAAM,GAAI,IAAI,CAK/C;AAED,wBAAgB,YAAY,CAAE,KAAK,EAAG,KAAK,GAAI,MAAM,EAAE,CAItD;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAK,KAAK,EAChB,OAAQ,CAAC,EAAE,QAAQ,GACjB,MAAM,CAGT;AAED,eAAO,MAAM,MAAM;;;;;;;CAAwE,CAAA"}
import { Buff } from '@cmdcode/buff-utils';
import { sha256sh } from './hash.js';
import { Bytes, Networks, ScriptData } from '../../schema/types.js';
export declare function check(address: string): boolean;
export declare function encode(input: Bytes, network?: Networks): string;
export declare function decode(address: string): Buff;
export declare function scriptPubKey(input: Bytes): string[];
export declare function fromScript(script: ScriptData, network?: Networks): string;
export declare const P2WSH: {
check: typeof check;
encode: typeof encode;
decode: typeof decode;
hash: typeof sha256sh;
scriptPubKey: typeof scriptPubKey;
fromScript: typeof fromScript;
};
//# sourceMappingURL=p2w-sh.d.ts.map
{"version":3,"file":"p2w-sh.d.ts","sourceRoot":"","sources":["../../../../src/lib/addr/p2w-sh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAiB,qBAAqB,CAAA;AAGrD,OAAO,EAAE,QAAQ,EAAE,MAAa,WAAW,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAInE,wBAAgB,KAAK,CAAE,OAAO,EAAG,MAAM,GAAI,OAAO,CAOjD;AAED,wBAAgB,MAAM,CACpB,KAAK,EAAK,KAAK,EACf,OAAO,GAAG,QAAiB,GACzB,MAAM,CAKT;AAED,wBAAgB,MAAM,CAAE,OAAO,EAAG,MAAM,GAAI,IAAI,CAK/C;AAED,wBAAgB,YAAY,CAAE,KAAK,EAAG,KAAK,GAAI,MAAM,EAAE,CAItD;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAK,UAAU,EACrB,OAAQ,CAAC,EAAE,QAAQ,GACjB,MAAM,CAGT;AAED,eAAO,MAAM,KAAK;;;;;;;CAAsE,CAAA"}
import { Buff } from '@cmdcode/buff-utils';
import { Bytes, Networks, OutputType, ScriptData } from '../../schema/types.js';
export type AddressType = [
prefix: string,
type: OutputType,
network: Networks,
size: number,
format: 'base58' | 'bech32' | 'bech32m'
];
export interface AddressData {
data: Buff;
network: Networks;
prefix: string;
script: string[];
type: OutputType;
}
export interface AddressTool {
check: (address: string, network?: Networks) => boolean;
encode: (input: Bytes, network?: Networks) => string;
decode: (address: string, network?: Networks) => Buff;
scriptPubKey: (keyhash: Bytes) => string[];
}
export interface AddrKeyTool extends AddressTool {
fromPubKey: (pubkey: Bytes, network?: Networks) => string;
}
export interface AddrScriptTool extends AddressTool {
fromScript: (script: ScriptData, network?: Networks) => string;
}
export declare const BECH32_PREFIXES: Record<Networks, string>;
//# sourceMappingURL=schema.d.ts.map
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/lib/addr/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAE/E,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAI,MAAM;IAChB,IAAI,EAAM,UAAU;IACpB,OAAO,EAAG,QAAQ;IAClB,IAAI,EAAM,MAAM;IAChB,MAAM,EAAI,QAAQ,GAAG,QAAQ,GAAG,SAAS;CAC1C,CAAA;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAM,IAAI,CAAA;IACd,OAAO,EAAG,QAAQ,CAAA;IAClB,MAAM,EAAI,MAAM,CAAA;IAChB,MAAM,EAAI,MAAM,EAAE,CAAA;IAClB,IAAI,EAAM,UAAU,CAAA;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAI,CAAC,OAAO,EAAG,MAAM,EAAE,OAAQ,CAAC,EAAE,QAAQ,KAAK,OAAO,CAAA;IAC3D,MAAM,EAAG,CAAC,KAAK,EAAK,KAAK,EAAE,OAAQ,CAAC,EAAE,QAAQ,KAAK,MAAM,CAAA;IACzD,MAAM,EAAG,CAAC,OAAO,EAAG,MAAM,EAAE,OAAQ,CAAC,EAAE,QAAQ,KAAK,IAAI,CAAA;IACxD,YAAY,EAAG,CAAC,OAAO,EAAG,KAAK,KAAK,MAAM,EAAE,CAAA;CAC7C;AAED,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC9C,UAAU,EAAG,CAAC,MAAM,EAAG,KAAK,EAAE,OAAQ,CAAC,EAAE,QAAQ,KAAK,MAAM,CAAA;CAC7D;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,UAAU,EAAG,CAAC,MAAM,EAAG,UAAU,EAAE,OAAQ,CAAC,EAAE,QAAQ,KAAK,MAAM,CAAA;CAClE;AAED,eAAO,MAAM,eAAe,EAAG,MAAM,CAAC,QAAQ,EAAE,MAAM,CAKrD,CAAA"}
import { Networks, ScriptData } from '../../schema/types.js';
import { AddressData, AddressType } from './schema.js';
export declare const ADDRESS_TYPES: AddressType[];
export declare function decodeAddress(address: string): AddressData;
export declare function fromScriptPubKey(script: ScriptData, network?: Networks): string;
export declare function toScriptPubKey(address: string): ScriptData;
//# sourceMappingURL=utils.d.ts.map
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/addr/utils.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAc,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAExE,OAAO,EACL,WAAW,EAEX,WAAW,EAEZ,MAAM,aAAa,CAAA;AAEpB,eAAO,MAAM,aAAa,EAAG,WAAW,EAevC,CAAA;AAmCD,wBAAgB,aAAa,CAC3B,OAAO,EAAG,MAAM,GACd,WAAW,CAMd;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAK,UAAU,EACrB,OAAQ,CAAC,EAAE,QAAQ,GACjB,MAAM,CAIT;AAED,wBAAgB,cAAc,CAAE,OAAO,EAAG,MAAM,GAAI,UAAU,CAG7D"}
import { Bytes } from '../schema/types';
export declare function isHex<T>(value: T): value is Extract<T, string>;
export declare function isBytes<T>(value: T): value is Extract<T, Bytes>;
export declare function isValidAnnex(annex: any): boolean;
//# sourceMappingURL=check.d.ts.map
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/lib/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,wBAAgB,KAAK,CAAC,CAAC,EAAG,KAAK,EAAG,CAAC,GAAI,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAMjE;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAG,KAAK,EAAG,CAAC,GAAI,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAElE;AAED,wBAAgB,YAAY,CAAE,KAAK,EAAG,GAAG,GAAI,OAAO,CAKnD"}
export declare function decodeScript(script: string | Uint8Array, varint?: boolean): string[];
export declare function decodeWords(words: Uint8Array): string[];
//# sourceMappingURL=decode.d.ts.map
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../../src/lib/script/decode.ts"],"names":[],"mappings":"AAQA,wBAAgB,YAAY,CAC1B,MAAM,EAAG,MAAM,GAAG,UAAU,EAC5B,MAAM,UAAQ,GACZ,MAAM,EAAE,CAWX;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAG,UAAU,GAChB,MAAM,EAAE,CA+CX"}
import { Buff } from '@cmdcode/buff-utils';
import { ScriptData, Word } from '../../schema/types.js';
export declare function encodeScript(script?: ScriptData, varint?: boolean): Buff;
export declare function encodeWords(wordArray: Word[]): Uint8Array;
export declare function encodeWord(word: Word): Uint8Array;
//# sourceMappingURL=encode.d.ts.map
{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../../../src/lib/script/encode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAIxD,wBAAgB,YAAY,CAC1B,MAAM,GAAG,UAAe,EACxB,MAAM,UAAO,GACX,IAAI,CAoBP;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAG,IAAI,EAAE,GAChB,UAAU,CAQb;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAG,IAAI,GACT,UAAU,CAiDb"}
import { Buff } from '@cmdcode/buff-utils';
import { ScriptData } from '../../schema/types.js';
declare function toAsm(script?: ScriptData, varint?: boolean): string[];
declare function toBytes(script?: ScriptData, varint?: boolean): Buff;
declare function toParam(script: ScriptData): Buff;
export declare const FmtScript: {
toAsm: typeof toAsm;
toBytes: typeof toBytes;
toParam: typeof toParam;
};
export {};
//# sourceMappingURL=format.d.ts.map
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/lib/script/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAc,qBAAqB,CAAA;AAIlD,OAAO,EAAE,UAAU,EAAE,MAAQ,uBAAuB,CAAA;AAEpD,iBAAS,KAAK,CACZ,MAAO,CAAC,EAAE,UAAU,EACpB,MAAO,CAAC,EAAE,OAAO,GACf,MAAM,EAAE,CAWX;AAED,iBAAS,OAAO,CACd,MAAO,CAAC,EAAE,UAAU,EACpB,MAAO,CAAC,EAAE,OAAO,GACf,IAAI,CASP;AAED,iBAAS,OAAO,CACd,MAAM,EAAG,UAAU,GACjB,IAAI,CAKP;AAED,eAAO,MAAM,SAAS;;;;CAIrB,CAAA"}
import { encodeScript } from './encode.js';
import { decodeScript } from './decode.js';
export declare const Script: {
encode: typeof encodeScript;
decode: typeof decodeScript;
fmt: {
toAsm: (script?: import("../../index.js").ScriptData | undefined, varint?: boolean | undefined) => string[];
toBytes: (script?: import("../../index.js").ScriptData | undefined, varint?: boolean | undefined) => import("@cmdcode/buff-utils").Buff;
toParam: (script: import("../../index.js").ScriptData) => import("@cmdcode/buff-utils").Buff;
};
};
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/script/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG1C,eAAO,MAAM,MAAM;;;;;;;;CAIlB,CAAA"}
export declare const OPCODE_MAP: {
OP_0: number;
OP_PUSHDATA1: number;
OP_PUSHDATA2: number;
OP_PUSHDATA4: number;
OP_1NEGATE: number;
OP_SUCCESS80: number;
OP_1: number;
OP_2: number;
OP_3: number;
OP_4: number;
OP_5: number;
OP_6: number;
OP_7: number;
OP_8: number;
OP_9: number;
OP_10: number;
OP_11: number;
OP_12: number;
OP_13: number;
OP_14: number;
OP_15: number;
OP_16: number;
OP_NOP: number;
OP_SUCCESS98: number;
OP_IF: number;
OP_NOTIF: number;
OP_ELSE: number;
OP_ENDIF: number;
OP_VERIFY: number;
OP_RETURN: number;
OP_TOALTSTACK: number;
OP_FROMALTSTACK: number;
OP_2DROP: number;
OP_2DUP: number;
OP_3DUP: number;
OP_2OVER: number;
OP_2ROT: number;
OP_2SWAP: number;
OP_IFDUP: number;
OP_DEPTH: number;
OP_DROP: number;
OP_DUP: number;
OP_NIP: number;
OP_OVER: number;
OP_PICK: number;
OP_ROLL: number;
OP_ROT: number;
OP_SWAP: number;
OP_TUCK: number;
OP_SUCCESS126: number;
OP_SUCCESS127: number;
OP_SUCCESS128: number;
OP_SUCCESS129: number;
OP_SIZE: number;
OP_SUCCESS131: number;
OP_SUCCESS132: number;
OP_SUCCESS133: number;
OP_SUCCESS134: number;
OP_EQUAL: number;
OP_EQUALVERIFY: number;
OP_SUCCESS137: number;
OP_SUCCESS138: number;
OP_1ADD: number;
OP_1SUB: number;
OP_SUCCESS141: number;
OP_SUCCESS142: number;
OP_NEGATE: number;
OP_ABS: number;
OP_NOT: number;
OP_0NOTEQUAL: number;
OP_ADD: number;
OP_SUB: number;
OP_SUCCESS149: number;
OP_SUCCESS150: number;
OP_SUCCESS151: number;
OP_SUCCESS152: number;
OP_SUCCESS153: number;
OP_BOOLAND: number;
OP_BOOLOR: number;
OP_NUMEQUAL: number;
OP_NUMEQUALVERIFY: number;
OP_NUMNOTEQUAL: number;
OP_LESSTHAN: number;
OP_GREATERTHAN: number;
OP_LESSTHANOREQUAL: number;
OP_GREATERTHANOREQUAL: number;
OP_MIN: number;
OP_MAX: number;
OP_WITHIN: number;
OP_RIPEMD160: number;
OP_SHA1: number;
OP_SHA256: number;
OP_HASH160: number;
OP_HASH256: number;
OP_CODESEPARATOR: number;
OP_CHECKSIG: number;
OP_CHECKSIGVERIFY: number;
OP_CHECKMULTISIG: number;
OP_CHECKMULTISIGVERIFY: number;
OP_NOP1: number;
OP_CHECKLOCKTIMEVERIFY: number;
OP_CHECKSEQUENCEVERIFY: number;
OP_NOP4: number;
OP_NOP5: number;
OP_NOP6: number;
OP_NOP7: number;
OP_NOP8: number;
OP_NOP9: number;
OP_NOP10: number;
OP_CHECKSIGADD: number;
OP_SUCCESS187: number;
OP_SUCCESS188: number;
OP_SUCCESS189: number;
OP_SUCCESS190: number;
OP_SUCCESS191: number;
OP_SUCCESS192: number;
OP_SUCCESS193: number;
OP_SUCCESS194: number;
OP_SUCCESS195: number;
OP_SUCCESS196: number;
OP_SUCCESS197: number;
OP_SUCCESS198: number;
OP_SUCCESS199: number;
OP_SUCCESS200: number;
OP_SUCCESS201: number;
OP_SUCCESS202: number;
OP_SUCCESS203: number;
OP_SUCCESS204: number;
OP_SUCCESS205: number;
OP_SUCCESS206: number;
OP_SUCCESS207: number;
OP_SUCCESS208: number;
OP_SUCCESS209: number;
OP_SUCCESS210: number;
OP_SUCCESS211: number;
OP_SUCCESS212: number;
OP_SUCCESS213: number;
OP_SUCCESS214: number;
OP_SUCCESS215: number;
OP_SUCCESS216: number;
OP_SUCCESS217: number;
OP_SUCCESS218: number;
OP_SUCCESS219: number;
OP_SUCCESS220: number;
OP_SUCCESS221: number;
OP_SUCCESS222: number;
OP_SUCCESS223: number;
OP_SUCCESS224: number;
OP_SUCCESS225: number;
OP_SUCCESS226: number;
OP_SUCCESS227: number;
OP_SUCCESS228: number;
OP_SUCCESS229: number;
OP_SUCCESS230: number;
OP_SUCCESS231: number;
OP_SUCCESS232: number;
OP_SUCCESS233: number;
OP_SUCCESS234: number;
OP_SUCCESS235: number;
OP_SUCCESS236: number;
OP_SUCCESS237: number;
OP_SUCCESS238: number;
OP_SUCCESS239: number;
OP_SUCCESS240: number;
OP_SUCCESS241: number;
OP_SUCCESS242: number;
OP_SUCCESS243: number;
OP_SUCCESS244: number;
OP_SUCCESS245: number;
OP_SUCCESS246: number;
OP_SUCCESS247: number;
OP_SUCCESS248: number;
OP_SUCCESS249: number;
OP_SUCCESS250: number;
OP_SUCCESS251: number;
OP_SUCCESS252: number;
OP_SUCCESS253: number;
OP_SUCCESS254: number;
};
export declare function getOpLabel(num: number): string;
export declare function getOpCode(string: string): number;
export declare function getWordType(word: number): string;
export declare function isValidWord(word: number): boolean;
//# sourceMappingURL=words.d.ts.map
{"version":3,"file":"words.d.ts","sourceRoot":"","sources":["../../../../src/lib/script/words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmLtB,CAAA;AAED,wBAAgB,UAAU,CAAE,GAAG,EAAG,MAAM,GAAI,MAAM,CAQjD;AAED,wBAAgB,SAAS,CAAE,MAAM,EAAG,MAAM,GAAI,MAAM,CAKnD;AAED,wBAAgB,WAAW,CAAE,IAAI,EAAG,MAAM,GAAI,MAAM,CAiBnD;AAED,wBAAgB,WAAW,CAAE,IAAI,EAAG,MAAM,GAAI,OAAO,CAqBpD"}
export declare const Signer: {
segwit: {
hash: typeof import("./segwit/hash.js").hashTx;
sign: typeof import("./segwit/sign.js").signTx;
verify: typeof import("./segwit/verify.js").verifyTx;
};
taproot: {
hash: typeof import("./taproot/hash.js").hashTx;
sign: typeof import("./taproot/sign.js").signTx;
verify: typeof import("./taproot/verify.js").verifyTx;
};
};
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/sig/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM;;;;;;;;;;;CAGlB,CAAA"}
import { Buff } from '@cmdcode/buff-utils';
import { HashConfig } from '../types.js';
import { TxTemplate, Bytes } from '../../../schema/types.js';
export declare function hashTx(txdata: TxTemplate | Bytes, idx: number, config?: HashConfig): Buff;
//# sourceMappingURL=hash.d.ts.map
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../../../src/lib/sig/segwit/hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAY,qBAAqB,CAAA;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,OAAO,EAGL,UAAU,EACV,KAAK,EACN,MAAM,0BAA0B,CAAA;AAKjC,wBAAgB,MAAM,CACpB,MAAM,EAAG,UAAU,GAAG,KAAK,EAC3B,GAAG,EAAM,MAAM,EACf,MAAM,GAAG,UAAe,GACtB,IAAI,CA2DP"}
import { hashTx } from './hash.js';
import { signTx } from './sign.js';
import { verifyTx } from './verify.js';
export declare const SWSigner: {
hash: typeof hashTx;
sign: typeof signTx;
verify: typeof verifyTx;
};
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/sig/segwit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAQ,WAAW,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAQ,WAAW,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,eAAO,MAAM,QAAQ;;;;CAIpB,CAAA"}
import { Buff } from '@cmdcode/buff-utils';
import { TxTemplate } from '../../../schema/types.js';
import { HashConfig } from '../types.js';
export declare function signTx(seckey: string | Uint8Array, txdata: TxTemplate | string | Uint8Array, index: number, config?: HashConfig): Buff;
//# sourceMappingURL=sign.d.ts.map
{"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../../../src/lib/sig/segwit/sign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAY,qBAAqB,CAAA;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,wBAAgB,MAAM,CACpB,MAAM,EAAI,MAAM,GAAG,UAAU,EAC7B,MAAM,EAAI,UAAU,GAAG,MAAM,GAAG,UAAU,EAC1C,KAAK,EAAK,MAAM,EAChB,MAAM,GAAI,UAAe,GACvB,IAAI,CAKP"}
import { TxTemplate } from '../../../schema/types.js';
import { HashConfig } from '../types.js';
export declare function verifyTx(txdata: TxTemplate | string | Uint8Array, index: number, config?: HashConfig): boolean;
//# sourceMappingURL=verify.d.ts.map
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../../src/lib/sig/segwit/verify.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,wBAAgB,QAAQ,CACtB,MAAM,EAAG,UAAU,GAAG,MAAM,GAAG,UAAU,EACzC,KAAK,EAAI,MAAM,EACf,MAAM,GAAG,UAAe,GACtB,OAAO,CAgDV"}
import { Buff } from '@cmdcode/buff-utils';
import { HashConfig } from '../types.js';
import { Bytes, InputData, OutputData, TxTemplate } from '../../../schema/types.js';
export declare function hashTx(template: TxTemplate | Bytes, index: number, config?: HashConfig): Buff;
export declare function hashOutpoints(vin: InputData[]): Uint8Array;
export declare function hashSequence(vin: InputData[]): Uint8Array;
export declare function hashAmounts(prevouts: OutputData[]): Uint8Array;
export declare function hashScripts(prevouts: OutputData[]): Uint8Array;
export declare function hashOutputs(vout: OutputData[]): Uint8Array;
export declare function hashOutput(vout: OutputData): Uint8Array;
//# sourceMappingURL=hash.d.ts.map
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../../../src/lib/sig/taproot/hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAc,qBAAqB,CAAA;AAKlD,OAAO,EAAE,UAAU,EAAE,MAAQ,aAAa,CAAA;AAE1C,OAAO,EACL,KAAK,EACL,SAAS,EACT,UAAU,EAEV,UAAU,EACX,MAAM,0BAA0B,CAAA;AAIjC,wBAAgB,MAAM,CACpB,QAAQ,EAAG,UAAU,GAAG,KAAK,EAC7B,KAAK,EAAM,MAAM,EACjB,MAAM,GAAK,UAAe,GACxB,IAAI,CAoHP;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAG,SAAS,EAAE,GACf,UAAU,CAOb;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAG,SAAS,EAAE,GACf,UAAU,CAMb;AAED,wBAAgB,WAAW,CACzB,QAAQ,EAAG,UAAU,EAAE,GACrB,UAAU,CAMb;AAED,wBAAgB,WAAW,CACzB,QAAQ,EAAG,UAAU,EAAE,GACrB,UAAU,CAMb;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAG,UAAU,EAAE,GACjB,UAAU,CAOb;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAG,UAAU,GACf,UAAU,CAKb"}
import { hashTx } from './hash.js';
import { signTx } from './sign.js';
import { verifyTx } from './verify.js';
export declare const TRSigner: {
hash: typeof hashTx;
sign: typeof signTx;
verify: typeof verifyTx;
};
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/sig/taproot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAQ,WAAW,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAQ,WAAW,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,eAAO,MAAM,QAAQ;;;;CAIpB,CAAA"}
import { Buff, Bytes } from '@cmdcode/buff-utils';
import { HashConfig } from '../types.js';
import { TxTemplate } from '../../../schema/types.js';
export declare function signTx(seckey: string | Uint8Array, txdata: TxTemplate | string | Uint8Array, index: number, config?: HashConfig): Buff;
export declare function sign(secret: Bytes, message: Bytes, rand?: Bytes): Buff;
export declare function verify(signature: Bytes, message: Bytes, pubkey: Bytes, shouldThrow?: boolean): boolean;
//# sourceMappingURL=sign.d.ts.map
{"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../../../src/lib/sig/taproot/sign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAO,qBAAqB,CAAA;AAGlD,OAAO,EAAE,UAAU,EAAE,MAAQ,aAAa,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAQ,0BAA0B,CAAA;AAOvD,wBAAgB,MAAM,CACpB,MAAM,EAAI,MAAM,GAAG,UAAU,EAC7B,MAAM,EAAI,UAAU,GAAG,MAAM,GAAG,UAAU,EAC1C,KAAK,EAAK,MAAM,EAChB,MAAM,GAAI,UAAe,GACvB,IAAI,CAWP;AAED,wBAAgB,IAAI,CAClB,MAAM,EAAI,KAAK,EACf,OAAO,EAAG,KAAK,EACf,IAAI,GAAM,KAAuB,GAC/B,IAAI,CA+BP;AAED,wBAAgB,MAAM,CACpB,SAAS,EAAG,KAAK,EACjB,OAAO,EAAK,KAAK,EACjB,MAAM,EAAM,KAAK,EACjB,WAAW,UAAQ,GACjB,OAAO,CA2CV"}
import { TxTemplate } from '../../../schema/types.js';
import { HashConfig } from '../types.js';
export declare function verifyTx(txdata: TxTemplate | string | Uint8Array, index: number, config?: HashConfig): boolean;
//# sourceMappingURL=verify.d.ts.map
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../../src/lib/sig/taproot/verify.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAS,0BAA0B,CAAA;AAExD,OAAO,EAAE,UAAU,EAAE,MAAS,aAAa,CAAA;AAE3C,wBAAgB,QAAQ,CACtB,MAAM,EAAI,UAAU,GAAG,MAAM,GAAG,UAAU,EAC1C,KAAK,EAAK,MAAM,EAChB,MAAM,GAAI,UAAe,GACvB,OAAO,CAoEV"}
import { Bytes } from '../../schema/types.js';
export interface HashConfig {
extension?: Bytes;
pubkey?: Bytes;
script?: Bytes;
sigflag?: number;
separator_pos?: number;
extflag?: number;
key_version?: number;
throws?: boolean;
}
//# sourceMappingURL=types.d.ts.map
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/sig/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAE7C,MAAM,WAAW,UAAU;IACzB,SAAc,CAAC,EAAE,KAAK,CAAA;IACtB,MAAc,CAAC,EAAE,KAAK,CAAA;IACtB,MAAc,CAAC,EAAE,KAAK,CAAA;IACtB,OAAc,CAAC,EAAE,MAAM,CAAA;IACvB,aAAc,CAAC,EAAE,MAAM,CAAA;IACvB,OAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAc,CAAC,EAAE,OAAO,CAAA;CACzB"}
import * as SCR from './tree.js';
import * as TWK from './tweak.js';
import * as CHK from './key.js';
export declare const TapTree: {
getTag: typeof SCR.getTapTag;
getLeaf: typeof SCR.getTapLeaf;
getBranch: typeof SCR.getTapBranch;
getRoot: typeof SCR.getTapRoot;
};
export declare const TapUtil: {
readCtrlBlock: typeof CHK.readCtrlBlock;
readParityBit: typeof CHK.readParityBit;
};
export declare const TapTweak: {
getPubKey: typeof TWK.getTweakedPub;
getSecKey: typeof TWK.getTweakedSec;
getTweak: typeof TWK.getTapTweak;
tweakSecKey: typeof TWK.tweakSecKey;
tweakPubKey: typeof TWK.tweakPubKey;
};
export declare const Tap: {
getPubKey: typeof CHK.getTapPubKey;
getSecKey: typeof CHK.getTapSecKey;
encodeScript: typeof SCR.getTapScript;
checkPath: typeof CHK.checkPath;
tree: {
getTag: typeof SCR.getTapTag;
getLeaf: typeof SCR.getTapLeaf;
getBranch: typeof SCR.getTapBranch;
getRoot: typeof SCR.getTapRoot;
};
tweak: {
getPubKey: typeof TWK.getTweakedPub;
getSecKey: typeof TWK.getTweakedSec;
getTweak: typeof TWK.getTapTweak;
tweakSecKey: typeof TWK.tweakSecKey;
tweakPubKey: typeof TWK.tweakPubKey;
};
util: {
readCtrlBlock: typeof CHK.readCtrlBlock;
readParityBit: typeof CHK.readParityBit;
};
SCRIPT_PUBKEY: import("@cmdcode/buff-utils").Buff;
};
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/tap/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAO,WAAW,CAAA;AACjC,OAAO,KAAK,GAAG,MAAO,YAAY,CAAA;AAClC,OAAO,KAAK,GAAG,MAAO,UAAU,CAAA;AAEhC,eAAO,MAAM,OAAO;;;;;CAKnB,CAAA;AAED,eAAO,MAAM,OAAO;;;CAGnB,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;CAMpB,CAAA;AAED,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;CASf,CAAA"}
import { CtrlBlock, TapConfig, TapKey } from './types.js';
import { Bytes } from '../../schema/types.js';
export declare function getTapSecKey(seckey: Bytes, config?: TapConfig): TapKey;
export declare function getTapPubKey(pubkey: Bytes, config?: TapConfig): TapKey;
export declare function checkPath(tapkey: Bytes, target: Bytes, cblock: Bytes, config?: TapConfig): boolean;
export declare function readCtrlBlock(cblock: Bytes): CtrlBlock;
export declare function readParityBit(parity?: number | string): number;
//# sourceMappingURL=key.d.ts.map
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../../../src/lib/tap/key.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAI7C,wBAAgB,YAAY,CAC1B,MAAM,EAAI,KAAK,EACf,MAAM,GAAI,SAAc,GACtB,MAAM,CAET;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAI,KAAK,EACf,MAAM,GAAI,SAAc,GACtB,MAAM,CAET;AA+DD,wBAAgB,SAAS,CACvB,MAAM,EAAG,KAAK,EACd,MAAM,EAAG,KAAK,EACd,MAAM,EAAG,KAAK,EACd,MAAM,GAAG,SAAc,GACrB,OAAO,CA4BV;AAED,wBAAgB,aAAa,CAAE,MAAM,EAAG,KAAK,GAAI,SAAS,CAezD;AAED,wBAAgB,aAAa,CAAE,MAAM,GAAG,MAAM,GAAG,MAAa,GAAI,MAAM,CAKvE"}
import { Buff } from '@cmdcode/buff-utils';
import { TapTree, TapProof } from './types.js';
import { Bytes, ScriptData } from '../../schema/types.js';
export declare function getTapTag(tag: string): Buff;
export declare function getTapLeaf(data: Bytes, version?: number): string;
export declare function getTapScript(script: ScriptData, version?: number): string;
export declare function getTapBranch(leafA: string, leafB: string): string;
export declare function getTapRoot(leaves: TapTree): Buff;
export declare function merkleize(taptree: TapTree, target?: string, path?: string[]): TapProof;
export declare function getVersion(version?: number): number;
//# sourceMappingURL=tree.d.ts.map
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../../src/lib/tap/tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAmB,qBAAqB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAKzD,wBAAgB,SAAS,CAAE,GAAG,EAAG,MAAM,GAAI,IAAI,CAG9C;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAG,KAAK,EACZ,OAAO,SAAkB,GACvB,MAAM,CAMT;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAK,UAAU,EACrB,OAAQ,CAAC,EAAE,MAAM,GACf,MAAM,CAET;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAG,MAAM,EACd,KAAK,EAAG,MAAM,GACZ,MAAM,CAYT;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAG,OAAO,GACd,IAAI,CAGP;AAED,wBAAgB,SAAS,CACvB,OAAO,EAAI,OAAO,EAClB,MAAQ,CAAC,EAAE,MAAM,EACjB,IAAI,GAAO,MAAM,EAAO,GACtB,QAAQ,CAwDX;AAED,wBAAgB,UAAU,CAAE,OAAO,SAAO,GAAI,MAAM,CAEnD"}
import { Buff } from '@cmdcode/buff-utils';
import { Bytes } from '../../schema/types.js';
export declare function getTapTweak(key: Bytes, data?: Bytes, isPrivate?: boolean): Buff;
export declare function getTweakedKey(intkey: Bytes, data?: Bytes, isPrivate?: boolean): Buff;
export declare function getTweakedPub(pubkey: Bytes, data?: Bytes): Buff;
export declare function getTweakedSec(seckey: Bytes, data?: Bytes): Buff;
export declare function tweakSecKey(seckey: Bytes, tweak: Bytes): Buff;
export declare function tweakPubKey(pubkey: Bytes, tweak: Bytes): Buff;
export declare const SCRIPT_PUBKEY: Buff;
//# sourceMappingURL=tweak.d.ts.map
{"version":3,"file":"tweak.d.ts","sourceRoot":"","sources":["../../../../src/lib/tap/tweak.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAc,qBAAqB,CAAA;AAIlD,OAAO,EAAE,KAAK,EAAE,MAAa,uBAAuB,CAAA;AAEpD,wBAAgB,WAAW,CACzB,GAAG,EAAK,KAAK,EACb,IAAI,GAAI,KAAwB,EAChC,SAAS,UAAQ,GACf,IAAI,CAKP;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAI,KAAK,EACf,IAAO,CAAC,EAAE,KAAK,EACf,SAAS,UAAQ,GACf,IAAI,CAaP;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAI,KAAK,EACf,IAAO,CAAC,EAAE,KAAK,GACb,IAAI,CAEP;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAI,KAAK,EACf,IAAO,CAAC,EAAE,KAAK,GACb,IAAI,CAEP;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAG,KAAK,EACd,KAAK,EAAI,KAAK,GACZ,IAAI,CAMP;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAG,KAAK,EACd,KAAK,EAAI,KAAK,GACZ,IAAI,CAKP;AASD,eAAO,MAAM,aAAa,MAAwB,CAAA"}
import { Buff } from '@cmdcode/buff-utils';
import { Bytes, ScriptData } from '../../schema/types.js';
export type TapKey = [
key: string,
cblock: string
];
export interface TapConfig {
data?: Bytes;
isPrivate?: boolean;
script?: ScriptData;
tapleaf?: Bytes;
target?: Bytes;
throws?: boolean;
tree?: TapTree;
version?: number;
}
export interface CtrlBlock {
version: number;
parity: number;
intkey: Buff;
paths: string[];
}
export type TapTree = Array<string | string[]>;
export type TapProof = [
root: string,
target: string | undefined,
path: string[]
];
//# sourceMappingURL=types.d.ts.map
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/tap/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEzD,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,EAAM,MAAM;IACf,MAAM,EAAG,MAAM;CAChB,CAAA;AAED,MAAM,WAAW,SAAS;IACxB,IAAU,CAAC,EAAE,KAAK,CAAA;IAClB,SAAU,CAAC,EAAE,OAAO,CAAA;IACpB,MAAU,CAAC,EAAE,UAAU,CAAA;IACvB,OAAU,CAAC,EAAE,KAAK,CAAA;IAClB,MAAU,CAAC,EAAE,KAAK,CAAA;IAClB,MAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAG,MAAM,CAAA;IAChB,MAAM,EAAI,MAAM,CAAA;IAChB,MAAM,EAAI,IAAI,CAAA;IACd,KAAK,EAAK,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,CAAA;AAE9C,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAK,MAAM;IACf,MAAM,EAAG,MAAM,GAAG,SAAS;IAC3B,IAAI,EAAK,MAAM,EAAE;CAClB,CAAA"}
import { Buff, Bytes } from '@cmdcode/buff-utils';
export declare function xOnlyPub(key: Bytes): Buff;
//# sourceMappingURL=utils.d.ts.map
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/tap/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAEjD,wBAAgB,QAAQ,CAAE,GAAG,EAAG,KAAK,GAAI,IAAI,CAG5C"}
import { TxData, TxTemplate } from '../../schema/types.js';
export declare function createTx(template: TxTemplate): TxData;
//# sourceMappingURL=create.d.ts.map
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/lib/tx/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAoB1D,wBAAgB,QAAQ,CAAE,QAAQ,EAAG,UAAU,GAAI,MAAM,CAKxD"}
import { TxData } from '../../schema/types.js';
export declare function decodeTx(bytes: string | Uint8Array): TxData;
//# sourceMappingURL=decode.d.ts.map
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../../src/lib/tx/decode.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,MAAM,EAGP,MAAM,uBAAuB,CAAA;AAE9B,wBAAgB,QAAQ,CAAE,KAAK,EAAG,MAAM,GAAG,UAAU,GAAI,MAAM,CA+B9D"}
import { Buff } from '@cmdcode/buff-utils';
import { SequenceData, TxTemplate, LockData, ValueData, TxData } from '../../schema/types.js';
export declare function encodeTx(txdata: TxTemplate | TxData, omitWitness?: boolean): Buff;
export declare function encodeVersion(num: number): Uint8Array;
export declare function encodeTxid(txid: string): Uint8Array;
export declare function encodePrevOut(vout: number): Uint8Array;
export declare function encodeSequence(sequence: SequenceData): Uint8Array;
export declare function encodeValue(value: ValueData): Uint8Array;
export declare function encodeLocktime(locktime: LockData): Uint8Array;
//# sourceMappingURL=encode.d.ts.map
{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../../../src/lib/tx/encode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAc,qBAAqB,CAAA;AAIlD,OAAO,EAGL,YAAY,EAEZ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACP,MAAM,uBAAuB,CAAA;AAE9B,wBAAgB,QAAQ,CACtB,MAAM,EAAG,UAAU,GAAG,MAAM,EAC5B,WAAY,CAAC,EAAE,OAAO,GACpB,IAAI,CA0BP;AAiBD,wBAAgB,aAAa,CAAE,GAAG,EAAG,MAAM,GAAI,UAAU,CAExD;AAED,wBAAgB,UAAU,CAAE,IAAI,EAAG,MAAM,GAAI,UAAU,CAEtD;AAED,wBAAgB,aAAa,CAAE,IAAI,EAAG,MAAM,GAAI,UAAU,CAEzD;AAED,wBAAgB,cAAc,CAC5B,QAAQ,EAAG,YAAY,GACrB,UAAU,CAQb;AAcD,wBAAgB,WAAW,CACzB,KAAK,EAAG,SAAS,GACf,UAAU,CAQb;AAmDD,wBAAgB,cAAc,CAAE,QAAQ,EAAG,QAAQ,GAAI,UAAU,CAQhE"}
import { Buff } from '@cmdcode/buff-utils';
import { Bytes, TxData, TxTemplate } from '../../schema/types.js';
export declare function toJson(txdata?: Bytes | TxData | TxTemplate): TxData;
export declare function toBytes(txdata?: Bytes | TxData | TxTemplate): Buff;
export declare const TxFmt: {
toBytes: typeof toBytes;
toJson: typeof toJson;
};
//# sourceMappingURL=format.d.ts.map
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/lib/tx/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAU,qBAAqB,CAAA;AAM9C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEjE,wBAAgB,MAAM,CACpB,MAAO,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,UAAU,GACnC,MAAM,CAYT;AAED,wBAAgB,OAAO,CACrB,MAAO,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,UAAU,GACnC,IAAI,CASP;AAED,eAAO,MAAM,KAAK;;;CAGjB,CAAA"}
import { encodeTx } from './encode.js';
import { decodeTx } from './decode.js';
import { createTx } from './create.js';
import { getTxid, getTxSize, readScriptPubKey, readWitness } from './parse.js';
export declare const Tx: {
create: typeof createTx;
encode: typeof encodeTx;
decode: typeof decodeTx;
fmt: {
toBytes: typeof import("./format.js").toBytes;
toJson: typeof import("./format.js").toJson;
};
util: {
getTxSize: typeof getTxSize;
getTxid: typeof getTxid;
readScriptPubKey: typeof readScriptPubKey;
readWitness: typeof readWitness;
};
};
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/tx/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EACL,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,WAAW,EACZ,MAAM,YAAY,CAAA;AAEnB,eAAO,MAAM,EAAE;;;;;;;;;;;;;;CAWd,CAAA"}
import { Bytes, ScriptData, ScriptPubKeyData, TxData, WitnessData } from '../../schema/types.js';
interface TxSizeData {
size: number;
bsize: number;
vsize: number;
weight: number;
}
export declare function readWitness(data?: ScriptData[]): WitnessData;
export declare function readScriptPubKey(script: ScriptData): ScriptPubKeyData;
export declare function getTxid(txdata: TxData | Bytes): string;
export declare function getTxSize(txdata: TxData | Bytes): TxSizeData;
export {};
//# sourceMappingURL=parse.d.ts.map
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/lib/tx/parse.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,EAEL,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAI9B,UAAU,UAAU;IAClB,IAAI,EAAK,MAAM,CAAA;IACf,KAAK,EAAI,MAAM,CAAA;IACf,KAAK,EAAI,MAAM,CAAA;IACf,MAAM,EAAG,MAAM,CAAA;CAChB;AA+FD,wBAAgB,WAAW,CACzB,IAAI,GAAG,UAAU,EAAO,GACtB,WAAW,CAOd;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAG,UAAU,GACjB,gBAAgB,CAWnB;AAED,wBAAgB,OAAO,CAAE,MAAM,EAAG,MAAM,GAAG,KAAK,GAAI,MAAM,CAIzD;AAED,wBAAgB,SAAS,CAAE,MAAM,EAAG,MAAM,GAAG,KAAK,GAAI,UAAU,CAQ/D"}
import { Buff, Bytes } from '@cmdcode/buff-utils';
export declare function checkSize(input: Bytes, size: number): void;
export declare function safeThrow(errorMsg: string, shouldThrow: boolean): boolean;
export declare function hashTag(tag: string, ...data: Bytes[]): Buff;
//# sourceMappingURL=utils.d.ts.map
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAEjD,wBAAgB,SAAS,CAAE,KAAK,EAAG,KAAK,EAAE,IAAI,EAAG,MAAM,GAAI,IAAI,CAK9D;AAED,wBAAgB,SAAS,CACvB,QAAQ,EAAM,MAAM,EACpB,WAAW,EAAG,OAAO,GACnB,OAAO,CAIV;AAED,wBAAgB,OAAO,CACrB,GAAG,EAAG,MAAM,EACZ,GAAG,IAAI,EAAG,KAAK,EAAE,GACf,IAAI,CAIP"}
import { z } from 'zod';
export declare const Schema: {
TxData: z.ZodObject<{
version: z.ZodNumber;
vin: z.ZodArray<z.ZodObject<{
txid: z.ZodString;
vout: z.ZodNumber;
scriptSig: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
sequence: z.ZodNumber;
prevout: z.ZodOptional<z.ZodObject<{
value: z.ZodUnion<[z.ZodNumber, z.ZodBigInt]>;
scriptPubKey: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
}, "strip", z.ZodTypeAny, {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
}, {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
}>>;
witness: z.ZodArray<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">;
}, "strip", z.ZodTypeAny, {
vout: number;
witness: (string | Uint8Array | (string | number | Uint8Array)[])[];
txid: string;
scriptSig: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
sequence: number;
prevout?: {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
} | undefined;
}, {
vout: number;
witness: (string | Uint8Array | (string | number | Uint8Array)[])[];
txid: string;
scriptSig: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
sequence: number;
prevout?: {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
} | undefined;
}>, "many">;
vout: z.ZodArray<z.ZodObject<{
value: z.ZodUnion<[z.ZodNumber, z.ZodBigInt]>;
scriptPubKey: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
}, "strip", z.ZodTypeAny, {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
}, {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
}>, "many">;
locktime: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
version: number;
vin: {
vout: number;
witness: (string | Uint8Array | (string | number | Uint8Array)[])[];
txid: string;
scriptSig: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
sequence: number;
prevout?: {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
} | undefined;
}[];
vout: {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
}[];
locktime: number;
}, {
version: number;
vin: {
vout: number;
witness: (string | Uint8Array | (string | number | Uint8Array)[])[];
txid: string;
scriptSig: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
sequence: number;
prevout?: {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
} | undefined;
}[];
vout: {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
}[];
locktime: number;
}>;
TxInput: z.ZodObject<{
txid: z.ZodString;
vout: z.ZodNumber;
scriptSig: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
sequence: z.ZodNumber;
prevout: z.ZodOptional<z.ZodObject<{
value: z.ZodUnion<[z.ZodNumber, z.ZodBigInt]>;
scriptPubKey: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
}, "strip", z.ZodTypeAny, {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
}, {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
}>>;
witness: z.ZodArray<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">;
}, "strip", z.ZodTypeAny, {
vout: number;
witness: (string | Uint8Array | (string | number | Uint8Array)[])[];
txid: string;
scriptSig: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
sequence: number;
prevout?: {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
} | undefined;
}, {
vout: number;
witness: (string | Uint8Array | (string | number | Uint8Array)[])[];
txid: string;
scriptSig: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
sequence: number;
prevout?: {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
} | undefined;
}>;
TxOutput: z.ZodObject<{
value: z.ZodUnion<[z.ZodNumber, z.ZodBigInt]>;
scriptPubKey: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
}, "strip", z.ZodTypeAny, {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
}, {
value: number | bigint;
scriptPubKey: (string | Uint8Array | (string | number | Uint8Array)[]) & (string | Uint8Array | (string | number | Uint8Array)[] | undefined);
}>;
witness: z.ZodArray<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">;
script: z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>, "many">, z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
hexstr: z.ZodString;
hash: z.ZodString;
uint32: z.ZodNumber;
uint64: z.ZodBigInt;
};
//# sourceMappingURL=check.d.ts.map
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/schema/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAgCvB,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUlB,CAAA"}
import { Buff } from '@cmdcode/buff-utils';
export type Networks = 'main' | 'testnet' | 'signet' | 'regtest';
export type InputType = 'p2pkh' | 'p2sh' | 'p2w-p2pkh' | 'p2w-p2sh' | 'p2w-pkh' | 'p2w-sh' | 'p2tr' | 'raw';
export type OutputType = 'p2pkh' | 'p2sh' | 'p2w-pkh' | 'p2w-sh' | 'p2tr' | 'raw';
export interface TxTemplate {
version?: number;
vin?: Array<{
txid: string;
vout: number;
scriptSig?: ScriptData;
sequence?: SequenceData;
witness?: ScriptData[];
prevout?: OutputData;
}>;
vout?: Array<{
value?: ValueData;
scriptPubKey?: ScriptData;
}>;
locktime?: LockData;
}
export interface TxData {
version: number;
vin: InputData[];
vout: OutputData[];
locktime: LockData;
}
export interface InputData {
txid: string;
vout: number;
scriptSig: ScriptData;
sequence: SequenceData;
witness: ScriptData[];
prevout?: OutputData;
}
export interface OutputData {
value: ValueData;
scriptPubKey: ScriptData;
}
export interface ScriptPubKeyData {
type: OutputType;
data: Buff;
}
export interface WitnessData {
annex: Buff | null;
cblock: Buff | null;
script: Buff | null;
params: Bytes[];
}
export type SequenceData = string | number;
export type LockData = string | number;
export type ValueData = number | bigint;
export type ScriptData = Bytes | Word[];
export type Bytes = string | Uint8Array;
export type Word = string | number | Uint8Array;
//# sourceMappingURL=types.d.ts.map
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/schema/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAE1C,MAAM,MAAM,QAAQ,GAAK,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;AAElE,MAAM,MAAM,SAAS,GAAI,OAAO,GAAK,MAAM,GAAK,WAAW,GAAG,UAAU,GAC/C,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;AAE9D,MAAM,MAAM,UAAU,GAAG,OAAO,GAAI,MAAM,GAAI,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;AAEnF,MAAM,WAAW,UAAU;IACzB,OAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAS,CAAC,EAAE,KAAK,CAAC;QAChB,IAAI,EAAG,MAAM,CAAA;QACb,IAAI,EAAG,MAAM,CAAA;QACb,SAAU,CAAC,EAAE,UAAU,CAAA;QACvB,QAAU,CAAC,EAAE,YAAY,CAAA;QACzB,OAAU,CAAC,EAAE,UAAU,EAAE,CAAA;QACzB,OAAU,CAAC,EAAE,UAAU,CAAA;KACxB,CAAC,CAAA;IACF,IAAK,CAAC,EAAE,KAAK,CAAC;QACZ,KAAa,CAAC,EAAE,SAAS,CAAA;QACzB,YAAa,CAAC,EAAE,UAAU,CAAA;KAC3B,CAAC,CAAA;IACF,QAAS,CAAC,EAAE,QAAQ,CAAA;CACrB;AAED,MAAM,WAAW,MAAM;IACrB,OAAO,EAAI,MAAM,CAAA;IACjB,GAAG,EAAQ,SAAS,EAAE,CAAA;IACtB,IAAI,EAAO,UAAU,EAAE,CAAA;IACvB,QAAQ,EAAG,QAAQ,CAAA;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAG,MAAM,CAAA;IACb,IAAI,EAAG,MAAM,CAAA;IACb,SAAS,EAAG,UAAU,CAAA;IACtB,QAAQ,EAAI,YAAY,CAAA;IACxB,OAAO,EAAK,UAAU,EAAE,CAAA;IACxB,OAAS,CAAC,EAAE,UAAU,CAAA;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAU,SAAS,CAAA;IACxB,YAAY,EAAG,UAAU,CAAA;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAG,UAAU,CAAA;IACjB,IAAI,EAAG,IAAI,CAAA;CACZ;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAI,IAAI,GAAG,IAAI,CAAA;IACpB,MAAM,EAAG,IAAI,GAAG,IAAI,CAAA;IACpB,MAAM,EAAG,IAAI,GAAG,IAAI,CAAA;IACpB,MAAM,EAAG,KAAK,EAAE,CAAA;CACjB;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAA;AAC1C,MAAM,MAAM,QAAQ,GAAO,MAAM,GAAG,MAAM,CAAA;AAC1C,MAAM,MAAM,SAAS,GAAM,MAAM,GAAG,MAAM,CAAA;AAC1C,MAAM,MAAM,UAAU,GAAK,KAAK,GAAI,IAAI,EAAE,CAAA;AAC1C,MAAM,MAAM,KAAK,GAAU,MAAM,GAAG,UAAU,CAAA;AAC9C,MAAM,MAAM,IAAI,GAAW,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA"}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display