@cityofzion/bs-neo3 0.4.2 → 0.7.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.
Files changed (73) hide show
  1. package/.rush/temp/operation/build/state.json +1 -1
  2. package/.rush/temp/package-deps_build.json +20 -0
  3. package/.rush/temp/shrinkwrap-deps.json +2 -2
  4. package/bs-neo3.build.log +1 -86
  5. package/dist/BSNeo3.d.ts +22 -12
  6. package/dist/BSNeo3.js +85 -55
  7. package/dist/constants.d.ts +10 -3
  8. package/docs/assets/search.js +1 -1
  9. package/docs/classes/BDSNeo3.html +13 -13
  10. package/docs/classes/BSNeo3.html +80 -36
  11. package/docs/interfaces/DoraNeo3Abi.html +6 -6
  12. package/docs/interfaces/DoraNeo3Asset.html +9 -9
  13. package/docs/interfaces/DoraNeo3AssetState.html +6 -6
  14. package/docs/interfaces/DoraNeo3Balance.html +5 -5
  15. package/docs/interfaces/DoraNeo3ConsensusNode.html +3 -3
  16. package/docs/interfaces/DoraNeo3Contract.html +8 -8
  17. package/docs/interfaces/DoraNeo3Event.html +3 -3
  18. package/docs/interfaces/DoraNeo3Features.html +1 -1
  19. package/docs/interfaces/DoraNeo3HistoryState.html +3 -3
  20. package/docs/interfaces/DoraNeo3Invocation.html +3 -3
  21. package/docs/interfaces/DoraNeo3Item.html +11 -11
  22. package/docs/interfaces/DoraNeo3Manifest.html +9 -9
  23. package/docs/interfaces/DoraNeo3Metadata.html +12 -12
  24. package/docs/interfaces/DoraNeo3Method.html +12 -12
  25. package/docs/interfaces/DoraNeo3Nef.html +7 -7
  26. package/docs/interfaces/DoraNeo3Notification.html +4 -4
  27. package/docs/interfaces/DoraNeo3Parameter.html +3 -3
  28. package/docs/interfaces/DoraNeo3Permission.html +3 -3
  29. package/docs/interfaces/DoraNeo3Signer.html +3 -3
  30. package/docs/interfaces/DoraNeo3Token.html +6 -6
  31. package/docs/interfaces/DoraNeo3Transaction.html +16 -16
  32. package/docs/interfaces/DoraNeo3TransactionHistory.html +3 -3
  33. package/docs/interfaces/DoraNeo3Transfer.html +9 -9
  34. package/docs/interfaces/DoraNeo3Witness.html +3 -3
  35. package/docs/variables/DORA_ASSET.html +1 -1
  36. package/docs/variables/DORA_BALANCE.html +1 -1
  37. package/docs/variables/DORA_CONTRACT.html +1 -1
  38. package/docs/variables/DORA_NODES.html +1 -1
  39. package/docs/variables/DORA_TRANSACTION.html +1 -1
  40. package/docs/variables/DORA_TRANSACTIONS.html +1 -1
  41. package/docs/variables/explorerOptions.html +1 -1
  42. package/docs/variables/gasInfoNeo3.html +11 -2
  43. package/docs/variables/neoInfoNeo3.html +11 -2
  44. package/jest.config.ts +13 -0
  45. package/jest.setup.ts +1 -0
  46. package/package.json +14 -6
  47. package/src/BSNeo3.ts +221 -221
  48. package/src/DoraBDSNeo3.ts +180 -0
  49. package/src/FlamingoEDSNeo3.ts +45 -0
  50. package/src/GhostMarketNDSNeo3.ts +117 -0
  51. package/src/RpcBDSNeo3.ts +155 -0
  52. package/src/__tests__/BDSNeo3.spec.ts +126 -0
  53. package/src/__tests__/BSNeo3.spec.ts +142 -0
  54. package/src/__tests__/FlamingoEDSNeo3.spec.ts +45 -0
  55. package/src/__tests__/GhostMarketNDSNeo3.spec.ts +43 -0
  56. package/src/__tests__/utils/sleep.ts +1 -0
  57. package/src/assets/tokens/common.json +14 -0
  58. package/src/assets/tokens/mainnet.json +116 -0
  59. package/src/constants.ts +26 -10
  60. package/src/index.ts +4 -2
  61. package/tsconfig.build.json +4 -0
  62. package/tsconfig.json +3 -7
  63. package/bs-neo3.build.error.log +0 -84
  64. package/dist/excpetions.d.ts +0 -3
  65. package/dist/excpetions.js +0 -8
  66. package/src/BDSNeo3.ts +0 -168
  67. package/src/assets/blockchain_icon_neo.png +0 -0
  68. package/src/assets/blockchain_icon_neo_white.png +0 -0
  69. package/src/assets/tokens.json +0 -129
  70. package/src/exceptions.ts +0 -5
  71. package/src/explorer/dora/DoraNeo3Responses.ts +0 -207
  72. package/src/explorer/dora/DoraNeo3Routes.ts +0 -6
  73. package/src/explorer/index.ts +0 -8
@@ -1,3 +1,3 @@
1
1
  {
2
- "nonCachedDurationMs": 5226.010300010443
2
+ "nonCachedDurationMs": 2617.5048999786377
3
3
  }
@@ -0,0 +1,20 @@
1
+ {
2
+ "files": {
3
+ "packages/bs-neo3/package.json": "a239a2b9bf9ca2018c2e40f47bef83b52f048760",
4
+ "packages/bs-neo3/src/BDSNeo3.ts": "6de6c505219ad5404357ba195b9b59b368fc574f",
5
+ "packages/bs-neo3/src/BSNeo3.ts": "39c473d9be67c3cd0ccf253fd037d1c9ea881027",
6
+ "packages/bs-neo3/src/assets/blockchain_icon_neo.png": "3b3c8c019cc3ab191648acd69b07663006abf495",
7
+ "packages/bs-neo3/src/assets/blockchain_icon_neo_white.png": "feaec214f1374496e428254d8d014a8aa39b7067",
8
+ "packages/bs-neo3/src/assets/tokens.json": "33d65a4a123ae414a95b0caf031c6d62eb715349",
9
+ "packages/bs-neo3/src/constants.ts": "39993e77862b88d771441980cf39a091ae5dee3a",
10
+ "packages/bs-neo3/src/exceptions.ts": "c7b6401d197e363dca8241b92a4304c227e7800f",
11
+ "packages/bs-neo3/src/explorer/dora/DoraNeo3Responses.ts": "6ccd07c95af63d966ef370ae8861cb37783cc4da",
12
+ "packages/bs-neo3/src/explorer/dora/DoraNeo3Routes.ts": "b6b4b85492e1a9611f0f88c2d9836371f1fba20b",
13
+ "packages/bs-neo3/src/explorer/index.ts": "4e892cff669a805bf2f9cc29554bdfc4e43af6c1",
14
+ "packages/bs-neo3/src/index.ts": "53f10ade66205f959dca69e06c4d2b73d045424a",
15
+ "packages/bs-neo3/tsconfig.json": "9c0d05b4a1620310c7310c1d18e7b1afb1977ff9",
16
+ "packages/bs-neo3/yarn.lock": "5bb25dd89095cbb23ce0906458c1234eb7da3ba2",
17
+ "packages/bs-neo3/.rush/temp/shrinkwrap-deps.json": "44f504325b8dc37c61401f680f09cbf5fe4786ab"
18
+ },
19
+ "arguments": "tsc && typedoc src/index.ts "
20
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
- "../../packages/bs-neo3": "../../packages/bs-neo3:wznx1aeGJheOTd9WDdXQC6xrlwb1EGnliJ0EFBUEQ08=:",
3
- "/@cityofzion/blockchain-service/0.3.2": "sha512-C84+HmZpgh5ThD0YhvVWH8arAPx7q9FKOLkct5k76v/kkDqb7s0h7xH99Yw01+BjZYOktOcTRJo31ao4QtQGdw==",
2
+ "../../packages/bs-neo3": "../../packages/bs-neo3:5AjwK6LRNSM9TOZOCykvRPdKq8cRSeT4mf6AxYY5YFU=:",
3
+ "/@cityofzion/blockchain-service/0.3.0": "sha512-Qe/lVI8tCAAVZZNeBglZEFrqS9khjihc5jkiiEobi6CY4l1z6uFj/xSGQ7Nnz2QlTNQ8DjUqN05iDjKuy+4LLA==",
4
4
  "/@cityofzion/dora-ts/0.0.11": "sha512-LJWGU29BHPTHkt0i/OwhNdMfUGM/rgAa4rqlDwBy95spxSoUHGSoAtOD5k4aSVKmLFwq77ghNna0Lpc7lEuHBA==",
5
5
  "/@cityofzion/neo3-invoker/1.4.0": "sha512-BOqJA2e6Kq3QPL/kaMYEjpPCeh9fdKTzRjEi9oIxi0MY5B7nj4rhAVl4l2A06jGNboi+VhToo/gJ/ZVzW/GaeQ==",
6
6
  "/@cityofzion/neo3-parser/1.6.0": "sha512-K+j3qaZEuq1cxit+fFziwAAc0hMQTdACbtllU1HUKJZ89dw7z/FY3Bmg12cyZ8tXuiktCloXvUT0Mg/IzoYqdg==",
package/bs-neo3.build.log CHANGED
@@ -1,87 +1,2 @@
1
- Invoking: tsc && typedoc
2
-
3
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:140:0 - warning BlockchainDataService is referenced by BDSNeo3 but not included in the documentation.
4
-
5
- 140 export interface BlockchainDataService {
6
-
7
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:137:0 - warning BDSClaimable is referenced by BDSNeo3 but not included in the documentation.
8
-
9
- 137 export interface BDSClaimable {
10
-
11
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:60:0 - warning BlockchainService is referenced by BSNeo3 but not included in the documentation.
12
-
13
- 60 export interface BlockchainService<BSCustomName extends string = string> {
14
-
15
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:30:0 - warning Claimable is referenced by BSNeo3 but not included in the documentation.
16
-
17
- 30 export interface Claimable {
18
-
19
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:41:0 - warning NeoNameService is referenced by BSNeo3 but not included in the documentation.
20
-
21
- 41 export interface NeoNameService {
22
-
23
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:11:0 - warning TokenInfo is referenced by gasInfoNeo3 but not included in the documentation.
24
-
25
- 11 export type TokenInfo = {
26
-
27
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:126:0 - warning BlockchainNetwork is referenced by BDSNeo3.network but not included in the documentation.
28
-
29
- 126 export type BlockchainNetwork = "mainnet" | "testnet" | "privatenet";
30
-
31
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:156:0 - warning Exchange is referenced by BSNeo3.exchange but not included in the documentation.
32
-
33
- 156 export interface Exchange {
34
-
35
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:46:0 - warning Token is referenced by BSNeo3.tokens but not included in the documentation.
36
-
37
- 46 export type Token = {
38
-
39
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:84:0 - warning TransactionResponse is referenced by BDSNeo3.findTransactionByTxid.findTransactionByTxid but not included in the documentation.
40
-
41
- 84 export type TransactionResponse = {
42
-
43
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:118:0 - warning ConsensusNodeResponse is referenced by BDSNeo3.getAllNodes.getAllNodes but not included in the documentation.
44
-
45
- 118 export type ConsensusNodeResponse = {
46
-
47
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:127:0 - warning BalanceResponse is referenced by BDSNeo3.getBalance.getBalance but not included in the documentation.
48
-
49
- 127 export type BalanceResponse = {
50
-
51
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:113:0 - warning ContractResponse is referenced by BDSNeo3.getContract.getContract but not included in the documentation.
52
-
53
- 113 export type ContractResponse = {
54
-
55
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:105:0 - warning TransactionHistoryResponse is referenced by BDSNeo3.getHistoryTransactions.getHistoryTransactions but not included in the documentation.
56
-
57
- 105 export type TransactionHistoryResponse = {
58
-
59
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:122:0 - warning TokenInfoResponse is referenced by BDSNeo3.getTokenInfo.getTokenInfo but not included in the documentation.
60
-
61
- 122 export type TokenInfoResponse = {
62
-
63
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:133:0 - warning UnclaimedResponse is referenced by BDSNeo3.getUnclaimed.getUnclaimed but not included in the documentation.
64
-
65
- 133 export type UnclaimedResponse = {
66
-
67
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:56:0 - warning CalculateTransferFeeResponse is referenced by BSNeo3.calculateTransferFee.calculateTransferFee but not included in the documentation.
68
-
69
- 56 export type CalculateTransferFeeResponse = {
70
-
71
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:52:0 - warning Account is referenced by BSNeo3.decryptKey.decryptKey but not included in the documentation.
72
-
73
- 52 export type Account = {
74
-
75
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:6:0 - warning IntentTransactionParam is referenced by BSNeo3.buildTransfer.buildTransfer.transactionIntents but not included in the documentation.
76
-
77
- 6 export type IntentTransactionParam = {
78
-
79
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:1:0 - warning SendTransactionParam is referenced by BSNeo3.calculateTransferFee.calculateTransferFee.param but not included in the documentation.
80
-
81
- 1 export type SendTransactionParam = {
82
-
83
- C:/Workspace/blockchain-services/packages/blockchain-service/dist/interfaces.d.ts:35:0 - warning NNSRecordTypes is referenced by BSNeo3.getNNSRecord.getNNSRecord.type but not included in the documentation.
84
-
85
- 35 export declare enum NNSRecordTypes {
86
-
1
+ Invoking: tsc && typedoc src/index.ts
87
2
  Documentation generated at ./docs
package/dist/BSNeo3.d.ts CHANGED
@@ -1,23 +1,34 @@
1
- import { BlockchainDataService, BlockchainService, SendTransactionParam, TokenInfo, Claimable, Account, Exchange, BDSClaimable, Token, NeoNameService, NNSRecordTypes, CalculateTransferFeeResponse } from '@cityofzion/blockchain-service';
1
+ import { BlockchainDataService, BlockchainService, SendTransactionParam, Claimable, Account, Exchange, BDSClaimable, Token, NeoNameService, NNSRecordTypes, CalculateTransferFeeResponse } from '@cityofzion/blockchain-service';
2
2
  export declare class BSNeo3<BSCustomName extends string = string> implements BlockchainService, Claimable, NeoNameService {
3
3
  blockchainName: BSCustomName;
4
4
  dataService: BlockchainDataService & BDSClaimable;
5
- feeToken: TokenInfo;
5
+ derivationPath: string;
6
+ feeToken: {
7
+ hash: string;
8
+ symbol: string;
9
+ decimals: number;
10
+ };
6
11
  exchange: Exchange;
7
- tokenClaim: TokenInfo;
12
+ tokenClaim: {
13
+ hash: string;
14
+ symbol: string;
15
+ decimals: number;
16
+ };
8
17
  tokens: Token[];
9
- private derivationPath;
18
+ private keychain;
10
19
  constructor(blockchainName: BSCustomName);
20
+ sendTransaction(param: SendTransactionParam): Promise<string>;
21
+ private buildTransfer;
22
+ private signTransfer;
23
+ generateMnemonic(): string;
24
+ generateWif(mnemonic: string, index: number): string;
25
+ generateAccount(mnemonic: string, index: number): Account;
26
+ generateAccountFromWif(wif: string): string;
27
+ decryptKey(encryptedKey: string, password: string): Promise<Account>;
11
28
  validateAddress(address: string): boolean;
12
29
  validateEncryptedKey(encryptedKey: string): boolean;
13
30
  validateWif(wif: string): boolean;
14
- validateNNSFormat(domainName: string): boolean;
15
- generateMnemonic(): string[];
16
- generateAccount(mnemonic: string[], index: number): Account;
17
- generateAccountFromWif(wif: string): Account;
18
- decryptKey(encryptedKey: string, password: string): Promise<Account>;
19
31
  calculateTransferFee(param: SendTransactionParam): Promise<CalculateTransferFeeResponse>;
20
- sendTransaction(param: SendTransactionParam): Promise<string>;
21
32
  claim(account: Account): Promise<{
22
33
  txid: string;
23
34
  symbol: string;
@@ -25,6 +36,5 @@ export declare class BSNeo3<BSCustomName extends string = string> implements Blo
25
36
  }>;
26
37
  getNNSRecord(domainName: string, type: NNSRecordTypes): Promise<any>;
27
38
  getOwnerOfNNS(domainName: string): Promise<any>;
28
- private buildTransfer;
29
- private signTransfer;
39
+ validateNNSFormat(domainName: string): boolean;
30
40
  }
package/dist/BSNeo3.js CHANGED
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -15,6 +38,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
38
  exports.BSNeo3 = void 0;
16
39
  const blockchain_service_1 = require("@cityofzion/blockchain-service");
17
40
  const neon_js_1 = require("@cityofzion/neon-js");
41
+ const AsteroidSDK = __importStar(require("@moonlight-io/asteroid-sdk-js"));
18
42
  const constants_1 = require("./constants");
19
43
  const exceptions_1 = require("./exceptions");
20
44
  const explorer_1 = require("./explorer");
@@ -26,43 +50,72 @@ const NEO_NS_HASH = "0x50ac1c37690cc2cfc594472833cf57505d5f46de";
26
50
  class BSNeo3 {
27
51
  constructor(blockchainName) {
28
52
  this.dataService = explorer_1.explorerOptions.dora;
53
+ this.derivationPath = "m/44'/888'/0'/0/?";
29
54
  this.feeToken = constants_1.gasInfoNeo3;
30
55
  this.exchange = blockchain_service_1.exchangeOptions.flamingo;
31
56
  this.tokenClaim = constants_1.neoInfoNeo3;
32
57
  this.tokens = tokens_json_1.default;
33
- this.derivationPath = "m/44'/888'/0'/0/?";
58
+ this.keychain = new AsteroidSDK.Keychain();
34
59
  this.blockchainName = blockchainName;
35
60
  }
36
- validateAddress(address) {
37
- return neon_js_1.wallet.isAddress(address, 53);
38
- }
39
- validateEncryptedKey(encryptedKey) {
40
- return neon_js_1.wallet.isNEP2(encryptedKey);
61
+ sendTransaction(param) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ try {
64
+ const { senderAccount, transactionIntents } = param;
65
+ const node = yield this.dataService.getHigherNode();
66
+ const facade = yield neon_js_1.api.NetworkFacade.fromConfig({ node: node.url });
67
+ const intents = this.buildTransfer(transactionIntents, senderAccount);
68
+ const signing = this.signTransfer(senderAccount);
69
+ const result = yield facade.transferToken(intents, signing);
70
+ return result;
71
+ }
72
+ catch (error) {
73
+ throw error;
74
+ }
75
+ });
41
76
  }
42
- validateWif(wif) {
43
- return neon_js_1.wallet.isWIF(wif);
77
+ buildTransfer(transactionIntents, account) {
78
+ const intents = [];
79
+ const neoAccount = new neon_js_1.wallet.Account(account.wif);
80
+ for (const transactionIntent of transactionIntents) {
81
+ const { amount, receiverAddress, tokenHash } = transactionIntent;
82
+ intents.push({
83
+ to: receiverAddress,
84
+ contractHash: tokenHash,
85
+ from: neoAccount,
86
+ decimalAmt: amount,
87
+ });
88
+ }
89
+ return intents;
44
90
  }
45
- validateNNSFormat(domainName) {
46
- if (!domainName.endsWith('.neo'))
47
- return false;
48
- return true;
91
+ signTransfer(account) {
92
+ const neoAccount = new neon_js_1.wallet.Account(account.address);
93
+ const result = {
94
+ signingCallback: neon_js_1.api.signWithAccount(neoAccount)
95
+ };
96
+ return result;
49
97
  }
50
98
  generateMnemonic() {
51
- blockchain_service_1.keychain.generateMnemonic(128);
52
- if (!blockchain_service_1.keychain.mnemonic)
99
+ var _a;
100
+ this.keychain.generateMnemonic(128);
101
+ const list = (_a = this.keychain.mnemonic) === null || _a === void 0 ? void 0 : _a.toString();
102
+ if (!list)
53
103
  throw new Error("Failed to generate mnemonic");
54
- return blockchain_service_1.keychain.mnemonic.toString().split(' ');
104
+ return list;
105
+ }
106
+ generateWif(mnemonic, index) {
107
+ this.keychain.importMnemonic(mnemonic);
108
+ const childKey = this.keychain.generateChildKey('neo', this.derivationPath.replace('?', index.toString()));
109
+ return childKey.getWIF();
55
110
  }
56
111
  generateAccount(mnemonic, index) {
57
- blockchain_service_1.keychain.importMnemonic(mnemonic.join(' '));
58
- const childKey = blockchain_service_1.keychain.generateChildKey("neo", this.derivationPath.replace('?', index.toString()));
59
- const wif = childKey.getWIF();
112
+ const wif = this.generateWif(mnemonic, index);
60
113
  const { address } = new neon_js_1.wallet.Account(wif);
61
114
  return { address, wif };
62
115
  }
63
116
  generateAccountFromWif(wif) {
64
117
  const { address } = new neon_js_1.wallet.Account(wif);
65
- return { address, wif };
118
+ return address;
66
119
  }
67
120
  decryptKey(encryptedKey, password) {
68
121
  return __awaiter(this, void 0, void 0, function* () {
@@ -71,6 +124,15 @@ class BSNeo3 {
71
124
  return { address, wif };
72
125
  });
73
126
  }
127
+ validateAddress(address) {
128
+ return neon_js_1.wallet.isAddress(address);
129
+ }
130
+ validateEncryptedKey(encryptedKey) {
131
+ return neon_js_1.wallet.isNEP2(encryptedKey);
132
+ }
133
+ validateWif(wif) {
134
+ return neon_js_1.wallet.isWIF(wif);
135
+ }
74
136
  calculateTransferFee(param) {
75
137
  return __awaiter(this, void 0, void 0, function* () {
76
138
  const node = yield this.dataService.getHigherNode();
@@ -107,22 +169,6 @@ class BSNeo3 {
107
169
  return result;
108
170
  });
109
171
  }
110
- sendTransaction(param) {
111
- return __awaiter(this, void 0, void 0, function* () {
112
- try {
113
- const { senderAccount, transactionIntents } = param;
114
- const node = yield this.dataService.getHigherNode();
115
- const facade = yield neon_js_1.api.NetworkFacade.fromConfig({ node: node.url });
116
- const intents = this.buildTransfer(transactionIntents, senderAccount);
117
- const signing = this.signTransfer(senderAccount);
118
- const result = yield facade.transferToken(intents, signing);
119
- return result;
120
- }
121
- catch (error) {
122
- throw error;
123
- }
124
- });
125
- }
126
172
  //Claimable interface implementation
127
173
  claim(account) {
128
174
  return __awaiter(this, void 0, void 0, function* () {
@@ -195,26 +241,10 @@ class BSNeo3 {
195
241
  return address;
196
242
  });
197
243
  }
198
- buildTransfer(transactionIntents, account) {
199
- const intents = [];
200
- const neoAccount = new neon_js_1.wallet.Account(account.wif);
201
- for (const transactionIntent of transactionIntents) {
202
- const { amount, receiverAddress, tokenHash } = transactionIntent;
203
- intents.push({
204
- to: receiverAddress,
205
- contractHash: tokenHash,
206
- from: neoAccount,
207
- decimalAmt: amount,
208
- });
209
- }
210
- return intents;
211
- }
212
- signTransfer(account) {
213
- const neoAccount = new neon_js_1.wallet.Account(account.address);
214
- const result = {
215
- signingCallback: neon_js_1.api.signWithAccount(neoAccount)
216
- };
217
- return result;
244
+ validateNNSFormat(domainName) {
245
+ if (!domainName.endsWith('.neo'))
246
+ return false;
247
+ return true;
218
248
  }
219
249
  }
220
250
  exports.BSNeo3 = BSNeo3;
@@ -1,3 +1,10 @@
1
- import { TokenInfo } from '@cityofzion/blockchain-service';
2
- export declare const gasInfoNeo3: TokenInfo;
3
- export declare const neoInfoNeo3: TokenInfo;
1
+ export declare const gasInfoNeo3: {
2
+ hash: string;
3
+ symbol: string;
4
+ decimals: number;
5
+ };
6
+ export declare const neoInfoNeo3: {
7
+ hash: string;
8
+ symbol: string;
9
+ decimals: number;
10
+ };