@cityofzion/bs-neo3 1.8.10 → 1.9.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 DoraESNeo3 implements ExplorerService {
|
|
|
6
6
|
buildTransactionUrl(hash: string): string;
|
|
7
7
|
buildContractUrl(contractHash: string): string;
|
|
8
8
|
buildNftUrl({ contractHash, tokenId }: BuildNftUrlParams): string;
|
|
9
|
+
getAddressTemplateUrl(): string | undefined;
|
|
10
|
+
getTxTemplateUrl(): string | undefined;
|
|
9
11
|
}
|
|
@@ -10,30 +10,41 @@ 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 _DoraESNeo3_network;
|
|
13
|
+
var _DoraESNeo3_BASE_URL, _DoraESNeo3_network;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.DoraESNeo3 = void 0;
|
|
16
16
|
const BSNeo3Helper_1 = require("../../helpers/BSNeo3Helper");
|
|
17
17
|
class DoraESNeo3 {
|
|
18
18
|
constructor(network) {
|
|
19
|
+
_DoraESNeo3_BASE_URL.set(this, 'https://dora.coz.io');
|
|
19
20
|
_DoraESNeo3_network.set(this, void 0);
|
|
20
21
|
__classPrivateFieldSet(this, _DoraESNeo3_network, network, "f");
|
|
21
22
|
}
|
|
22
23
|
buildTransactionUrl(hash) {
|
|
23
24
|
if (BSNeo3Helper_1.BSNeo3Helper.isCustomNet(__classPrivateFieldGet(this, _DoraESNeo3_network, "f")))
|
|
24
25
|
throw new Error('DoraESNeo3 is only available on mainnet and testnet');
|
|
25
|
-
return
|
|
26
|
+
return `${__classPrivateFieldGet(this, _DoraESNeo3_BASE_URL, "f")}/transaction/neo3/${__classPrivateFieldGet(this, _DoraESNeo3_network, "f").id}/${hash}`;
|
|
26
27
|
}
|
|
27
28
|
buildContractUrl(contractHash) {
|
|
28
29
|
if (BSNeo3Helper_1.BSNeo3Helper.isCustomNet(__classPrivateFieldGet(this, _DoraESNeo3_network, "f")))
|
|
29
30
|
throw new Error('DoraESNeo3 is only available on mainnet and testnet');
|
|
30
|
-
return
|
|
31
|
+
return `${__classPrivateFieldGet(this, _DoraESNeo3_BASE_URL, "f")}/contract/neo3/${__classPrivateFieldGet(this, _DoraESNeo3_network, "f").id}/${contractHash}`;
|
|
31
32
|
}
|
|
32
33
|
buildNftUrl({ contractHash, tokenId }) {
|
|
33
34
|
if (BSNeo3Helper_1.BSNeo3Helper.isCustomNet(__classPrivateFieldGet(this, _DoraESNeo3_network, "f")))
|
|
34
35
|
throw new Error('DoraESNeo3 is only available on mainnet and testnet');
|
|
35
|
-
return
|
|
36
|
+
return `${__classPrivateFieldGet(this, _DoraESNeo3_BASE_URL, "f")}/nft/neo3/${__classPrivateFieldGet(this, _DoraESNeo3_network, "f").id}/${contractHash}/${tokenId}`;
|
|
37
|
+
}
|
|
38
|
+
getAddressTemplateUrl() {
|
|
39
|
+
if (BSNeo3Helper_1.BSNeo3Helper.isCustomNet(__classPrivateFieldGet(this, _DoraESNeo3_network, "f")))
|
|
40
|
+
return undefined;
|
|
41
|
+
return `${__classPrivateFieldGet(this, _DoraESNeo3_BASE_URL, "f")}/address/neo3/${__classPrivateFieldGet(this, _DoraESNeo3_network, "f").id}/{address}`;
|
|
42
|
+
}
|
|
43
|
+
getTxTemplateUrl() {
|
|
44
|
+
if (BSNeo3Helper_1.BSNeo3Helper.isCustomNet(__classPrivateFieldGet(this, _DoraESNeo3_network, "f")))
|
|
45
|
+
return undefined;
|
|
46
|
+
return `${__classPrivateFieldGet(this, _DoraESNeo3_BASE_URL, "f")}/transaction/neo3/${__classPrivateFieldGet(this, _DoraESNeo3_network, "f").id}/{txId}`;
|
|
36
47
|
}
|
|
37
48
|
}
|
|
38
49
|
exports.DoraESNeo3 = DoraESNeo3;
|
|
39
|
-
_DoraESNeo3_network = new WeakMap();
|
|
50
|
+
_DoraESNeo3_BASE_URL = new WeakMap(), _DoraESNeo3_network = new WeakMap();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-neo3",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": "https://github.com/CityOfZion/blockchain-services",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"bignumber.js": "^9.1.2",
|
|
21
21
|
"isomorphic-ws": "^5.0.0",
|
|
22
22
|
"lodash.clonedeep": "^4.5.0",
|
|
23
|
-
"@cityofzion/
|
|
24
|
-
"@cityofzion/
|
|
23
|
+
"@cityofzion/bs-asteroid-sdk": "0.9.0",
|
|
24
|
+
"@cityofzion/blockchain-service": "1.13.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@cityofzion/neon-dappkit-types": "~0.3.1",
|