@solana/rpc-core
Advanced tools
Comparing version 2.0.0-experimental.3e5b95c to 2.0.0-experimental.444644c
@@ -1,2 +0,2 @@ | ||
import bs58 from 'bs58'; | ||
import { base58 } from '@metaplex-foundation/umi-serializers-encodings'; | ||
@@ -13,3 +13,3 @@ // src/blockhash.ts | ||
} | ||
const bytes = bs58.decode(putativeBlockhash); | ||
const bytes = base58.serialize(putativeBlockhash); | ||
const numBytes = bytes.byteLength; | ||
@@ -146,4 +146,48 @@ if (numBytes !== 32) { | ||
export { assertIsBlockhash, createSolanaRpcApi }; | ||
// src/stringified-bigint.ts | ||
function assertIsStringifiedBigInt(putativeBigInt) { | ||
try { | ||
BigInt(putativeBigInt); | ||
} catch (e) { | ||
throw new Error(`\`${putativeBigInt}\` cannot be parsed as a BigInt`, { | ||
cause: e | ||
}); | ||
} | ||
} | ||
function assertIsTransactionSignature(putativeTransactionSignature) { | ||
try { | ||
if ( | ||
// Lowest value (64 bytes of zeroes) | ||
putativeTransactionSignature.length < 64 || // Highest value (64 bytes of 255) | ||
putativeTransactionSignature.length > 88 | ||
) { | ||
throw new Error("Expected input string to decode to a byte array of length 64."); | ||
} | ||
const bytes = base58.serialize(putativeTransactionSignature); | ||
const numBytes = bytes.byteLength; | ||
if (numBytes !== 64) { | ||
throw new Error(`Expected input string to decode to a byte array of length 64. Actual length: ${numBytes}`); | ||
} | ||
} catch (e) { | ||
throw new Error(`\`${putativeTransactionSignature}\` is not a transaction signature`, { | ||
cause: e | ||
}); | ||
} | ||
} | ||
// src/unix-timestamp.ts | ||
function assertIsUnixTimestamp(putativeTimestamp) { | ||
try { | ||
if (putativeTimestamp > 864e13 || putativeTimestamp < -864e13) { | ||
throw new Error("Expected input number to be in the range [-8.64e15, 8.64e15]"); | ||
} | ||
} catch (e) { | ||
throw new Error(`\`${putativeTimestamp}\` is not a timestamp`, { | ||
cause: e | ||
}); | ||
} | ||
} | ||
export { assertIsBlockhash, assertIsStringifiedBigInt, assertIsTransactionSignature, assertIsUnixTimestamp, createSolanaRpcApi }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.browser.js.map |
@@ -1,2 +0,2 @@ | ||
import bs58 from 'bs58'; | ||
import { base58 } from '@metaplex-foundation/umi-serializers-encodings'; | ||
@@ -13,3 +13,3 @@ // src/blockhash.ts | ||
} | ||
const bytes = bs58.decode(putativeBlockhash); | ||
const bytes = base58.serialize(putativeBlockhash); | ||
const numBytes = bytes.byteLength; | ||
@@ -146,4 +146,48 @@ if (numBytes !== 32) { | ||
export { assertIsBlockhash, createSolanaRpcApi }; | ||
// src/stringified-bigint.ts | ||
function assertIsStringifiedBigInt(putativeBigInt) { | ||
try { | ||
BigInt(putativeBigInt); | ||
} catch (e) { | ||
throw new Error(`\`${putativeBigInt}\` cannot be parsed as a BigInt`, { | ||
cause: e | ||
}); | ||
} | ||
} | ||
function assertIsTransactionSignature(putativeTransactionSignature) { | ||
try { | ||
if ( | ||
// Lowest value (64 bytes of zeroes) | ||
putativeTransactionSignature.length < 64 || // Highest value (64 bytes of 255) | ||
putativeTransactionSignature.length > 88 | ||
) { | ||
throw new Error("Expected input string to decode to a byte array of length 64."); | ||
} | ||
const bytes = base58.serialize(putativeTransactionSignature); | ||
const numBytes = bytes.byteLength; | ||
if (numBytes !== 64) { | ||
throw new Error(`Expected input string to decode to a byte array of length 64. Actual length: ${numBytes}`); | ||
} | ||
} catch (e) { | ||
throw new Error(`\`${putativeTransactionSignature}\` is not a transaction signature`, { | ||
cause: e | ||
}); | ||
} | ||
} | ||
// src/unix-timestamp.ts | ||
function assertIsUnixTimestamp(putativeTimestamp) { | ||
try { | ||
if (putativeTimestamp > 864e13 || putativeTimestamp < -864e13) { | ||
throw new Error("Expected input number to be in the range [-8.64e15, 8.64e15]"); | ||
} | ||
} catch (e) { | ||
throw new Error(`\`${putativeTimestamp}\` is not a timestamp`, { | ||
cause: e | ||
}); | ||
} | ||
} | ||
export { assertIsBlockhash, assertIsStringifiedBigInt, assertIsTransactionSignature, assertIsUnixTimestamp, createSolanaRpcApi }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.native.js.map |
@@ -1,2 +0,2 @@ | ||
import bs58 from 'bs58'; | ||
import { base58 } from '@metaplex-foundation/umi-serializers-encodings'; | ||
@@ -13,3 +13,3 @@ // src/blockhash.ts | ||
} | ||
const bytes = bs58.decode(putativeBlockhash); | ||
const bytes = base58.serialize(putativeBlockhash); | ||
const numBytes = bytes.byteLength; | ||
@@ -146,4 +146,48 @@ if (numBytes !== 32) { | ||
export { assertIsBlockhash, createSolanaRpcApi }; | ||
// src/stringified-bigint.ts | ||
function assertIsStringifiedBigInt(putativeBigInt) { | ||
try { | ||
BigInt(putativeBigInt); | ||
} catch (e) { | ||
throw new Error(`\`${putativeBigInt}\` cannot be parsed as a BigInt`, { | ||
cause: e | ||
}); | ||
} | ||
} | ||
function assertIsTransactionSignature(putativeTransactionSignature) { | ||
try { | ||
if ( | ||
// Lowest value (64 bytes of zeroes) | ||
putativeTransactionSignature.length < 64 || // Highest value (64 bytes of 255) | ||
putativeTransactionSignature.length > 88 | ||
) { | ||
throw new Error("Expected input string to decode to a byte array of length 64."); | ||
} | ||
const bytes = base58.serialize(putativeTransactionSignature); | ||
const numBytes = bytes.byteLength; | ||
if (numBytes !== 64) { | ||
throw new Error(`Expected input string to decode to a byte array of length 64. Actual length: ${numBytes}`); | ||
} | ||
} catch (e) { | ||
throw new Error(`\`${putativeTransactionSignature}\` is not a transaction signature`, { | ||
cause: e | ||
}); | ||
} | ||
} | ||
// src/unix-timestamp.ts | ||
function assertIsUnixTimestamp(putativeTimestamp) { | ||
try { | ||
if (putativeTimestamp > 864e13 || putativeTimestamp < -864e13) { | ||
throw new Error("Expected input number to be in the range [-8.64e15, 8.64e15]"); | ||
} | ||
} catch (e) { | ||
throw new Error(`\`${putativeTimestamp}\` is not a timestamp`, { | ||
cause: e | ||
}); | ||
} | ||
} | ||
export { assertIsBlockhash, assertIsStringifiedBigInt, assertIsTransactionSignature, assertIsUnixTimestamp, createSolanaRpcApi }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.node.js.map |
export * from './blockhash'; | ||
export * from './rpc-methods'; | ||
export * from './stringified-bigint'; | ||
export * from './transaction-signature'; | ||
export * from './unix-timestamp'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@solana/rpc-core", | ||
"version": "2.0.0-experimental.3e5b95c", | ||
"version": "2.0.0-experimental.444644c", | ||
"description": "A library for making calls to the Solana JSON RPC API", | ||
@@ -49,4 +49,4 @@ "exports": { | ||
"dependencies": { | ||
"bs58": "^5.0.0", | ||
"@solana/keys": "2.0.0-experimental.3e5b95c" | ||
"@metaplex-foundation/umi-serializers-encodings": "^0.8.2", | ||
"@solana/keys": "2.0.0-experimental.444644c" | ||
}, | ||
@@ -57,3 +57,3 @@ "devDependencies": { | ||
"@swc/jest": "^0.2.26", | ||
"@types/jest": "^29.5.1", | ||
"@types/jest": "^29.5.2", | ||
"@typescript-eslint/eslint-plugin": "^5.57.1", | ||
@@ -66,4 +66,4 @@ "@typescript-eslint/parser": "^5.57.1", | ||
"eslint-plugin-sort-keys-fix": "^1.1.2", | ||
"jest": "^29.5.0", | ||
"jest-environment-jsdom": "^29.5.0", | ||
"jest": "^29.6.1", | ||
"jest-environment-jsdom": "^29.6.0", | ||
"jest-fetch-mock-fork": "^3.0.4", | ||
@@ -78,3 +78,3 @@ "jest-runner-eslint": "^2.1.0", | ||
"version-from-git": "^1.1.1", | ||
"@solana/rpc-transport": "2.0.0-experimental.3e5b95c", | ||
"@solana/rpc-transport": "2.0.0-experimental.444644c", | ||
"build-scripts": "0.0.0", | ||
@@ -81,0 +81,0 @@ "test-config": "0.0.0", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
211105
84
1916
0
+ Added@metaplex-foundation/umi-serializers-encodings@^0.8.2
+ Added@metaplex-foundation/umi-serializers-core@0.8.9(transitive)
+ Added@metaplex-foundation/umi-serializers-encodings@0.8.9(transitive)
+ Added@solana/keys@2.0.0-experimental.444644c(transitive)
- Removedbs58@^5.0.0
- Removed@solana/keys@2.0.0-experimental.3e5b95c(transitive)
- Removedbase-x@4.0.0(transitive)
- Removedbs58@5.0.0(transitive)