@cityofzion/bs-neo-legacy 1.7.1 → 1.8.0
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.
|
@@ -6,4 +6,6 @@ export declare class NeoTubeESNeoLegacy implements ExplorerService {
|
|
|
6
6
|
buildTransactionUrl(hash: string): string;
|
|
7
7
|
buildContractUrl(contractHash: string): string;
|
|
8
8
|
buildNftUrl(_params: BuildNftUrlParams): string;
|
|
9
|
+
getAddressTemplateUrl(): string | undefined;
|
|
10
|
+
getTxTemplateUrl(): string | undefined;
|
|
9
11
|
}
|
|
@@ -10,29 +10,40 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var _NeoTubeESNeoLegacy_network;
|
|
13
|
+
var _NeoTubeESNeoLegacy_BASE_URL, _NeoTubeESNeoLegacy_network;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.NeoTubeESNeoLegacy = void 0;
|
|
16
16
|
const blockchain_service_1 = require("@cityofzion/blockchain-service");
|
|
17
17
|
const BSNeoLegacyHelper_1 = require("../../helpers/BSNeoLegacyHelper");
|
|
18
18
|
class NeoTubeESNeoLegacy {
|
|
19
19
|
constructor(network) {
|
|
20
|
+
_NeoTubeESNeoLegacy_BASE_URL.set(this, 'https://neo2.neotube.io');
|
|
20
21
|
_NeoTubeESNeoLegacy_network.set(this, void 0);
|
|
21
22
|
__classPrivateFieldSet(this, _NeoTubeESNeoLegacy_network, network, "f");
|
|
22
23
|
}
|
|
23
24
|
buildTransactionUrl(hash) {
|
|
24
25
|
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.isMainnet(__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_network, "f")))
|
|
25
26
|
throw new Error('NeoTube is only available on mainnet');
|
|
26
|
-
return
|
|
27
|
+
return `${__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_BASE_URL, "f")}/transaction/${(0, blockchain_service_1.denormalizeHash)(hash)}`;
|
|
27
28
|
}
|
|
28
29
|
buildContractUrl(contractHash) {
|
|
29
30
|
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.isMainnet(__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_network, "f")))
|
|
30
31
|
throw new Error('NeoTube is only available on mainnet');
|
|
31
|
-
return
|
|
32
|
+
return `${__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_BASE_URL, "f")}/asset/${contractHash}/page/1`;
|
|
32
33
|
}
|
|
33
34
|
buildNftUrl(_params) {
|
|
34
35
|
throw new Error('NeoTube does not support nft');
|
|
35
36
|
}
|
|
37
|
+
getAddressTemplateUrl() {
|
|
38
|
+
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.isMainnet(__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_network, "f")))
|
|
39
|
+
return undefined;
|
|
40
|
+
return `${__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_BASE_URL, "f")}/address/{address}`;
|
|
41
|
+
}
|
|
42
|
+
getTxTemplateUrl() {
|
|
43
|
+
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.isMainnet(__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_network, "f")))
|
|
44
|
+
return undefined;
|
|
45
|
+
return `${__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_BASE_URL, "f")}/transaction/{txId}`;
|
|
46
|
+
}
|
|
36
47
|
}
|
|
37
48
|
exports.NeoTubeESNeoLegacy = NeoTubeESNeoLegacy;
|
|
38
|
-
_NeoTubeESNeoLegacy_network = new WeakMap();
|
|
49
|
+
_NeoTubeESNeoLegacy_BASE_URL = new WeakMap(), _NeoTubeESNeoLegacy_network = new WeakMap();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-neo-legacy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"author": "Coz",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"@cityofzion/dora-ts": "0.0.11",
|
|
13
13
|
"@cityofzion/neon-js": "4.8.3",
|
|
14
14
|
"@ledgerhq/hw-transport": "~6.30.5",
|
|
15
|
-
"@cityofzion/
|
|
16
|
-
"@cityofzion/
|
|
15
|
+
"@cityofzion/bs-asteroid-sdk": "0.9.0",
|
|
16
|
+
"@cityofzion/blockchain-service": "1.13.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/jest": "29.5.3",
|