@cityofzion/bs-neo3 1.16.1 → 1.16.3

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.
@@ -315,7 +315,7 @@ class DoraBDSNeo3 extends RpcBDSNeo3_1.RpcBDSNeo3 {
315
315
  if (cachedToken) {
316
316
  return cachedToken;
317
317
  }
318
- let token = this._tokens.find(this._tokenService.predicateByHash(tokenHash));
318
+ let token = this._tokens.find(currentToken => this._tokenService.predicateByHash(tokenHash, currentToken));
319
319
  if (!token) {
320
320
  const { decimals, symbol, name, scripthash } = yield exports.DoraNeoRest.asset(tokenHash, this._network.id);
321
321
  token = this._tokenService.normalizeToken({
@@ -399,7 +399,7 @@ _DoraBDSNeo3_supportedNep11Standards = new WeakMap(), _DoraBDSNeo3_nftDataServic
399
399
  if (!byteStringReceiverAddress)
400
400
  return undefined;
401
401
  const receiverAddress = `0x${neon_js_1.u.HexString.fromBase64(byteStringReceiverAddress).toLittleEndian()}`;
402
- const token = __classPrivateFieldGet(this, _DoraBDSNeo3_neo3NeoXBridgeService, "f").tokens.find(this._tokenService.predicateByHash(isNativeToken ? BSNeo3Constants_1.BSNeo3Constants.GAS_TOKEN : BSNeo3Constants_1.BSNeo3Constants.NEO_TOKEN));
402
+ const token = __classPrivateFieldGet(this, _DoraBDSNeo3_neo3NeoXBridgeService, "f").tokens.find(currentToken => this._tokenService.predicateByHash(isNativeToken ? BSNeo3Constants_1.BSNeo3Constants.GAS_TOKEN : BSNeo3Constants_1.BSNeo3Constants.NEO_TOKEN, currentToken));
403
403
  if (!token)
404
404
  return undefined;
405
405
  return { amount, token, receiverAddress };
@@ -92,7 +92,7 @@ class RpcBDSNeo3 {
92
92
  if (cachedToken) {
93
93
  return cachedToken;
94
94
  }
95
- let token = this._tokens.find(this._tokenService.predicateByHash(tokenHash));
95
+ let token = this._tokens.find(currentToken => this._tokenService.predicateByHash(tokenHash, currentToken));
96
96
  if (!token) {
97
97
  const rpcClient = new neon_core_1.rpc.RPCClient(this._network.url);
98
98
  const contractState = yield rpcClient.getContractState(tokenHash);
@@ -51,7 +51,7 @@ class Neo3NeoXBridgeService {
51
51
  const invoker = yield neon_dappkit_1.NeonInvoker.init({
52
52
  rpcAddress: __classPrivateFieldGet(this, _Neo3NeoXBridgeService_service, "f").network.url,
53
53
  });
54
- const isNativeToken = __classPrivateFieldGet(this, _Neo3NeoXBridgeService_service, "f").tokenService.predicateByHash(token)(BSNeo3Constants_1.BSNeo3Constants.GAS_TOKEN);
54
+ const isNativeToken = __classPrivateFieldGet(this, _Neo3NeoXBridgeService_service, "f").tokenService.predicateByHash(token, BSNeo3Constants_1.BSNeo3Constants.GAS_TOKEN);
55
55
  let invocations;
56
56
  if (isNativeToken) {
57
57
  invocations = [
@@ -132,16 +132,15 @@ class Neo3NeoXBridgeService {
132
132
  scopes: 16,
133
133
  allowedContracts: [this.BRIDGE_SCRIPT_HASH, BSNeo3Constants_1.BSNeo3Constants.GAS_TOKEN.hash],
134
134
  };
135
- const isNativeToken = __classPrivateFieldGet(this, _Neo3NeoXBridgeService_service, "f").tokenService.predicateByHash(params.token)(BSNeo3Constants_1.BSNeo3Constants.GAS_TOKEN);
135
+ const isNativeToken = __classPrivateFieldGet(this, _Neo3NeoXBridgeService_service, "f").tokenService.predicateByHash(params.token, BSNeo3Constants_1.BSNeo3Constants.GAS_TOKEN);
136
136
  if (!isNativeToken) {
137
137
  (_a = contractInvocation.args) === null || _a === void 0 ? void 0 : _a.unshift({ type: 'Hash160', value: BSNeo3Constants_1.BSNeo3Constants.NEO_TOKEN.hash });
138
138
  (_b = signer.allowedContracts) === null || _b === void 0 ? void 0 : _b.push(BSNeo3Constants_1.BSNeo3Constants.NEO_TOKEN.hash);
139
139
  }
140
- const transactionHash = yield invoker.invokeFunction({
140
+ return yield invoker.invokeFunction({
141
141
  invocations: [contractInvocation],
142
142
  signers: [signer],
143
143
  });
144
- return transactionHash;
145
144
  });
146
145
  }
147
146
  getNonce(params) {
@@ -157,7 +156,7 @@ class Neo3NeoXBridgeService {
157
156
  if ((log === null || log === void 0 ? void 0 : log.vmstate) !== 'HALT') {
158
157
  throw new blockchain_service_1.BSError('Transaction invalid', 'INVALID_TRANSACTION');
159
158
  }
160
- const isNativeToken = __classPrivateFieldGet(this, _Neo3NeoXBridgeService_service, "f").tokenService.predicateByHash(params.token)(BSNeo3Constants_1.BSNeo3Constants.GAS_TOKEN);
159
+ const isNativeToken = __classPrivateFieldGet(this, _Neo3NeoXBridgeService_service, "f").tokenService.predicateByHash(params.token, BSNeo3Constants_1.BSNeo3Constants.GAS_TOKEN);
161
160
  let nonce = null;
162
161
  if (isNativeToken) {
163
162
  const notification = log.notifications.find(item => item.event_name === 'NativeDeposit');
@@ -177,7 +176,7 @@ class Neo3NeoXBridgeService {
177
176
  return __awaiter(this, void 0, void 0, function* () {
178
177
  let data;
179
178
  try {
180
- const isNativeToken = __classPrivateFieldGet(this, _Neo3NeoXBridgeService_service, "f").tokenService.predicateByHash(params.token)(BSNeo3Constants_1.BSNeo3Constants.GAS_TOKEN);
179
+ const isNativeToken = __classPrivateFieldGet(this, _Neo3NeoXBridgeService_service, "f").tokenService.predicateByHash(params.token, BSNeo3Constants_1.BSNeo3Constants.GAS_TOKEN);
181
180
  const response = yield axios_1.default.post('https://neofura.ngd.network', {
182
181
  jsonrpc: '2.0',
183
182
  method: 'GetBridgeTxByNonce',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-neo3",
3
- "version": "1.16.1",
3
+ "version": "1.16.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",
@@ -21,8 +21,8 @@
21
21
  "isomorphic-ws": "^5.0.0",
22
22
  "lodash.clonedeep": "^4.5.0",
23
23
  "date-fns": "~4.1.0",
24
- "@cityofzion/blockchain-service": "1.21.0",
25
- "@cityofzion/bs-asteroid-sdk": "0.9.1"
24
+ "@cityofzion/bs-asteroid-sdk": "0.9.1",
25
+ "@cityofzion/blockchain-service": "1.21.2"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@cityofzion/neon-dappkit-types": "~0.5.0",