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

@solana/accounts

Package Overview
Dependencies
Maintainers
14
Versions
1002
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/accounts - npm Package Compare versions

Comparing version 2.0.0-experimental.ed98b3d to 2.0.0-experimental.ef2569b

9

dist/index.browser.js

@@ -75,5 +75,12 @@ import { getBase64Encoder, getBase58Encoder } from '@solana/codecs-strings';

}
function assertAccountsExist(accounts) {
const missingAccounts = accounts.filter((a) => !a.exists);
if (missingAccounts.length > 0) {
const missingAddresses = missingAccounts.map((a) => a.address);
throw new Error(`Expected accounts [${missingAddresses.join(", ")}] to exist.`);
}
}
export { BASE_ACCOUNT_SIZE, assertAccountExists, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, fetchJsonParsedAccount, fetchJsonParsedAccounts, parseBase58RpcAccount, parseBase64RpcAccount, parseJsonRpcAccount };
export { BASE_ACCOUNT_SIZE, assertAccountExists, assertAccountsExist, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, fetchJsonParsedAccount, fetchJsonParsedAccounts, parseBase58RpcAccount, parseBase64RpcAccount, parseJsonRpcAccount };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.browser.js.map

@@ -75,5 +75,12 @@ import { getBase64Encoder, getBase58Encoder } from '@solana/codecs-strings';

}
function assertAccountsExist(accounts) {
const missingAccounts = accounts.filter((a) => !a.exists);
if (missingAccounts.length > 0) {
const missingAddresses = missingAccounts.map((a) => a.address);
throw new Error(`Expected accounts [${missingAddresses.join(", ")}] to exist.`);
}
}
export { BASE_ACCOUNT_SIZE, assertAccountExists, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, fetchJsonParsedAccount, fetchJsonParsedAccounts, parseBase58RpcAccount, parseBase64RpcAccount, parseJsonRpcAccount };
export { BASE_ACCOUNT_SIZE, assertAccountExists, assertAccountsExist, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, fetchJsonParsedAccount, fetchJsonParsedAccounts, parseBase58RpcAccount, parseBase64RpcAccount, parseJsonRpcAccount };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.native.js.map

@@ -75,5 +75,12 @@ import { getBase64Encoder, getBase58Encoder } from '@solana/codecs-strings';

}
function assertAccountsExist(accounts) {
const missingAccounts = accounts.filter((a) => !a.exists);
if (missingAccounts.length > 0) {
const missingAddresses = missingAccounts.map((a) => a.address);
throw new Error(`Expected accounts [${missingAddresses.join(", ")}] to exist.`);
}
}
export { BASE_ACCOUNT_SIZE, assertAccountExists, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, fetchJsonParsedAccount, fetchJsonParsedAccounts, parseBase58RpcAccount, parseBase64RpcAccount, parseJsonRpcAccount };
export { BASE_ACCOUNT_SIZE, assertAccountExists, assertAccountsExist, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, fetchJsonParsedAccount, fetchJsonParsedAccounts, parseBase58RpcAccount, parseBase64RpcAccount, parseJsonRpcAccount };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.node.js.map

@@ -16,2 +16,6 @@ import { Address } from '@solana/addresses';

};
/** Asserts that all accounts that may or may not exist, actually all exist. */
export declare function assertAccountsExist<TData extends object | Uint8Array, TAddress extends string = string>(accounts: MaybeAccount<TData, TAddress>[]): asserts accounts is (Account<TData, TAddress> & {
exists: true;
})[];
//# sourceMappingURL=maybe-account.d.ts.map

14

package.json
{
"name": "@solana/accounts",
"version": "2.0.0-experimental.ed98b3d",
"version": "2.0.0-experimental.ef2569b",
"description": "Helpers for representing, fetching and decoding Solana accounts",

@@ -49,8 +49,8 @@ "exports": {

"dependencies": {
"@solana/codecs-core": "2.0.0-experimental.ed98b3d",
"@solana/addresses": "2.0.0-experimental.ed98b3d",
"@solana/codecs-strings": "2.0.0-experimental.ed98b3d",
"@solana/rpc-core": "2.0.0-experimental.ed98b3d",
"@solana/rpc-transport": "2.0.0-experimental.ed98b3d",
"@solana/rpc-types": "2.0.0-experimental.ed98b3d"
"@solana/codecs-core": "2.0.0-experimental.ef2569b",
"@solana/addresses": "2.0.0-experimental.ef2569b",
"@solana/codecs-strings": "2.0.0-experimental.ef2569b",
"@solana/rpc-core": "2.0.0-experimental.ef2569b",
"@solana/rpc-transport": "2.0.0-experimental.ef2569b",
"@solana/rpc-types": "2.0.0-experimental.ef2569b"
},

@@ -57,0 +57,0 @@ "devDependencies": {

@@ -150,2 +150,17 @@ [![npm][npm-image]][npm-url]

### `assertAccountsExist()`
Given an array of `MaybeAccount`s, this function asserts that all the accounts
exist and allows them to be used as an array of `Account`s going forward.
```ts
const myAccounts: MaybeEncodedAccount<Address>[];
assertAccountsExist(myAccounts);
// Now we can use them as an array of accounts
for (const a of myAccounts) {
a satisfies EncodedAccount<Address>;
}
```
### `parseBase64RpcAccount()`

@@ -152,0 +167,0 @@

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

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

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