utxo-lib 1.0.4 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/bitgo/wallet/chains.d.ts +1 -1
- package/package.json +3 -3
- package/dist/src/bitgo/bbc/DashPsbt.d.ts +0 -12
- package/dist/src/bitgo/bbc/DashPsbt.d.ts.map +0 -1
- package/dist/src/bitgo/bbc/DashPsbt.js +0 -27
- package/dist/src/bitgo/bbc/DashTransaction.d.ts +0 -39
- package/dist/src/bitgo/bbc/DashTransaction.d.ts.map +0 -1
- package/dist/src/bitgo/bbc/DashTransaction.js +0 -109
- package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts +0 -14
- package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts.map +0 -1
- package/dist/src/bitgo/bbc/DashTransactionBuilder.js +0 -28
- package/dist/src/bitgo/bbc/index.d.ts +0 -4
- package/dist/src/bitgo/bbc/index.d.ts.map +0 -1
- package/dist/src/bitgo/bbc/index.js +0 -16
@@ -18,7 +18,7 @@ export declare const chainCodesP2shP2wsh: readonly [10, 11];
|
|
18
18
|
export declare const chainCodesP2wsh: readonly [20, 21];
|
19
19
|
export declare const chainCodesP2tr: readonly [30, 31];
|
20
20
|
export declare const chainCodesP2trMusig2: readonly [40, 41];
|
21
|
-
export declare const chainCodes: (0 | 30 | 1 |
|
21
|
+
export declare const chainCodes: (0 | 30 | 1 | 20 | 10 | 11 | 21 | 31 | 40 | 41)[];
|
22
22
|
export declare type ChainCode = typeof chainCodes[number];
|
23
23
|
export declare function isChainCode(n: unknown): n is ChainCode;
|
24
24
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "utxo-lib",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.6",
|
4
4
|
"description": "Client-side Bitcoin JavaScript library",
|
5
5
|
"main": "./dist/src/index.js",
|
6
6
|
"engines": {
|
@@ -47,13 +47,13 @@
|
|
47
47
|
],
|
48
48
|
"dependencies": {
|
49
49
|
"@bitgo/blake2b": "^3.2.1",
|
50
|
-
"@brandonblack/musig": "
|
50
|
+
"@brandonblack/musig": "https://github.com/Mustafa-Agha/musig-js.git",
|
51
51
|
"@noble/secp256k1": "1.6.3",
|
52
52
|
"bech32": "^2.0.0",
|
53
53
|
"bip174": "npm:@bitgo-forks/bip174@3.1.0-master.3",
|
54
54
|
"bip32": "^3.0.1",
|
55
55
|
"bitcoin-ops": "^1.3.0",
|
56
|
-
"bitcoinjs-lib": "
|
56
|
+
"bitcoinjs-lib": "npm:@bitgo-forks/bitcoinjs-lib@7.1.0-master.4",
|
57
57
|
"bn.js": "^5.2.1",
|
58
58
|
"bs58check": "^2.1.2",
|
59
59
|
"cashaddress": "^1.1.0",
|
@@ -1,12 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
import { DashTransaction } from './BabacoinTransaction';
|
3
|
-
import { PsbtOpts, UtxoPsbt } from '../UtxoPsbt';
|
4
|
-
import { Network } from '../../networks';
|
5
|
-
import { Psbt as PsbtBase } from 'bip174';
|
6
|
-
export declare class DashPsbt extends UtxoPsbt<DashTransaction<bigint>> {
|
7
|
-
protected static transactionFromBuffer(buffer: Buffer, network: Network): DashTransaction<bigint>;
|
8
|
-
static createPsbt(opts: PsbtOpts, data?: PsbtBase): DashPsbt;
|
9
|
-
setType(type: number): DashPsbt;
|
10
|
-
setExtraPayload(extraPayload?: Buffer): DashPsbt;
|
11
|
-
}
|
12
|
-
//# sourceMappingURL=DashPsbt.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"DashPsbt.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/bbc/DashPsbt.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAG1C,qBAAa,QAAS,SAAQ,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC7D,SAAS,CAAC,MAAM,CAAC,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC;IAIjG,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ;IAO5D,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;IAM/B,eAAe,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ;CAKjD"}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.DashPsbt = void 0;
|
4
|
-
const DashTransaction_1 = require("./DashTransaction");
|
5
|
-
const UtxoPsbt_1 = require("../UtxoPsbt");
|
6
|
-
const bip174_1 = require("bip174");
|
7
|
-
const bitcoinjs_lib_1 = require("bitcoinjs-lib");
|
8
|
-
class DashPsbt extends UtxoPsbt_1.UtxoPsbt {
|
9
|
-
static transactionFromBuffer(buffer, network) {
|
10
|
-
return DashTransaction_1.DashTransaction.fromBuffer(buffer, false, 'bigint', network);
|
11
|
-
}
|
12
|
-
static createPsbt(opts, data) {
|
13
|
-
return new DashPsbt(opts, data || new bip174_1.Psbt(new bitcoinjs_lib_1.PsbtTransaction({ tx: new DashTransaction_1.DashTransaction(opts.network) })));
|
14
|
-
}
|
15
|
-
setType(type) {
|
16
|
-
this.checkForSignatures('type');
|
17
|
-
this.tx.type = type;
|
18
|
-
return this;
|
19
|
-
}
|
20
|
-
setExtraPayload(extraPayload) {
|
21
|
-
this.checkForSignatures('extraPayload');
|
22
|
-
this.tx.extraPayload = extraPayload;
|
23
|
-
return this;
|
24
|
-
}
|
25
|
-
}
|
26
|
-
exports.DashPsbt = DashPsbt;
|
27
|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gICAgKTtcbiAgfVxuXG4gIHNldFR5cGUodHlwZTogbnVtYmVyKTogRGFzaFBzYnQge1xuICAgIHRoaXMuY2hlY2tGb3JTaWduYXR1cmVzKCd0eXBlJyk7XG4gICAgdGhpcy50eC50eXBlID0gdHlwZTtcbiAgICByZXR1cm4gdGhpcztcbiAgfVxuXG4gIHNldEV4dHJhUGF5bG9hZChleHRyYVBheWxvYWQ/OiBCdWZmZXIpOiBEYXNoUHNidCB7XG4gICAgdGhpcy5jaGVja0ZvclNpZ25hdHVyZXMoJ2V4dHJhUGF5bG9hZCcpO1xuICAgIHRoaXMudHguZXh0cmFQYXlsb2FkID0gZXh0cmFQYXlsb2FkO1xuICAgIHJldHVybiB0aGlzO1xuICB9XG59XG4iXX0=
|
@@ -1,39 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
import { Transaction } from 'bitcoinjs-lib';
|
3
|
-
import { UtxoTransaction } from '../UtxoTransaction';
|
4
|
-
import { Network } from '../../networks';
|
5
|
-
export declare class DashTransaction<TNumber extends number | bigint = number> extends UtxoTransaction<TNumber> {
|
6
|
-
static DASH_NORMAL: number;
|
7
|
-
static DASH_PROVIDER_REGISTER: number;
|
8
|
-
static DASH_PROVIDER_UPDATE_SERVICE: number;
|
9
|
-
static DASH_PROVIDER_UPDATE_REGISTRAR: number;
|
10
|
-
static DASH_PROVIDER_UPDATE_REVOKE: number;
|
11
|
-
static DASH_COINBASE: number;
|
12
|
-
static DASH_QUORUM_COMMITMENT: number;
|
13
|
-
type: number;
|
14
|
-
extraPayload?: Buffer;
|
15
|
-
constructor(network: Network, tx?: Transaction<bigint | number>, amountType?: 'bigint' | 'number');
|
16
|
-
protected static newTransaction<TNumber extends number | bigint = number>(network: Network, transaction?: DashTransaction<number | bigint>, amountType?: 'number' | 'bigint'): DashTransaction<TNumber>;
|
17
|
-
static fromBuffer<TNumber extends number | bigint = number>(buffer: Buffer, noStrict: boolean, amountType: "number" | "bigint" | undefined, network: Network): DashTransaction<TNumber>;
|
18
|
-
clone<TN2 extends bigint | number = TNumber>(amountType?: 'number' | 'bigint'): DashTransaction<TN2>;
|
19
|
-
byteLength(_ALLOW_WITNESS?: boolean): number;
|
20
|
-
/**
|
21
|
-
* Helper to override `__toBuffer()` of bitcoinjs.Transaction.
|
22
|
-
* Since the method is private, we use a hack in the constructor to make it work.
|
23
|
-
*
|
24
|
-
* TODO: remove `private` modifier in bitcoinjs `__toBuffer()` or find some other solution
|
25
|
-
*
|
26
|
-
* @param buffer - optional target buffer
|
27
|
-
* @param initialOffset - can only be undefined or 0. Other values are only used for serialization in blocks.
|
28
|
-
* @param _ALLOW_WITNESS - ignored
|
29
|
-
*/
|
30
|
-
private toBufferWithExtraPayload;
|
31
|
-
getHash(forWitness?: boolean): Buffer;
|
32
|
-
/**
|
33
|
-
* Build a hash for all or none of the transaction inputs depending on the hashtype
|
34
|
-
* @param hashType
|
35
|
-
* @returns Buffer
|
36
|
-
*/
|
37
|
-
getPrevoutHash(hashType: number): Buffer;
|
38
|
-
}
|
39
|
-
//# sourceMappingURL=DashTransaction.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"DashTransaction.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/bbc/DashTransaction.ts"],"names":[],"mappings":";AACA,OAAO,EAAqB,WAAW,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAgB,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAS,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEhD,qBAAa,eAAe,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAE,SAAQ,eAAe,CAAC,OAAO,CAAC;IACrG,MAAM,CAAC,WAAW,SAAK;IACvB,MAAM,CAAC,sBAAsB,SAAK;IAClC,MAAM,CAAC,4BAA4B,SAAK;IACxC,MAAM,CAAC,8BAA8B,SAAK;IAC1C,MAAM,CAAC,2BAA2B,SAAK;IACvC,MAAM,CAAC,aAAa,SAAK;IACzB,MAAM,CAAC,sBAAsB,SAAK;IAE3B,IAAI,SAAK;IACT,YAAY,CAAC,EAAE,MAAM,CAAC;gBAEjB,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ;IAoBjG,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EACtE,OAAO,EAAE,OAAO,EAChB,WAAW,CAAC,EAAE,eAAe,CAAC,MAAM,GAAG,MAAM,CAAC,EAC9C,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAC/B,eAAe,CAAC,OAAO,CAAC;IAI3B,MAAM,CAAC,UAAU,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EACxD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,OAAO,EACjB,UAAU,iCAAgC,EAC1C,OAAO,EAAE,OAAO,GACf,eAAe,CAAC,OAAO,CAAC;IAW3B,KAAK,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC;IAIpG,UAAU,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM;IAI5C;;;;;;;;;OASG;IACH,OAAO,CAAC,wBAAwB;IA8BhC,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;IAOrC;;;;OAIG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;CAczC"}
|
@@ -1,109 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.DashTransaction = void 0;
|
4
|
-
const bufferutils_1 = require("bitcoinjs-lib/src/bufferutils");
|
5
|
-
const bitcoinjs_lib_1 = require("bitcoinjs-lib");
|
6
|
-
const UtxoTransaction_1 = require("../UtxoTransaction");
|
7
|
-
const networks_1 = require("../../networks");
|
8
|
-
class DashTransaction extends UtxoTransaction_1.UtxoTransaction {
|
9
|
-
constructor(network, tx, amountType) {
|
10
|
-
super(network, tx, amountType);
|
11
|
-
this.type = 0;
|
12
|
-
if (!networks_1.isBbc(network)) {
|
13
|
-
throw new Error(`invalid network`);
|
14
|
-
}
|
15
|
-
if (tx) {
|
16
|
-
this.version = tx.version;
|
17
|
-
if (tx instanceof DashTransaction) {
|
18
|
-
this.type = tx.type;
|
19
|
-
this.extraPayload = tx.extraPayload;
|
20
|
-
}
|
21
|
-
}
|
22
|
-
// since `__toBuffer` is private we have to do a little hack here
|
23
|
-
this.__toBuffer = this.toBufferWithExtraPayload;
|
24
|
-
}
|
25
|
-
static newTransaction(network, transaction, amountType) {
|
26
|
-
return new DashTransaction(network, transaction, amountType);
|
27
|
-
}
|
28
|
-
static fromBuffer(buffer, noStrict, amountType = 'number', network) {
|
29
|
-
const tx = new DashTransaction(network, super.fromBuffer(buffer, true, amountType, network));
|
30
|
-
tx.type = tx.version >> 16;
|
31
|
-
tx.version = tx.version & 0xffff;
|
32
|
-
if (tx.byteLength() !== buffer.length) {
|
33
|
-
const bufferReader = new bufferutils_1.BufferReader(buffer, tx.byteLength());
|
34
|
-
tx.extraPayload = bufferReader.readVarSlice();
|
35
|
-
}
|
36
|
-
return tx;
|
37
|
-
}
|
38
|
-
clone(amountType) {
|
39
|
-
return new DashTransaction(this.network, this, amountType);
|
40
|
-
}
|
41
|
-
byteLength(_ALLOW_WITNESS) {
|
42
|
-
return super.byteLength(_ALLOW_WITNESS) + (this.extraPayload ? UtxoTransaction_1.varSliceSize(this.extraPayload) : 0);
|
43
|
-
}
|
44
|
-
/**
|
45
|
-
* Helper to override `__toBuffer()` of bitcoinjs.Transaction.
|
46
|
-
* Since the method is private, we use a hack in the constructor to make it work.
|
47
|
-
*
|
48
|
-
* TODO: remove `private` modifier in bitcoinjs `__toBuffer()` or find some other solution
|
49
|
-
*
|
50
|
-
* @param buffer - optional target buffer
|
51
|
-
* @param initialOffset - can only be undefined or 0. Other values are only used for serialization in blocks.
|
52
|
-
* @param _ALLOW_WITNESS - ignored
|
53
|
-
*/
|
54
|
-
toBufferWithExtraPayload(buffer, initialOffset, _ALLOW_WITNESS = false) {
|
55
|
-
// We can ignore the `_ALLOW_WITNESS` parameter here since it has no effect.
|
56
|
-
if (!buffer) {
|
57
|
-
buffer = Buffer.allocUnsafe(this.byteLength(false));
|
58
|
-
}
|
59
|
-
if (initialOffset !== undefined && initialOffset !== 0) {
|
60
|
-
throw new Error(`not supported`);
|
61
|
-
}
|
62
|
-
// Start out with regular bitcoin byte sequence.
|
63
|
-
// This buffer will have excess size because it uses `byteLength()` to allocate.
|
64
|
-
const baseBuffer = bitcoinjs_lib_1.Transaction.prototype.__toBuffer.call(this);
|
65
|
-
baseBuffer.copy(buffer);
|
66
|
-
// overwrite leading version bytes (uint16 version, uint16 type)
|
67
|
-
const bufferWriter = new bufferutils_1.BufferWriter(buffer, 0);
|
68
|
-
bufferWriter.writeUInt32((this.version & 0xffff) | (this.type << 16));
|
69
|
-
// Seek to end of original byte sequence and add extraPayload.
|
70
|
-
// We must use the byteLength as calculated by the bitcoinjs implementation since
|
71
|
-
// `baseBuffer` has an excess size.
|
72
|
-
if (this.extraPayload) {
|
73
|
-
bufferWriter.offset = bitcoinjs_lib_1.Transaction.prototype.byteLength.call(this);
|
74
|
-
bufferWriter.writeVarSlice(this.extraPayload);
|
75
|
-
}
|
76
|
-
return buffer;
|
77
|
-
}
|
78
|
-
getHash(forWitness) {
|
79
|
-
if (forWitness) {
|
80
|
-
throw new Error(`invalid argument`);
|
81
|
-
}
|
82
|
-
return bitcoinjs_lib_1.crypto.hash256(this.toBuffer());
|
83
|
-
}
|
84
|
-
/**
|
85
|
-
* Build a hash for all or none of the transaction inputs depending on the hashtype
|
86
|
-
* @param hashType
|
87
|
-
* @returns Buffer
|
88
|
-
*/
|
89
|
-
getPrevoutHash(hashType) {
|
90
|
-
if (!(hashType & UtxoTransaction_1.UtxoTransaction.SIGHASH_ANYONECANPAY)) {
|
91
|
-
const bufferWriter = new bufferutils_1.BufferWriter(Buffer.allocUnsafe(36 * this.ins.length));
|
92
|
-
this.ins.forEach(function (txIn) {
|
93
|
-
bufferWriter.writeSlice(txIn.hash);
|
94
|
-
bufferWriter.writeUInt32(txIn.index);
|
95
|
-
});
|
96
|
-
return bitcoinjs_lib_1.crypto.hash256(bufferWriter.buffer);
|
97
|
-
}
|
98
|
-
return Buffer.alloc(32, 0);
|
99
|
-
}
|
100
|
-
}
|
101
|
-
exports.DashTransaction = DashTransaction;
|
102
|
-
DashTransaction.DASH_NORMAL = 0;
|
103
|
-
DashTransaction.DASH_PROVIDER_REGISTER = 1;
|
104
|
-
DashTransaction.DASH_PROVIDER_UPDATE_SERVICE = 2;
|
105
|
-
DashTransaction.DASH_PROVIDER_UPDATE_REGISTRAR = 3;
|
106
|
-
DashTransaction.DASH_PROVIDER_UPDATE_REVOKE = 4;
|
107
|
-
DashTransaction.DASH_COINBASE = 5;
|
108
|
-
DashTransaction.DASH_QUORUM_COMMITMENT = 6;
|
109
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGFzaFRyYW5zYWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2JpdGdvL2JiYy9EYXNoVHJhbnNhY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsK0RBQTJFO0FBQzNFLGlEQUErRDtBQUUvRCx3REFBbUU7QUFDbkUsNkNBQWdEO0FBRWhELE1BQWEsZUFBMEQsU0FBUSxpQ0FBd0I7SUFZckcsWUFBWSxPQUFnQixFQUFFLEVBQWlDLEVBQUUsVUFBZ0M7UUFDL0YsS0FBSyxDQUFDLE9BQU8sRUFBRSxFQUFFLEV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IuYnVmZmVyKTtcbiAgICB9XG5cbiAgICByZXR1cm4gQnVmZmVyLmFsbG9jKDMyLCAwKTtcbiAgfVxufVxuIl19
|
@@ -1,14 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
import * as bitcoinjs from 'bitcoinjs-lib';
|
3
|
-
import { Network } from '../../networks';
|
4
|
-
import { UtxoTransactionBuilder } from '../UtxoTransactionBuilder';
|
5
|
-
import { DashTransaction } from './BabacoinTransaction';
|
6
|
-
import { UtxoTransaction } from '../UtxoTransaction';
|
7
|
-
export declare class DashTransactionBuilder<TNumber extends number | bigint = number> extends UtxoTransactionBuilder<TNumber, DashTransaction<TNumber>> {
|
8
|
-
constructor(network: Network, tx?: UtxoTransaction<TNumber>);
|
9
|
-
protected static newTransactionBuilder<TNumber extends number | bigint>(network: Network, tx: UtxoTransaction<TNumber>): DashTransactionBuilder<TNumber>;
|
10
|
-
protected createInitialTransaction(network: Network, tx?: bitcoinjs.Transaction<TNumber>): DashTransaction<TNumber>;
|
11
|
-
setType(type: number): void;
|
12
|
-
setExtraPayload(extraPayload?: Buffer): void;
|
13
|
-
}
|
14
|
-
//# sourceMappingURL=DashTransactionBuilder.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"DashTransactionBuilder.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/bbc/DashTransactionBuilder.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAAa,sBAAsB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAE,SAAQ,sBAAsB,CAC1G,OAAO,EACP,eAAe,CAAC,OAAO,CAAC,CACzB;gBACa,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC;IAQ3D,SAAS,CAAC,MAAM,CAAC,qBAAqB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EACpE,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,eAAe,CAAC,OAAO,CAAC,GAC3B,sBAAsB,CAAC,OAAO,CAAC;IAIlC,SAAS,CAAC,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC;IAInH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI3B,eAAe,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI;CAG7C"}
|
@@ -1,28 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.DashTransactionBuilder = void 0;
|
4
|
-
const UtxoTransactionBuilder_1 = require("../UtxoTransactionBuilder");
|
5
|
-
const DashTransaction_1 = require("./DashTransaction");
|
6
|
-
class DashTransactionBuilder extends UtxoTransactionBuilder_1.UtxoTransactionBuilder {
|
7
|
-
constructor(network, tx) {
|
8
|
-
super(network, tx);
|
9
|
-
if (tx instanceof DashTransaction_1.DashTransaction) {
|
10
|
-
this.setType(tx.type);
|
11
|
-
this.setExtraPayload(tx.extraPayload);
|
12
|
-
}
|
13
|
-
}
|
14
|
-
static newTransactionBuilder(network, tx) {
|
15
|
-
return new DashTransactionBuilder(network, tx);
|
16
|
-
}
|
17
|
-
createInitialTransaction(network, tx) {
|
18
|
-
return new DashTransaction_1.DashTransaction(network, tx);
|
19
|
-
}
|
20
|
-
setType(type) {
|
21
|
-
this.tx.type = type;
|
22
|
-
}
|
23
|
-
setExtraPayload(extraPayload) {
|
24
|
-
this.tx.extraPayload = extraPayload;
|
25
|
-
}
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VtYmVyIHwgYmlnaW50PihcbiAgICBuZXR3b3JrOiBOZXR3b3JrLFxuICAgIHR4OiBVdHhvVHJhbnNhY3Rpb248VE51bWJlcj5cbiAgKTogRGFzaFRyYW5zYWN0aW9uQnVpbGRlcjxUTnVtYmVyPiB7XG4gICAgcmV0dXJuIG5ldyBEYXNoVHJhbnNhY3Rpb25CdWlsZGVyPFROdW1iZXI+KG5ldHdvcmssIHR4KTtcbiAgfVxuXG4gIHByb3RlY3RlZCBjcmVhdGVJbml0aWFsVHJhbnNhY3Rpb24obmV0d29yazogTmV0d29yaywgdHg/OiBiaXRjb2luanMuVHJhbnNhY3Rpb248VE51bWJlcj4pOiBEYXNoVHJhbnNhY3Rpb248VE51bWJlcj4ge1xuICAgIHJldHVybiBuZXcgRGFzaFRyYW5zYWN0aW9uPFROdW1iZXI+KG5ldHdvcmssIHR4KTtcbiAgfVxuXG4gIHNldFR5cGUodHlwZTogbnVtYmVyKTogdm9pZCB7XG4gICAgdGhpcy50eC50eXBlID0gdHlwZTtcbiAgfVxuXG4gIHNldEV4dHJhUGF5bG9hZChleHRyYVBheWxvYWQ/OiBCdWZmZXIpOiB2b2lkIHtcbiAgICB0aGlzLnR4LmV4dHJhUGF5bG9hZCA9IGV4dHJhUGF5bG9hZDtcbiAgfVxufVxuIl19
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/bbc/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC"}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
-
}) : (function(o, m, k, k2) {
|
6
|
-
if (k2 === undefined) k2 = k;
|
7
|
-
o[k2] = m[k];
|
8
|
-
}));
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
11
|
-
};
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
-
__exportStar(require("./DashPsbt"), exports);
|
14
|
-
__exportStar(require("./DashTransaction"), exports);
|
15
|
-
__exportStar(require("./DashTransactionBuilder"), exports);
|
16
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYml0Z28vYmJjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUFBLDZDQUEyQjtBQUMzQixvREFBa0M7QUFDbEMsMkRBQXlDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9EYXNoUHNidCc7XG5leHBvcnQgKiBmcm9tICcuL0Rhc2hUcmFuc2FjdGlvbic7XG5leHBvcnQgKiBmcm9tICcuL0Rhc2hUcmFuc2FjdGlvbkJ1aWxkZXInO1xuIl19
|