@solana/rpc-core
Advanced tools
Comparing version 2.0.0-experimental.77f78a8 to 2.0.0-experimental.7b00896
@@ -0,1 +1,25 @@ | ||
import bs58 from 'bs58'; | ||
// src/blockhash.ts | ||
function assertIsBlockhash(putativeBlockhash) { | ||
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 = bs58.decode(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/params-patcher.ts | ||
@@ -66,3 +90,3 @@ function visitNode(value, keyPath, onIntegerOverflow) { | ||
// src/index.ts | ||
// src/rpc-methods/index.ts | ||
function createSolanaRpcApi(config) { | ||
@@ -95,4 +119,4 @@ return new Proxy({}, { | ||
export { createSolanaRpcApi }; | ||
export { assertIsBlockhash, createSolanaRpcApi }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.browser.js.map |
@@ -0,1 +1,25 @@ | ||
import bs58 from 'bs58'; | ||
// src/blockhash.ts | ||
function assertIsBlockhash(putativeBlockhash) { | ||
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 = bs58.decode(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/params-patcher.ts | ||
@@ -66,3 +90,3 @@ function visitNode(value, keyPath, onIntegerOverflow) { | ||
// src/index.ts | ||
// src/rpc-methods/index.ts | ||
function createSolanaRpcApi(config) { | ||
@@ -95,4 +119,4 @@ return new Proxy({}, { | ||
export { createSolanaRpcApi }; | ||
export { assertIsBlockhash, createSolanaRpcApi }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.native.js.map |
@@ -0,1 +1,25 @@ | ||
import bs58 from 'bs58'; | ||
// src/blockhash.ts | ||
function assertIsBlockhash(putativeBlockhash) { | ||
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 = bs58.decode(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/params-patcher.ts | ||
@@ -66,3 +90,3 @@ function visitNode(value, keyPath, onIntegerOverflow) { | ||
// src/index.ts | ||
// src/rpc-methods/index.ts | ||
function createSolanaRpcApi(config) { | ||
@@ -95,4 +119,4 @@ return new Proxy({}, { | ||
export { createSolanaRpcApi }; | ||
export { assertIsBlockhash, createSolanaRpcApi }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.node.js.map |
@@ -1,13 +0,3 @@ | ||
import { IRpcApi } from '@solana/rpc-transport/dist/types/json-rpc-types'; | ||
import { GetAccountInfoApi } from './rpc-methods/getAccountInfo'; | ||
import { GetBlockHeightApi } from './rpc-methods/getBlockHeight'; | ||
import { GetBlocksApi } from './rpc-methods/getBlocks'; | ||
import { GetInflationRewardApi } from './rpc-methods/getInflationReward'; | ||
import { GetBalanceApi } from './rpc-methods/getBalance'; | ||
type Config = Readonly<{ | ||
onIntegerOverflow?: (methodName: string, keyPath: (number | string)[], value: bigint) => void; | ||
}>; | ||
export type SolanaRpcMethods = GetAccountInfoApi & GetBalanceApi & GetBlockHeightApi & GetBlocksApi & GetInflationRewardApi; | ||
export declare function createSolanaRpcApi(config?: Config): IRpcApi<SolanaRpcMethods>; | ||
export {}; | ||
export * from './blockhash'; | ||
export * from './rpc-methods'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { createSolanaRpcApi } from './index'; | ||
import { createSolanaRpcApi } from './rpc-methods'; | ||
import { KeyPath } from './response-patcher'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { createSolanaRpcApi } from './index'; | ||
import { createSolanaRpcApi } from './rpc-methods'; | ||
import { KeyPathWildcard } from './response-patcher-types'; | ||
@@ -3,0 +3,0 @@ export type KeyPath = ReadonlyArray<KeyPathWildcard | number | string | KeyPath>; |
@@ -6,2 +6,5 @@ export type Commitment = 'confirmed' | 'finalized' | 'processed'; | ||
}>; | ||
export type LamportsUnsafeBeyond2Pow53Minus1 = bigint & { | ||
readonly __lamports: unique symbol; | ||
}; | ||
export type Slot = U64UnsafeBeyond2Pow53Minus1; | ||
@@ -8,0 +11,0 @@ export type U64UnsafeBeyond2Pow53Minus1 = bigint; |
import { Base58EncodedAddress } from '@solana/keys'; | ||
import { Commitment, DataSlice, Slot, U64UnsafeBeyond2Pow53Minus1 } from './common'; | ||
import { Commitment, DataSlice, LamportsUnsafeBeyond2Pow53Minus1, Slot, U64UnsafeBeyond2Pow53Minus1 } from './common'; | ||
type Base58EncodedBytes = string & { | ||
@@ -21,3 +21,3 @@ readonly __base58EncodedBytes: unique symbol; | ||
executable: boolean; | ||
lamports: U64UnsafeBeyond2Pow53Minus1; | ||
lamports: LamportsUnsafeBeyond2Pow53Minus1; | ||
owner: Base58EncodedAddress; | ||
@@ -24,0 +24,0 @@ rentEpoch: U64UnsafeBeyond2Pow53Minus1; |
import { Base58EncodedAddress } from '@solana/keys'; | ||
import { Commitment, RpcResponse, Slot, U64UnsafeBeyond2Pow53Minus1 } from './common'; | ||
type GetBalanceApiResponse = RpcResponse<U64UnsafeBeyond2Pow53Minus1>; | ||
import { Commitment, LamportsUnsafeBeyond2Pow53Minus1, RpcResponse, Slot } from './common'; | ||
type GetBalanceApiResponse = RpcResponse<LamportsUnsafeBeyond2Pow53Minus1>; | ||
export interface GetBalanceApi { | ||
@@ -5,0 +5,0 @@ /** |
import { Base58EncodedAddress } from '@solana/keys'; | ||
import { Commitment, Slot, U64UnsafeBeyond2Pow53Minus1 } from './common'; | ||
import { Commitment, LamportsUnsafeBeyond2Pow53Minus1, Slot, U64UnsafeBeyond2Pow53Minus1 } from './common'; | ||
type GetInflationRewardApiResponse = Readonly<{ | ||
amount: U64UnsafeBeyond2Pow53Minus1; | ||
amount: LamportsUnsafeBeyond2Pow53Minus1; | ||
commission: number; | ||
effectiveSlot: U64UnsafeBeyond2Pow53Minus1; | ||
effectiveSlot: Slot; | ||
epoch: U64UnsafeBeyond2Pow53Minus1; | ||
postBalance: U64UnsafeBeyond2Pow53Minus1; | ||
postBalance: LamportsUnsafeBeyond2Pow53Minus1; | ||
}>; | ||
@@ -10,0 +10,0 @@ export interface GetInflationRewardApi { |
{ | ||
"name": "@solana/rpc-core", | ||
"version": "2.0.0-experimental.77f78a8", | ||
"version": "2.0.0-experimental.7b00896", | ||
"description": "A library for making calls to the Solana JSON RPC API", | ||
@@ -49,3 +49,4 @@ "exports": { | ||
"dependencies": { | ||
"@solana/keys": "2.0.0-experimental.77f78a8" | ||
"bs58": "^5.0.0", | ||
"@solana/keys": "2.0.0-experimental.7b00896" | ||
}, | ||
@@ -75,3 +76,3 @@ "devDependencies": { | ||
"version-from-git": "^1.1.1", | ||
"@solana/rpc-transport": "2.0.0-experimental.77f78a8", | ||
"@solana/rpc-transport": "2.0.0-experimental.7b00896", | ||
"build-scripts": "0.0.0", | ||
@@ -78,0 +79,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
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
104914
1013
2
62
+ Addedbs58@^5.0.0
+ Added@solana/keys@2.0.0-experimental.7b00896(transitive)
- Removed@solana/keys@2.0.0-experimental.77f78a8(transitive)