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

@helium/account-fetch-cache

Package Overview
Dependencies
Maintainers
7
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@helium/account-fetch-cache - npm Package Compare versions

Comparing version 0.6.15 to 0.6.16

6

lib/cjs/accountFetchCache.js

@@ -62,3 +62,3 @@ "use strict";

class AccountFetchCache {
constructor({ connection, chunkSize = exports.DEFAULT_CHUNK_SIZE, delay = exports.DEFAULT_DELAY, commitment, missingRefetchDelay = 10000, extendConnection = false, cache, }) {
constructor({ connection, chunkSize = exports.DEFAULT_CHUNK_SIZE, delay = exports.DEFAULT_DELAY, commitment, missingRefetchDelay = 10000, extendConnection = false, cache, enableLogging = false, }) {
this.accountWatchersCount = new Map();

@@ -74,2 +74,3 @@ this.accountChangeListeners = new Map();

this.emitter = new eventEmitter_1.EventEmitter();
this.enableLogging = enableLogging;
this.genericCache = cache || new MapAccountCache();

@@ -167,2 +168,5 @@ this.id = ++id;

this.currentBatch = new Set(); // Erase current batch from state, so we can fetch multiple at a time
if (this.enableLogging) {
console.log(`Fetching batch of ${currentBatch.size} accounts`);
}
try {

@@ -169,0 +173,0 @@ const keys = Array.from(currentBatch);

@@ -46,2 +46,3 @@ import { Connection, PublicKey, Transaction, } from "@solana/web3.js";

export class AccountFetchCache {
enableLogging;
connection;

@@ -67,3 +68,4 @@ chunkSize;

missingInterval;
constructor({ connection, chunkSize = DEFAULT_CHUNK_SIZE, delay = DEFAULT_DELAY, commitment, missingRefetchDelay = 10000, extendConnection = false, cache, }) {
constructor({ connection, chunkSize = DEFAULT_CHUNK_SIZE, delay = DEFAULT_DELAY, commitment, missingRefetchDelay = 10000, extendConnection = false, cache, enableLogging = false, }) {
this.enableLogging = enableLogging;
this.genericCache = cache || new MapAccountCache();

@@ -152,2 +154,5 @@ this.id = ++id;

this.currentBatch = new Set(); // Erase current batch from state, so we can fetch multiple at a time
if (this.enableLogging) {
console.log(`Fetching batch of ${currentBatch.size} accounts`);
}
try {

@@ -154,0 +159,0 @@ const keys = Array.from(currentBatch);

4

lib/types/src/accountFetchCache.d.ts

@@ -29,2 +29,3 @@ /// <reference types="node" />

export declare class AccountFetchCache {
enableLogging: boolean;
connection: Connection;

@@ -50,3 +51,3 @@ chunkSize: number;

missingInterval: NodeJS.Timeout;
constructor({ connection, chunkSize, delay, commitment, missingRefetchDelay, extendConnection, cache, }: {
constructor({ connection, chunkSize, delay, commitment, missingRefetchDelay, extendConnection, cache, enableLogging, }: {
connection: Connection;

@@ -60,2 +61,3 @@ chunkSize?: number;

cache?: AccountCache;
enableLogging?: boolean;
});

@@ -62,0 +64,0 @@ requeryMissing(instructions: TransactionInstruction[]): Promise<void>;

{
"name": "@helium/account-fetch-cache",
"version": "0.6.15",
"version": "0.6.16",
"description": "Solana account fetch cache to eliminate reduntant fetching, and batch fetches",

@@ -41,3 +41,3 @@ "publishConfig": {

},
"gitHead": "6b303c8ddf16903d4c4d8cb9bf2e1f6905b3b933"
"gitHead": "d2225406239148ac56158ca0e022a836dd815a37"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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