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

@solana/accounts

Package Overview
Dependencies
Maintainers
15
Versions
953
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.eb951b0 to 2.0.0-experimental.ed41fe2

4

dist/types/account.d.ts

@@ -7,8 +7,8 @@ import type { Address } from '@solana/addresses';

export type BaseAccount = {
readonly programAddress: Address;
readonly executable: boolean;
readonly lamports: LamportsUnsafeBeyond2Pow53Minus1;
readonly programAddress: Address;
};
/** Defines a Solana account with its generic details and parsed or encoded data. */
export type Account<TData extends object | Uint8Array, TAddress extends string = string> = BaseAccount & {
export type Account<TData extends Uint8Array | object, TAddress extends string = string> = BaseAccount & {
readonly address: Address<TAddress>;

@@ -15,0 +15,0 @@ readonly data: TData;

@@ -8,5 +8,5 @@ import type { Address } from '@solana/addresses';

export type FetchAccountConfig = {
abortSignal?: AbortSignal;
commitment?: Commitment;
minContextSlot?: Slot;
abortSignal?: AbortSignal;
};

@@ -19,5 +19,5 @@ /** Fetch a base64-encoded account that may or may not exist using an RPC client. */

export type FetchAccountsConfig = {
abortSignal?: AbortSignal;
commitment?: Commitment;
minContextSlot?: Slot;
abortSignal?: AbortSignal;
};

@@ -35,29 +35,29 @@ /** Fetch multiple base64-encoded accounts that may or may not exist using an RPC client. */

[P in keyof TAddresses]: Address<TAddresses[P]>;
}>(rpc: Rpc<GetMultipleAccountsApi>, addresses: TWrappedAddresses, config?: FetchAccountsConfig): Promise<{ [P in keyof TData]: ({
readonly exists: true;
} & import("./account").BaseAccount & {
readonly address: Address<TAddresses[P & keyof TAddresses]>;
readonly data: TData[P];
}) | {
}>(rpc: Rpc<GetMultipleAccountsApi>, addresses: TWrappedAddresses, config?: FetchAccountsConfig): Promise<{ [P in keyof TAddresses]: {
readonly address: Address<TAddresses[P]>;
readonly exists: false;
readonly address: Address<TAddresses[P & keyof TAddresses]>;
} | ({
} | (import("./account").BaseAccount & {
readonly address: Address<TAddresses[P]>;
readonly data: TData[P & keyof TData];
} & {
readonly exists: true;
} & import("./account").BaseAccount & {
readonly address: Address<TAddresses[P & keyof TAddresses]>;
}) | (import("./account").BaseAccount & {
readonly address: Address<TAddresses[P]>;
readonly data: Uint8Array;
}); } & { [P_1 in keyof TAddresses]: ({
} & {
readonly exists: true;
} & import("./account").BaseAccount & {
readonly address: Address<TAddresses[P_1]>;
readonly data: TData[P_1 & keyof TData];
}) | {
}); } & { [P_1 in keyof TData]: {
readonly address: Address<TAddresses[P_1 & keyof TAddresses]>;
readonly exists: false;
readonly address: Address<TAddresses[P_1]>;
} | ({
} | (import("./account").BaseAccount & {
readonly address: Address<TAddresses[P_1 & keyof TAddresses]>;
readonly data: TData[P_1];
} & {
readonly exists: true;
} & import("./account").BaseAccount & {
readonly address: Address<TAddresses[P_1]>;
}) | (import("./account").BaseAccount & {
readonly address: Address<TAddresses[P_1 & keyof TAddresses]>;
readonly data: Uint8Array;
} & {
readonly exists: true;
}); }>;
//# sourceMappingURL=fetch-account.d.ts.map
import { Address } from '@solana/addresses';
import { Account } from './account.js';
/** Defines a Solana account that may or may not exist after having tried to fetch it. */
export type MaybeAccount<TData extends object | Uint8Array, TAddress extends string = string> = ({
export type MaybeAccount<TData extends Uint8Array | object, TAddress extends string = string> = {
readonly address: Address<TAddress>;
readonly exists: false;
} | (Account<TData, TAddress> & {
readonly exists: true;
} & Account<TData, TAddress>) | {
readonly exists: false;
readonly address: Address<TAddress>;
};
});
/** Defines a Solana account with encoded data that may or may not exist after having tried to fetch it. */
export type MaybeEncodedAccount<TAddress extends string = string> = MaybeAccount<Uint8Array, TAddress>;
/** Asserts that an account that may or may not exists, actually exists. */
export declare function assertAccountExists<TData extends object | Uint8Array, TAddress extends string = string>(account: MaybeAccount<TData, TAddress>): asserts account is Account<TData, TAddress> & {
export declare function assertAccountExists<TData extends Uint8Array | object, TAddress extends string = string>(account: MaybeAccount<TData, TAddress>): asserts account is Account<TData, TAddress> & {
exists: true;
};
/** 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> & {
export declare function assertAccountsExist<TData extends Uint8Array | object, TAddress extends string = string>(accounts: MaybeAccount<TData, TAddress>[]): asserts accounts is (Account<TData, TAddress> & {
exists: true;
})[];
//# sourceMappingURL=maybe-account.d.ts.map
import type { U64UnsafeBeyond2Pow53Minus1 } from '@solana/rpc-types';
export type JsonParsedDataResponse<TData = object> = Readonly<{
program: string;
parsed: {

@@ -8,4 +7,5 @@ info?: TData;

};
program: string;
space: U64UnsafeBeyond2Pow53Minus1;
}>;
//# sourceMappingURL=common.d.ts.map
{
"name": "@solana/accounts",
"version": "2.0.0-experimental.eb951b0",
"version": "2.0.0-experimental.ed41fe2",
"description": "Helpers for representing, fetching and decoding Solana accounts",

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

"dependencies": {
"@solana/addresses": "2.0.0-experimental.eb951b0",
"@solana/codecs-core": "2.0.0-experimental.eb951b0",
"@solana/codecs-strings": "2.0.0-experimental.eb951b0",
"@solana/errors": "2.0.0-experimental.eb951b0",
"@solana/rpc-spec": "2.0.0-experimental.eb951b0",
"@solana/rpc-types": "2.0.0-experimental.eb951b0"
"@solana/addresses": "2.0.0-experimental.ed41fe2",
"@solana/codecs-core": "2.0.0-experimental.ed41fe2",
"@solana/codecs-strings": "2.0.0-experimental.ed41fe2",
"@solana/errors": "2.0.0-experimental.ed41fe2",
"@solana/rpc-spec": "2.0.0-experimental.ed41fe2",
"@solana/rpc-types": "2.0.0-experimental.ed41fe2"
},

@@ -67,9 +67,9 @@ "bundlewatch": {

"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
"compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/@solana/build-scripts/add-js-extension-to-types.mjs",
"dev": "jest -c node_modules/@solana/test-config/jest-dev.config.ts --rootDir . --watch",
"compile:typedefs": "tsc -p ./tsconfig.declarations.json && node ../../node_modules/@solana/build-scripts/add-js-extension-to-types.mjs",
"dev": "jest -c ../../node_modules/@solana/test-config/jest-dev.config.ts --rootDir . --watch",
"publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || pnpm publish --tag experimental --access public --no-git-checks",
"publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
"test:lint": "jest -c node_modules/@solana/test-config/jest-lint.config.ts --rootDir . --silent",
"test:prettier": "jest -c node_modules/@solana/test-config/jest-prettier.config.ts --rootDir . --silent",
"test:lint": "jest -c ../../node_modules/@solana/test-config/jest-lint.config.ts --rootDir . --silent",
"test:prettier": "jest -c ../../node_modules/@solana/test-config/jest-prettier.config.ts --rootDir . --silent",
"test:treeshakability:browser": "agadoo dist/index.browser.js",

@@ -79,5 +79,5 @@ "test:treeshakability:native": "agadoo dist/index.native.js",

"test:typecheck": "tsc --noEmit",
"test:unit:browser": "jest -c node_modules/@solana/test-config/jest-unit.config.browser.ts --rootDir . --silent",
"test:unit:node": "jest -c node_modules/@solana/test-config/jest-unit.config.node.ts --rootDir . --silent"
"test:unit:browser": "jest -c ../../node_modules/@solana/test-config/jest-unit.config.browser.ts --rootDir . --silent",
"test:unit:node": "jest -c ../../node_modules/@solana/test-config/jest-unit.config.node.ts --rootDir . --silent"
}
}

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