@cityofzion/bs-neo-legacy 1.13.4 → 1.13.5
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/dist/BSNeoLegacy.d.ts +37 -53
- package/dist/BSNeoLegacy.js +144 -195
- package/dist/constants/BSNeoLegacyConstants.d.ts +13 -34
- package/dist/constants/BSNeoLegacyConstants.js +26 -38
- package/dist/helpers/BSNeoLegacyHelper.d.ts +4 -22
- package/dist/helpers/BSNeoLegacyHelper.js +2 -69
- package/dist/helpers/BSNeoLegacyNeonJsSingletonHelper.d.ts +6 -0
- package/dist/helpers/BSNeoLegacyNeonJsSingletonHelper.js +26 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/services/blockchain-data/DoraBDSNeoLegacy.d.ts +13 -12
- package/dist/services/blockchain-data/DoraBDSNeoLegacy.js +45 -92
- package/dist/services/claim-data/DoraCDSNeoLegacy.d.ts +7 -0
- package/dist/services/claim-data/DoraCDSNeoLegacy.js +42 -0
- package/dist/services/exchange-data/CryptoCompareEDSNeoLegacy.d.ts +6 -6
- package/dist/services/exchange-data/CryptoCompareEDSNeoLegacy.js +7 -7
- package/dist/services/explorer/NeoTubeESNeoLegacy.d.ts +6 -5
- package/dist/services/explorer/NeoTubeESNeoLegacy.js +16 -18
- package/dist/services/ledger/NeonJsLedgerServiceNeoLegacy.d.ts +8 -8
- package/dist/services/ledger/NeonJsLedgerServiceNeoLegacy.js +25 -33
- package/dist/services/migration/Neo3NeoLegacyMigrationService.d.ts +16 -0
- package/dist/services/migration/Neo3NeoLegacyMigrationService.js +173 -0
- package/dist/types.d.ts +44 -0
- package/dist/types.js +17 -0
- package/package.json +16 -18
- package/dist/assets/tokens/mainnet.json +0 -466
- package/dist/assets/tokens/native.json +0 -14
|
@@ -19,23 +19,23 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
19
19
|
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");
|
|
20
20
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
21
|
};
|
|
22
|
-
var
|
|
22
|
+
var _CryptoCompareEDSNeoLegacy_service;
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.CryptoCompareEDSNeoLegacy = void 0;
|
|
25
25
|
const blockchain_service_1 = require("@cityofzion/blockchain-service");
|
|
26
26
|
const BSNeoLegacyHelper_1 = require("../../helpers/BSNeoLegacyHelper");
|
|
27
27
|
class CryptoCompareEDSNeoLegacy extends blockchain_service_1.CryptoCompareEDS {
|
|
28
|
-
constructor(
|
|
28
|
+
constructor(service) {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
__classPrivateFieldSet(this,
|
|
30
|
+
_CryptoCompareEDSNeoLegacy_service.set(this, void 0);
|
|
31
|
+
__classPrivateFieldSet(this, _CryptoCompareEDSNeoLegacy_service, service, "f");
|
|
32
32
|
}
|
|
33
33
|
getTokenPriceHistory(params) {
|
|
34
34
|
const _super = Object.create(null, {
|
|
35
35
|
getTokenPriceHistory: { get: () => super.getTokenPriceHistory }
|
|
36
36
|
});
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.
|
|
38
|
+
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.isMainnetNetwork(__classPrivateFieldGet(this, _CryptoCompareEDSNeoLegacy_service, "f").network))
|
|
39
39
|
throw new Error('Exchange is only available on mainnet');
|
|
40
40
|
return yield _super.getTokenPriceHistory.call(this, params);
|
|
41
41
|
});
|
|
@@ -45,11 +45,11 @@ class CryptoCompareEDSNeoLegacy extends blockchain_service_1.CryptoCompareEDS {
|
|
|
45
45
|
getTokenPrices: { get: () => super.getTokenPrices }
|
|
46
46
|
});
|
|
47
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.
|
|
48
|
+
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.isMainnetNetwork(__classPrivateFieldGet(this, _CryptoCompareEDSNeoLegacy_service, "f").network))
|
|
49
49
|
throw new Error('Exchange is only available on mainnet');
|
|
50
50
|
return yield _super.getTokenPrices.call(this, params);
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.CryptoCompareEDSNeoLegacy = CryptoCompareEDSNeoLegacy;
|
|
55
|
-
|
|
55
|
+
_CryptoCompareEDSNeoLegacy_service = new WeakMap();
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare class NeoTubeESNeoLegacy implements
|
|
1
|
+
import { TBuildNftUrlParams, IExplorerService } from '@cityofzion/blockchain-service';
|
|
2
|
+
import { IBSNeoLegacy } from '../../types';
|
|
3
|
+
export declare class NeoTubeESNeoLegacy<N extends string> implements IExplorerService {
|
|
4
4
|
#private;
|
|
5
|
-
|
|
5
|
+
static readonly BASE_URL: string;
|
|
6
|
+
constructor(service: IBSNeoLegacy<N>);
|
|
6
7
|
buildTransactionUrl(hash: string): string;
|
|
7
8
|
buildContractUrl(contractHash: string): string;
|
|
8
|
-
buildNftUrl(_params:
|
|
9
|
+
buildNftUrl(_params: TBuildNftUrlParams): string;
|
|
9
10
|
getAddressTemplateUrl(): string | undefined;
|
|
10
11
|
getTxTemplateUrl(): string | undefined;
|
|
11
12
|
getNftTemplateUrl(): undefined;
|
|
@@ -10,49 +10,47 @@ 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
|
|
13
|
+
var _NeoTubeESNeoLegacy_service;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.NeoTubeESNeoLegacy = void 0;
|
|
16
16
|
const BSNeoLegacyHelper_1 = require("../../helpers/BSNeoLegacyHelper");
|
|
17
17
|
class NeoTubeESNeoLegacy {
|
|
18
|
-
constructor(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_NeoTubeESNeoLegacy_tokenService.set(this, void 0);
|
|
22
|
-
__classPrivateFieldSet(this, _NeoTubeESNeoLegacy_network, network, "f");
|
|
23
|
-
__classPrivateFieldSet(this, _NeoTubeESNeoLegacy_tokenService, tokenService, "f");
|
|
18
|
+
constructor(service) {
|
|
19
|
+
_NeoTubeESNeoLegacy_service.set(this, void 0);
|
|
20
|
+
__classPrivateFieldSet(this, _NeoTubeESNeoLegacy_service, service, "f");
|
|
24
21
|
}
|
|
25
22
|
buildTransactionUrl(hash) {
|
|
26
|
-
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.
|
|
23
|
+
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.isMainnetNetwork(__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_service, "f").network))
|
|
27
24
|
throw new Error('NeoTube is only available on mainnet');
|
|
28
|
-
return `${
|
|
25
|
+
return `${NeoTubeESNeoLegacy.BASE_URL}/transaction/${__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_service, "f").tokenService.normalizeHash(hash)}`;
|
|
29
26
|
}
|
|
30
27
|
buildContractUrl(contractHash) {
|
|
31
|
-
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.
|
|
28
|
+
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.isMainnetNetwork(__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_service, "f").network))
|
|
32
29
|
throw new Error('NeoTube is only available on mainnet');
|
|
33
|
-
return `${
|
|
30
|
+
return `${NeoTubeESNeoLegacy.BASE_URL}/asset/${__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_service, "f").tokenService.normalizeHash(contractHash)}/page/1`;
|
|
34
31
|
}
|
|
35
32
|
buildNftUrl(_params) {
|
|
36
33
|
throw new Error('NeoTube does not support nft');
|
|
37
34
|
}
|
|
38
35
|
getAddressTemplateUrl() {
|
|
39
|
-
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.
|
|
36
|
+
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.isMainnetNetwork(__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_service, "f").network))
|
|
40
37
|
return undefined;
|
|
41
|
-
return `${
|
|
38
|
+
return `${NeoTubeESNeoLegacy.BASE_URL}/address/{address}`;
|
|
42
39
|
}
|
|
43
40
|
getTxTemplateUrl() {
|
|
44
|
-
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.
|
|
41
|
+
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.isMainnetNetwork(__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_service, "f").network))
|
|
45
42
|
return undefined;
|
|
46
|
-
return `${
|
|
43
|
+
return `${NeoTubeESNeoLegacy.BASE_URL}/transaction/{txId}`;
|
|
47
44
|
}
|
|
48
45
|
getNftTemplateUrl() {
|
|
49
46
|
return undefined;
|
|
50
47
|
}
|
|
51
48
|
getContractTemplateUrl() {
|
|
52
|
-
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.
|
|
49
|
+
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.isMainnetNetwork(__classPrivateFieldGet(this, _NeoTubeESNeoLegacy_service, "f").network))
|
|
53
50
|
return undefined;
|
|
54
|
-
return `${
|
|
51
|
+
return `${NeoTubeESNeoLegacy.BASE_URL}/asset/{hash}/page/1`;
|
|
55
52
|
}
|
|
56
53
|
}
|
|
57
54
|
exports.NeoTubeESNeoLegacy = NeoTubeESNeoLegacy;
|
|
58
|
-
|
|
55
|
+
_NeoTubeESNeoLegacy_service = new WeakMap();
|
|
56
|
+
NeoTubeESNeoLegacy.BASE_URL = 'https://neo2.neotube.io';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TBSAccount, TGetLedgerTransport, ILedgerService, TLedgerServiceEmitter, TUntilIndexRecord } from '@cityofzion/blockchain-service';
|
|
2
2
|
import { BSNeoLegacy } from '../../BSNeoLegacy';
|
|
3
3
|
import Transport from '@ledgerhq/hw-transport';
|
|
4
|
-
export declare class NeonJsLedgerServiceNeoLegacy<
|
|
4
|
+
export declare class NeonJsLedgerServiceNeoLegacy<N extends string = string> implements ILedgerService<N> {
|
|
5
5
|
#private;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
constructor(blockchainService: BSNeoLegacy<
|
|
9
|
-
getAccount(transport: Transport, index: number): Promise<
|
|
10
|
-
getAccounts(transport: Transport, untilIndexByBlockchainService?:
|
|
11
|
-
getSigningCallback(transport: Transport, account:
|
|
6
|
+
readonly getLedgerTransport?: TGetLedgerTransport<N>;
|
|
7
|
+
emitter: TLedgerServiceEmitter;
|
|
8
|
+
constructor(blockchainService: BSNeoLegacy<N>, getLedgerTransport?: TGetLedgerTransport<N>);
|
|
9
|
+
getAccount(transport: Transport, index: number): Promise<TBSAccount<N>>;
|
|
10
|
+
getAccounts(transport: Transport, untilIndexByBlockchainService?: TUntilIndexRecord<N>): Promise<TBSAccount<N>[]>;
|
|
11
|
+
getSigningCallback(transport: Transport, account: TBSAccount): (transaction: string, publicKey: string) => Promise<string | string[]>;
|
|
12
12
|
}
|
|
@@ -22,57 +22,45 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
22
22
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
24
|
};
|
|
25
|
-
var _NeonJsLedgerServiceNeoLegacy_instances,
|
|
25
|
+
var _NeonJsLedgerServiceNeoLegacy_instances, _NeonJsLedgerServiceNeoLegacy_service, _NeonJsLedgerServiceNeoLegacy_sendChunk, _NeonJsLedgerServiceNeoLegacy_bip44PathToHex, _NeonJsLedgerServiceNeoLegacy_derSignatureToHex;
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.NeonJsLedgerServiceNeoLegacy = void 0;
|
|
28
28
|
const blockchain_service_1 = require("@cityofzion/blockchain-service");
|
|
29
29
|
const events_1 = __importDefault(require("events"));
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
(function (LedgerStatus) {
|
|
33
|
-
LedgerStatus[LedgerStatus["OK"] = 36864] = "OK";
|
|
34
|
-
})(LedgerStatus || (LedgerStatus = {}));
|
|
35
|
-
var LedgerCommand;
|
|
36
|
-
(function (LedgerCommand) {
|
|
37
|
-
LedgerCommand[LedgerCommand["GET_PUBLIC_KEY"] = 4] = "GET_PUBLIC_KEY";
|
|
38
|
-
LedgerCommand[LedgerCommand["SIGN"] = 2] = "SIGN";
|
|
39
|
-
})(LedgerCommand || (LedgerCommand = {}));
|
|
40
|
-
var LedgerParameter;
|
|
41
|
-
(function (LedgerParameter) {
|
|
42
|
-
LedgerParameter[LedgerParameter["MORE_DATA"] = 0] = "MORE_DATA";
|
|
43
|
-
LedgerParameter[LedgerParameter["LAST_DATA"] = 128] = "LAST_DATA";
|
|
44
|
-
})(LedgerParameter || (LedgerParameter = {}));
|
|
30
|
+
const types_1 = require("../../types");
|
|
31
|
+
const BSNeoLegacyNeonJsSingletonHelper_1 = require("../../helpers/BSNeoLegacyNeonJsSingletonHelper");
|
|
45
32
|
class NeonJsLedgerServiceNeoLegacy {
|
|
46
33
|
constructor(blockchainService, getLedgerTransport) {
|
|
47
34
|
_NeonJsLedgerServiceNeoLegacy_instances.add(this);
|
|
48
|
-
|
|
35
|
+
_NeonJsLedgerServiceNeoLegacy_service.set(this, void 0);
|
|
49
36
|
this.emitter = new events_1.default();
|
|
50
|
-
__classPrivateFieldSet(this,
|
|
37
|
+
__classPrivateFieldSet(this, _NeonJsLedgerServiceNeoLegacy_service, blockchainService, "f");
|
|
51
38
|
this.getLedgerTransport = getLedgerTransport;
|
|
52
39
|
}
|
|
53
40
|
getAccount(transport, index) {
|
|
54
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
const bip44Path = __classPrivateFieldGet(this,
|
|
42
|
+
const bip44Path = __classPrivateFieldGet(this, _NeonJsLedgerServiceNeoLegacy_service, "f").bip44DerivationPath.replace('?', index.toString());
|
|
56
43
|
const bip44PathHex = __classPrivateFieldGet(this, _NeonJsLedgerServiceNeoLegacy_instances, "m", _NeonJsLedgerServiceNeoLegacy_bip44PathToHex).call(this, bip44Path);
|
|
57
|
-
const result = yield __classPrivateFieldGet(this, _NeonJsLedgerServiceNeoLegacy_instances, "m", _NeonJsLedgerServiceNeoLegacy_sendChunk).call(this, transport,
|
|
44
|
+
const result = yield __classPrivateFieldGet(this, _NeonJsLedgerServiceNeoLegacy_instances, "m", _NeonJsLedgerServiceNeoLegacy_sendChunk).call(this, transport, types_1.ENeonJsLedgerServiceNeoLegacyCommand.GET_PUBLIC_KEY, types_1.ENeonJsLedgerServiceNeoLegacyParameter.LAST_DATA, bip44PathHex);
|
|
58
45
|
const publicKey = result.toString('hex').substring(0, 130);
|
|
59
|
-
const {
|
|
46
|
+
const { wallet } = BSNeoLegacyNeonJsSingletonHelper_1.BSNeoLegacyNeonJsSingletonHelper.getInstance();
|
|
47
|
+
const { address } = new wallet.Account(publicKey);
|
|
60
48
|
return {
|
|
61
49
|
address,
|
|
62
50
|
key: publicKey,
|
|
63
51
|
type: 'publicKey',
|
|
64
52
|
bip44Path,
|
|
65
|
-
blockchain: __classPrivateFieldGet(this,
|
|
53
|
+
blockchain: __classPrivateFieldGet(this, _NeonJsLedgerServiceNeoLegacy_service, "f").name,
|
|
66
54
|
isHardware: true,
|
|
67
55
|
};
|
|
68
56
|
});
|
|
69
57
|
}
|
|
70
58
|
getAccounts(transport, untilIndexByBlockchainService) {
|
|
71
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
const accountsByBlockchainService = yield (0, blockchain_service_1.generateAccountForBlockchainService)([__classPrivateFieldGet(this,
|
|
60
|
+
const accountsByBlockchainService = yield (0, blockchain_service_1.generateAccountForBlockchainService)([__classPrivateFieldGet(this, _NeonJsLedgerServiceNeoLegacy_service, "f")], (_service, index) => __awaiter(this, void 0, void 0, function* () {
|
|
73
61
|
return this.getAccount(transport, index);
|
|
74
62
|
}), untilIndexByBlockchainService);
|
|
75
|
-
const accounts = accountsByBlockchainService.get(__classPrivateFieldGet(this,
|
|
63
|
+
const accounts = accountsByBlockchainService.get(__classPrivateFieldGet(this, _NeonJsLedgerServiceNeoLegacy_service, "f").name);
|
|
76
64
|
return accounts !== null && accounts !== void 0 ? accounts : [];
|
|
77
65
|
});
|
|
78
66
|
}
|
|
@@ -83,8 +71,9 @@ class NeonJsLedgerServiceNeoLegacy {
|
|
|
83
71
|
if (!account.bip44Path) {
|
|
84
72
|
throw new Error('Account must have a bip 44 path to sign with Ledger');
|
|
85
73
|
}
|
|
86
|
-
const
|
|
87
|
-
const
|
|
74
|
+
const { wallet, tx } = BSNeoLegacyNeonJsSingletonHelper_1.BSNeoLegacyNeonJsSingletonHelper.getInstance();
|
|
75
|
+
const neonJsAccount = new wallet.Account(account.key);
|
|
76
|
+
const witnessScriptHash = wallet.getScriptHashFromPublicKey(publicKey);
|
|
88
77
|
if (neonJsAccount.scriptHash !== witnessScriptHash) {
|
|
89
78
|
throw new Error('Public key does not match the account key');
|
|
90
79
|
}
|
|
@@ -94,15 +83,15 @@ class NeonJsLedgerServiceNeoLegacy {
|
|
|
94
83
|
const chunks = payload.match(/.{1,510}/g) || [];
|
|
95
84
|
// Send all chunks except the last one
|
|
96
85
|
for (let i = 0; i < chunks.length - 1; i++) {
|
|
97
|
-
yield __classPrivateFieldGet(this, _NeonJsLedgerServiceNeoLegacy_instances, "m", _NeonJsLedgerServiceNeoLegacy_sendChunk).call(this, transport,
|
|
86
|
+
yield __classPrivateFieldGet(this, _NeonJsLedgerServiceNeoLegacy_instances, "m", _NeonJsLedgerServiceNeoLegacy_sendChunk).call(this, transport, types_1.ENeonJsLedgerServiceNeoLegacyCommand.SIGN, types_1.ENeonJsLedgerServiceNeoLegacyParameter.MORE_DATA, chunks[i]);
|
|
98
87
|
}
|
|
99
88
|
// Send the last chunk signaling that it is the last one and get the signature
|
|
100
|
-
const response = yield __classPrivateFieldGet(this, _NeonJsLedgerServiceNeoLegacy_instances, "m", _NeonJsLedgerServiceNeoLegacy_sendChunk).call(this, transport,
|
|
101
|
-
if (response.readUIntBE(0, 2) ===
|
|
89
|
+
const response = yield __classPrivateFieldGet(this, _NeonJsLedgerServiceNeoLegacy_instances, "m", _NeonJsLedgerServiceNeoLegacy_sendChunk).call(this, transport, types_1.ENeonJsLedgerServiceNeoLegacyCommand.SIGN, types_1.ENeonJsLedgerServiceNeoLegacyParameter.LAST_DATA, chunks[chunks.length - 1]);
|
|
90
|
+
if (response.readUIntBE(0, 2) === types_1.ENeonJsLedgerServiceNeoLegacyStatus.OK) {
|
|
102
91
|
throw new Error('No more data but Ledger did not return signature!');
|
|
103
92
|
}
|
|
104
93
|
const signature = __classPrivateFieldGet(this, _NeonJsLedgerServiceNeoLegacy_instances, "m", _NeonJsLedgerServiceNeoLegacy_derSignatureToHex).call(this, response.toString('hex'));
|
|
105
|
-
const witness =
|
|
94
|
+
const witness = tx.Witness.fromSignature(signature, publicKey);
|
|
106
95
|
return witness.serialize();
|
|
107
96
|
}
|
|
108
97
|
finally {
|
|
@@ -112,8 +101,10 @@ class NeonJsLedgerServiceNeoLegacy {
|
|
|
112
101
|
}
|
|
113
102
|
}
|
|
114
103
|
exports.NeonJsLedgerServiceNeoLegacy = NeonJsLedgerServiceNeoLegacy;
|
|
115
|
-
|
|
116
|
-
return transport.send(0x80, command, parameter, 0x00, Buffer.from(chunk, 'hex'), [
|
|
104
|
+
_NeonJsLedgerServiceNeoLegacy_service = new WeakMap(), _NeonJsLedgerServiceNeoLegacy_instances = new WeakSet(), _NeonJsLedgerServiceNeoLegacy_sendChunk = function _NeonJsLedgerServiceNeoLegacy_sendChunk(transport, command, parameter, chunk) {
|
|
105
|
+
return transport.send(0x80, command, parameter, 0x00, Buffer.from(chunk, 'hex'), [
|
|
106
|
+
types_1.ENeonJsLedgerServiceNeoLegacyStatus.OK,
|
|
107
|
+
]);
|
|
117
108
|
}, _NeonJsLedgerServiceNeoLegacy_bip44PathToHex = function _NeonJsLedgerServiceNeoLegacy_bip44PathToHex(path) {
|
|
118
109
|
let result = '';
|
|
119
110
|
const components = path.split('/');
|
|
@@ -129,7 +120,8 @@ _NeonJsLedgerServiceNeoLegacy_blockchainService = new WeakMap(), _NeonJsLedgerSe
|
|
|
129
120
|
});
|
|
130
121
|
return result;
|
|
131
122
|
}, _NeonJsLedgerServiceNeoLegacy_derSignatureToHex = function _NeonJsLedgerServiceNeoLegacy_derSignatureToHex(response) {
|
|
132
|
-
const
|
|
123
|
+
const { u } = BSNeoLegacyNeonJsSingletonHelper_1.BSNeoLegacyNeonJsSingletonHelper.getInstance();
|
|
124
|
+
const ss = new u.StringStream(response);
|
|
133
125
|
// The first byte is format. It is usually 0x30 (SEQ) or 0x31 (SET)
|
|
134
126
|
// The second byte represents the total length of the DER module.
|
|
135
127
|
ss.read(2);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IBSNeoLegacy, TNeo3NeoLegacyMigrationNeo3Amounts, TNeo3NeoLegacyMigrationNeoLegacyAmounts, TNeo3NeoLegacyMigrateParams, TNeo3NeoLegacyWaitForMigrationParams } from '../../types';
|
|
2
|
+
import { TBalanceResponse } from '@cityofzion/blockchain-service';
|
|
3
|
+
export declare class Neo3NeoLegacyMigrationService<N extends string> {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(service: IBSNeoLegacy<N>);
|
|
6
|
+
migrate({ account, neo3Address, neoLegacyMigrationAmounts }: TNeo3NeoLegacyMigrateParams<N>): Promise<string>;
|
|
7
|
+
/**
|
|
8
|
+
* Reference: https://github.com/CityOfZion/legacy-n3-swap-service/blob/master/policy/policy.go
|
|
9
|
+
*/
|
|
10
|
+
calculateNeo3MigrationAmounts(neoLegacyMigrationAmounts: TNeo3NeoLegacyMigrationNeoLegacyAmounts): TNeo3NeoLegacyMigrationNeo3Amounts;
|
|
11
|
+
calculateNeoLegacyMigrationAmounts(balance: TBalanceResponse[]): TNeo3NeoLegacyMigrationNeoLegacyAmounts;
|
|
12
|
+
static waitForMigration(params: TNeo3NeoLegacyWaitForMigrationParams): Promise<{
|
|
13
|
+
isTransactionConfirmed: boolean;
|
|
14
|
+
isNeo3TransactionConfirmed: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
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 __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
+
};
|
|
17
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
18
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
19
|
+
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");
|
|
20
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
|
+
};
|
|
22
|
+
var _Neo3NeoLegacyMigrationService_service;
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.Neo3NeoLegacyMigrationService = void 0;
|
|
25
|
+
const BSNeoLegacyHelper_1 = require("../../helpers/BSNeoLegacyHelper");
|
|
26
|
+
const BSNeoLegacyConstants_1 = require("../../constants/BSNeoLegacyConstants");
|
|
27
|
+
const blockchain_service_1 = require("@cityofzion/blockchain-service");
|
|
28
|
+
const BSNeoLegacyNeonJsSingletonHelper_1 = require("../../helpers/BSNeoLegacyNeonJsSingletonHelper");
|
|
29
|
+
class Neo3NeoLegacyMigrationService {
|
|
30
|
+
constructor(service) {
|
|
31
|
+
_Neo3NeoLegacyMigrationService_service.set(this, void 0);
|
|
32
|
+
__classPrivateFieldSet(this, _Neo3NeoLegacyMigrationService_service, service, "f");
|
|
33
|
+
}
|
|
34
|
+
migrate(_a) {
|
|
35
|
+
return __awaiter(this, arguments, void 0, function* ({ account, neo3Address, neoLegacyMigrationAmounts }) {
|
|
36
|
+
if (!BSNeoLegacyHelper_1.BSNeoLegacyHelper.isMainnetNetwork(__classPrivateFieldGet(this, _Neo3NeoLegacyMigrationService_service, "f").network)) {
|
|
37
|
+
throw new Error('Must use Mainnet network');
|
|
38
|
+
}
|
|
39
|
+
if ((!neoLegacyMigrationAmounts.hasEnoughGasBalance && !neoLegacyMigrationAmounts.hasEnoughNeoBalance) ||
|
|
40
|
+
(!neoLegacyMigrationAmounts.gasBalance && !neoLegacyMigrationAmounts.neoBalance)) {
|
|
41
|
+
throw new Error('Must have at least 0.1 GAS or 2 NEO');
|
|
42
|
+
}
|
|
43
|
+
const { neonJsAccount, signingCallback } = yield __classPrivateFieldGet(this, _Neo3NeoLegacyMigrationService_service, "f").generateSigningCallback(account);
|
|
44
|
+
const { api, tx, u } = BSNeoLegacyNeonJsSingletonHelper_1.BSNeoLegacyNeonJsSingletonHelper.getInstance();
|
|
45
|
+
const provider = new api.neoCli.instance(__classPrivateFieldGet(this, _Neo3NeoLegacyMigrationService_service, "f").network.url);
|
|
46
|
+
const intents = [];
|
|
47
|
+
if (neoLegacyMigrationAmounts.hasEnoughGasBalance && neoLegacyMigrationAmounts.gasBalance)
|
|
48
|
+
intents.push(...api.makeIntent({ [BSNeoLegacyConstants_1.BSNeoLegacyConstants.GAS_ASSET.symbol]: Number(neoLegacyMigrationAmounts.gasBalance.amount) }, BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_COZ_LEGACY_ADDRESS));
|
|
49
|
+
if (neoLegacyMigrationAmounts.hasEnoughNeoBalance && neoLegacyMigrationAmounts.neoBalance)
|
|
50
|
+
intents.push(...api.makeIntent({ [BSNeoLegacyConstants_1.BSNeoLegacyConstants.NEO_ASSET.symbol]: Number(neoLegacyMigrationAmounts.neoBalance.amount) }, BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_COZ_LEGACY_ADDRESS));
|
|
51
|
+
return yield __classPrivateFieldGet(this, _Neo3NeoLegacyMigrationService_service, "f").sendTransfer({
|
|
52
|
+
url: __classPrivateFieldGet(this, _Neo3NeoLegacyMigrationService_service, "f").network.url,
|
|
53
|
+
api: provider,
|
|
54
|
+
account: neonJsAccount,
|
|
55
|
+
intents,
|
|
56
|
+
signingFunction: signingCallback,
|
|
57
|
+
override: {
|
|
58
|
+
attributes: [
|
|
59
|
+
new tx.TransactionAttribute({
|
|
60
|
+
usage: tx.TxAttrUsage.Remark14,
|
|
61
|
+
data: u.str2hexstring(neo3Address),
|
|
62
|
+
}),
|
|
63
|
+
new tx.TransactionAttribute({
|
|
64
|
+
usage: tx.TxAttrUsage.Remark15,
|
|
65
|
+
data: u.str2hexstring('Neon Desktop Migration'),
|
|
66
|
+
}),
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Reference: https://github.com/CityOfZion/legacy-n3-swap-service/blob/master/policy/policy.go
|
|
74
|
+
*/
|
|
75
|
+
calculateNeo3MigrationAmounts(neoLegacyMigrationAmounts) {
|
|
76
|
+
const response = {
|
|
77
|
+
gasMigrationReceiveAmount: undefined,
|
|
78
|
+
gasMigrationTotalFees: undefined,
|
|
79
|
+
neoMigrationReceiveAmount: undefined,
|
|
80
|
+
neoMigrationTotalFees: undefined,
|
|
81
|
+
};
|
|
82
|
+
if (neoLegacyMigrationAmounts.gasBalance && neoLegacyMigrationAmounts.hasEnoughGasBalance) {
|
|
83
|
+
// Two transfers fee and one transfer fee left over
|
|
84
|
+
const allNep17TransfersFee = BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_NEP_17_TRANSFER_FEE * 3;
|
|
85
|
+
const gasMigrationAmountNumber = Number(neoLegacyMigrationAmounts.gasBalance.amount);
|
|
86
|
+
// Necessary to calculate the COZ fee
|
|
87
|
+
const gasAmountNumberLessAllNep17TransfersFee = gasMigrationAmountNumber - allNep17TransfersFee;
|
|
88
|
+
// Example: ~0.06635710 * 0.01 = ~0.00066357
|
|
89
|
+
const cozFee = gasAmountNumberLessAllNep17TransfersFee * BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_COZ_FEE;
|
|
90
|
+
// Example: ~0.06635710 - ~0.00066357 = ~0.06569352
|
|
91
|
+
const gasAmountNumberLessCozFee = gasAmountNumberLessAllNep17TransfersFee - cozFee;
|
|
92
|
+
const allGasFeeNumberThatUserWillPay = cozFee + BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_NEP_17_TRANSFER_FEE * 2;
|
|
93
|
+
const allGasAmountNumberThatUserWillReceive = gasAmountNumberLessCozFee + BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_NEP_17_TRANSFER_FEE;
|
|
94
|
+
response.gasMigrationTotalFees = blockchain_service_1.BSBigNumberHelper.format(allGasFeeNumberThatUserWillPay, {
|
|
95
|
+
decimals: BSNeoLegacyConstants_1.BSNeoLegacyConstants.GAS_ASSET.decimals,
|
|
96
|
+
});
|
|
97
|
+
response.gasMigrationReceiveAmount = blockchain_service_1.BSBigNumberHelper.format(allGasAmountNumberThatUserWillReceive, {
|
|
98
|
+
decimals: BSNeoLegacyConstants_1.BSNeoLegacyConstants.GAS_ASSET.decimals,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (neoLegacyMigrationAmounts.neoBalance && neoLegacyMigrationAmounts.hasEnoughNeoBalance) {
|
|
102
|
+
const neoMigrationAmountNumber = Number(neoLegacyMigrationAmounts.neoBalance.amount);
|
|
103
|
+
response.neoMigrationTotalFees = blockchain_service_1.BSBigNumberHelper.format(Math.ceil(neoMigrationAmountNumber * BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_COZ_FEE), { decimals: BSNeoLegacyConstants_1.BSNeoLegacyConstants.NEO_ASSET.decimals });
|
|
104
|
+
response.neoMigrationReceiveAmount = blockchain_service_1.BSBigNumberHelper.format(neoMigrationAmountNumber - Number(response.neoMigrationTotalFees), { decimals: BSNeoLegacyConstants_1.BSNeoLegacyConstants.NEO_ASSET.decimals });
|
|
105
|
+
}
|
|
106
|
+
return response;
|
|
107
|
+
}
|
|
108
|
+
calculateNeoLegacyMigrationAmounts(balance) {
|
|
109
|
+
const gasBalance = balance.find(({ token }) => __classPrivateFieldGet(this, _Neo3NeoLegacyMigrationService_service, "f").tokenService.predicateByHash(BSNeoLegacyConstants_1.BSNeoLegacyConstants.GAS_ASSET, token));
|
|
110
|
+
const neoBalance = balance.find(({ token }) => __classPrivateFieldGet(this, _Neo3NeoLegacyMigrationService_service, "f").tokenService.predicateByHash(BSNeoLegacyConstants_1.BSNeoLegacyConstants.NEO_ASSET, token));
|
|
111
|
+
let hasEnoughGasBalance = false;
|
|
112
|
+
let hasEnoughNeoBalance = false;
|
|
113
|
+
if (gasBalance) {
|
|
114
|
+
const gasBalanceNumber = blockchain_service_1.BSBigNumberHelper.fromNumber(gasBalance.amount);
|
|
115
|
+
hasEnoughGasBalance = gasBalanceNumber.isGreaterThanOrEqualTo(BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_MIN_GAS);
|
|
116
|
+
}
|
|
117
|
+
if (neoBalance) {
|
|
118
|
+
const neoBalanceNumber = blockchain_service_1.BSBigNumberHelper.fromNumber(neoBalance.amount);
|
|
119
|
+
hasEnoughNeoBalance = neoBalanceNumber.isGreaterThanOrEqualTo(BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_MIN_NEO);
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
gasBalance,
|
|
123
|
+
neoBalance,
|
|
124
|
+
hasEnoughGasBalance,
|
|
125
|
+
hasEnoughNeoBalance,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
static waitForMigration(params) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
const { neo3Address, neo3Service, transactionHash, neoLegacyService } = params;
|
|
131
|
+
const MAX_ATTEMPTS = 10;
|
|
132
|
+
const NEO3_MAX_ATTEMPTS = 20;
|
|
133
|
+
const response = {
|
|
134
|
+
isTransactionConfirmed: false,
|
|
135
|
+
isNeo3TransactionConfirmed: false,
|
|
136
|
+
};
|
|
137
|
+
let transactionResponse;
|
|
138
|
+
for (let i = 0; i < MAX_ATTEMPTS; i++) {
|
|
139
|
+
yield blockchain_service_1.BSUtilsHelper.wait(30000);
|
|
140
|
+
try {
|
|
141
|
+
transactionResponse = yield neoLegacyService.blockchainDataService.getTransaction(transactionHash);
|
|
142
|
+
response.isTransactionConfirmed = true;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
catch (_a) {
|
|
146
|
+
// Empty block
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (!response.isTransactionConfirmed)
|
|
150
|
+
return response;
|
|
151
|
+
for (let i = 0; i < NEO3_MAX_ATTEMPTS; i++) {
|
|
152
|
+
yield blockchain_service_1.BSUtilsHelper.wait(60000);
|
|
153
|
+
try {
|
|
154
|
+
const neo3Response = yield neo3Service.blockchainDataService.getTransactionsByAddress({
|
|
155
|
+
address: neo3Address,
|
|
156
|
+
});
|
|
157
|
+
const isTransactionConfirmed = neo3Response.transactions.some(transaction => transaction.time > transactionResponse.time &&
|
|
158
|
+
transaction.transfers.some(transfer => transfer.from === BSNeoLegacyConstants_1.BSNeoLegacyConstants.MIGRATION_COZ_NEO3_ADDRESS));
|
|
159
|
+
if (isTransactionConfirmed) {
|
|
160
|
+
response.isNeo3TransactionConfirmed = true;
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
catch (_b) {
|
|
165
|
+
// Empty block
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return response;
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
exports.Neo3NeoLegacyMigrationService = Neo3NeoLegacyMigrationService;
|
|
173
|
+
_Neo3NeoLegacyMigrationService_service = new WeakMap();
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TBSAccount, TBalanceResponse, IBlockchainService, IBSWithClaim, IBSWithEncryption, IBSWithExplorer, IBSWithLedger, TBSNetworkId } from '@cityofzion/blockchain-service';
|
|
2
|
+
export type TBSNeoLegacyNetworkId = TBSNetworkId<'mainnet' | 'testnet'>;
|
|
3
|
+
export type TSigningCallback = (transaction: string, publicKey: string) => Promise<string | string[]>;
|
|
4
|
+
export interface IBSNeoLegacy<N extends string = string> extends IBlockchainService<N, TBSNeoLegacyNetworkId>, IBSWithClaim<N>, IBSWithExplorer, IBSWithLedger<N>, IBSWithEncryption<N> {
|
|
5
|
+
generateSigningCallback(account: TBSAccount<N>): Promise<{
|
|
6
|
+
neonJsAccount: any;
|
|
7
|
+
signingCallback: TSigningCallback;
|
|
8
|
+
}>;
|
|
9
|
+
sendTransfer(config: any, nep5ScriptBuilder?: any): Promise<string>;
|
|
10
|
+
}
|
|
11
|
+
export type TNeo3NeoLegacyWaitForMigrationParams = {
|
|
12
|
+
transactionHash: string;
|
|
13
|
+
neo3Address: string;
|
|
14
|
+
neo3Service: IBlockchainService;
|
|
15
|
+
neoLegacyService: IBlockchainService;
|
|
16
|
+
};
|
|
17
|
+
export type TNeo3NeoLegacyMigrateParams<N extends string = string> = {
|
|
18
|
+
account: TBSAccount<N>;
|
|
19
|
+
neo3Address: string;
|
|
20
|
+
neoLegacyMigrationAmounts: TNeo3NeoLegacyMigrationNeoLegacyAmounts;
|
|
21
|
+
};
|
|
22
|
+
export type TNeo3NeoLegacyMigrationNeo3Amounts = {
|
|
23
|
+
gasMigrationTotalFees?: string;
|
|
24
|
+
neoMigrationTotalFees?: string;
|
|
25
|
+
gasMigrationReceiveAmount?: string;
|
|
26
|
+
neoMigrationReceiveAmount?: string;
|
|
27
|
+
};
|
|
28
|
+
export type TNeo3NeoLegacyMigrationNeoLegacyAmounts = {
|
|
29
|
+
hasEnoughGasBalance: boolean;
|
|
30
|
+
hasEnoughNeoBalance: boolean;
|
|
31
|
+
gasBalance?: TBalanceResponse;
|
|
32
|
+
neoBalance?: TBalanceResponse;
|
|
33
|
+
};
|
|
34
|
+
export declare enum ENeonJsLedgerServiceNeoLegacyStatus {
|
|
35
|
+
OK = 36864
|
|
36
|
+
}
|
|
37
|
+
export declare enum ENeonJsLedgerServiceNeoLegacyCommand {
|
|
38
|
+
GET_PUBLIC_KEY = 4,
|
|
39
|
+
SIGN = 2
|
|
40
|
+
}
|
|
41
|
+
export declare enum ENeonJsLedgerServiceNeoLegacyParameter {
|
|
42
|
+
MORE_DATA = 0,
|
|
43
|
+
LAST_DATA = 128
|
|
44
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ENeonJsLedgerServiceNeoLegacyParameter = exports.ENeonJsLedgerServiceNeoLegacyCommand = exports.ENeonJsLedgerServiceNeoLegacyStatus = void 0;
|
|
4
|
+
var ENeonJsLedgerServiceNeoLegacyStatus;
|
|
5
|
+
(function (ENeonJsLedgerServiceNeoLegacyStatus) {
|
|
6
|
+
ENeonJsLedgerServiceNeoLegacyStatus[ENeonJsLedgerServiceNeoLegacyStatus["OK"] = 36864] = "OK";
|
|
7
|
+
})(ENeonJsLedgerServiceNeoLegacyStatus || (exports.ENeonJsLedgerServiceNeoLegacyStatus = ENeonJsLedgerServiceNeoLegacyStatus = {}));
|
|
8
|
+
var ENeonJsLedgerServiceNeoLegacyCommand;
|
|
9
|
+
(function (ENeonJsLedgerServiceNeoLegacyCommand) {
|
|
10
|
+
ENeonJsLedgerServiceNeoLegacyCommand[ENeonJsLedgerServiceNeoLegacyCommand["GET_PUBLIC_KEY"] = 4] = "GET_PUBLIC_KEY";
|
|
11
|
+
ENeonJsLedgerServiceNeoLegacyCommand[ENeonJsLedgerServiceNeoLegacyCommand["SIGN"] = 2] = "SIGN";
|
|
12
|
+
})(ENeonJsLedgerServiceNeoLegacyCommand || (exports.ENeonJsLedgerServiceNeoLegacyCommand = ENeonJsLedgerServiceNeoLegacyCommand = {}));
|
|
13
|
+
var ENeonJsLedgerServiceNeoLegacyParameter;
|
|
14
|
+
(function (ENeonJsLedgerServiceNeoLegacyParameter) {
|
|
15
|
+
ENeonJsLedgerServiceNeoLegacyParameter[ENeonJsLedgerServiceNeoLegacyParameter["MORE_DATA"] = 0] = "MORE_DATA";
|
|
16
|
+
ENeonJsLedgerServiceNeoLegacyParameter[ENeonJsLedgerServiceNeoLegacyParameter["LAST_DATA"] = 128] = "LAST_DATA";
|
|
17
|
+
})(ENeonJsLedgerServiceNeoLegacyParameter || (exports.ENeonJsLedgerServiceNeoLegacyParameter = ENeonJsLedgerServiceNeoLegacyParameter = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-neo-legacy",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.5",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"author": "Coz",
|
|
@@ -9,30 +9,28 @@
|
|
|
9
9
|
"/dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@cityofzion/dora-ts": "0.5.1",
|
|
12
|
+
"@cityofzion/dora-ts": "~0.5.1",
|
|
13
13
|
"@cityofzion/neon-js": "4.8.3",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"date-fns": "~4.1.0",
|
|
17
|
-
"@cityofzion/blockchain-service": "1.21.2",
|
|
18
|
-
"@cityofzion/bs-asteroid-sdk": "0.9.1"
|
|
14
|
+
"axios": "~1.12.2",
|
|
15
|
+
"@cityofzion/blockchain-service": "1.21.3"
|
|
19
16
|
},
|
|
20
17
|
"devDependencies": {
|
|
21
|
-
"@types/jest": "
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
24
|
-
"
|
|
25
|
-
"dotenv": "
|
|
26
|
-
"eslint": "
|
|
27
|
-
"jest": "
|
|
28
|
-
"ts-jest": "~29.4.
|
|
18
|
+
"@types/jest": "~30.0.0",
|
|
19
|
+
"@ledgerhq/hw-transport": "~6.31.11",
|
|
20
|
+
"@ledgerhq/hw-transport-node-hid": "~6.29.12",
|
|
21
|
+
"date-fns": "~4.1.0",
|
|
22
|
+
"dotenv": "~17.2.2",
|
|
23
|
+
"eslint": "~9.36.0",
|
|
24
|
+
"jest": "~30.1.3",
|
|
25
|
+
"ts-jest": "~29.4.4",
|
|
29
26
|
"ts-node": "~10.9.2",
|
|
30
|
-
"typescript": "
|
|
27
|
+
"typescript": "~5.9.2"
|
|
31
28
|
},
|
|
32
29
|
"scripts": {
|
|
33
|
-
"build": "tsc --project tsconfig.build.json",
|
|
30
|
+
"build": "rm -rf ./dist && tsc --project tsconfig.build.json",
|
|
34
31
|
"test": "jest --config jest.config.ts",
|
|
35
32
|
"lint": "eslint .",
|
|
36
|
-
"format": "eslint --fix"
|
|
33
|
+
"format": "eslint . --fix",
|
|
34
|
+
"package": "npm run build && npm pack"
|
|
37
35
|
}
|
|
38
36
|
}
|