@orca-so/token-sdk
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -54,4 +54,4 @@ "use strict"; | ||
async findMany(addresses, refresh = false) { | ||
const mints = common_sdk_1.AddressUtil.toPubKeys(addresses); | ||
const misses = refresh ? mints : mints.filter((mint) => !this._cache.has(mint.toBase58())); | ||
const mints = common_sdk_1.AddressUtil.toStrings(addresses); | ||
const misses = refresh ? mints : mints.filter((mint) => !this._cache.has(mint)); | ||
if (misses.length > 0) { | ||
@@ -61,5 +61,4 @@ const mintInfos = (await this.request((0, common_sdk_1.getMultipleParsedAccounts)(this.connection, misses, common_sdk_1.ParsableMintInfo))).filter((mintInfo) => mintInfo !== null); | ||
misses.forEach((mint, index) => { | ||
const mintString = mint.toBase58(); | ||
this._cache.set(mintString, { | ||
mint: mintString, | ||
this._cache.set(mint, { | ||
mint, | ||
decimals: mintInfos[index].decimals, | ||
@@ -80,7 +79,6 @@ }); | ||
misses.forEach((mint) => { | ||
const mintString = mint.toBase58(); | ||
const cachedValue = this._cache.get(mintString); | ||
const cachedValue = this._cache.get(mint); | ||
(0, tiny_invariant_1.default)(cachedValue, "Expecting token to be in cache"); | ||
const token = mergeMetadata(cachedValue, metadatas.get(mintString)); | ||
this._cache.set(mintString, token); | ||
const token = mergeMetadata(cachedValue, metadatas.get(mint)); | ||
this._cache.set(mint, token); | ||
if (metadata_1.MetadataUtil.isPartial(token)) { | ||
@@ -98,3 +96,3 @@ next.push(mint); | ||
} | ||
return new Map(mints.map((mint) => [mint.toBase58(), this._cache.get(mint.toBase58())])); | ||
return new Map(mints.map((mint) => [mint, this._cache.get(mint)])); | ||
} | ||
@@ -101,0 +99,0 @@ request(promise) { |
@@ -41,3 +41,3 @@ "use strict"; | ||
return { | ||
symbol: contract.symbol.toUpperCase(), // Coingecko symbols are lowercase | ||
symbol: contract.symbol.toUpperCase(), | ||
name: contract.name, | ||
@@ -44,0 +44,0 @@ image: contract.image.large ?? contract.image.small ?? contract.image.thumb, |
{ | ||
"name": "@orca-so/token-sdk", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "SPL Token Utilities", | ||
@@ -35,2 +35,2 @@ "repository": "https://github.com/orca-so/orca-sdks", | ||
] | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
36
1410
114477
1