@airgap/groestlcoin 0.13.45-beta.2 → 0.13.45-beta.3
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 +5 -5
- package/v0/index.js +5 -5
- package/v0/index.js.map +1 -1
- package/v0/protocol/GroestlcoinProtocol.js +40 -49
- package/v0/protocol/GroestlcoinProtocol.js.map +1 -1
- package/v0/protocol/GroestlcoinProtocolOptions.js +45 -111
- package/v0/protocol/GroestlcoinProtocolOptions.js.map +1 -1
- package/v0/protocol/GroestlcoinTestnetProtocol.js +25 -32
- package/v0/protocol/GroestlcoinTestnetProtocol.js.map +1 -1
- package/v1/block-explorer/CryptoIDBlockExplorer.js +12 -61
- package/v1/block-explorer/CryptoIDBlockExplorer.js.map +1 -1
- package/v1/index.js +3 -3
- package/v1/index.js.map +1 -1
- package/v1/module/GroestlcoinModule.d.ts +1 -1
- package/v1/module/GroestlcoinModule.js +37 -95
- package/v1/module/GroestlcoinModule.js.map +1 -1
- package/v1/module.js +2 -3
- package/v1/module.js.map +1 -1
- package/v1/protocol/GroestlcoinProtocol.js +195 -426
- package/v1/protocol/GroestlcoinProtocol.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +5 -6
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/serializer-companion.js +69 -148
- package/v1/serializer/v3/serializer-companion.js.map +1 -1
- package/v1/serializer/v3/validators/transaction-validator.js +3 -23
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
- package/v1/serializer/v3/validators/validators.js +1 -1
- package/v1/serializer/v3/validators/validators.js.map +1 -1
- package/v1/types/crypto.d.ts +1 -1
- package/v1/types/protocol.d.ts +2 -2
|
@@ -1,107 +1,49 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
3
|
exports.GroestlcoinModule = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
_a[coinlib_core_1.MainProtocolSymbols.GRS] = new module_kit_1.ModuleNetworkRegistry({
|
|
4
|
+
const coinlib_core_1 = require("@airgap/coinlib-core");
|
|
5
|
+
const errors_1 = require("@airgap/coinlib-core/errors");
|
|
6
|
+
const module_kit_1 = require("@airgap/module-kit");
|
|
7
|
+
const CryptoIDBlockExplorer_1 = require("../block-explorer/CryptoIDBlockExplorer");
|
|
8
|
+
const GroestlcoinProtocol_1 = require("../protocol/GroestlcoinProtocol");
|
|
9
|
+
const serializer_companion_1 = require("../serializer/v3/serializer-companion");
|
|
10
|
+
class GroestlcoinModule {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.networkRegistries = {
|
|
13
|
+
[coinlib_core_1.MainProtocolSymbols.GRS]: new module_kit_1.ModuleNetworkRegistry({
|
|
51
14
|
supportedNetworks: [GroestlcoinProtocol_1.GROESTLCOIN_MAINNET_PROTOCOL_NETWORK, GroestlcoinProtocol_1.GROESTLCOIN_TESTNET_PROTOCOL_NETWORK]
|
|
52
|
-
})
|
|
53
|
-
|
|
15
|
+
})
|
|
16
|
+
};
|
|
54
17
|
this.supportedProtocols = (0, module_kit_1.createSupportedProtocols)(this.networkRegistries);
|
|
55
18
|
}
|
|
56
|
-
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
var _a;
|
|
78
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
79
|
-
var network;
|
|
80
|
-
return __generator(this, function (_b) {
|
|
81
|
-
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
82
|
-
if (network === undefined) {
|
|
83
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.GROESTLCOIN, 'Block Explorer network type not supported.');
|
|
84
|
-
}
|
|
85
|
-
return [2 /*return*/, new CryptoIDBlockExplorer_1.CryptoIDBlockExplorer(network.blockExplorerUrl)];
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
GroestlcoinModule.prototype.createV3SerializerCompanion = function () {
|
|
90
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
-
return __generator(this, function (_a) {
|
|
92
|
-
return [2 /*return*/, new serializer_companion_1.GroestlcoinV3SerializerCompanion()];
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
GroestlcoinModule.prototype.createProtocol = function (identifier, network) {
|
|
19
|
+
async createOfflineProtocol(identifier) {
|
|
20
|
+
return this.createProtocol(identifier);
|
|
21
|
+
}
|
|
22
|
+
async createOnlineProtocol(identifier, networkOrId) {
|
|
23
|
+
const network = typeof networkOrId === 'object' ? networkOrId : this.networkRegistries[identifier]?.findNetwork(networkOrId);
|
|
24
|
+
if (network === undefined) {
|
|
25
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.GROESTLCOIN, 'Protocol network type not supported.');
|
|
26
|
+
}
|
|
27
|
+
return this.createProtocol(identifier, network);
|
|
28
|
+
}
|
|
29
|
+
async createBlockExplorer(identifier, networkOrId) {
|
|
30
|
+
const network = typeof networkOrId === 'object' ? networkOrId : this.networkRegistries[identifier]?.findNetwork(networkOrId);
|
|
31
|
+
if (network === undefined) {
|
|
32
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.GROESTLCOIN, 'Block Explorer network type not supported.');
|
|
33
|
+
}
|
|
34
|
+
return new CryptoIDBlockExplorer_1.CryptoIDBlockExplorer(network.blockExplorerUrl);
|
|
35
|
+
}
|
|
36
|
+
async createV3SerializerCompanion() {
|
|
37
|
+
return new serializer_companion_1.GroestlcoinV3SerializerCompanion();
|
|
38
|
+
}
|
|
39
|
+
createProtocol(identifier, network) {
|
|
97
40
|
switch (identifier) {
|
|
98
41
|
case coinlib_core_1.MainProtocolSymbols.GRS:
|
|
99
|
-
return (0, GroestlcoinProtocol_1.createGroestlcoinProtocol)({ network
|
|
42
|
+
return (0, GroestlcoinProtocol_1.createGroestlcoinProtocol)({ network });
|
|
100
43
|
default:
|
|
101
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.GROESTLCOIN,
|
|
44
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.GROESTLCOIN, `Protocol ${identifier} not supported.`);
|
|
102
45
|
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
}());
|
|
46
|
+
}
|
|
47
|
+
}
|
|
106
48
|
exports.GroestlcoinModule = GroestlcoinModule;
|
|
107
49
|
//# sourceMappingURL=GroestlcoinModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroestlcoinModule.js","sourceRoot":"","sources":["../../../src/v1/module/GroestlcoinModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GroestlcoinModule.js","sourceRoot":"","sources":["../../../src/v1/module/GroestlcoinModule.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C,qBAAM,CAAC,WAAW,EAAE,4CAA4C,CAAC,CAAA;QACrG,CAAC;QAED,OAAO,IAAI,6CAAqB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAC5D,CAAC;IAEM,KAAK,CAAC,2BAA2B;QACtC,OAAO,IAAI,uDAAgC,EAAE,CAAA;IAC/C,CAAC;IAEO,cAAc,CAAC,UAA8B,EAAE,OAAyB;QAC9E,QAAQ,UAAU,EAAE,CAAC;YACnB,KAAK,kCAAmB,CAAC,GAAG;gBAC1B,OAAO,IAAA,+CAAyB,EAAC,EAAE,OAAO,EAAE,CAAC,CAAA;YAC/C;gBACE,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,WAAW,EAAE,YAAY,UAAU,iBAAiB,CAAC,CAAA;QAClG,CAAC;IACH,CAAC;CACF;AApDD,8CAoDC"}
|
package/v1/module.js
CHANGED
|
@@ -14,11 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.create =
|
|
18
|
-
|
|
17
|
+
exports.create = create;
|
|
18
|
+
const GroestlcoinModule_1 = require("./module/GroestlcoinModule");
|
|
19
19
|
__exportStar(require("./index"), exports);
|
|
20
20
|
function create() {
|
|
21
21
|
return new GroestlcoinModule_1.GroestlcoinModule();
|
|
22
22
|
}
|
|
23
|
-
exports.create = create;
|
|
24
23
|
//# sourceMappingURL=module.js.map
|
package/v1/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/v1/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/v1/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAKA,wBAEC;AAND,kEAA8D;AAE9D,0CAAuB;AAEvB,SAAgB,MAAM;IACpB,OAAO,IAAI,qCAAiB,EAAE,CAAA;AAChC,CAAC"}
|