@airgap/bitcoin 0.13.13-beta.3 → 0.13.13-beta.5
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airgap/bitcoin",
|
|
3
|
-
"version": "0.13.13-beta.
|
|
3
|
+
"version": "0.13.13-beta.5",
|
|
4
4
|
"description": "The @airgap/bitcoin is a Bitcoin implementation of the ICoinProtocol interface from @airgap/coinlib-core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"airgap",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
},
|
|
31
31
|
"author": "Papers AG <contact@papers.ch> (https://papers.ch)",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@airgap/coinlib-core": "^0.13.13-beta.
|
|
34
|
-
"@airgap/crypto": "^0.13.13-beta.
|
|
35
|
-
"@airgap/module-kit": "^0.13.13-beta.
|
|
36
|
-
"@airgap/serializer": "^0.13.13-beta.
|
|
33
|
+
"@airgap/coinlib-core": "^0.13.13-beta.5",
|
|
34
|
+
"@airgap/crypto": "^0.13.13-beta.5",
|
|
35
|
+
"@airgap/module-kit": "^0.13.13-beta.5",
|
|
36
|
+
"@airgap/serializer": "^0.13.13-beta.5",
|
|
37
37
|
"bitcoinjs-lib": "5.2.0"
|
|
38
38
|
},
|
|
39
39
|
"localDependencies": {
|
|
@@ -68,11 +68,11 @@ var BitcoinModule = /** @class */ (function () {
|
|
|
68
68
|
return __awaiter(this, void 0, void 0, function () {
|
|
69
69
|
var network;
|
|
70
70
|
return __generator(this, function (_b) {
|
|
71
|
-
network = typeof networkOrId === '
|
|
71
|
+
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
72
72
|
if (network === undefined) {
|
|
73
73
|
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.BITCOIN, 'Protocol network not supported.');
|
|
74
74
|
}
|
|
75
|
-
return [2 /*return*/, (
|
|
75
|
+
return [2 /*return*/, this.createProtocol(identifier, network)];
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
};
|
|
@@ -81,7 +81,7 @@ var BitcoinModule = /** @class */ (function () {
|
|
|
81
81
|
return __awaiter(this, void 0, void 0, function () {
|
|
82
82
|
var network;
|
|
83
83
|
return __generator(this, function (_b) {
|
|
84
|
-
network = typeof networkOrId === '
|
|
84
|
+
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
85
85
|
if (network === undefined) {
|
|
86
86
|
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.BITCOIN, 'Block Explorer network not supported.');
|
|
87
87
|
}
|
|
@@ -99,9 +99,9 @@ var BitcoinModule = /** @class */ (function () {
|
|
|
99
99
|
BitcoinModule.prototype.createProtocol = function (identifier, network) {
|
|
100
100
|
switch (identifier) {
|
|
101
101
|
case coinlib_core_1.MainProtocolSymbols.BTC:
|
|
102
|
-
return (0, BitcoinProtocol_1.createBitcoinProtocol)();
|
|
102
|
+
return (0, BitcoinProtocol_1.createBitcoinProtocol)({ network: network });
|
|
103
103
|
case coinlib_core_1.MainProtocolSymbols.BTC_SEGWIT:
|
|
104
|
-
return (0, BitcoinSegwitProtocol_1.createBitcoinSegwitProtocol)();
|
|
104
|
+
return (0, BitcoinSegwitProtocol_1.createBitcoinSegwitProtocol)({ network: network });
|
|
105
105
|
default:
|
|
106
106
|
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.BITCOIN, "Protocol ".concat(identifier, " not supported."));
|
|
107
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitcoinModule.js","sourceRoot":"","sources":["../../../src/v1/module/BitcoinModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA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