@solana/rpc-types
Advanced tools
Comparing version 2.0.0-experimental.15440e6 to 2.0.0-experimental.1a0940d
@@ -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 | ||
@@ -101,4 +139,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, 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 | ||
@@ -101,4 +139,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, 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 | ||
@@ -101,4 +139,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, devnet, isLamports, isStringifiedBigInt, isStringifiedNumber, isUnixTimestamp, lamports, mainnet, stringifiedBigInt, stringifiedNumber, testnet, unixTimestamp }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.node.js.map |
@@ -0,6 +1,12 @@ | ||
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 './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.15440e6", | ||
"version": "2.0.0-experimental.1a0940d", | ||
"description": "Type definitions for values used in the Solana RPC, and helper functions for working with them", | ||
@@ -67,3 +67,3 @@ "exports": { | ||
"version-from-git": "^1.1.1", | ||
"@solana/transactions": "2.0.0-experimental.15440e6", | ||
"@solana/codecs-core": "2.0.0-experimental.1a0940d", | ||
"build-scripts": "0.0.0", | ||
@@ -81,2 +81,5 @@ "test-config": "0.0.0", | ||
}, | ||
"dependencies": { | ||
"@solana/codecs-strings": "2.0.0-experimental.1a0940d" | ||
}, | ||
"scripts": { | ||
@@ -83,0 +86,0 @@ "compile:js": "tsup --config build-scripts/tsup.config.package.ts", |
@@ -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
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
149939
40
1669
1
+ Added@solana/codecs-core@2.0.0-experimental.1a0940d(transitive)
+ Added@solana/codecs-numbers@2.0.0-experimental.1a0940d(transitive)
+ Added@solana/codecs-strings@2.0.0-experimental.1a0940d(transitive)
+ Addedfastestsmallesttextencoderdecoder@1.0.22(transitive)