@airgap/bitcoin 0.13.8-beta.6 → 0.13.8-beta.7
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/package.json +4 -4
- package/v1/index.d.ts +1 -1
- package/v1/index.js +2 -2
- package/v1/index.js.map +1 -1
- package/v1/module/BitcoinModule.d.ts +2 -1
- package/v1/module/BitcoinModule.js +8 -0
- package/v1/module/BitcoinModule.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +25 -4
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-segwit.d.ts +1 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bitcoin.d.ts +1 -1
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-bitcoin-segwit.json +8 -15
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-bitcoin.json +17 -24
- package/v1/serializer/v3/serializer-companion.d.ts +14 -0
- package/v1/serializer/v3/serializer-companion.js +197 -0
- package/v1/serializer/v3/serializer-companion.js.map +1 -0
- package/v1/serializer/v3/validators/{transaction-validators.d.ts → transaction-validator.d.ts} +1 -4
- package/v1/serializer/v3/validators/{transaction-validators.js → transaction-validator.js} +2 -11
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -0
- package/v1/serializer/v3/validators/transaction-validators.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airgap/bitcoin",
|
|
3
|
-
"version": "0.13.8-beta.
|
|
3
|
+
"version": "0.13.8-beta.7",
|
|
4
4
|
"description": "The @airgap/bitcoin is a Bitcoin implementation of the ICoinProtocol interface from @airgap/coinlib-core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"airgap",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"bitcoinjs-lib": "5.2.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@airgap/coinlib-core": "^0.13.
|
|
38
|
-
"@airgap/module-kit": "^0.13.
|
|
39
|
-
"@airgap/serializer": "^0.13.
|
|
37
|
+
"@airgap/coinlib-core": "^0.13.8-beta.6",
|
|
38
|
+
"@airgap/module-kit": "^0.13.8-beta.6",
|
|
39
|
+
"@airgap/serializer": "^0.13.8-beta.6"
|
|
40
40
|
},
|
|
41
41
|
"localDependencies": {
|
|
42
42
|
"bitcoinjs-message": "2.1.1"
|
package/v1/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { BitcoinTransactionSignRequest } from './serializer/v3/schemas/definitio
|
|
|
8
8
|
import { BitcoinSegwitTransactionSignRequest } from './serializer/v3/schemas/definitions/transaction-sign-request-bitcoin-segwit';
|
|
9
9
|
import { BitcoinTransactionSignResponse } from './serializer/v3/schemas/definitions/transaction-sign-response-bitcoin';
|
|
10
10
|
import { BitcoinSegwitTransactionSignResponse } from './serializer/v3/schemas/definitions/transaction-sign-response-bitcoin-segwit';
|
|
11
|
-
import { BitcoinTransactionValidator } from './serializer/v3/validators/transaction-
|
|
11
|
+
import { BitcoinTransactionValidator } from './serializer/v3/validators/transaction-validator';
|
|
12
12
|
import { bitcoinValidators } from './serializer/v3/validators/validators';
|
|
13
13
|
import { BitcoinProtocolNetwork, BitcoinProtocolOptions, BitcoinUnits } from './types/protocol';
|
|
14
14
|
import { BitcoinInTransaction, BitcoinOutTransaction, BitcoinSegwitSignedTransaction, BitcoinSegwitUnsignedTransaction, BitcoinSignedTransaction, BitcoinTransactionCursor, BitcoinUnsignedTransaction } from './types/transaction';
|
package/v1/index.js
CHANGED
|
@@ -17,8 +17,8 @@ Object.defineProperty(exports, "bitcoinSignedTransactionToResponse", { enumerabl
|
|
|
17
17
|
Object.defineProperty(exports, "bitcoinTransactionSignRequestToUnsigned", { enumerable: true, get: function () { return transaction_converter_1.bitcoinTransactionSignRequestToUnsigned; } });
|
|
18
18
|
Object.defineProperty(exports, "bitcoinTransactionSignResponseToSigned", { enumerable: true, get: function () { return transaction_converter_1.bitcoinTransactionSignResponseToSigned; } });
|
|
19
19
|
Object.defineProperty(exports, "bitcoinUnsignedTransactionToRequest", { enumerable: true, get: function () { return transaction_converter_1.bitcoinUnsignedTransactionToRequest; } });
|
|
20
|
-
var
|
|
21
|
-
Object.defineProperty(exports, "BitcoinTransactionValidator", { enumerable: true, get: function () { return
|
|
20
|
+
var transaction_validator_1 = require("./serializer/v3/validators/transaction-validator");
|
|
21
|
+
Object.defineProperty(exports, "BitcoinTransactionValidator", { enumerable: true, get: function () { return transaction_validator_1.BitcoinTransactionValidator; } });
|
|
22
22
|
var validators_1 = require("./serializer/v3/validators/validators");
|
|
23
23
|
Object.defineProperty(exports, "bitcoinValidators", { enumerable: true, get: function () { return validators_1.bitcoinValidators; } });
|
|
24
24
|
//# sourceMappingURL=index.js.map
|
package/v1/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,sFAAoF;AA8C3E,yGA9CA,mDAAwB,OA8CA;AA7CjC,wDAAsD;AA6B7C,8FA7BA,6BAAa,OA6BA;AA5BtB,8DAAiH;AAoC/G,sGApCwB,uCAAqB,OAoCxB;AAGrB,6GAvC+C,8CAA4B,OAuC/C;AAtC9B,0EAAqG;AAqCnG,4GArC8B,mDAA2B,OAqC9B;AApC7B,4EAAwG;AAmCtG,6GAnC+B,qDAA4B,OAmC/B;AAlC9B,iGAKgE;AA+D9D,mHAnEA,0DAAkC,OAmEA;AAClC,wHAnEA,+DAAuC,OAmEA;AACvC,uHAnEA,8DAAsC,OAmEA;AAHtC,oHA/DA,2DAAmC,OA+DA;AAzDrC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,sFAAoF;AA8C3E,yGA9CA,mDAAwB,OA8CA;AA7CjC,wDAAsD;AA6B7C,8FA7BA,6BAAa,OA6BA;AA5BtB,8DAAiH;AAoC/G,sGApCwB,uCAAqB,OAoCxB;AAGrB,6GAvC+C,8CAA4B,OAuC/C;AAtC9B,0EAAqG;AAqCnG,4GArC8B,mDAA2B,OAqC9B;AApC7B,4EAAwG;AAmCtG,6GAnC+B,qDAA4B,OAmC/B;AAlC9B,iGAKgE;AA+D9D,mHAnEA,0DAAkC,OAmEA;AAClC,wHAnEA,+DAAuC,OAmEA;AACvC,uHAnEA,8DAAsC,OAmEA;AAHtC,oHA/DA,2DAAmC,OA+DA;AAzDrC,0FAA8F;AAuD5F,4GAvDO,mDAA2B,OAuDP;AAtD7B,oEAAyE;AAuDvE,kGAvDO,8BAAiB,OAuDP"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MainProtocolSymbols } from '@airgap/coinlib-core';
|
|
2
|
-
import { AirGapBlockExplorer, AirGapModule, AirGapOfflineProtocol, AirGapOnlineProtocol, ProtocolConfiguration } from '@airgap/module-kit';
|
|
2
|
+
import { AirGapBlockExplorer, AirGapModule, AirGapOfflineProtocol, AirGapOnlineProtocol, AirGapV3SerializerCompanion, ProtocolConfiguration } from '@airgap/module-kit';
|
|
3
3
|
declare type SupportedProtocols = MainProtocolSymbols.BTC | MainProtocolSymbols.BTC_SEGWIT;
|
|
4
4
|
export declare class BitcoinModule implements AirGapModule<{
|
|
5
5
|
Protocols: SupportedProtocols;
|
|
@@ -10,6 +10,7 @@ export declare class BitcoinModule implements AirGapModule<{
|
|
|
10
10
|
createOfflineProtocol(identifier: SupportedProtocols): Promise<AirGapOfflineProtocol | undefined>;
|
|
11
11
|
createOnlineProtocol(identifier: SupportedProtocols, networkId?: string): Promise<AirGapOnlineProtocol | undefined>;
|
|
12
12
|
createBlockExplorer(identifier: SupportedProtocols, networkId?: string): Promise<AirGapBlockExplorer | undefined>;
|
|
13
|
+
createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
|
|
13
14
|
private createProtocol;
|
|
14
15
|
}
|
|
15
16
|
export {};
|
|
@@ -43,6 +43,7 @@ var module_kit_1 = require("@airgap/module-kit");
|
|
|
43
43
|
var BlockCypherBlockExplorer_1 = require("../block-explorer/BlockCypherBlockExplorer");
|
|
44
44
|
var BitcoinProtocol_1 = require("../protocol/BitcoinProtocol");
|
|
45
45
|
var BitcoinSegwitProtocol_1 = require("../protocol/BitcoinSegwitProtocol");
|
|
46
|
+
var serializer_companion_1 = require("../serializer/v3/serializer-companion");
|
|
46
47
|
var BitcoinModule = /** @class */ (function () {
|
|
47
48
|
function BitcoinModule() {
|
|
48
49
|
var _a;
|
|
@@ -88,6 +89,13 @@ var BitcoinModule = /** @class */ (function () {
|
|
|
88
89
|
});
|
|
89
90
|
});
|
|
90
91
|
};
|
|
92
|
+
BitcoinModule.prototype.createV3SerializerCompanion = function () {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
+
return __generator(this, function (_a) {
|
|
95
|
+
return [2 /*return*/, new serializer_companion_1.BitcoinV3SerializerCompanion()];
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
};
|
|
91
99
|
BitcoinModule.prototype.createProtocol = function (identifier, network) {
|
|
92
100
|
switch (identifier) {
|
|
93
101
|
case coinlib_core_1.MainProtocolSymbols.BTC:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitcoinModule.js","sourceRoot":"","sources":["../../../src/v1/module/BitcoinModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,sDAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"BitcoinModule.js","sourceRoot":"","sources":["../../../src/v1/module/BitcoinModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,sDAAqE;AACrE,iDAW2B;AAE3B,uFAAqF;AACrF,+DAAqG;AACrG,2EAA+E;AAC/E,8EAAoF;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4B,EAAE,EAAA;;;KAC1C;IAEO,sCAAc,GAAtB,UAAuB,UAA8B,EAAE,OAAyB;QAC9E,QAAQ,UAAU,EAAE;YAClB,KAAK,kCAAmB,CAAC,GAAG;gBAC1B,OAAO,IAAA,uCAAqB,GAAE,CAAA;YAChC,KAAK,kCAAmB,CAAC,UAAU;gBACjC,OAAO,IAAA,mDAA2B,GAAE,CAAA;YACtC;gBACE,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,OAAO,EAAE,mBAAY,UAAU,oBAAiB,CAAC,CAAA;SAC7F;IACH,CAAC;IACH,oBAAC;AAAD,CAAC,AAnDD,IAmDC;AAnDY,sCAAa"}
|
|
@@ -10,11 +10,27 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
25
|
exports.bitcoinSegwitTransactionSignResponseToSigned = exports.bitcoinSegwitTransactionSignRequestToUnsigned = exports.bitcoinTransactionSignResponseToSigned = exports.bitcoinTransactionSignRequestToUnsigned = exports.bitcoinSegwitSignedTransactionToResponse = exports.bitcoinSegwitUnsignedTransactionToRequest = exports.bitcoinSignedTransactionToResponse = exports.bitcoinUnsignedTransactionToRequest = void 0;
|
|
15
26
|
var module_kit_1 = require("@airgap/module-kit");
|
|
16
27
|
function bitcoinUnsignedTransactionToRequest(unsigned, publicKey, callbackUrl) {
|
|
17
|
-
|
|
28
|
+
var _ = unsigned.type, rest = __rest(unsigned, ["type"]);
|
|
29
|
+
return {
|
|
30
|
+
transaction: rest,
|
|
31
|
+
publicKey: publicKey,
|
|
32
|
+
callbackURL: callbackUrl
|
|
33
|
+
};
|
|
18
34
|
}
|
|
19
35
|
exports.bitcoinUnsignedTransactionToRequest = bitcoinUnsignedTransactionToRequest;
|
|
20
36
|
function bitcoinSignedTransactionToResponse(signed, accountIdentifier) {
|
|
@@ -22,7 +38,12 @@ function bitcoinSignedTransactionToResponse(signed, accountIdentifier) {
|
|
|
22
38
|
}
|
|
23
39
|
exports.bitcoinSignedTransactionToResponse = bitcoinSignedTransactionToResponse;
|
|
24
40
|
function bitcoinSegwitUnsignedTransactionToRequest(unsigned, publicKey, callbackUrl) {
|
|
25
|
-
|
|
41
|
+
var _ = unsigned.type, rest = __rest(unsigned, ["type"]);
|
|
42
|
+
return {
|
|
43
|
+
transaction: rest,
|
|
44
|
+
publicKey: publicKey,
|
|
45
|
+
callbackURL: callbackUrl
|
|
46
|
+
};
|
|
26
47
|
}
|
|
27
48
|
exports.bitcoinSegwitUnsignedTransactionToRequest = bitcoinSegwitUnsignedTransactionToRequest;
|
|
28
49
|
function bitcoinSegwitSignedTransactionToResponse(signed, accountIdentifier) {
|
|
@@ -30,7 +51,7 @@ function bitcoinSegwitSignedTransactionToResponse(signed, accountIdentifier) {
|
|
|
30
51
|
}
|
|
31
52
|
exports.bitcoinSegwitSignedTransactionToResponse = bitcoinSegwitSignedTransactionToResponse;
|
|
32
53
|
function bitcoinTransactionSignRequestToUnsigned(request) {
|
|
33
|
-
return request.transaction;
|
|
54
|
+
return (0, module_kit_1.newUnsignedTransaction)(request.transaction);
|
|
34
55
|
}
|
|
35
56
|
exports.bitcoinTransactionSignRequestToUnsigned = bitcoinTransactionSignRequestToUnsigned;
|
|
36
57
|
function bitcoinTransactionSignResponseToSigned(response) {
|
|
@@ -44,7 +65,7 @@ function bitcoinTransactionSignResponseToSigned(response) {
|
|
|
44
65
|
}
|
|
45
66
|
exports.bitcoinTransactionSignResponseToSigned = bitcoinTransactionSignResponseToSigned;
|
|
46
67
|
function bitcoinSegwitTransactionSignRequestToUnsigned(request) {
|
|
47
|
-
return request.transaction;
|
|
68
|
+
return (0, module_kit_1.newUnsignedTransaction)(request.transaction);
|
|
48
69
|
}
|
|
49
70
|
exports.bitcoinSegwitTransactionSignRequestToUnsigned = bitcoinSegwitTransactionSignRequestToUnsigned;
|
|
50
71
|
function bitcoinSegwitTransactionSignResponseToSigned(response) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-converter.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/converter/transaction-converter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction-converter.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/converter/transaction-converter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAiF;AAYjF,SAAgB,mCAAmC,CACjD,QAAoC,EACpC,SAAiB,EACjB,WAAoB;IAEZ,IAAM,CAAC,GAAc,QAAQ,KAAtB,EAAK,IAAI,UAAK,QAAQ,EAA/B,QAAoB,CAAF,CAAa;IAErC,OAAO;QACL,WAAW,EAAE,IAAI;QACjB,SAAS,WAAA;QACT,WAAW,EAAE,WAAW;KACzB,CAAA;AACH,CAAC;AAZD,kFAYC;AAED,SAAgB,kCAAkC,CAChD,MAAgC,EAChC,iBAAyB;IAEzB,6BAAY,MAAM,KAAE,iBAAiB,mBAAA,IAAE;AACzC,CAAC;AALD,gFAKC;AAED,SAAgB,yCAAyC,CACvD,QAA0C,EAC1C,SAAiB,EACjB,WAAoB;IAEZ,IAAM,CAAC,GAAc,QAAQ,KAAtB,EAAK,IAAI,UAAK,QAAQ,EAA/B,QAAoB,CAAF,CAAa;IAErC,OAAO;QACL,WAAW,EAAE,IAAI;QACjB,SAAS,WAAA;QACT,WAAW,EAAE,WAAW;KACzB,CAAA;AACH,CAAC;AAZD,8FAYC;AAED,SAAgB,wCAAwC,CACtD,MAAsC,EACtC,iBAAyB;IAEzB,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,IAAI,EAAE,iBAAiB,mBAAA,EAAE,CAAA;AACxD,CAAC;AALD,4FAKC;AAED,SAAgB,uCAAuC,CAAC,OAAsC;IAC5F,OAAO,IAAA,mCAAsB,EAA6B,OAAO,CAAC,WAAW,CAAC,CAAA;AAChF,CAAC;AAFD,0FAEC;AAED,SAAgB,sCAAsC,CAAC,QAAwC;IAC7F,OAAO,IAAA,iCAAoB,EAA2B;QACpD,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,EAAE,EAAE,QAAQ,CAAC,EAAE;QACf,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,WAAW,EAAE,QAAQ,CAAC,WAAW;KAClC,CAAC,CAAA;AACJ,CAAC;AARD,wFAQC;AAED,SAAgB,6CAA6C,CAC3D,OAA4C;IAE5C,OAAO,IAAA,mCAAsB,EAAC,OAAO,CAAC,WAAW,CAAC,CAAA;AACpD,CAAC;AAJD,sGAIC;AAED,SAAgB,4CAA4C,CAC1D,QAA8C;IAE9C,OAAO,IAAA,iCAAoB,EAAiC,EAAE,IAAI,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;AAC7F,CAAC;AAJD,oGAIC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TransactionSignRequest } from '@airgap/serializer';
|
|
2
2
|
import { BitcoinSegwitUnsignedTransaction } from '../../../../types/transaction';
|
|
3
|
-
export interface BitcoinSegwitTransactionSignRequest extends TransactionSignRequest<BitcoinSegwitUnsignedTransaction
|
|
3
|
+
export interface BitcoinSegwitTransactionSignRequest extends TransactionSignRequest<Omit<BitcoinSegwitUnsignedTransaction, 'type'>> {
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TransactionSignRequest } from '@airgap/serializer';
|
|
2
2
|
import { BitcoinUnsignedTransaction } from '../../../../types/transaction';
|
|
3
|
-
export interface BitcoinTransactionSignRequest extends TransactionSignRequest<BitcoinUnsignedTransaction
|
|
3
|
+
export interface BitcoinTransactionSignRequest extends TransactionSignRequest<Omit<BitcoinUnsignedTransaction, 'type'>> {
|
|
4
4
|
}
|
|
@@ -12,25 +12,18 @@
|
|
|
12
12
|
"type": "string"
|
|
13
13
|
},
|
|
14
14
|
"transaction": {
|
|
15
|
-
"
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"properties": {
|
|
17
|
+
"psbt": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": ["psbt"],
|
|
22
|
+
"type": "object"
|
|
16
23
|
}
|
|
17
24
|
},
|
|
18
25
|
"required": ["publicKey", "transaction"],
|
|
19
26
|
"type": "object"
|
|
20
|
-
},
|
|
21
|
-
"BitcoinSegwitUnsignedTransaction": {
|
|
22
|
-
"additionalProperties": false,
|
|
23
|
-
"properties": {
|
|
24
|
-
"psbt": {
|
|
25
|
-
"type": "string"
|
|
26
|
-
},
|
|
27
|
-
"type": {
|
|
28
|
-
"enum": ["unsigned"],
|
|
29
|
-
"type": "string"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"required": ["psbt", "type"],
|
|
33
|
-
"type": "object"
|
|
34
27
|
}
|
|
35
28
|
}
|
|
36
29
|
}
|
|
@@ -53,33 +53,26 @@
|
|
|
53
53
|
"type": "string"
|
|
54
54
|
},
|
|
55
55
|
"transaction": {
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
"outs": {
|
|
72
|
-
"items": {
|
|
73
|
-
"$ref": "#/definitions/BitcoinOutTransaction"
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"properties": {
|
|
58
|
+
"ins": {
|
|
59
|
+
"items": {
|
|
60
|
+
"$ref": "#/definitions/BitcoinInTransaction"
|
|
61
|
+
},
|
|
62
|
+
"type": "array"
|
|
63
|
+
},
|
|
64
|
+
"outs": {
|
|
65
|
+
"items": {
|
|
66
|
+
"$ref": "#/definitions/BitcoinOutTransaction"
|
|
67
|
+
},
|
|
68
|
+
"type": "array"
|
|
69
|
+
}
|
|
74
70
|
},
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
"type": {
|
|
78
|
-
"enum": ["unsigned"],
|
|
79
|
-
"type": "string"
|
|
71
|
+
"required": ["ins", "outs"],
|
|
72
|
+
"type": "object"
|
|
80
73
|
}
|
|
81
74
|
},
|
|
82
|
-
"required": ["
|
|
75
|
+
"required": ["publicKey", "transaction"],
|
|
83
76
|
"type": "object"
|
|
84
77
|
}
|
|
85
78
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AirGapV3SerializerCompanion, SignedTransaction, UnsignedTransaction } from '@airgap/module-kit';
|
|
2
|
+
import { V3SchemaConfiguration } from '@airgap/module-kit/types/serializer';
|
|
3
|
+
import { TransactionSignRequest, TransactionSignResponse } from '@airgap/serializer';
|
|
4
|
+
export declare class BitcoinV3SerializerCompanion implements AirGapV3SerializerCompanion {
|
|
5
|
+
readonly schemas: V3SchemaConfiguration[];
|
|
6
|
+
private readonly bitcoinTransactionValidator;
|
|
7
|
+
constructor();
|
|
8
|
+
toTransactionSignRequest(identifier: string, unsignedTransaction: UnsignedTransaction, publicKey: string, callbackUrl?: string): Promise<TransactionSignRequest>;
|
|
9
|
+
fromTransactionSignRequest(identifier: string, transactionSignRequest: TransactionSignRequest): Promise<UnsignedTransaction>;
|
|
10
|
+
validateTransactionSignRequest(identifier: string, transactionSignRequest: TransactionSignRequest): Promise<boolean>;
|
|
11
|
+
toTransactionSignResponse(identifier: string, signedTransaction: SignedTransaction, accountIdentifier: string): Promise<TransactionSignResponse>;
|
|
12
|
+
fromTransactionSignResponse(identifier: string, transactionSignResponse: TransactionSignResponse): Promise<SignedTransaction>;
|
|
13
|
+
validateTransactionSignResponse(identifier: string, transactionSignResponse: TransactionSignResponse): Promise<boolean>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.BitcoinV3SerializerCompanion = void 0;
|
|
40
|
+
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
41
|
+
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
42
|
+
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
43
|
+
var serializer_1 = require("@airgap/serializer");
|
|
44
|
+
var transaction_converter_1 = require("./schemas/converter/transaction-converter");
|
|
45
|
+
var transaction_validator_1 = require("./validators/transaction-validator");
|
|
46
|
+
var validators_1 = require("./validators/validators");
|
|
47
|
+
var bitcoinTransactionSignRequest = require('./schemas/generated/transaction-sign-request-bitcoin.json');
|
|
48
|
+
var bitcoinTransactionSignResponse = require('./schemas/generated/transaction-sign-response-bitcoin.json');
|
|
49
|
+
var bitcoinSegwitTransactionSignRequest = require('./schemas/generated/transaction-sign-request-bitcoin-segwit.json');
|
|
50
|
+
var bitcoinSegwitTransactionSignResponse = require('./schemas/generated/transaction-sign-response-bitcoin-segwit.json');
|
|
51
|
+
var BitcoinV3SerializerCompanion = /** @class */ (function () {
|
|
52
|
+
function BitcoinV3SerializerCompanion() {
|
|
53
|
+
this.schemas = [
|
|
54
|
+
{
|
|
55
|
+
type: serializer_1.IACMessageType.TransactionSignRequest,
|
|
56
|
+
schema: { schema: bitcoinTransactionSignRequest },
|
|
57
|
+
protocolIdentifier: coinlib_core_1.MainProtocolSymbols.BTC
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: serializer_1.IACMessageType.TransactionSignResponse,
|
|
61
|
+
schema: { schema: bitcoinTransactionSignResponse },
|
|
62
|
+
protocolIdentifier: coinlib_core_1.MainProtocolSymbols.BTC
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: serializer_1.IACMessageType.TransactionSignRequest,
|
|
66
|
+
schema: { schema: bitcoinSegwitTransactionSignRequest },
|
|
67
|
+
protocolIdentifier: coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: serializer_1.IACMessageType.TransactionSignResponse,
|
|
71
|
+
schema: { schema: bitcoinSegwitTransactionSignResponse },
|
|
72
|
+
protocolIdentifier: coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
this.bitcoinTransactionValidator = new transaction_validator_1.BitcoinTransactionValidator();
|
|
76
|
+
Object.keys(validators_1.bitcoinValidators).forEach(function (key) {
|
|
77
|
+
validate_1.validators[key] = validators_1.bitcoinValidators[key];
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
BitcoinV3SerializerCompanion.prototype.toTransactionSignRequest = function (identifier, unsignedTransaction, publicKey, callbackUrl) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82
|
+
return __generator(this, function (_a) {
|
|
83
|
+
switch (identifier) {
|
|
84
|
+
case coinlib_core_1.MainProtocolSymbols.BTC:
|
|
85
|
+
return [2 /*return*/, (0, transaction_converter_1.bitcoinUnsignedTransactionToRequest)(unsignedTransaction, publicKey, callbackUrl)];
|
|
86
|
+
case coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT:
|
|
87
|
+
return [2 /*return*/, (0, transaction_converter_1.bitcoinSegwitUnsignedTransactionToRequest)(unsignedTransaction, publicKey, callbackUrl)];
|
|
88
|
+
default:
|
|
89
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.BITCOIN, "Protocol ".concat(identifier, " not supported"));
|
|
90
|
+
}
|
|
91
|
+
return [2 /*return*/];
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
BitcoinV3SerializerCompanion.prototype.fromTransactionSignRequest = function (identifier, transactionSignRequest) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
+
return __generator(this, function (_a) {
|
|
98
|
+
switch (identifier) {
|
|
99
|
+
case coinlib_core_1.MainProtocolSymbols.BTC:
|
|
100
|
+
return [2 /*return*/, (0, transaction_converter_1.bitcoinTransactionSignRequestToUnsigned)(transactionSignRequest)];
|
|
101
|
+
case coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT:
|
|
102
|
+
return [2 /*return*/, (0, transaction_converter_1.bitcoinSegwitTransactionSignRequestToUnsigned)(transactionSignRequest)];
|
|
103
|
+
default:
|
|
104
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.BITCOIN, "Protocol ".concat(identifier, " not supported"));
|
|
105
|
+
}
|
|
106
|
+
return [2 /*return*/];
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
BitcoinV3SerializerCompanion.prototype.validateTransactionSignRequest = function (identifier, transactionSignRequest) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
+
var _a, _b;
|
|
113
|
+
return __generator(this, function (_c) {
|
|
114
|
+
switch (_c.label) {
|
|
115
|
+
case 0:
|
|
116
|
+
_a = identifier;
|
|
117
|
+
switch (_a) {
|
|
118
|
+
case coinlib_core_1.MainProtocolSymbols.BTC: return [3 /*break*/, 1];
|
|
119
|
+
case coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT: return [3 /*break*/, 4];
|
|
120
|
+
}
|
|
121
|
+
return [3 /*break*/, 5];
|
|
122
|
+
case 1:
|
|
123
|
+
_c.trys.push([1, 3, , 4]);
|
|
124
|
+
return [4 /*yield*/, this.bitcoinTransactionValidator.validateUnsignedTransaction(transactionSignRequest)];
|
|
125
|
+
case 2:
|
|
126
|
+
_c.sent();
|
|
127
|
+
return [2 /*return*/, true];
|
|
128
|
+
case 3:
|
|
129
|
+
_b = _c.sent();
|
|
130
|
+
return [2 /*return*/, false];
|
|
131
|
+
case 4: return [2 /*return*/, true];
|
|
132
|
+
case 5: throw new errors_1.UnsupportedError(coinlib_core_1.Domain.BITCOIN, "Protocol ".concat(identifier, " not supported"));
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
BitcoinV3SerializerCompanion.prototype.toTransactionSignResponse = function (identifier, signedTransaction, accountIdentifier) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
139
|
+
return __generator(this, function (_a) {
|
|
140
|
+
switch (identifier) {
|
|
141
|
+
case coinlib_core_1.MainProtocolSymbols.BTC:
|
|
142
|
+
return [2 /*return*/, (0, transaction_converter_1.bitcoinSignedTransactionToResponse)(signedTransaction, accountIdentifier)];
|
|
143
|
+
case coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT:
|
|
144
|
+
return [2 /*return*/, (0, transaction_converter_1.bitcoinSegwitSignedTransactionToResponse)(signedTransaction, accountIdentifier)];
|
|
145
|
+
default:
|
|
146
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.BITCOIN, "Protocol ".concat(identifier, " not supported"));
|
|
147
|
+
}
|
|
148
|
+
return [2 /*return*/];
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
BitcoinV3SerializerCompanion.prototype.fromTransactionSignResponse = function (identifier, transactionSignResponse) {
|
|
153
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
154
|
+
return __generator(this, function (_a) {
|
|
155
|
+
switch (identifier) {
|
|
156
|
+
case coinlib_core_1.MainProtocolSymbols.BTC:
|
|
157
|
+
return [2 /*return*/, (0, transaction_converter_1.bitcoinTransactionSignResponseToSigned)(transactionSignResponse)];
|
|
158
|
+
case coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT:
|
|
159
|
+
return [2 /*return*/, (0, transaction_converter_1.bitcoinSegwitTransactionSignResponseToSigned)(transactionSignResponse)];
|
|
160
|
+
default:
|
|
161
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.BITCOIN, "Protocol ".concat(identifier, " not supported"));
|
|
162
|
+
}
|
|
163
|
+
return [2 /*return*/];
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
BitcoinV3SerializerCompanion.prototype.validateTransactionSignResponse = function (identifier, transactionSignResponse) {
|
|
168
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
169
|
+
var _a, _b;
|
|
170
|
+
return __generator(this, function (_c) {
|
|
171
|
+
switch (_c.label) {
|
|
172
|
+
case 0:
|
|
173
|
+
_a = identifier;
|
|
174
|
+
switch (_a) {
|
|
175
|
+
case coinlib_core_1.MainProtocolSymbols.BTC: return [3 /*break*/, 1];
|
|
176
|
+
case coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT: return [3 /*break*/, 4];
|
|
177
|
+
}
|
|
178
|
+
return [3 /*break*/, 5];
|
|
179
|
+
case 1:
|
|
180
|
+
_c.trys.push([1, 3, , 4]);
|
|
181
|
+
return [4 /*yield*/, this.bitcoinTransactionValidator.validateSignedTransaction(transactionSignResponse)];
|
|
182
|
+
case 2:
|
|
183
|
+
_c.sent();
|
|
184
|
+
return [2 /*return*/, true];
|
|
185
|
+
case 3:
|
|
186
|
+
_b = _c.sent();
|
|
187
|
+
return [2 /*return*/, false];
|
|
188
|
+
case 4: return [2 /*return*/, true];
|
|
189
|
+
case 5: throw new errors_1.UnsupportedError(coinlib_core_1.Domain.BITCOIN, "Protocol ".concat(identifier, " not supported"));
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
return BitcoinV3SerializerCompanion;
|
|
195
|
+
}());
|
|
196
|
+
exports.BitcoinV3SerializerCompanion = BitcoinV3SerializerCompanion;
|
|
197
|
+
//# sourceMappingURL=serializer-companion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer-companion.js","sourceRoot":"","sources":["../../../../src/v1/serializer/v3/serializer-companion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,8FAA8F;AAC9F,sDAA8D;AAG9D,iDAAgH;AAShH,mFASkD;AAElD,4EAAgF;AAChF,sDAA2D;AAE3D,IAAM,6BAA6B,GAAe,OAAO,CAAC,2DAA2D,CAAC,CAAA;AACtH,IAAM,8BAA8B,GAAe,OAAO,CAAC,4DAA4D,CAAC,CAAA;AAExH,IAAM,mCAAmC,GAAe,OAAO,CAAC,kEAAkE,CAAC,CAAA;AACnI,IAAM,oCAAoC,GAAe,OAAO,CAAC,mEAAmE,CAAC,CAAA;AAErI;IA0BE;QAzBgB,YAAO,GAA4B;YACjD;gBACE,IAAI,EAAE,2BAAc,CAAC,sBAAsB;gBAC3C,MAAM,EAAE,EAAE,MAAM,EAAE,6BAA6B,EAAE;gBACjD,kBAAkB,EAAE,kCAAmB,CAAC,GAAG;aAC5C;YACD;gBACE,IAAI,EAAE,2BAAc,CAAC,uBAAuB;gBAC5C,MAAM,EAAE,EAAE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C,uBAAyD,CAAC,EAAA;oBAC1G,KAAK,kCAAmB,CAAC,UAAU;wBACjC,sBAAO,IAAA,oEAA4C,EAAC,uBAAyD,CAAC,EAAA;oBAChH;wBACE,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,OAAO,EAAE,mBAAY,UAAU,mBAAgB,CAAC,CAAA;iBACrF;;;;KACF;IAEY,sEAA+B,GAA5C,UAA6C,UAAkB,EAAE,uBAAgD;;;;;;wBACvG,KAAA,UAAU,CAAA;;iCACX,kCAAmB,CAAC,GAAG,CAAC,CAAxB,wBAAuB;iCAQvB,kCAAmB,CAAC,UAAU,CAAC,CAA/B,wBAA8B;;;;;wBAN/B,qBAAM,IAAI,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,uBAAyD,CAAC,EAAA;;wBAA3H,SAA2H,CAAA;wBAE3H,sBAAO,IAAI,EAAA;;;wBAEX,sBAAO,KAAK,EAAA;4BAGd,sBAAO,IAAI,EAAA;4BAEX,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,OAAO,EAAE,mBAAY,UAAU,mBAAgB,CAAC,CAAA;;;;KAEvF;IACH,mCAAC;AAAD,CAAC,AA5HD,IA4HC;AA5HY,oEAA4B"}
|
package/v1/serializer/v3/validators/{transaction-validators.d.ts → transaction-validator.d.ts}
RENAMED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { TransactionValidator
|
|
1
|
+
import { TransactionValidator } from '@airgap/serializer';
|
|
2
2
|
import { BitcoinTransactionSignRequest } from '../schemas/definitions/transaction-sign-request-bitcoin';
|
|
3
3
|
import { BitcoinTransactionSignResponse } from '../schemas/definitions/transaction-sign-response-bitcoin';
|
|
4
4
|
export declare class BitcoinTransactionValidator implements TransactionValidator {
|
|
5
5
|
validateUnsignedTransaction(request: BitcoinTransactionSignRequest): Promise<any>;
|
|
6
6
|
validateSignedTransaction(response: BitcoinTransactionSignResponse): Promise<any>;
|
|
7
7
|
}
|
|
8
|
-
export declare class BitcoinTransactionValidatorFactory implements TransactionValidatorFactory<BitcoinTransactionValidator> {
|
|
9
|
-
create(): BitcoinTransactionValidator;
|
|
10
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.BitcoinTransactionValidator = void 0;
|
|
4
4
|
// tslint:disable: max-classes-per-file
|
|
5
5
|
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
6
6
|
var serializer_1 = require("@airgap/serializer");
|
|
@@ -53,13 +53,4 @@ var BitcoinTransactionValidator = /** @class */ (function () {
|
|
|
53
53
|
return BitcoinTransactionValidator;
|
|
54
54
|
}());
|
|
55
55
|
exports.BitcoinTransactionValidator = BitcoinTransactionValidator;
|
|
56
|
-
|
|
57
|
-
function BitcoinTransactionValidatorFactory() {
|
|
58
|
-
}
|
|
59
|
-
BitcoinTransactionValidatorFactory.prototype.create = function () {
|
|
60
|
-
return new BitcoinTransactionValidator();
|
|
61
|
-
};
|
|
62
|
-
return BitcoinTransactionValidatorFactory;
|
|
63
|
-
}());
|
|
64
|
-
exports.BitcoinTransactionValidatorFactory = BitcoinTransactionValidatorFactory;
|
|
65
|
-
//# sourceMappingURL=transaction-validators.js.map
|
|
56
|
+
//# sourceMappingURL=transaction-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/transaction-validator.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,8FAAyF;AACzF,iDAA6E;AAK7E,IAAM,8BAA8B,GAAG;IACrC,GAAG,EAAE;QACH,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,mBAAmB,EAAE,IAAI;KAC1B;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,oBAAoB,E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":3,"file":"transaction-validators.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/transaction-validators.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,8FAAyF;AACzF,iDAA0G;AAM1G,IAAM,8BAA8B,GAAG;IACrC,GAAG,EAAE;QACH,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,mBAAmB,EAAE,IAAI;KAC1B;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,oBAAoB,EAAE,IAAI;KAC3B;CACF,CAAA;AAED,IAAM,4BAA4B,GAAG;IACnC,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,uBAAuB,EAAE,IAAI;KAC9B;IACD,MAAM,EAAE;QACN,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;KAChC;IACD,GAAG,EAAE;QACH,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;KAChC;IACD,iBAAiB,EAAE;QACjB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;KAChC;IACD,WAAW,EAAE;QACX,sBAAsB,EAAE,IAAI;QAC5B,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;KAChC;CACF,CAAA;AACD,IAAM,OAAO,GAAG,cAAM,OAAA,SAAS,EAAT,CAAS,CAAA;AAC/B,IAAM,KAAK,GAAG,UAAC,MAAM,IAAK,OAAA,MAAM,EAAN,CAAM,CAAA;AAEhC;IAAA;IAUA,CAAC;IATQ,iEAA2B,GAAlC,UAAmC,OAAsC;QACvE,IAAM,WAAW,GAA+B,OAAO,CAAC,WAAW,CAAA;QACnE,IAAA,+BAAkB,EAAC,EAAE,CAAC,CAAA;QAEtB,OAAO,IAAA,gBA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