@solana/rpc-types
Advanced tools
Comparing version 2.0.0-experimental.65e87b8 to 2.0.0-experimental.6725a9f
@@ -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 |
@@ -1,6 +0,11 @@ | ||
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 './rpc-api.js'; | ||
export * from './stringified-bigint.js'; | ||
export * from './stringified-number.js'; | ||
export * from './token-amount.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.65e87b8", | ||
"version": "2.0.0-experimental.6725a9f", | ||
"description": "Type definitions for values used in the Solana RPC, and helper functions for working with them", | ||
@@ -51,4 +51,4 @@ "exports": { | ||
"@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 +64,7 @@ "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.65e87b8", | ||
"@solana/codecs-core": "2.0.0-experimental.6725a9f", | ||
"build-scripts": "0.0.0", | ||
@@ -82,5 +82,8 @@ "test-config": "0.0.0", | ||
}, | ||
"dependencies": { | ||
"@solana/codecs-strings": "2.0.0-experimental.6725a9f" | ||
}, | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143642
38
1586
1
+ Added@solana/codecs-core@2.0.0-experimental.6725a9f(transitive)
+ Added@solana/codecs-numbers@2.0.0-experimental.6725a9f(transitive)
+ Added@solana/codecs-strings@2.0.0-experimental.6725a9f(transitive)
+ Addedfastestsmallesttextencoderdecoder@1.0.22(transitive)