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

@solana/rpc-types

Package Overview
Dependencies
Maintainers
14
Versions
1058
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.4c1874d to 2.0.0-experimental.4c9a8b8

dist/types/blockhash.d.ts

29

dist/index.browser.js

@@ -0,1 +1,28 @@

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/commitment.ts

@@ -101,4 +128,4 @@ function getCommitmentScore(commitment) {

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

@@ -0,1 +1,28 @@

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/commitment.ts

@@ -101,4 +128,4 @@ function getCommitmentScore(commitment) {

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

@@ -0,1 +1,28 @@

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/commitment.ts

@@ -101,4 +128,4 @@ function getCommitmentScore(commitment) {

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

14

dist/types/index.d.ts

@@ -1,6 +0,10 @@

export * from './commitment';
export * from './lamports';
export * from './stringified-bigint';
export * from './stringified-number';
export * from './unix-timestamp';
export * from './blockhash.js';
export * from './commitment.js';
export * from './encoded-bytes.js';
export * from './lamports.js';
export * from './stringified-bigint.js';
export * from './stringified-number.js';
export * from './token-amount.js';
export * from './unix-timestamp.js';
export type Slot = bigint;
//# sourceMappingURL=index.d.ts.map
{
"name": "@solana/rpc-types",
"version": "2.0.0-experimental.4c1874d",
"version": "2.0.0-experimental.4c9a8b8",
"description": "Type definitions for values used in the Solana RPC, and helper functions for working with them",

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

"devDependencies": {
"@solana/codecs-core": "2.0.0-development",
"@solana/eslint-config-solana": "^1.0.2",
"@swc/jest": "^0.2.29",
"@types/jest": "^29.5.6",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.3.0",

@@ -64,7 +65,6 @@ "agadoo": "^3.0.0",

"jest-runner-prettier": "^1.0.0",
"prettier": "^2.8",
"prettier": "^3.1",
"tsup": "^8.0.1",
"typescript": "^5.2.2",
"version-from-git": "^1.1.1",
"@solana/transactions": "2.0.0-experimental.4c1874d",
"build-scripts": "0.0.0",

@@ -82,5 +82,8 @@ "test-config": "0.0.0",

},
"dependencies": {
"@solana/codecs-strings": "2.0.0-development"
},
"scripts": {
"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
"compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/build-scripts/add-js-extension-to-types.mjs",
"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",

@@ -87,0 +90,0 @@ "publish-packages": "pnpm publish --tag experimental --access public --no-git-checks",

@@ -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