-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
index.ts
56 lines (49 loc) · 1.3 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
* Represents a payment object, which is used to create a payment.
*
* Supports P2PKH、P2SH、P2WPKH、P2WSH、P2TR and so on
*
* @packageDocumentation
*/
import { Network } from '../networks';
import { Taptree } from '../types';
import { p2data as embed } from './embed';
import { p2ms } from './p2ms';
import { p2pk } from './p2pk';
import { p2pkh } from './p2pkh';
import { p2sh } from './p2sh';
import { p2wpkh } from './p2wpkh';
import { p2wsh } from './p2wsh';
import { p2tr } from './p2tr';
export interface Payment {
name?: string;
network?: Network;
output?: Buffer;
data?: Buffer[];
m?: number;
n?: number;
pubkeys?: Buffer[];
input?: Buffer;
signatures?: Buffer[];
internalPubkey?: Buffer;
pubkey?: Buffer;
signature?: Buffer;
address?: string;
hash?: Buffer;
redeem?: Payment;
redeemVersion?: number;
scriptTree?: Taptree;
witness?: Buffer[];
}
export type PaymentCreator = (a: Payment, opts?: PaymentOpts) => Payment;
export type PaymentFunction = () => Payment;
export interface PaymentOpts {
validate?: boolean;
allowIncomplete?: boolean;
}
export type StackElement = Buffer | number;
export type Stack = StackElement[];
export type StackFunction = () => Stack;
export { embed, p2ms, p2pk, p2pkh, p2sh, p2wpkh, p2wsh, p2tr };
// TODO
// witness commitment