Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@orca-so/token-sdk

Package Overview
Dependencies
Maintainers
6
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orca-so/token-sdk - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

dist/token-fetcher.d.ts

18

dist/fetcher.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc