UNPKG

@secux/app-btc

Version:
162 lines (158 loc) 4.76 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" /> export { OPCODES } from "./coindef"; export declare enum ScriptType { P2PKH = 0, P2WPKH = 1, P2SH = 2, P2SH_P2PKH = 3, P2SH_P2WPKH = 4, P2TR = 5, P2WSH = 6, P2MS = 7, P2SH_P2MS = 8, P2WSH_P2MS = 9, __LENGTH = 10 } export declare enum CoinType { BITCOIN = 0, TESTNET = 1, REGTEST = 2, LITECOIN = 3, BITCOINCASH = 4, GROESTL = 5, DIGIBYTE = 6, DASH = 7, DOGECOIN = 8, __LENGTH = 9 } export declare const coinmap: any; export declare const btcCoinTypes: any; export declare const btcPurposes: readonly number[]; export declare const ow_balance: import("ow").AnyPredicate<string | number>; export declare const ow_path: import("ow").StringPredicate; export declare const ow_accountPath: import("ow").StringPredicate; export declare const ow_hexString: import("ow").StringPredicate; export declare const ow_hashString: import("ow").StringPredicate; export type PathObject = { coin: CoinType; script: ScriptType; }; export declare const ow_PathObject: import("ow").ObjectPredicate<{ coin: number; script: number; }>; export type txInput = { hash: string; vout: number; txHex?: string; script?: ScriptType; satoshis: number | string; path: string; publickey?: string | Buffer; }; export declare const ow_txInput: import("ow").ObjectPredicate<{ hash: string; vout: number; txHex: string | undefined; script: number | undefined; satoshis: string | number; path: string; publickey: string | Buffer | undefined; }>; export type txOutputAddress = { address: string; satoshis: number | string; }; export declare const ow_txOutputAddress: import("ow").ObjectPredicate<{ address: string; satoshis: string | number; }>; export type txOutputScript = { scriptHex: string; satoshis: number | string; }; export declare const ow_txOutputScript: import("ow").ObjectPredicate<{ scriptHex: string; satoshis: string | number; }>; export type txOutputScriptExtened = { publickey?: string | Buffer; path: string; satoshis: number | string; script?: ScriptType; }; export declare const ow_txOutputScriptExtened: import("ow").ObjectPredicate<{ publickey: string | Buffer | undefined; path: string; satoshis: string | number; script: number | undefined; }>; export type txOutput = { to: txOutputAddress | txOutputScriptExtened; utxo?: txOutputScriptExtened; }; export declare const ow_txOutput: import("ow").ObjectPredicate<{ to: { address: string; satoshis: string | number; } | { publickey: string | Buffer | undefined; path: string; satoshis: string | number; script: number | undefined; }; utxo: { publickey: string | Buffer | undefined; path: string; satoshis: string | number; script: number | undefined; } | undefined; }>; export type txOutputExtended = txOutputAddress | txOutputScript | txOutputScriptExtened; export declare function isOutputAddress(output: txOutputExtended): txOutputAddress | undefined; export declare function isOutuptScript(output: txOutputExtended): txOutputScript | undefined; export declare function isOutuptScriptExtended(output: txOutputExtended): txOutputScriptExtened | undefined; export type TransactionObject = { rawTx: string; publickeys: Array<string | Buffer>; coin?: CoinType; }; export declare const ow_TransactionObject: import("ow").ObjectPredicate<{ rawTx: string; publickeys: (string | Buffer)[]; coin: number | undefined; }>; export type AddressOption = { coin?: CoinType; script?: ScriptType; }; export type SignOption = { coin?: CoinType; feeRate?: number; isRBF?: boolean; xpub?: string; }; export declare const ow_AddressOption: import("ow").ObjectPredicate<{ coin: number | undefined; script: number | undefined; }>; export declare const ow_SignOption: import("ow").ObjectPredicate<{ coin: number | undefined; feeRate: number | undefined; isRBF: boolean | undefined; }>;