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

@solana/rpc-types

Package Overview
Dependencies
Maintainers
15
Versions
1057
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/rpc-types - npm Package Compare versions

Comparing version 2.0.0-experimental.e9e224b to 2.0.0-experimental.eb14acd

dist/types/account-filters.d.ts

61

dist/index.browser.js

@@ -0,1 +1,39 @@

import { getBase58Encoder } from '@solana/codecs-strings';
// src/blockhash.ts
var base58Encoder;
function assertIsBlockhash(putativeBlockhash) {
if (!base58Encoder)
base58Encoder = getBase58Encoder();
try {
if (
// Lowest value (32 bytes of zeroes)
putativeBlockhash.length < 32 || // Highest value (32 bytes of 255)
putativeBlockhash.length > 44
) {
throw new Error("Expected input string to decode to a byte array of length 32.");
}
const bytes = base58Encoder.encode(putativeBlockhash);
const numBytes = bytes.byteLength;
if (numBytes !== 32) {
throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${numBytes}`);
}
} catch (e) {
throw new Error(`\`${putativeBlockhash}\` is not a blockhash`, {
cause: e
});
}
}
// src/cluster-url.ts
function mainnet(putativeString) {
return putativeString;
}
function devnet(putativeString) {
return putativeString;
}
function testnet(putativeString) {
return putativeString;
}
// src/commitment.ts

@@ -41,2 +79,23 @@ function getCommitmentScore(commitment) {

// src/rpc-errors.ts
var SolanaRpcErrorCode = {
JSON_RPC_INVALID_PARAMS: -32602,
JSON_RPC_SCAN_ERROR: -32012,
JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: -32001,
JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE: -32004,
JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET: -32014,
JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX: -32010,
JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED: -32009,
JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED: -32016,
JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY: -32005,
JSON_RPC_SERVER_ERROR_NO_SNAPSHOT: -32008,
JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE: -32002,
JSON_RPC_SERVER_ERROR_SLOT_SKIPPED: -32007,
JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE: -32011,
JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE: -32006,
JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH: -32013,
JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE: -32003,
JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION: -32015
};
// src/stringified-bigint.ts

@@ -102,4 +161,4 @@ function isStringifiedBigInt(putativeBigInt) {

export { assertIsLamports, assertIsStringifiedBigInt, assertIsStringifiedNumber, assertIsUnixTimestamp, commitmentComparator, isLamports, isStringifiedBigInt, isStringifiedNumber, isUnixTimestamp, lamports, stringifiedBigInt, stringifiedNumber, unixTimestamp };
export { SolanaRpcErrorCode, assertIsBlockhash, assertIsLamports, assertIsStringifiedBigInt, assertIsStringifiedNumber, assertIsUnixTimestamp, commitmentComparator, devnet, isLamports, isStringifiedBigInt, isStringifiedNumber, isUnixTimestamp, lamports, mainnet, stringifiedBigInt, stringifiedNumber, testnet, unixTimestamp };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.browser.js.map

@@ -0,1 +1,39 @@

import { getBase58Encoder } from '@solana/codecs-strings';
// src/blockhash.ts
var base58Encoder;
function assertIsBlockhash(putativeBlockhash) {
if (!base58Encoder)
base58Encoder = getBase58Encoder();
try {
if (
// Lowest value (32 bytes of zeroes)
putativeBlockhash.length < 32 || // Highest value (32 bytes of 255)
putativeBlockhash.length > 44
) {
throw new Error("Expected input string to decode to a byte array of length 32.");
}
const bytes = base58Encoder.encode(putativeBlockhash);
const numBytes = bytes.byteLength;
if (numBytes !== 32) {
throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${numBytes}`);
}
} catch (e) {
throw new Error(`\`${putativeBlockhash}\` is not a blockhash`, {
cause: e
});
}
}
// src/cluster-url.ts
function mainnet(putativeString) {
return putativeString;
}
function devnet(putativeString) {
return putativeString;
}
function testnet(putativeString) {
return putativeString;
}
// src/commitment.ts

@@ -41,2 +79,23 @@ function getCommitmentScore(commitment) {

// src/rpc-errors.ts
var SolanaRpcErrorCode = {
JSON_RPC_INVALID_PARAMS: -32602,
JSON_RPC_SCAN_ERROR: -32012,
JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: -32001,
JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE: -32004,
JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET: -32014,
JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX: -32010,
JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED: -32009,
JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED: -32016,
JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY: -32005,
JSON_RPC_SERVER_ERROR_NO_SNAPSHOT: -32008,
JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE: -32002,
JSON_RPC_SERVER_ERROR_SLOT_SKIPPED: -32007,
JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE: -32011,
JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE: -32006,
JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH: -32013,
JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE: -32003,
JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION: -32015
};
// src/stringified-bigint.ts

@@ -102,4 +161,4 @@ function isStringifiedBigInt(putativeBigInt) {

export { assertIsLamports, assertIsStringifiedBigInt, assertIsStringifiedNumber, assertIsUnixTimestamp, commitmentComparator, isLamports, isStringifiedBigInt, isStringifiedNumber, isUnixTimestamp, lamports, stringifiedBigInt, stringifiedNumber, unixTimestamp };
export { SolanaRpcErrorCode, assertIsBlockhash, assertIsLamports, assertIsStringifiedBigInt, assertIsStringifiedNumber, assertIsUnixTimestamp, commitmentComparator, devnet, isLamports, isStringifiedBigInt, isStringifiedNumber, isUnixTimestamp, lamports, mainnet, stringifiedBigInt, stringifiedNumber, testnet, unixTimestamp };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.native.js.map

@@ -0,1 +1,39 @@

import { getBase58Encoder } from '@solana/codecs-strings';
// src/blockhash.ts
var base58Encoder;
function assertIsBlockhash(putativeBlockhash) {
if (!base58Encoder)
base58Encoder = getBase58Encoder();
try {
if (
// Lowest value (32 bytes of zeroes)
putativeBlockhash.length < 32 || // Highest value (32 bytes of 255)
putativeBlockhash.length > 44
) {
throw new Error("Expected input string to decode to a byte array of length 32.");
}
const bytes = base58Encoder.encode(putativeBlockhash);
const numBytes = bytes.byteLength;
if (numBytes !== 32) {
throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${numBytes}`);
}
} catch (e) {
throw new Error(`\`${putativeBlockhash}\` is not a blockhash`, {
cause: e
});
}
}
// src/cluster-url.ts
function mainnet(putativeString) {
return putativeString;
}
function devnet(putativeString) {
return putativeString;
}
function testnet(putativeString) {
return putativeString;
}
// src/commitment.ts

@@ -41,2 +79,23 @@ function getCommitmentScore(commitment) {

// src/rpc-errors.ts
var SolanaRpcErrorCode = {
JSON_RPC_INVALID_PARAMS: -32602,
JSON_RPC_SCAN_ERROR: -32012,
JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: -32001,
JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE: -32004,
JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET: -32014,
JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX: -32010,
JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED: -32009,
JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED: -32016,
JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY: -32005,
JSON_RPC_SERVER_ERROR_NO_SNAPSHOT: -32008,
JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE: -32002,
JSON_RPC_SERVER_ERROR_SLOT_SKIPPED: -32007,
JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE: -32011,
JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE: -32006,
JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH: -32013,
JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE: -32003,
JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION: -32015
};
// src/stringified-bigint.ts

@@ -102,4 +161,4 @@ function isStringifiedBigInt(putativeBigInt) {

export { assertIsLamports, assertIsStringifiedBigInt, assertIsStringifiedNumber, assertIsUnixTimestamp, commitmentComparator, isLamports, isStringifiedBigInt, isStringifiedNumber, isUnixTimestamp, lamports, stringifiedBigInt, stringifiedNumber, unixTimestamp };
export { SolanaRpcErrorCode, assertIsBlockhash, assertIsLamports, assertIsStringifiedBigInt, assertIsStringifiedNumber, assertIsUnixTimestamp, commitmentComparator, devnet, isLamports, isStringifiedBigInt, isStringifiedNumber, isUnixTimestamp, lamports, mainnet, stringifiedBigInt, stringifiedNumber, testnet, unixTimestamp };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.node.js.map

22

dist/types/index.d.ts

@@ -1,6 +0,18 @@

export * from './commitment';
export * from './lamports';
export * from './stringified-bigint';
export * from './stringified-number';
export * from './unix-timestamp';
export * from './account-filters.js';
export * from './account-info.js';
export * from './blockhash.js';
export * from './cluster-url.js';
export * from './commitment.js';
export * from './encoded-bytes.js';
export * from './lamports.js';
export * from './rpc-api.js';
export * from './rpc-errors.js';
export * from './stringified-bigint.js';
export * from './stringified-number.js';
export * from './token-amount.js';
export * from './token-balance.js';
export * from './transaction.js';
export * from './transaction-error.js';
export * from './typed-numbers.js';
export * from './unix-timestamp.js';
//# sourceMappingURL=index.d.ts.map
{
"name": "@solana/rpc-types",
"version": "2.0.0-experimental.e9e224b",
"version": "2.0.0-experimental.eb14acd",
"description": "Type definitions for values used in the Solana RPC, and helper functions for working with them",

@@ -48,25 +48,5 @@ "exports": {

],
"devDependencies": {
"@solana/eslint-config-solana": "^1.0.2",
"@swc/jest": "^0.2.29",
"@types/jest": "^29.5.6",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.3.0",
"agadoo": "^3.0.0",
"eslint": "^8.45.0",
"eslint-plugin-jest": "^27.4.2",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-fetch-mock-fork": "^3.0.4",
"jest-runner-eslint": "^2.1.2",
"jest-runner-prettier": "^1.0.0",
"prettier": "^2.8",
"tsup": "7.2.0",
"typescript": "^5.2.2",
"version-from-git": "^1.1.1",
"@solana/transactions": "2.0.0-experimental.e9e224b",
"build-scripts": "0.0.0",
"test-config": "0.0.0",
"tsconfig": "0.0.0"
"dependencies": {
"@solana/addresses": "2.0.0-experimental.eb14acd",
"@solana/codecs-strings": "2.0.0-experimental.eb14acd"
},

@@ -83,8 +63,9 @@ "bundlewatch": {

"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
"dev": "jest -c node_modules/test-config/jest-dev.config.ts --globalSetup test-config/test-validator-setup.js --globalTeardown test-config/test-validator-teardown.js --rootDir . --watch",
"publish-packages": "pnpm publish --tag experimental --access public --no-git-checks",
"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 --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --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/test-config/jest-lint.config.ts --rootDir . --silent",
"test:prettier": "jest -c node_modules/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",

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

"test:typecheck": "tsc --noEmit",
"test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.ts --globalSetup test-config/test-validator-setup.js --globalTeardown test-config/test-validator-teardown.js --rootDir . --silent",
"test:unit:node": "jest -c node_modules/test-config/jest-unit.config.node.ts --globalSetup test-config/test-validator-setup.js --globalTeardown test-config/test-validator-teardown.js --rootDir . --silent"
"test:unit:browser": "jest -c node_modules/@solana/test-config/jest-unit.config.browser.ts --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --silent",
"test:unit:node": "jest -c node_modules/@solana/test-config/jest-unit.config.node.ts --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --silent"
}
}

@@ -49,3 +49,3 @@ [![npm][npm-image]][npm-url]

From time to time you might acquire an number that you expect to be a quantity of Lamports, from an untrusted network API or user input. To assert that such an arbitrary number is usable as a quantity of Lamports, use the `assertIsLamports` function.
From time to time you might acquire a number that you expect to be a quantity of Lamports, from an untrusted network API or user input. To assert that such an arbitrary number is usable as a quantity of Lamports, use the `assertIsLamports` function.

@@ -52,0 +52,0 @@ ```ts

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