Socket
Socket
Sign inDemoInstall

@solana/accounts

Package Overview
Dependencies
Maintainers
15
Versions
865
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.2df278c to 2.0.0-experimental.2e0ae95

27

dist/index.browser.js

@@ -0,1 +1,2 @@

import { SolanaError, SOLANA_ERROR__FAILED_TO_DECODE_ACCOUNT, SOLANA_ERROR__EXPECTED_DECODED_ACCOUNT, SOLANA_ERROR__NOT_ALL_ACCOUNTS_DECODED, SOLANA_ERROR__ACCOUNT_NOT_FOUND, SOLANA_ERROR__MULTIPLE_ACCOUNTS_NOT_FOUND } from '@solana/errors';
import { getBase64Encoder, getBase58Encoder } from '@solana/codecs-strings';

@@ -5,4 +6,2 @@

var BASE_ACCOUNT_SIZE = 128;
// src/decode-account.ts
function decodeAccount(encodedAccount, decoder) {

@@ -14,6 +13,6 @@ try {

return Object.freeze({ ...encodedAccount, data: decoder.decode(encodedAccount.data) });
} catch (error) {
const newError = new Error(`Failed to decode account [${encodedAccount.address}].`);
newError.cause = error;
throw newError;
} catch (e) {
throw new SolanaError(SOLANA_ERROR__FAILED_TO_DECODE_ACCOUNT, {
address: encodedAccount.address
});
}

@@ -26,3 +25,5 @@ }

if (accountExists(account) && account.data instanceof Uint8Array) {
throw new Error(`Expected account [${account.address}] to be decoded.`);
throw new SolanaError(SOLANA_ERROR__EXPECTED_DECODED_ACCOUNT, {
address: account.address
});
}

@@ -33,4 +34,6 @@ }

if (encoded.length > 0) {
const encodedAddresses = encoded.map((a) => a.address).join(", ");
throw new Error(`Expected accounts [${encodedAddresses}] to be decoded.`);
const encodedAddresses = encoded.map((a) => a.address);
throw new SolanaError(SOLANA_ERROR__NOT_ALL_ACCOUNTS_DECODED, {
addresses: encodedAddresses
});
}

@@ -87,7 +90,5 @@ }

}
// src/maybe-account.ts
function assertAccountExists(account) {
if (!account.exists) {
throw new Error(`Expected account [${account.address}] to exist.`);
throw new SolanaError(SOLANA_ERROR__ACCOUNT_NOT_FOUND, { address: account.address });
}

@@ -99,3 +100,3 @@ }

const missingAddresses = missingAccounts.map((a) => a.address);
throw new Error(`Expected accounts [${missingAddresses.join(", ")}] to exist.`);
throw new SolanaError(SOLANA_ERROR__MULTIPLE_ACCOUNTS_NOT_FOUND, { addresses: missingAddresses });
}

@@ -102,0 +103,0 @@ }

@@ -0,1 +1,2 @@

import { SolanaError, SOLANA_ERROR__FAILED_TO_DECODE_ACCOUNT, SOLANA_ERROR__EXPECTED_DECODED_ACCOUNT, SOLANA_ERROR__NOT_ALL_ACCOUNTS_DECODED, SOLANA_ERROR__ACCOUNT_NOT_FOUND, SOLANA_ERROR__MULTIPLE_ACCOUNTS_NOT_FOUND } from '@solana/errors';
import { getBase64Encoder, getBase58Encoder } from '@solana/codecs-strings';

@@ -5,4 +6,2 @@

var BASE_ACCOUNT_SIZE = 128;
// src/decode-account.ts
function decodeAccount(encodedAccount, decoder) {

@@ -14,6 +13,6 @@ try {

return Object.freeze({ ...encodedAccount, data: decoder.decode(encodedAccount.data) });
} catch (error) {
const newError = new Error(`Failed to decode account [${encodedAccount.address}].`);
newError.cause = error;
throw newError;
} catch (e) {
throw new SolanaError(SOLANA_ERROR__FAILED_TO_DECODE_ACCOUNT, {
address: encodedAccount.address
});
}

@@ -26,3 +25,5 @@ }

if (accountExists(account) && account.data instanceof Uint8Array) {
throw new Error(`Expected account [${account.address}] to be decoded.`);
throw new SolanaError(SOLANA_ERROR__EXPECTED_DECODED_ACCOUNT, {
address: account.address
});
}

@@ -33,4 +34,6 @@ }

if (encoded.length > 0) {
const encodedAddresses = encoded.map((a) => a.address).join(", ");
throw new Error(`Expected accounts [${encodedAddresses}] to be decoded.`);
const encodedAddresses = encoded.map((a) => a.address);
throw new SolanaError(SOLANA_ERROR__NOT_ALL_ACCOUNTS_DECODED, {
addresses: encodedAddresses
});
}

@@ -87,7 +90,5 @@ }

}
// src/maybe-account.ts
function assertAccountExists(account) {
if (!account.exists) {
throw new Error(`Expected account [${account.address}] to exist.`);
throw new SolanaError(SOLANA_ERROR__ACCOUNT_NOT_FOUND, { address: account.address });
}

@@ -99,3 +100,3 @@ }

const missingAddresses = missingAccounts.map((a) => a.address);
throw new Error(`Expected accounts [${missingAddresses.join(", ")}] to exist.`);
throw new SolanaError(SOLANA_ERROR__MULTIPLE_ACCOUNTS_NOT_FOUND, { addresses: missingAddresses });
}

@@ -102,0 +103,0 @@ }

@@ -0,1 +1,2 @@

import { SolanaError, SOLANA_ERROR__FAILED_TO_DECODE_ACCOUNT, SOLANA_ERROR__EXPECTED_DECODED_ACCOUNT, SOLANA_ERROR__NOT_ALL_ACCOUNTS_DECODED, SOLANA_ERROR__ACCOUNT_NOT_FOUND, SOLANA_ERROR__MULTIPLE_ACCOUNTS_NOT_FOUND } from '@solana/errors';
import { getBase64Encoder, getBase58Encoder } from '@solana/codecs-strings';

@@ -5,4 +6,2 @@

var BASE_ACCOUNT_SIZE = 128;
// src/decode-account.ts
function decodeAccount(encodedAccount, decoder) {

@@ -14,6 +13,6 @@ try {

return Object.freeze({ ...encodedAccount, data: decoder.decode(encodedAccount.data) });
} catch (error) {
const newError = new Error(`Failed to decode account [${encodedAccount.address}].`);
newError.cause = error;
throw newError;
} catch (e) {
throw new SolanaError(SOLANA_ERROR__FAILED_TO_DECODE_ACCOUNT, {
address: encodedAccount.address
});
}

@@ -26,3 +25,5 @@ }

if (accountExists(account) && account.data instanceof Uint8Array) {
throw new Error(`Expected account [${account.address}] to be decoded.`);
throw new SolanaError(SOLANA_ERROR__EXPECTED_DECODED_ACCOUNT, {
address: account.address
});
}

@@ -33,4 +34,6 @@ }

if (encoded.length > 0) {
const encodedAddresses = encoded.map((a) => a.address).join(", ");
throw new Error(`Expected accounts [${encodedAddresses}] to be decoded.`);
const encodedAddresses = encoded.map((a) => a.address);
throw new SolanaError(SOLANA_ERROR__NOT_ALL_ACCOUNTS_DECODED, {
addresses: encodedAddresses
});
}

@@ -87,7 +90,5 @@ }

}
// src/maybe-account.ts
function assertAccountExists(account) {
if (!account.exists) {
throw new Error(`Expected account [${account.address}] to exist.`);
throw new SolanaError(SOLANA_ERROR__ACCOUNT_NOT_FOUND, { address: account.address });
}

@@ -99,3 +100,3 @@ }

const missingAddresses = missingAccounts.map((a) => a.address);
throw new Error(`Expected accounts [${missingAddresses.join(", ")}] to exist.`);
throw new SolanaError(SOLANA_ERROR__MULTIPLE_ACCOUNTS_NOT_FOUND, { addresses: missingAddresses });
}

@@ -102,0 +103,0 @@ }

{
"name": "@solana/accounts",
"version": "2.0.0-experimental.2df278c",
"version": "2.0.0-experimental.2e0ae95",
"description": "Helpers for representing, fetching and decoding Solana accounts",

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

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

@@ -56,0 +57,0 @@ "bundlewatch": {

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

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