@cityofzion/bs-neo-legacy 0.1.0 → 0.2.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/dist/BSNeoLegacy.d.ts +5 -18
- package/dist/BSNeoLegacy.js +8 -8
- package/docs/assets/search.js +1 -1
- package/docs/classes/BDSNeoLegacy.html +13 -13
- package/docs/classes/BSNeoLegacy.html +34 -46
- 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 +2 -7
- package/src/BSNeoLegacy.ts +13 -13
- /package/src/{blockchain_icon_neo_legacy.png → asset/blockchain_icon_neo_legacy.png} +0 -0
- /package/src/{blockchain_icon_neo_legacy_white.png → asset/blockchain_icon_neo_legacy_white.png} +0 -0
|
@@ -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/38910fc/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/38910fc/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/38910fc/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/38910fc/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/38910fc/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/38910fc/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/38910fc/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/38910fc/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/38910fc/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/38910fc/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/38910fc/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/38910fc/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/38910fc/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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-neo-legacy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"author": "Coz",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@cityofzion/neon-js": "^4.8.3",
|
|
13
|
-
"@cityofzion/blockchain-service": "0.
|
|
13
|
+
"@cityofzion/blockchain-service": "0.2.0",
|
|
14
14
|
"@moonlight-io/asteroid-sdk-js": "git+https://github.com/Moonlight-io/asteroid-sdk-js",
|
|
15
15
|
"axios": "1.3.2",
|
|
16
16
|
"@cityofzion/dora-ts": "0.0.11"
|
|
@@ -19,10 +19,5 @@
|
|
|
19
19
|
"ts-node": "10.9.1",
|
|
20
20
|
"typescript": "4.9.5",
|
|
21
21
|
"typedoc": "0.23.24"
|
|
22
|
-
},
|
|
23
|
-
"repository": {
|
|
24
|
-
"type": "git",
|
|
25
|
-
"url": "https://github.com/CityOfZion/blockchain-services",
|
|
26
|
-
"directory": "packages/bs-neo-legacy"
|
|
27
22
|
}
|
|
28
23
|
}
|
package/src/BSNeoLegacy.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Account, BDSClaimable, BlockchainDataService, BlockchainService, CalculateTransferFeeDetails, Claimable, Exchange, IntentTransactionParam, SendTransactionParam, Token } from '@cityofzion/blockchain-service'
|
|
1
|
+
import { Account, BDSClaimable, BlockchainDataService, BlockchainService, CalculateTransferFeeDetails, CalculateTransferFeeResponse, ClaimResponse, Claimable, Exchange, IntentTransactionParam, SendTransactionParam, Token } from '@cityofzion/blockchain-service'
|
|
2
2
|
import * as AsteroidSDK from '@moonlight-io/asteroid-sdk-js'
|
|
3
3
|
import { api, sc, u, wallet } from '@cityofzion/neon-js'
|
|
4
4
|
import { explorerNeoLegacyOption } from './explorer'
|
|
5
5
|
import { nativeAssetsNeoLegacy, unclaimedTokenNeoLegacy } from './constants'
|
|
6
6
|
const [gasToken, neoToken] = nativeAssetsNeoLegacy
|
|
7
7
|
import tokens from './asset/tokens.json'
|
|
8
|
-
export class BSNeoLegacy<BSCustomName extends string = string> implements BlockchainService, Claimable
|
|
8
|
+
export class BSNeoLegacy<BSCustomName extends string = string> implements BlockchainService, Claimable {
|
|
9
9
|
dataService: BlockchainDataService & BDSClaimable = explorerNeoLegacyOption.dora
|
|
10
10
|
blockchainName: BSCustomName;
|
|
11
11
|
derivationPath: string = "m/44'/888'/0'/0/?"
|
|
@@ -21,12 +21,12 @@ export class BSNeoLegacy<BSCustomName extends string = string> implements Blockc
|
|
|
21
21
|
async sendTransaction(param: SendTransactionParam): Promise<string> {
|
|
22
22
|
const url = (await this.dataService.getHigherNode()).url
|
|
23
23
|
const apiProvider = new api.neoscan.instance("MainNet")
|
|
24
|
-
const account = new wallet.Account(param.senderAccount.
|
|
24
|
+
const account = new wallet.Account(param.senderAccount.wif)
|
|
25
25
|
const intentsWithTye = this.setTypeIntents(param.transactionIntents)
|
|
26
26
|
const isNativeTransaction = intentsWithTye.every(intent => intent.type === 'native')
|
|
27
27
|
const priorityFee = param.priorityFee ?? 0
|
|
28
28
|
const [gasAsset] = this.nativeAssets
|
|
29
|
-
const gasBalance = (await this.dataService.getBalance(param.senderAccount.
|
|
29
|
+
const gasBalance = (await this.dataService.getBalance(param.senderAccount.address)).find(balance => balance.hash === gasAsset.hash)
|
|
30
30
|
if (gasBalance?.amount < priorityFee) throw new Error("Don't have funds to pay the transaction");
|
|
31
31
|
const transactionOperations = {
|
|
32
32
|
native: () => {
|
|
@@ -71,7 +71,7 @@ export class BSNeoLegacy<BSCustomName extends string = string> implements Blockc
|
|
|
71
71
|
const sb = new sc.ScriptBuilder()
|
|
72
72
|
transactionIntents.forEach(transaction => {
|
|
73
73
|
if (!this.isNativeTransaction(transaction)) {
|
|
74
|
-
const senderHash = u.reverseHex(wallet.getScriptHashFromAddress(senderAccount.
|
|
74
|
+
const senderHash = u.reverseHex(wallet.getScriptHashFromAddress(senderAccount.address))
|
|
75
75
|
const receiveHash = u.reverseHex(wallet.getScriptHashFromAddress(transaction.receiverAddress))
|
|
76
76
|
const adjustedAmount = new u.Fixed8(transaction.amount).toRawNumber()
|
|
77
77
|
sb.emitAppCall(transaction.tokenHash.replace('0x', ''), "transfer", [
|
|
@@ -105,7 +105,7 @@ export class BSNeoLegacy<BSCustomName extends string = string> implements Blockc
|
|
|
105
105
|
const childKey = this.keychain.generateChildKey('neo', this.derivationPath.replace('?', index.toString()))
|
|
106
106
|
return childKey.getWIF()
|
|
107
107
|
}
|
|
108
|
-
generateAccount(mnemonic: string, index: number):
|
|
108
|
+
generateAccount(mnemonic: string, index: number): Account {
|
|
109
109
|
const wif = this.generateWif(mnemonic, index)
|
|
110
110
|
const { address } = new wallet.Account(wif)
|
|
111
111
|
const result: { wif: string; address: string; } = { address, wif }
|
|
@@ -114,7 +114,7 @@ export class BSNeoLegacy<BSCustomName extends string = string> implements Blockc
|
|
|
114
114
|
generateAccountFromWif(wif: string): string {
|
|
115
115
|
return new wallet.Account(wif).address
|
|
116
116
|
}
|
|
117
|
-
async decryptKey(encryptedKey: string, password: string): Promise<
|
|
117
|
+
async decryptKey(encryptedKey: string, password: string): Promise<Account> {
|
|
118
118
|
const wif = await wallet.decrypt(encryptedKey, password)
|
|
119
119
|
const { address } = new wallet.Account(wif)
|
|
120
120
|
const result: { wif: string; address: string; } = { address, wif }
|
|
@@ -129,21 +129,21 @@ export class BSNeoLegacy<BSCustomName extends string = string> implements Blockc
|
|
|
129
129
|
validateWif(wif: string): boolean {
|
|
130
130
|
return wallet.isWIF(wif)
|
|
131
131
|
}
|
|
132
|
-
calculateTransferFee(
|
|
132
|
+
calculateTransferFee(): Promise<CalculateTransferFeeResponse> {
|
|
133
133
|
throw new Error(`Doesn't have fee to make a transaction on ${this.blockchainName}`);
|
|
134
134
|
}
|
|
135
135
|
//Implementation Claim interface
|
|
136
|
-
async claim(account: Account): Promise<
|
|
137
|
-
const neoAccount = new wallet.Account(account.
|
|
138
|
-
const balances = await this.dataService.getBalance(account.
|
|
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
139
|
const neoBalance = balances.find(balance => balance.symbol === 'NEO')
|
|
140
140
|
const apiProvider = new api.neoscan.instance("MainNet")
|
|
141
141
|
const neoNativeAsset = this.nativeAssets.find(nativeAsset => nativeAsset.symbol === neoBalance?.symbol)
|
|
142
142
|
if (!neoNativeAsset || !neoBalance) throw new Error("Neo it's necessary to do a claim");
|
|
143
|
-
const hasClaim = await this.dataService.getUnclaimed(account.
|
|
143
|
+
const hasClaim = await this.dataService.getUnclaimed(account.address)
|
|
144
144
|
if (hasClaim.unclaimed <= 0) throw new Error(`Doesn't have gas to claim`);
|
|
145
145
|
const url = (await this.dataService.getHigherNode()).url
|
|
146
|
-
const claims = await api.neoCli.getClaims(url, account.
|
|
146
|
+
const claims = await api.neoCli.getClaims(url, account.address)
|
|
147
147
|
const claimGasResponse = await api.claimGas({
|
|
148
148
|
claims,
|
|
149
149
|
api: apiProvider,
|
|
File without changes
|
/package/src/{blockchain_icon_neo_legacy_white.png → asset/blockchain_icon_neo_legacy_white.png}
RENAMED
|
File without changes
|