UNPKG

@secux/app-btc

Version:
42 lines (38 loc) 2.21 kB
/*! Copyright 2022 SecuX Technology Inc Copyright Chen Wei-En Copyright Wu Tsung-Yu Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// <reference types="node" /> /// <reference types="node" /> import { CoinType, ScriptType } from "./interface"; import { PaymentBTC } from "./payment"; import { Transaction } from "./transaction"; export declare function getPayment(coin: CoinType): typeof PaymentBTC; export declare function getCoinType(path: string): CoinType; export declare function getPurpose(script: ScriptType): number; export declare function getDefaultScript(path: string): ScriptType; export declare function getSerializer(coin: CoinType): typeof Transaction; export declare function getInScriptSize(type: ScriptType): number; export declare function getWitnessSize(type: ScriptType, sighashType?: number): Array<number>; export declare function getOutScriptSize(type: ScriptType): number; export declare function getDustThreshold(output: ScriptType, dustRelayFee: number): number; export declare function sliceSize(size: number): number; export declare function vectorSize(sizes: Array<number>): number; export declare function witnessStackToScriptWitness(witness: Buffer[]): Buffer; export declare function scriptWitnessToWitnessStack(buffer: Buffer): Buffer[]; export declare function getPublickey(data: string | Buffer): Buffer; export declare function toTweakedPublickey(data: string | Buffer): Buffer; declare const TAGS: readonly ["BIP0340/challenge", "BIP0340/aux", "BIP0340/nonce", "TapLeaf", "TapBranch", "TapSighash", "TapTweak", "KeyAgg list", "KeyAgg coefficient"]; export type TaggedHashPrefix = typeof TAGS[number]; export declare function taggedHash(prefix: TaggedHashPrefix, data: Buffer): Buffer; export {};