@cityofzion/bs-neo-legacy 0.3.1 → 0.4.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.
- package/.rush/temp/shrinkwrap-deps.json +2 -2
- package/bs-neo-legacy.build.error.log +82 -2
- package/bs-neo-legacy.build.log +84 -3
- package/dist/BSNeoLegacy.d.ts +13 -23
- package/dist/BSNeoLegacy.js +71 -98
- package/dist/constants.d.ts +2 -5
- package/docs/assets/search.js +1 -1
- package/docs/classes/BDSNeoLegacy.html +13 -13
- package/docs/classes/BSNeoLegacy.html +37 -81
- package/docs/interfaces/DoraNeoLegacyAsset.html +7 -7
- package/docs/interfaces/DoraNeoLegacyAssetResponse.html +9 -9
- package/docs/interfaces/DoraNeoLegacyBalance.html +5 -5
- package/docs/interfaces/DoraNeoLegacyConsensusNode.html +3 -3
- package/docs/interfaces/DoraNeoLegacyDetails.html +12 -12
- package/docs/interfaces/DoraNeoLegacyEntriesEntity.html +8 -8
- package/docs/interfaces/DoraNeoLegacyNameEntity.html +3 -3
- package/docs/interfaces/DoraNeoLegacyScriptsEntity.html +3 -3
- package/docs/interfaces/DoraNeoLegacyTransaction.html +14 -14
- package/docs/interfaces/DoraNeoLegacyTransactionsHistory.html +6 -6
- package/docs/interfaces/DoraNeoLegacyUnclaimed.html +4 -4
- package/docs/interfaces/DoraNeoLegacyVinEntity.html +3 -3
- package/docs/interfaces/DoraNeoLegacyVoutEntity.html +5 -5
- package/docs/variables/DORA_NEO_LEGACY_ASSET.html +1 -1
- package/docs/variables/DORA_NEO_LEGACY_BALANCE.html +1 -1
- package/docs/variables/DORA_NEO_LEGACY_CONTRACT.html +1 -1
- package/docs/variables/DORA_NEO_LEGACY_HISTORY_TRANSACTIONS.html +1 -1
- package/docs/variables/DORA_NEO_LEGACY_NODES.html +1 -1
- package/docs/variables/DORA_NEO_LEGACY_TRANSACTION.html +1 -1
- package/docs/variables/DORA_NEO_LEGACY_UNCLAIMED.html +1 -1
- package/docs/variables/explorerNeoLegacyOption.html +1 -1
- package/package.json +7 -7
- package/src/BDSNeoLegacy.ts +0 -1
- package/src/BSNeoLegacy.ts +73 -73
- package/src/constants.ts +3 -1
- package/tsconfig.json +6 -1
- package/neo-neo-logo.png +0 -0
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<ul class="tsd-hierarchy">
|
|
21
21
|
<li><span class="target">DoraNeoLegacyVinEntity</span></li></ul></section><aside class="tsd-sources">
|
|
22
22
|
<ul>
|
|
23
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
23
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraResponsesNeoLegacy.ts#L60">explorer/dora/DoraResponsesNeoLegacy.ts:60</a></li></ul></aside>
|
|
24
24
|
<section class="tsd-panel-group tsd-index-group">
|
|
25
25
|
<section class="tsd-panel tsd-index-panel">
|
|
26
26
|
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
<h3 class="tsd-anchor-link"><span>txid</span><a href="#txid" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none" id="icon-anchor-a"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" id="icon-anchor-b"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" id="icon-anchor-c"></path></svg></a></h3>
|
|
38
38
|
<div class="tsd-signature">txid<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
|
|
39
39
|
<ul>
|
|
40
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
40
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraResponsesNeoLegacy.ts#L61">explorer/dora/DoraResponsesNeoLegacy.ts:61</a></li></ul></aside></section>
|
|
41
41
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="vout" class="tsd-anchor"></a>
|
|
42
42
|
<h3 class="tsd-anchor-link"><span>vout</span><a href="#vout" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
43
43
|
<div class="tsd-signature">vout<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources">
|
|
44
44
|
<ul>
|
|
45
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
45
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraResponsesNeoLegacy.ts#L62">explorer/dora/DoraResponsesNeoLegacy.ts:62</a></li></ul></aside></section></section></div>
|
|
46
46
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
47
47
|
<div class="tsd-navigation settings">
|
|
48
48
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<ul class="tsd-hierarchy">
|
|
21
21
|
<li><span class="target">DoraNeoLegacyVoutEntity</span></li></ul></section><aside class="tsd-sources">
|
|
22
22
|
<ul>
|
|
23
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
23
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraResponsesNeoLegacy.ts#L64">explorer/dora/DoraResponsesNeoLegacy.ts:64</a></li></ul></aside>
|
|
24
24
|
<section class="tsd-panel-group tsd-index-group">
|
|
25
25
|
<section class="tsd-panel tsd-index-panel">
|
|
26
26
|
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
@@ -39,22 +39,22 @@
|
|
|
39
39
|
<h3 class="tsd-anchor-link"><span>address</span><a href="#address" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none" id="icon-anchor-a"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" id="icon-anchor-b"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" id="icon-anchor-c"></path></svg></a></h3>
|
|
40
40
|
<div class="tsd-signature">address<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
|
|
41
41
|
<ul>
|
|
42
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
42
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraResponsesNeoLegacy.ts#L68">explorer/dora/DoraResponsesNeoLegacy.ts:68</a></li></ul></aside></section>
|
|
43
43
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="asset" class="tsd-anchor"></a>
|
|
44
44
|
<h3 class="tsd-anchor-link"><span>asset</span><a href="#asset" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
45
45
|
<div class="tsd-signature">asset<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
|
|
46
46
|
<ul>
|
|
47
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
47
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraResponsesNeoLegacy.ts#L66">explorer/dora/DoraResponsesNeoLegacy.ts:66</a></li></ul></aside></section>
|
|
48
48
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="n" class="tsd-anchor"></a>
|
|
49
49
|
<h3 class="tsd-anchor-link"><span>n</span><a href="#n" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
50
50
|
<div class="tsd-signature">n<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources">
|
|
51
51
|
<ul>
|
|
52
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
52
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraResponsesNeoLegacy.ts#L65">explorer/dora/DoraResponsesNeoLegacy.ts:65</a></li></ul></aside></section>
|
|
53
53
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="value" class="tsd-anchor"></a>
|
|
54
54
|
<h3 class="tsd-anchor-link"><span>value</span><a href="#value" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
55
55
|
<div class="tsd-signature">value<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
|
|
56
56
|
<ul>
|
|
57
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
57
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraResponsesNeoLegacy.ts#L67">explorer/dora/DoraResponsesNeoLegacy.ts:67</a></li></ul></aside></section></section></div>
|
|
58
58
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
59
59
|
<div class="tsd-navigation settings">
|
|
60
60
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<h1>Variable DORA_NEO_LEGACY_ASSET<code class="tsd-tag ts-flagConst">Const</code> </h1></div>
|
|
18
18
|
<div class="tsd-signature">DORA_<wbr/>NEO_<wbr/>LEGACY_<wbr/>ASSET<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"asset"</span><span class="tsd-signature-symbol"> = 'asset'</span></div><aside class="tsd-sources">
|
|
19
19
|
<ul>
|
|
20
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
20
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraRoutesNeoLegacy.ts#L6">explorer/dora/DoraRoutesNeoLegacy.ts:6</a></li></ul></aside></div>
|
|
21
21
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
22
22
|
<div class="tsd-navigation settings">
|
|
23
23
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<h1>Variable DORA_NEO_LEGACY_BALANCE<code class="tsd-tag ts-flagConst">Const</code> </h1></div>
|
|
18
18
|
<div class="tsd-signature">DORA_<wbr/>NEO_<wbr/>LEGACY_<wbr/>BALANCE<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"balance"</span><span class="tsd-signature-symbol"> = 'balance'</span></div><aside class="tsd-sources">
|
|
19
19
|
<ul>
|
|
20
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
20
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraRoutesNeoLegacy.ts#L3">explorer/dora/DoraRoutesNeoLegacy.ts:3</a></li></ul></aside></div>
|
|
21
21
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
22
22
|
<div class="tsd-navigation settings">
|
|
23
23
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<h1>Variable DORA_NEO_LEGACY_CONTRACT<code class="tsd-tag ts-flagConst">Const</code> </h1></div>
|
|
18
18
|
<div class="tsd-signature">DORA_<wbr/>NEO_<wbr/>LEGACY_<wbr/>CONTRACT<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"contract"</span><span class="tsd-signature-symbol"> = 'contract'</span></div><aside class="tsd-sources">
|
|
19
19
|
<ul>
|
|
20
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
20
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraRoutesNeoLegacy.ts#L4">explorer/dora/DoraRoutesNeoLegacy.ts:4</a></li></ul></aside></div>
|
|
21
21
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
22
22
|
<div class="tsd-navigation settings">
|
|
23
23
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<h1>Variable DORA_NEO_LEGACY_HISTORY_TRANSACTIONS<code class="tsd-tag ts-flagConst">Const</code> </h1></div>
|
|
18
18
|
<div class="tsd-signature">DORA_<wbr/>NEO_<wbr/>LEGACY_<wbr/>HISTORY_<wbr/>TRANSACTIONS<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"get_address_abstracts"</span><span class="tsd-signature-symbol"> = 'get_address_abstracts'</span></div><aside class="tsd-sources">
|
|
19
19
|
<ul>
|
|
20
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
20
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraRoutesNeoLegacy.ts#L2">explorer/dora/DoraRoutesNeoLegacy.ts:2</a></li></ul></aside></div>
|
|
21
21
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
22
22
|
<div class="tsd-navigation settings">
|
|
23
23
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<h1>Variable DORA_NEO_LEGACY_NODES<code class="tsd-tag ts-flagConst">Const</code> </h1></div>
|
|
18
18
|
<div class="tsd-signature">DORA_<wbr/>NEO_<wbr/>LEGACY_<wbr/>NODES<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"get_all_nodes"</span><span class="tsd-signature-symbol"> = 'get_all_nodes'</span></div><aside class="tsd-sources">
|
|
19
19
|
<ul>
|
|
20
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
20
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraRoutesNeoLegacy.ts#L1">explorer/dora/DoraRoutesNeoLegacy.ts:1</a></li></ul></aside></div>
|
|
21
21
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
22
22
|
<div class="tsd-navigation settings">
|
|
23
23
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<h1>Variable DORA_NEO_LEGACY_TRANSACTION<code class="tsd-tag ts-flagConst">Const</code> </h1></div>
|
|
18
18
|
<div class="tsd-signature">DORA_<wbr/>NEO_<wbr/>LEGACY_<wbr/>TRANSACTION<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"transaction"</span><span class="tsd-signature-symbol"> = 'transaction'</span></div><aside class="tsd-sources">
|
|
19
19
|
<ul>
|
|
20
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
20
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraRoutesNeoLegacy.ts#L5">explorer/dora/DoraRoutesNeoLegacy.ts:5</a></li></ul></aside></div>
|
|
21
21
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
22
22
|
<div class="tsd-navigation settings">
|
|
23
23
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<h1>Variable DORA_NEO_LEGACY_UNCLAIMED<code class="tsd-tag ts-flagConst">Const</code> </h1></div>
|
|
18
18
|
<div class="tsd-signature">DORA_<wbr/>NEO_<wbr/>LEGACY_<wbr/>UNCLAIMED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"get_unclaimed"</span><span class="tsd-signature-symbol"> = 'get_unclaimed'</span></div><aside class="tsd-sources">
|
|
19
19
|
<ul>
|
|
20
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
20
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/dora/DoraRoutesNeoLegacy.ts#L7">explorer/dora/DoraRoutesNeoLegacy.ts:7</a></li></ul></aside></div>
|
|
21
21
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
22
22
|
<div class="tsd-navigation settings">
|
|
23
23
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<li class="tsd-parameter">
|
|
23
23
|
<h5>dora<span class="tsd-signature-symbol">: </span><a href="../classes/BDSNeoLegacy.html" class="tsd-signature-type" data-tsd-kind="Class">BDSNeoLegacy</a></h5></li></ul></div><aside class="tsd-sources">
|
|
24
24
|
<ul>
|
|
25
|
-
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/
|
|
25
|
+
<li>Defined in <a href="https://github.com/CityOfZion/blockchain-services/blob/e0129c6/packages/bs-neo-legacy/src/explorer/index.ts#L6">explorer/index.ts:6</a></li></ul></aside></div>
|
|
26
26
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
27
27
|
<div class="tsd-navigation settings">
|
|
28
28
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-neo-legacy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"author": "Coz",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "tsc && typedoc
|
|
9
|
+
"build": "tsc && typedoc"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"@cityofzion/blockchain-service": "0.4.0",
|
|
13
|
+
"@cityofzion/dora-ts": "0.0.11",
|
|
12
14
|
"@cityofzion/neon-js": "^4.8.3",
|
|
13
|
-
"@cityofzion/
|
|
14
|
-
"
|
|
15
|
-
"axios": "1.3.2",
|
|
16
|
-
"@cityofzion/dora-ts": "0.0.11"
|
|
15
|
+
"@cityofzion/wallet-sdk": "0.1.0",
|
|
16
|
+
"axios": "1.3.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"ts-node": "10.9.1",
|
|
20
20
|
"typescript": "4.9.5",
|
|
21
21
|
"typedoc": "0.23.24"
|
|
22
22
|
}
|
|
23
|
-
}
|
|
23
|
+
}
|
package/src/BDSNeoLegacy.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BalanceResponse, BlockchainNetwork, BlockchainDataService, ConsensusNodeResponse, ContractResponse, TokenInfoResponse, TransactionHistoryResponse, TransactionResponse, TransactionTransfer, BDSClaimable, UnclaimedResponse } from '@cityofzion/blockchain-service'
|
|
2
|
-
import { rpc } from '@cityofzion/neon-js';
|
|
3
2
|
import axios from 'axios'
|
|
4
3
|
import { DoraNeoLegacyEntriesEntity, DoraNeoLegacyTransaction } from './explorer/dora/DoraResponsesNeoLegacy';
|
|
5
4
|
import { DORA_NEO_LEGACY_TRANSACTION } from './explorer/dora/DoraRoutesNeoLegacy';
|
package/src/BSNeoLegacy.ts
CHANGED
|
@@ -1,23 +1,61 @@
|
|
|
1
|
-
import { Account, BDSClaimable, BlockchainDataService, BlockchainService, CalculateTransferFeeDetails, CalculateTransferFeeResponse, ClaimResponse, Claimable, Exchange, IntentTransactionParam, SendTransactionParam, Token } from '@cityofzion/blockchain-service'
|
|
2
|
-
import * as AsteroidSDK from '@moonlight-io/asteroid-sdk-js'
|
|
1
|
+
import { Account, BDSClaimable, BlockchainDataService, BlockchainService, CalculateTransferFeeDetails, CalculateTransferFeeResponse, ClaimResponse, Claimable, Exchange, IntentTransactionParam, SendTransactionParam, Token, TokenInfo } from '@cityofzion/blockchain-service'
|
|
3
2
|
import { api, sc, u, wallet } from '@cityofzion/neon-js'
|
|
4
3
|
import { explorerNeoLegacyOption } from './explorer'
|
|
5
4
|
import { nativeAssetsNeoLegacy, unclaimedTokenNeoLegacy } from './constants'
|
|
6
|
-
const [
|
|
5
|
+
const [, neoToken] = nativeAssetsNeoLegacy
|
|
7
6
|
import tokens from './asset/tokens.json'
|
|
7
|
+
import { BIP39Encoded } from '@cityofzion/wallet-sdk'
|
|
8
|
+
|
|
8
9
|
export class BSNeoLegacy<BSCustomName extends string = string> implements BlockchainService, Claimable {
|
|
9
10
|
dataService: BlockchainDataService & BDSClaimable = explorerNeoLegacyOption.dora
|
|
10
11
|
blockchainName: BSCustomName;
|
|
11
|
-
|
|
12
|
-
feeToken: { hash: string; symbol: string; decimals: number; };
|
|
12
|
+
feeToken: TokenInfo;
|
|
13
13
|
exchange: Exchange;
|
|
14
|
-
tokenClaim:
|
|
14
|
+
tokenClaim: TokenInfo = neoToken
|
|
15
15
|
tokens: Token[] = tokens
|
|
16
|
-
|
|
17
|
-
private nativeAssets:
|
|
16
|
+
|
|
17
|
+
private nativeAssets: TokenInfo[] = nativeAssetsNeoLegacy
|
|
18
|
+
private derivationPath: string = "m/44'/888'/0'/0/?"
|
|
19
|
+
|
|
18
20
|
constructor(blockchainName: BSCustomName) {
|
|
19
21
|
this.blockchainName = blockchainName
|
|
20
22
|
}
|
|
23
|
+
validateAddress(address: string): boolean {
|
|
24
|
+
return wallet.isAddress(address)
|
|
25
|
+
}
|
|
26
|
+
validateEncryptedKey(encryptedKey: string): boolean {
|
|
27
|
+
return wallet.isNEP2(encryptedKey)
|
|
28
|
+
}
|
|
29
|
+
validateWif(wif: string): boolean {
|
|
30
|
+
return wallet.isWIF(wif)
|
|
31
|
+
}
|
|
32
|
+
generateMnemonic(): string[] {
|
|
33
|
+
const bip39 = new BIP39Encoded()
|
|
34
|
+
const {phonetic} = bip39.generateMnemonic({length: 12})
|
|
35
|
+
if (!phonetic) throw new Error("Failed to generate mnemonic");
|
|
36
|
+
return phonetic
|
|
37
|
+
}
|
|
38
|
+
generateAccount(mnemonic: string[], index: number): Account {
|
|
39
|
+
const bip39 = new BIP39Encoded({ mnemonic })
|
|
40
|
+
const keychain = bip39.getKeychain('neo')
|
|
41
|
+
const childKey = keychain.generateChildKey(this.derivationPath.replace('?', index.toString()))
|
|
42
|
+
const wif = childKey.getWIF()
|
|
43
|
+
const { address } = new wallet.Account(wif)
|
|
44
|
+
return { address, wif }
|
|
45
|
+
}
|
|
46
|
+
generateAccountFromWif(wif: string): Account {
|
|
47
|
+
const { address } = new wallet.Account(wif)
|
|
48
|
+
return { address, wif }
|
|
49
|
+
}
|
|
50
|
+
async decryptKey(encryptedKey: string, password: string): Promise<Account> {
|
|
51
|
+
const wif = await wallet.decrypt(encryptedKey, password)
|
|
52
|
+
const { address } = new wallet.Account(wif)
|
|
53
|
+
const result: { wif: string; address: string; } = { address, wif }
|
|
54
|
+
return result
|
|
55
|
+
}
|
|
56
|
+
calculateTransferFee(): Promise<CalculateTransferFeeResponse> {
|
|
57
|
+
throw new Error(`Doesn't have fee to make a transaction on ${this.blockchainName}`);
|
|
58
|
+
}
|
|
21
59
|
async sendTransaction(param: SendTransactionParam): Promise<string> {
|
|
22
60
|
const url = (await this.dataService.getHigherNode()).url
|
|
23
61
|
const apiProvider = new api.neoscan.instance("MainNet")
|
|
@@ -57,6 +95,33 @@ export class BSNeoLegacy<BSCustomName extends string = string> implements Blockc
|
|
|
57
95
|
if (!result.tx) throw new Error("Failed to send transaction");
|
|
58
96
|
return result.tx.hash
|
|
59
97
|
}
|
|
98
|
+
//Implementation Claim interface
|
|
99
|
+
async claim(account: Account): Promise<ClaimResponse> {
|
|
100
|
+
const neoAccount = new wallet.Account(account.wif)
|
|
101
|
+
const balances = await this.dataService.getBalance(account.address)
|
|
102
|
+
const neoBalance = balances.find(balance => balance.symbol === 'NEO')
|
|
103
|
+
const apiProvider = new api.neoscan.instance("MainNet")
|
|
104
|
+
const neoNativeAsset = this.nativeAssets.find(nativeAsset => nativeAsset.symbol === neoBalance?.symbol)
|
|
105
|
+
if (!neoNativeAsset || !neoBalance) throw new Error("Neo it's necessary to do a claim");
|
|
106
|
+
const hasClaim = await this.dataService.getUnclaimed(account.address)
|
|
107
|
+
if (hasClaim.unclaimed <= 0) throw new Error(`Doesn't have gas to claim`);
|
|
108
|
+
const url = (await this.dataService.getHigherNode()).url
|
|
109
|
+
const claims = await api.neoCli.getClaims(url, account.address)
|
|
110
|
+
const claimGasResponse = await api.claimGas({
|
|
111
|
+
claims,
|
|
112
|
+
api: apiProvider,
|
|
113
|
+
account: neoAccount,
|
|
114
|
+
url
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
const result: { txid: string; symbol: string; hash: string } = {
|
|
118
|
+
txid: claimGasResponse.response.txid,
|
|
119
|
+
hash: unclaimedTokenNeoLegacy.hash,
|
|
120
|
+
symbol: unclaimedTokenNeoLegacy.symbol
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return result
|
|
124
|
+
}
|
|
60
125
|
private buildNativeTransaction(transactionIntents: IntentTransactionParam[]) {
|
|
61
126
|
let intents: ReturnType<typeof api.makeIntent> = []
|
|
62
127
|
transactionIntents.forEach(transaction => {
|
|
@@ -94,69 +159,4 @@ export class BSNeoLegacy<BSCustomName extends string = string> implements Blockc
|
|
|
94
159
|
private isNativeTransaction(transactionParam: IntentTransactionParam) {
|
|
95
160
|
return this.nativeAssets.some(asset => asset.hash === transactionParam.tokenHash)
|
|
96
161
|
}
|
|
97
|
-
generateMnemonic(): string {
|
|
98
|
-
this.keychain.generateMnemonic(128)
|
|
99
|
-
const list = this.keychain.mnemonic?.toString()
|
|
100
|
-
if (!list) throw new Error("Failed to generate mnemonic");
|
|
101
|
-
return list
|
|
102
|
-
}
|
|
103
|
-
generateWif(mnemonic: string, index: number): string {
|
|
104
|
-
this.keychain.importMnemonic(mnemonic)
|
|
105
|
-
const childKey = this.keychain.generateChildKey('neo', this.derivationPath.replace('?', index.toString()))
|
|
106
|
-
return childKey.getWIF()
|
|
107
|
-
}
|
|
108
|
-
generateAccount(mnemonic: string, index: number): Account {
|
|
109
|
-
const wif = this.generateWif(mnemonic, index)
|
|
110
|
-
const { address } = new wallet.Account(wif)
|
|
111
|
-
const result: { wif: string; address: string; } = { address, wif }
|
|
112
|
-
return result
|
|
113
|
-
}
|
|
114
|
-
generateAccountFromWif(wif: string): string {
|
|
115
|
-
return new wallet.Account(wif).address
|
|
116
|
-
}
|
|
117
|
-
async decryptKey(encryptedKey: string, password: string): Promise<Account> {
|
|
118
|
-
const wif = await wallet.decrypt(encryptedKey, password)
|
|
119
|
-
const { address } = new wallet.Account(wif)
|
|
120
|
-
const result: { wif: string; address: string; } = { address, wif }
|
|
121
|
-
return result
|
|
122
|
-
}
|
|
123
|
-
validateAddress(address: string): boolean {
|
|
124
|
-
return wallet.isAddress(address)
|
|
125
|
-
}
|
|
126
|
-
validateEncryptedKey(encryptedKey: string): boolean {
|
|
127
|
-
return wallet.isNEP2(encryptedKey)
|
|
128
|
-
}
|
|
129
|
-
validateWif(wif: string): boolean {
|
|
130
|
-
return wallet.isWIF(wif)
|
|
131
|
-
}
|
|
132
|
-
calculateTransferFee(): Promise<CalculateTransferFeeResponse> {
|
|
133
|
-
throw new Error(`Doesn't have fee to make a transaction on ${this.blockchainName}`);
|
|
134
|
-
}
|
|
135
|
-
//Implementation Claim interface
|
|
136
|
-
async claim(account: Account): Promise<ClaimResponse> {
|
|
137
|
-
const neoAccount = new wallet.Account(account.wif)
|
|
138
|
-
const balances = await this.dataService.getBalance(account.address)
|
|
139
|
-
const neoBalance = balances.find(balance => balance.symbol === 'NEO')
|
|
140
|
-
const apiProvider = new api.neoscan.instance("MainNet")
|
|
141
|
-
const neoNativeAsset = this.nativeAssets.find(nativeAsset => nativeAsset.symbol === neoBalance?.symbol)
|
|
142
|
-
if (!neoNativeAsset || !neoBalance) throw new Error("Neo it's necessary to do a claim");
|
|
143
|
-
const hasClaim = await this.dataService.getUnclaimed(account.address)
|
|
144
|
-
if (hasClaim.unclaimed <= 0) throw new Error(`Doesn't have gas to claim`);
|
|
145
|
-
const url = (await this.dataService.getHigherNode()).url
|
|
146
|
-
const claims = await api.neoCli.getClaims(url, account.address)
|
|
147
|
-
const claimGasResponse = await api.claimGas({
|
|
148
|
-
claims,
|
|
149
|
-
api: apiProvider,
|
|
150
|
-
account: neoAccount,
|
|
151
|
-
url
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
const result: { txid: string; symbol: string; hash: string } = {
|
|
155
|
-
txid: claimGasResponse.response.txid,
|
|
156
|
-
hash: unclaimedTokenNeoLegacy.hash,
|
|
157
|
-
symbol: unclaimedTokenNeoLegacy.symbol
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return result
|
|
161
|
-
}
|
|
162
162
|
}
|
package/src/constants.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { TokenInfo } from "@cityofzion/blockchain-service"
|
|
2
|
+
|
|
1
3
|
export const unclaimedTokenNeoLegacy = {
|
|
2
4
|
symbol: 'GAS',
|
|
3
5
|
name: 'GAS',
|
|
4
6
|
hash: '0x602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7'
|
|
5
7
|
}
|
|
6
8
|
|
|
7
|
-
export const nativeAssetsNeoLegacy:
|
|
9
|
+
export const nativeAssetsNeoLegacy: TokenInfo[] = [
|
|
8
10
|
{
|
|
9
11
|
decimals: 8,
|
|
10
12
|
symbol: 'GAS',
|
package/tsconfig.json
CHANGED
package/neo-neo-logo.png
DELETED
|
Binary file
|