@cityofzion/bs-neo-legacy
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -98,4 +98,4 @@ "use strict"; | ||
for (const intent of intents) { | ||
const tokenHashFixed = intent.tokenHash.replace('0x', ''); | ||
const nativeAsset = BSNeoLegacyHelper_1.BSNeoLegacyHelper.NATIVE_ASSETS.find(asset => asset.hash === tokenHashFixed); | ||
const tokenHashFixed = BSNeoLegacyHelper_1.BSNeoLegacyHelper.normalizeHash(intent.tokenHash); | ||
const nativeAsset = BSNeoLegacyHelper_1.BSNeoLegacyHelper.NATIVE_ASSETS.find(asset => BSNeoLegacyHelper_1.BSNeoLegacyHelper.normalizeHash(asset.hash) === tokenHashFixed); | ||
if (nativeAsset) { | ||
@@ -102,0 +102,0 @@ nativeIntents.push(...neon_js_1.api.makeIntent({ [nativeAsset.symbol]: Number(intent.amount) }, intent.receiverAddress)); |
@@ -29,2 +29,3 @@ import { Network, NetworkId } from '@cityofzion/blockchain-service'; | ||
static isMainnet(network: Network<BSNeoLegacyNetworkId>): boolean; | ||
static normalizeHash(hash: string): string; | ||
} |
@@ -34,2 +34,5 @@ "use strict"; | ||
} | ||
static normalizeHash(hash) { | ||
return hash.startsWith('0x') ? hash.slice(2) : hash; | ||
} | ||
} | ||
@@ -36,0 +39,0 @@ exports.BSNeoLegacyHelper = BSNeoLegacyHelper; |
@@ -123,3 +123,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const localToken = __classPrivateFieldGet(this, _DoraBDSNeoLegacy_tokens, "f").find(token => token.hash === tokenHash); | ||
const localToken = __classPrivateFieldGet(this, _DoraBDSNeoLegacy_tokens, "f").find(token => BSNeoLegacyHelper_1.BSNeoLegacyHelper.normalizeHash(token.hash) === BSNeoLegacyHelper_1.BSNeoLegacyHelper.normalizeHash(tokenHash)); | ||
if (localToken) | ||
@@ -147,3 +147,3 @@ return localToken; | ||
const promises = data.map((balance) => __awaiter(this, void 0, void 0, function* () { | ||
const hash = balance.asset.replace('0x', ''); | ||
const hash = BSNeoLegacyHelper_1.BSNeoLegacyHelper.normalizeHash(balance.asset); | ||
let token = { | ||
@@ -150,0 +150,0 @@ hash, |
{ | ||
"name": "@cityofzion/bs-neo-legacy", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49333
1151