ecash-lib 4.3.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/payment/output.d.ts +19 -4
- package/dist/payment/output.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/payment/output.ts +25 -8
package/README.md
CHANGED
|
@@ -98,3 +98,4 @@ console.log(toHex(rawTx));
|
|
|
98
98
|
- 4.1.0 - Add Tx deserialization methods [D18393](https://reviews.bitcoinabc.org/D18393)
|
|
99
99
|
- 4.2.0 - Add Tx.txid() method to compute the TxId of a transaction [D18394](https://reviews.bitcoinabc.org/D18394)
|
|
100
100
|
- 4.3.0 - Export a Tx.toHex() method [D18396](https://reviews.bitcoinabc.org/D18396)
|
|
101
|
+
- 4.3.1 - Modify union type of payment outputs to include ecash-wallet template OP_RETURN [D18403](https://reviews.bitcoinabc.org/D18403)
|
package/dist/payment/output.d.ts
CHANGED
|
@@ -7,16 +7,31 @@ export type PaymentOutput = PaymentNonTokenOutput | PaymentTokenOutput;
|
|
|
7
7
|
*
|
|
8
8
|
* Note than an OP_RETURN output is a NonTokenPaymentOutput
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type PaymentNonTokenOutput = {
|
|
11
11
|
/** The amount of satoshis in this tx output */
|
|
12
12
|
sats?: bigint;
|
|
13
13
|
/** The outputScript of this tx output */
|
|
14
14
|
script?: Script;
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The eCash address of this tx output
|
|
17
|
+
* Alternative to script - if script is provided, address should not be set
|
|
18
|
+
*/
|
|
19
|
+
address?: never;
|
|
20
|
+
} | {
|
|
21
|
+
/** The amount of satoshis in this tx output */
|
|
22
|
+
sats?: bigint;
|
|
23
|
+
/** The outputScript of this tx output */
|
|
24
|
+
script?: never;
|
|
25
|
+
/**
|
|
26
|
+
* The eCash address of this tx output
|
|
27
|
+
* Alternative to script - if script is not provided, address must be set
|
|
28
|
+
*/
|
|
29
|
+
address: string;
|
|
30
|
+
};
|
|
16
31
|
/**
|
|
17
32
|
* All token transaction outputs specified in Action have this shape
|
|
18
33
|
*/
|
|
19
|
-
export
|
|
34
|
+
export type PaymentTokenOutput = PaymentNonTokenOutput & {
|
|
20
35
|
/** The tokenId of the token associated with this tx output */
|
|
21
36
|
tokenId: string;
|
|
22
37
|
/**
|
|
@@ -27,5 +42,5 @@ export interface PaymentTokenOutput extends PaymentNonTokenOutput {
|
|
|
27
42
|
atoms: bigint;
|
|
28
43
|
/** Is this tx output a mint baton */
|
|
29
44
|
isMintBaton: boolean;
|
|
30
|
-
}
|
|
45
|
+
};
|
|
31
46
|
//# sourceMappingURL=output.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/payment/output.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,sEAAsE;AACtE,MAAM,MAAM,aAAa,GAAG,qBAAqB,GAAG,kBAAkB,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/payment/output.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,sEAAsE;AACtE,MAAM,MAAM,aAAa,GAAG,qBAAqB,GAAG,kBAAkB,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAC3B;IACI,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;CACnB,GACD;IACI,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAER;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,GAAG;IACrD,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,WAAW,EAAE,OAAO,CAAC;CACxB,CAAC"}
|
package/package.json
CHANGED
package/src/payment/output.ts
CHANGED
|
@@ -13,17 +13,34 @@ export type PaymentOutput = PaymentNonTokenOutput | PaymentTokenOutput;
|
|
|
13
13
|
*
|
|
14
14
|
* Note than an OP_RETURN output is a NonTokenPaymentOutput
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
export type PaymentNonTokenOutput =
|
|
17
|
+
| {
|
|
18
|
+
/** The amount of satoshis in this tx output */
|
|
19
|
+
sats?: bigint;
|
|
20
|
+
/** The outputScript of this tx output */
|
|
21
|
+
script?: Script;
|
|
22
|
+
/**
|
|
23
|
+
* The eCash address of this tx output
|
|
24
|
+
* Alternative to script - if script is provided, address should not be set
|
|
25
|
+
*/
|
|
26
|
+
address?: never;
|
|
27
|
+
}
|
|
28
|
+
| {
|
|
29
|
+
/** The amount of satoshis in this tx output */
|
|
30
|
+
sats?: bigint;
|
|
31
|
+
/** The outputScript of this tx output */
|
|
32
|
+
script?: never;
|
|
33
|
+
/**
|
|
34
|
+
* The eCash address of this tx output
|
|
35
|
+
* Alternative to script - if script is not provided, address must be set
|
|
36
|
+
*/
|
|
37
|
+
address: string;
|
|
38
|
+
};
|
|
22
39
|
|
|
23
40
|
/**
|
|
24
41
|
* All token transaction outputs specified in Action have this shape
|
|
25
42
|
*/
|
|
26
|
-
export
|
|
43
|
+
export type PaymentTokenOutput = PaymentNonTokenOutput & {
|
|
27
44
|
/** The tokenId of the token associated with this tx output */
|
|
28
45
|
tokenId: string;
|
|
29
46
|
/**
|
|
@@ -34,4 +51,4 @@ export interface PaymentTokenOutput extends PaymentNonTokenOutput {
|
|
|
34
51
|
atoms: bigint;
|
|
35
52
|
/** Is this tx output a mint baton */
|
|
36
53
|
isMintBaton: boolean;
|
|
37
|
-
}
|
|
54
|
+
};
|