@airgap/stellar 0.13.45-beta.3 → 0.13.45-beta.4
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/block-explorer/StellarBlockExplorer.js +61 -12
- package/v1/block-explorer/StellarBlockExplorer.js.map +1 -1
- package/v1/data/StellarAddress.js +14 -13
- package/v1/data/StellarAddress.js.map +1 -1
- package/v1/index.js +4 -4
- package/v1/index.js.map +1 -1
- package/v1/module/StellarModule.js +110 -41
- package/v1/module/StellarModule.js.map +1 -1
- package/v1/module.js +3 -2
- package/v1/module.js.map +1 -1
- package/v1/protocol/StellarProtocol.js +859 -591
- package/v1/protocol/StellarProtocol.js.map +1 -1
- package/v1/protocol/stellarAssets/StellarAsset.js +466 -259
- package/v1/protocol/stellarAssets/StellarAsset.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +20 -8
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/serializer-companion.js +134 -61
- package/v1/serializer/v3/serializer-companion.js.map +1 -1
- package/v1/serializer/v3/validators/transaction-validator.js +61 -14
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
- package/v1/serializer/v3/validators/validators.js +62 -18
- 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
- package/v1/types/protocol.js +2 -2
- package/v1/types/protocol.js.map +1 -1
- package/v1/utils/convert.js +7 -6
- package/v1/utils/convert.js.map +1 -1
- package/v1/utils/key.js +10 -9
- package/v1/utils/key.js.map +1 -1
- package/v1/utils/signature.js +5 -4
- package/v1/utils/signature.js.map +1 -1
- package/v1/utils/transaction.d.ts +1 -0
- package/v1/utils/transaction.js +10 -9
- package/v1/utils/transaction.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airgap/stellar",
|
|
3
|
-
"version": "0.13.45-beta.
|
|
3
|
+
"version": "0.13.45-beta.4",
|
|
4
4
|
"description": "The @airgap/aeternity is an Aeternity implementation of the ICoinProtocol interface from @airgap/coinlib-core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"airgap",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"author": "Papers AG <contact@papers.ch> (https://papers.ch)",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@airgap/coinlib-core": "^0.13.45-beta.
|
|
34
|
-
"@airgap/module-kit": "^0.13.45-beta.
|
|
35
|
-
"@airgap/serializer": "^0.13.45-beta.
|
|
33
|
+
"@airgap/coinlib-core": "^0.13.45-beta.4",
|
|
34
|
+
"@airgap/module-kit": "^0.13.45-beta.4",
|
|
35
|
+
"@airgap/serializer": "^0.13.45-beta.4",
|
|
36
36
|
"@stellar/stellar-sdk": "^13.3.0"
|
|
37
37
|
},
|
|
38
38
|
"localDependencies": {},
|
|
@@ -1,23 +1,72 @@
|
|
|
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
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.StellarBlockExplorer = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
40
|
+
var StellarBlockExplorer = /** @class */ (function () {
|
|
41
|
+
function StellarBlockExplorer(url) {
|
|
6
42
|
this.url = url;
|
|
7
43
|
this.metadata = {
|
|
8
44
|
name: 'Stellar Explorer',
|
|
9
45
|
url: this.url
|
|
10
46
|
};
|
|
11
47
|
}
|
|
12
|
-
|
|
13
|
-
return this
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
48
|
+
StellarBlockExplorer.prototype.getMetadata = function () {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
return __generator(this, function (_a) {
|
|
51
|
+
return [2 /*return*/, this.metadata];
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
StellarBlockExplorer.prototype.createAddressUrl = function (address) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
return [2 /*return*/, "".concat(this.url, "/account/").concat(address)];
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
StellarBlockExplorer.prototype.createTransactionUrl = function (transactionId) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
+
return __generator(this, function (_a) {
|
|
65
|
+
return [2 /*return*/, "".concat(this.url, "/tx/").concat(transactionId)];
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
return StellarBlockExplorer;
|
|
70
|
+
}());
|
|
22
71
|
exports.StellarBlockExplorer = StellarBlockExplorer;
|
|
23
72
|
//# sourceMappingURL=StellarBlockExplorer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StellarBlockExplorer.js","sourceRoot":"","sources":["../../../src/v1/block-explorer/StellarBlockExplorer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StellarBlockExplorer.js","sourceRoot":"","sources":["../../../src/v1/block-explorer/StellarBlockExplorer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;IACE,8BAAmC,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;QAE7B,aAAQ,GAA0B;YACjD,IAAI,EAAE,kBAAkB;YACxB,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAA;IALgD,CAAC;IAOrC,0CAAW,GAAxB;;;gBACE,sBAAO,IAAI,CAAC,QAAQ,EAAA;;;KACrB;IAEY,+CAAgB,GAA7B,UAA8B,OAAe;;;gBAC3C,sBAAO,UAAG,IAAI,CAAC,GAAG,sBAAY,OAAO,CAAE,EAAA;;;KACxC;IAEY,mDAAoB,GAAjC,UAAkC,aAAqB;;;gBACrD,sBAAO,UAAG,IAAI,CAAC,GAAG,iBAAO,aAAa,CAAE,EAAA;;;KACzC;IACH,2BAAC;AAAD,CAAC,AAnBD,IAmBC;AAnBY,oDAAoB"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarAddress = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
var module_kit_1 = require("@airgap/module-kit");
|
|
5
|
+
var stellar_sdk_1 = require("@stellar/stellar-sdk");
|
|
6
|
+
var StellarAddress = /** @class */ (function () {
|
|
7
|
+
function StellarAddress(value) {
|
|
8
8
|
this.value = value;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
StellarAddress.from = function (publicKey) {
|
|
11
11
|
if (stellar_sdk_1.StrKey.isValidEd25519PublicKey(publicKey.value)) {
|
|
12
12
|
return new StellarAddress(publicKey.value);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
var rawPublicKey = Buffer.from(publicKey.value, 'hex');
|
|
15
|
+
var stellarAddress = stellar_sdk_1.StrKey.encodeEd25519PublicKey(rawPublicKey);
|
|
16
16
|
return new StellarAddress(stellarAddress);
|
|
17
|
-
}
|
|
18
|
-
asString() {
|
|
17
|
+
};
|
|
18
|
+
StellarAddress.prototype.asString = function () {
|
|
19
19
|
return this.value;
|
|
20
|
-
}
|
|
21
|
-
toPublicKey() {
|
|
20
|
+
};
|
|
21
|
+
StellarAddress.prototype.toPublicKey = function () {
|
|
22
22
|
return (0, module_kit_1.newPublicKey)(this.value, 'encoded');
|
|
23
|
-
}
|
|
24
|
-
|
|
23
|
+
};
|
|
24
|
+
return StellarAddress;
|
|
25
|
+
}());
|
|
25
26
|
exports.StellarAddress = StellarAddress;
|
|
26
27
|
//# sourceMappingURL=StellarAddress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StellarAddress.js","sourceRoot":"","sources":["../../../src/v1/data/StellarAddress.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"StellarAddress.js","sourceRoot":"","sources":["../../../src/v1/data/StellarAddress.ts"],"names":[],"mappings":";;;AAAA,iDAA4D;AAE5D,oDAA6C;AAE7C;IACE,wBAAqC,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IAAG,CAAC;IAExC,mBAAI,GAAlB,UAAmB,SAAoB;QACrC,IAAI,oBAAM,CAAC,uBAAuB,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;YACnD,OAAO,IAAI,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;SAC3C;QAED,IAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;QAExD,IAAM,cAAc,GAAG,oBAAM,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAAA;QAElE,OAAO,IAAI,cAAc,CAAC,cAAc,CAAC,CAAA;IAC3C,CAAC;IAEM,iCAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IAEM,oCAAW,GAAlB;QACE,OAAO,IAAA,yBAAY,EAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IAC5C,CAAC;IACH,qBAAC;AAAD,CAAC,AAtBD,IAsBC;AAtBY,wCAAc"}
|
package/v1/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StellarBlockExplorer = exports.createStellarAssetProtocol = exports.createStellarProtocolOptions = exports.createStellarProtocol = exports.StellarModule = void 0;
|
|
4
|
-
|
|
4
|
+
var StellarBlockExplorer_1 = require("./block-explorer/StellarBlockExplorer");
|
|
5
5
|
Object.defineProperty(exports, "StellarBlockExplorer", { enumerable: true, get: function () { return StellarBlockExplorer_1.StellarBlockExplorer; } });
|
|
6
|
-
|
|
6
|
+
var StellarModule_1 = require("./module/StellarModule");
|
|
7
7
|
Object.defineProperty(exports, "StellarModule", { enumerable: true, get: function () { return StellarModule_1.StellarModule; } });
|
|
8
|
-
|
|
8
|
+
var StellarAsset_1 = require("./protocol/stellarAssets/StellarAsset");
|
|
9
9
|
Object.defineProperty(exports, "createStellarAssetProtocol", { enumerable: true, get: function () { return StellarAsset_1.createStellarAssetProtocol; } });
|
|
10
|
-
|
|
10
|
+
var StellarProtocol_1 = require("./protocol/StellarProtocol");
|
|
11
11
|
Object.defineProperty(exports, "createStellarProtocol", { enumerable: true, get: function () { return StellarProtocol_1.createStellarProtocol; } });
|
|
12
12
|
Object.defineProperty(exports, "createStellarProtocolOptions", { enumerable: true, get: function () { return StellarProtocol_1.createStellarProtocolOptions; } });
|
|
13
13
|
//# 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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,8EAA4E;AAoBnE,qGApBA,2CAAoB,OAoBA;AAnB7B,wDAAsD;AAW7C,8FAXA,6BAAa,OAWA;AAVtB,sEAAwG;AAczB,2GAdtE,yCAA0B,OAcsE;AAbzG,8DAAiH;AAavF,sGAbA,uCAAqB,OAaA;AAAE,6GAbA,8CAA4B,OAaA"}
|
|
@@ -1,55 +1,124 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
2
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
50
|
exports.StellarModule = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
51
|
+
var module_kit_1 = require("@airgap/module-kit");
|
|
52
|
+
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
53
|
+
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
54
|
+
var StellarBlockExplorer_1 = require("../block-explorer/StellarBlockExplorer");
|
|
55
|
+
var StellarProtocol_1 = require("../protocol/StellarProtocol");
|
|
56
|
+
var serializer_companion_1 = require("../serializer/v3/serializer-companion");
|
|
57
|
+
var StellarAssets_1 = require("./StellarAssets");
|
|
58
|
+
var StellarAsset_1 = require("../protocol/stellarAssets/StellarAsset");
|
|
59
|
+
var StellarModule = /** @class */ (function () {
|
|
60
|
+
function StellarModule() {
|
|
61
|
+
var _a;
|
|
62
|
+
var stellarNetworkRegistry = new module_kit_1.ModuleNetworkRegistry({
|
|
15
63
|
supportedNetworks: [StellarProtocol_1.STELLAR_MAINNET_PROTOCOL_NETWORK]
|
|
16
64
|
});
|
|
17
|
-
this.networkRegistries = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
65
|
+
this.networkRegistries = __assign((_a = {}, _a[coinlib_core_1.MainProtocolSymbols.STELLAR] = stellarNetworkRegistry, _a), StellarAssets_1.stellarAssetsIdentifiers.reduce(function (obj, next) {
|
|
66
|
+
var _a;
|
|
67
|
+
return Object.assign(obj, (_a = {}, _a[next] = stellarNetworkRegistry, _a));
|
|
68
|
+
}, {}));
|
|
21
69
|
this.supportedProtocols = (0, module_kit_1.createSupportedProtocols)(this.networkRegistries);
|
|
22
70
|
}
|
|
23
|
-
|
|
24
|
-
return this
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
71
|
+
StellarModule.prototype.createOfflineProtocol = function (identifier) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
return [2 /*return*/, this.createProtocol(identifier)];
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
StellarModule.prototype.createOnlineProtocol = function (identifier, networkOrId) {
|
|
79
|
+
var _a;
|
|
80
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
81
|
+
var network;
|
|
82
|
+
return __generator(this, function (_b) {
|
|
83
|
+
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
84
|
+
if (network === undefined) {
|
|
85
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.STELLAR, 'Protocol network not supported.');
|
|
86
|
+
}
|
|
87
|
+
return [2 /*return*/, this.createProtocol(identifier, network)];
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
StellarModule.prototype.createBlockExplorer = function (identifier, networkOrId) {
|
|
92
|
+
var _a;
|
|
93
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
+
var network;
|
|
95
|
+
return __generator(this, function (_b) {
|
|
96
|
+
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
97
|
+
if (network === undefined) {
|
|
98
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.STELLAR, 'Block Explorer network not supported.');
|
|
99
|
+
}
|
|
100
|
+
return [2 /*return*/, new StellarBlockExplorer_1.StellarBlockExplorer(network.blockExplorerUrl)];
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
StellarModule.prototype.createV3SerializerCompanion = function () {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
+
return __generator(this, function (_a) {
|
|
107
|
+
return [2 /*return*/, new serializer_companion_1.StellarV3SerializerCompanion()];
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
StellarModule.prototype.createProtocol = function (identifier, network) {
|
|
44
112
|
if (identifier === coinlib_core_1.MainProtocolSymbols.STELLAR) {
|
|
45
|
-
return (0, StellarProtocol_1.createStellarProtocol)({ network });
|
|
113
|
+
return (0, StellarProtocol_1.createStellarProtocol)({ network: network });
|
|
46
114
|
}
|
|
47
115
|
if (StellarAssets_1.stellarAssets[identifier] !== undefined) {
|
|
48
|
-
|
|
116
|
+
var tokenMetadata = StellarAssets_1.stellarAssets[identifier];
|
|
49
117
|
return (0, StellarAsset_1.createStellarAssetProtocol)(tokenMetadata);
|
|
50
118
|
}
|
|
51
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.SERIALIZER,
|
|
52
|
-
}
|
|
53
|
-
|
|
119
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.SERIALIZER, "Protocol ".concat(identifier, " not supported."));
|
|
120
|
+
};
|
|
121
|
+
return StellarModule;
|
|
122
|
+
}());
|
|
54
123
|
exports.StellarModule = StellarModule;
|
|
55
124
|
//# sourceMappingURL=StellarModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StellarModule.js","sourceRoot":"","sources":["../../../src/v1/module/StellarModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StellarModule.js","sourceRoot":"","sources":["../../../src/v1/module/StellarModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAW2B;AAC3B,qDAAkE;AAClE,sDAAqE;AAErE,+EAA6E;AAC7E,+DAAqG;AACrG,8EAAoF;AAEpF,iDAAyE;AACzE,uEAAmF;AAEnF;IAIE;;QACE,IAAM,sBAAsB,GAAkD,IAAI,kCAAqB,CAAC;YACtG,iBAAiB,EAAE,CAAC,kDAAgC,CAAC;SACtD,CAAC,CAAA;QAEF,IAAI,CAAC,iBAAiB,yBACnB,kCAAmB,CAAC,OAAO,IAAG,sBAAsB,OAClD,wCAAwB,CAAC,MAAM,CAChC,UAAC,GAA0C,EAAE,IAAY;;YAAK,OAAA,MAAM,CAAC,MAAM,CAAC,GAAG,YAAI,GAAC,IAAI,IAAG,sBAAsB,MAAG;QAAtD,CAAsD,EACpH,EAAE,CACH,CACF,CAAA;QAED,IAAI,CAAC,kBAAkB,GAAG,IAAA,qCAAwB,EAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;IAC5E,CAAC;IAEY,6CAAqB,GAAlC,UAAmC,UAAkB;;;gBACnD,sBAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAA;;;KACvC;IAEY,4CAAoB,GAAjC,UACE,UAAkB,EAClB,WAA6C;;;;;gBAEvC,OAAO,GACX,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,0CAAE,WAAW,CAAC,WAAW,CAAC,CAAA;gBAE9G,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,OAAO,EAAE,iCAAiC,CAAC,CAAA;iBACrF;gBAED,sBAAO,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,EAAA;;;KAChD;IAEY,2CAAmB,GAAhC,UACE,UAAkB,EAClB,WAA6C;;;;;gBAEvC,OAAO,GACX,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,0CAAE,WAAW,CAAC,WAAW,CAAC,CAAA;gBAE9G,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,OAAO,EAAE,uCAAuC,CAAC,CAAA;iBAC3F;gBAED,sBAAO,IAAI,2CAAoB,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAA;;;KAC1D;IAEY,mDAA2B,GAAxC;;;gBACE,sBAAO,IAAI,mDAA4B,EAAE,EAAA;;;KAC1C;IAEO,sCAAc,GAAtB,UAAuB,UAAkB,EAAE,OAAyB;QAClE,IAAI,UAAU,KAAK,kCAAmB,CAAC,OAAO,EAAE;YAC9C,OAAO,IAAA,uCAAqB,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAA;SAC1C;QAED,IAAI,6BAAa,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;YAC3C,IAAM,aAAa,GAAyB,6BAAa,CAAC,UAAU,CAAC,CAAA;YAErE,OAAO,IAAA,yCAA0B,EAAC,aAAa,CAAC,CAAA;SACjD;QAED,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,UAAU,EAAE,mBAAY,UAAU,oBAAiB,CAAC,CAAA;IAC/F,CAAC;IACH,oBAAC;AAAD,CAAC,AArED,IAqEC;AArEY,sCAAa"}
|
package/v1/module.js
CHANGED
|
@@ -14,10 +14,11 @@ 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 = void 0;
|
|
18
|
+
var StellarModule_1 = require("./module/StellarModule");
|
|
19
19
|
__exportStar(require("./index"), exports);
|
|
20
20
|
function create() {
|
|
21
21
|
return new StellarModule_1.StellarModule();
|
|
22
22
|
}
|
|
23
|
+
exports.create = create;
|
|
23
24
|
//# 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":";;;;;;;;;;;;;;;;;AACA,wDAAsD;AAEtD,0CAAuB;AAEvB,SAAgB,MAAM;IACpB,OAAO,IAAI,6BAAa,EAAE,CAAA;AAC5B,CAAC;AAFD,wBAEC"}
|