New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@everlend/general-pool

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@everlend/general-pool - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

6

dist/accounts/withdrawalRequests.d.ts

@@ -11,4 +11,2 @@ /// <reference types="node" />

mint: PublicKey;
nextTicket: BN;
nextProcessTicket: BN;
liquiditySupply: BN;

@@ -21,8 +19,6 @@ };

mint: PublicKey;
nextTicket: BN;
nextProcessTicket: BN;
liquiditySupply: BN;
}
export declare class WithdrawalRequests extends Account<WithdrawalRequestsData> {
static readonly LEN = 89;
static readonly LEN = 73;
constructor(key: PublicKey, info: AccountInfo<Buffer>);

@@ -29,0 +25,0 @@ static getPDA(poolMarket: PublicKey, tokenMint: PublicKey): Promise<PublicKey>;

4

dist/accounts/withdrawalRequests.js

@@ -17,4 +17,2 @@ "use strict";

['mint', 'publicKey'],
['nextTicket', 'u64'],
['nextProcessTicket', 'u64'],
['liquiditySupply', 'u64'],

@@ -39,3 +37,3 @@ ]);

exports.WithdrawalRequests = WithdrawalRequests;
WithdrawalRequests.LEN = 89;
WithdrawalRequests.LEN = 73;
//# sourceMappingURL=withdrawalRequests.js.map
/// <reference types="node" />
import { AccountInfo, PublicKey } from '@solana/web3.js';
import { AccountInfo, Connection, PublicKey } from '@solana/web3.js';
import BN from 'bn.js';

@@ -29,3 +29,7 @@ import { Buffer } from 'buffer';

static getPDA(withdrawalRequests: PublicKey, from: PublicKey): Promise<PublicKey>;
static findMany(connection: Connection, filters?: {
pool?: PublicKey;
from?: PublicKey;
}): Promise<WithdrawalRequest[]>;
}
export {};
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var _a;

@@ -7,2 +19,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

const web3_js_1 = require("@solana/web3.js");
const bs58_1 = __importDefault(require("bs58"));
const buffer_1 = require("buffer");

@@ -38,2 +51,35 @@ const common_1 = require("@everlend/common");

}
static findMany(connection, filters = {}) {
return __awaiter(this, void 0, void 0, function* () {
return (yield program_1.GeneralPoolsProgram.getProgramAccounts(connection, {
filters: [
{
memcmp: {
offset: 0,
bytes: bs58_1.default.encode(buffer_1.Buffer.from([program_1.AccountType.WithdrawRequest])),
},
},
filters.pool && {
memcmp: {
offset: 1,
bytes: new web3_js_1.PublicKey(filters.pool).toBase58(),
},
},
filters.from && {
memcmp: {
offset: 33,
bytes: new web3_js_1.PublicKey(filters.from).toBase58(),
},
},
].filter(Boolean),
}))
.map((account) => {
try {
return WithdrawalRequest.from(account);
}
catch (err) { }
})
.filter(Boolean);
});
}
}

@@ -40,0 +86,0 @@ exports.WithdrawalRequest = WithdrawalRequest;

{
"name": "@everlend/general-pool",
"version": "0.0.5",
"version": "0.0.6",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -11,4 +11,2 @@ import { AccountType, GeneralPoolsProgram } from '../program'

mint: PublicKey
nextTicket: BN
nextProcessTicket: BN
liquiditySupply: BN

@@ -22,4 +20,2 @@ }

['mint', 'publicKey'],
['nextTicket', 'u64'],
['nextProcessTicket', 'u64'],
['liquiditySupply', 'u64'],

@@ -31,4 +27,2 @@ ])

mint: PublicKey
nextTicket: BN
nextProcessTicket: BN
liquiditySupply: BN

@@ -38,3 +32,3 @@ }

export class WithdrawalRequests extends Account<WithdrawalRequestsData> {
static readonly LEN = 89
static readonly LEN = 73

@@ -41,0 +35,0 @@ constructor(key: PublicKey, info: AccountInfo<Buffer>) {

@@ -1,4 +0,5 @@

import { GeneralPoolsProgram } from '../program'
import { AccountInfo, PublicKey } from '@solana/web3.js'
import { AccountType, GeneralPoolsProgram } from '../program'
import { AccountInfo, Connection, PublicKey } from '@solana/web3.js'
import BN from 'bn.js'
import bs58 from 'bs58'
import { Buffer } from 'buffer'

@@ -57,2 +58,41 @@ import { Account, Borsh, Errors } from '@everlend/common'

}
static async findMany(
connection: Connection,
filters: { pool?: PublicKey; from?: PublicKey } = {},
) {
return (
await GeneralPoolsProgram.getProgramAccounts(connection, {
filters: [
// Filter for WithdrawRequest by key
{
memcmp: {
offset: 0,
bytes: bs58.encode(Buffer.from([AccountType.WithdrawRequest])),
},
},
// Filter for assigned to pool
filters.pool && {
memcmp: {
offset: 1,
bytes: new PublicKey(filters.pool).toBase58(),
},
},
// Filter for assigned to from
filters.from && {
memcmp: {
offset: 33,
bytes: new PublicKey(filters.from).toBase58(),
},
},
].filter(Boolean),
})
)
.map((account) => {
try {
return WithdrawalRequest.from(account)
} catch (err) {}
})
.filter(Boolean)
}
}

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