@solana/rpc-core
Advanced tools
Comparing version 2.0.0-experimental.caf8d51 to 2.0.0-experimental.cb1a5a0
@@ -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; | ||
@@ -58,3 +58,79 @@ if (numBytes !== 32) { | ||
var ALLOWED_NUMERIC_KEYPATHS = { | ||
getInflationReward: [[KEYPATH_WILDCARD, "commission"]] | ||
getAccountInfo: [ | ||
// parsed AddressTableLookup account | ||
["value", "data", "parsed", "info", "lastExtendedSlotStartIndex"], | ||
// parsed Config account | ||
["value", "data", "parsed", "info", "slashPenalty"], | ||
["value", "data", "parsed", "info", "warmupCooldownRate"], | ||
// parsed Token/Token22 token account | ||
["value", "data", "parsed", "info", "tokenAmount", "decimals"], | ||
["value", "data", "parsed", "info", "tokenAmount", "uiAmount"], | ||
["value", "data", "parsed", "info", "rentExemptReserve", "decimals"], | ||
["value", "data", "parsed", "info", "delegatedAmount", "decimals"], | ||
[ | ||
"value", | ||
"data", | ||
"parsed", | ||
"info", | ||
"extensions", | ||
KEYPATH_WILDCARD, | ||
"state", | ||
"olderTransferFee", | ||
"transferFeeBasisPoints" | ||
], | ||
[ | ||
"value", | ||
"data", | ||
"parsed", | ||
"info", | ||
"extensions", | ||
KEYPATH_WILDCARD, | ||
"state", | ||
"newerTransferFee", | ||
"transferFeeBasisPoints" | ||
], | ||
["value", "data", "parsed", "info", "extensions", KEYPATH_WILDCARD, "state", "preUpdateAverageRate"], | ||
["value", "data", "parsed", "info", "extensions", KEYPATH_WILDCARD, "state", "currentRate"], | ||
// parsed Token/Token22 mint account | ||
["value", "data", "parsed", "info", "decimals"], | ||
// parsed Token/Token22 multisig account | ||
["value", "data", "parsed", "info", "numRequiredSigners"], | ||
["value", "data", "parsed", "info", "numValidSigners"], | ||
// parsed Stake account | ||
["value", "data", "parsed", "info", "stake", "delegation", "warmupCooldownRate"], | ||
// parsed Sysvar rent account | ||
["value", "data", "parsed", "info", "exemptionThreshold"], | ||
["value", "data", "parsed", "info", "burnPercent"], | ||
// parsed Vote account | ||
["value", "data", "parsed", "info", "commission"], | ||
["value", "data", "parsed", "info", "votes", KEYPATH_WILDCARD, "confirmationCount"] | ||
], | ||
getBlockTime: [[]], | ||
getInflationReward: [[KEYPATH_WILDCARD, "commission"]], | ||
getRecentPerformanceSamples: [[KEYPATH_WILDCARD, "samplePeriodSecs"]], | ||
getTokenLargestAccounts: [ | ||
["value", KEYPATH_WILDCARD, "decimals"], | ||
["value", KEYPATH_WILDCARD, "uiAmount"] | ||
], | ||
getTransaction: [ | ||
["meta", "preTokenBalances", KEYPATH_WILDCARD, "accountIndex"], | ||
["meta", "preTokenBalances", KEYPATH_WILDCARD, "uiTokenAmount", "decimals"], | ||
["meta", "postTokenBalances", KEYPATH_WILDCARD, "accountIndex"], | ||
["meta", "postTokenBalances", KEYPATH_WILDCARD, "uiTokenAmount", "decimals"], | ||
["meta", "rewards", KEYPATH_WILDCARD, "commission"], | ||
["meta", "innerInstructions", KEYPATH_WILDCARD, "index"], | ||
["meta", "innerInstructions", KEYPATH_WILDCARD, "instructions", KEYPATH_WILDCARD, "programIdIndex"], | ||
["meta", "innerInstructions", KEYPATH_WILDCARD, "instructions", KEYPATH_WILDCARD, "accounts", KEYPATH_WILDCARD], | ||
["transaction", "message", "addressTableLookups", KEYPATH_WILDCARD, "writableIndexes", KEYPATH_WILDCARD], | ||
["transaction", "message", "addressTableLookups", KEYPATH_WILDCARD, "readonlyIndexes", KEYPATH_WILDCARD], | ||
["transaction", "message", "instructions", KEYPATH_WILDCARD, "programIdIndex"], | ||
["transaction", "message", "instructions", KEYPATH_WILDCARD, "accounts", KEYPATH_WILDCARD], | ||
["transaction", "message", "header", "numReadonlySignedAccounts"], | ||
["transaction", "message", "header", "numReadonlyUnsignedAccounts"], | ||
["transaction", "message", "header", "numRequiredSignatures"] | ||
], | ||
getVoteAccounts: [ | ||
["current", KEYPATH_WILDCARD, "commission"], | ||
["delinquent", KEYPATH_WILDCARD, "commission"] | ||
] | ||
}; | ||
@@ -81,3 +157,4 @@ | ||
// Upcast the value to `bigint` unless an allowed keypath is present. | ||
allowedKeypaths.length === 0) { | ||
allowedKeypaths.length === 0 && // Only try to upcast an Integer to `bigint` | ||
Number.isInteger(value)) { | ||
return BigInt(value); | ||
@@ -121,4 +198,48 @@ } else { | ||
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; | ||
@@ -58,3 +58,79 @@ if (numBytes !== 32) { | ||
var ALLOWED_NUMERIC_KEYPATHS = { | ||
getInflationReward: [[KEYPATH_WILDCARD, "commission"]] | ||
getAccountInfo: [ | ||
// parsed AddressTableLookup account | ||
["value", "data", "parsed", "info", "lastExtendedSlotStartIndex"], | ||
// parsed Config account | ||
["value", "data", "parsed", "info", "slashPenalty"], | ||
["value", "data", "parsed", "info", "warmupCooldownRate"], | ||
// parsed Token/Token22 token account | ||
["value", "data", "parsed", "info", "tokenAmount", "decimals"], | ||
["value", "data", "parsed", "info", "tokenAmount", "uiAmount"], | ||
["value", "data", "parsed", "info", "rentExemptReserve", "decimals"], | ||
["value", "data", "parsed", "info", "delegatedAmount", "decimals"], | ||
[ | ||
"value", | ||
"data", | ||
"parsed", | ||
"info", | ||
"extensions", | ||
KEYPATH_WILDCARD, | ||
"state", | ||
"olderTransferFee", | ||
"transferFeeBasisPoints" | ||
], | ||
[ | ||
"value", | ||
"data", | ||
"parsed", | ||
"info", | ||
"extensions", | ||
KEYPATH_WILDCARD, | ||
"state", | ||
"newerTransferFee", | ||
"transferFeeBasisPoints" | ||
], | ||
["value", "data", "parsed", "info", "extensions", KEYPATH_WILDCARD, "state", "preUpdateAverageRate"], | ||
["value", "data", "parsed", "info", "extensions", KEYPATH_WILDCARD, "state", "currentRate"], | ||
// parsed Token/Token22 mint account | ||
["value", "data", "parsed", "info", "decimals"], | ||
// parsed Token/Token22 multisig account | ||
["value", "data", "parsed", "info", "numRequiredSigners"], | ||
["value", "data", "parsed", "info", "numValidSigners"], | ||
// parsed Stake account | ||
["value", "data", "parsed", "info", "stake", "delegation", "warmupCooldownRate"], | ||
// parsed Sysvar rent account | ||
["value", "data", "parsed", "info", "exemptionThreshold"], | ||
["value", "data", "parsed", "info", "burnPercent"], | ||
// parsed Vote account | ||
["value", "data", "parsed", "info", "commission"], | ||
["value", "data", "parsed", "info", "votes", KEYPATH_WILDCARD, "confirmationCount"] | ||
], | ||
getBlockTime: [[]], | ||
getInflationReward: [[KEYPATH_WILDCARD, "commission"]], | ||
getRecentPerformanceSamples: [[KEYPATH_WILDCARD, "samplePeriodSecs"]], | ||
getTokenLargestAccounts: [ | ||
["value", KEYPATH_WILDCARD, "decimals"], | ||
["value", KEYPATH_WILDCARD, "uiAmount"] | ||
], | ||
getTransaction: [ | ||
["meta", "preTokenBalances", KEYPATH_WILDCARD, "accountIndex"], | ||
["meta", "preTokenBalances", KEYPATH_WILDCARD, "uiTokenAmount", "decimals"], | ||
["meta", "postTokenBalances", KEYPATH_WILDCARD, "accountIndex"], | ||
["meta", "postTokenBalances", KEYPATH_WILDCARD, "uiTokenAmount", "decimals"], | ||
["meta", "rewards", KEYPATH_WILDCARD, "commission"], | ||
["meta", "innerInstructions", KEYPATH_WILDCARD, "index"], | ||
["meta", "innerInstructions", KEYPATH_WILDCARD, "instructions", KEYPATH_WILDCARD, "programIdIndex"], | ||
["meta", "innerInstructions", KEYPATH_WILDCARD, "instructions", KEYPATH_WILDCARD, "accounts", KEYPATH_WILDCARD], | ||
["transaction", "message", "addressTableLookups", KEYPATH_WILDCARD, "writableIndexes", KEYPATH_WILDCARD], | ||
["transaction", "message", "addressTableLookups", KEYPATH_WILDCARD, "readonlyIndexes", KEYPATH_WILDCARD], | ||
["transaction", "message", "instructions", KEYPATH_WILDCARD, "programIdIndex"], | ||
["transaction", "message", "instructions", KEYPATH_WILDCARD, "accounts", KEYPATH_WILDCARD], | ||
["transaction", "message", "header", "numReadonlySignedAccounts"], | ||
["transaction", "message", "header", "numReadonlyUnsignedAccounts"], | ||
["transaction", "message", "header", "numRequiredSignatures"] | ||
], | ||
getVoteAccounts: [ | ||
["current", KEYPATH_WILDCARD, "commission"], | ||
["delinquent", KEYPATH_WILDCARD, "commission"] | ||
] | ||
}; | ||
@@ -81,3 +157,4 @@ | ||
// Upcast the value to `bigint` unless an allowed keypath is present. | ||
allowedKeypaths.length === 0) { | ||
allowedKeypaths.length === 0 && // Only try to upcast an Integer to `bigint` | ||
Number.isInteger(value)) { | ||
return BigInt(value); | ||
@@ -121,4 +198,48 @@ } else { | ||
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; | ||
@@ -58,3 +58,79 @@ if (numBytes !== 32) { | ||
var ALLOWED_NUMERIC_KEYPATHS = { | ||
getInflationReward: [[KEYPATH_WILDCARD, "commission"]] | ||
getAccountInfo: [ | ||
// parsed AddressTableLookup account | ||
["value", "data", "parsed", "info", "lastExtendedSlotStartIndex"], | ||
// parsed Config account | ||
["value", "data", "parsed", "info", "slashPenalty"], | ||
["value", "data", "parsed", "info", "warmupCooldownRate"], | ||
// parsed Token/Token22 token account | ||
["value", "data", "parsed", "info", "tokenAmount", "decimals"], | ||
["value", "data", "parsed", "info", "tokenAmount", "uiAmount"], | ||
["value", "data", "parsed", "info", "rentExemptReserve", "decimals"], | ||
["value", "data", "parsed", "info", "delegatedAmount", "decimals"], | ||
[ | ||
"value", | ||
"data", | ||
"parsed", | ||
"info", | ||
"extensions", | ||
KEYPATH_WILDCARD, | ||
"state", | ||
"olderTransferFee", | ||
"transferFeeBasisPoints" | ||
], | ||
[ | ||
"value", | ||
"data", | ||
"parsed", | ||
"info", | ||
"extensions", | ||
KEYPATH_WILDCARD, | ||
"state", | ||
"newerTransferFee", | ||
"transferFeeBasisPoints" | ||
], | ||
["value", "data", "parsed", "info", "extensions", KEYPATH_WILDCARD, "state", "preUpdateAverageRate"], | ||
["value", "data", "parsed", "info", "extensions", KEYPATH_WILDCARD, "state", "currentRate"], | ||
// parsed Token/Token22 mint account | ||
["value", "data", "parsed", "info", "decimals"], | ||
// parsed Token/Token22 multisig account | ||
["value", "data", "parsed", "info", "numRequiredSigners"], | ||
["value", "data", "parsed", "info", "numValidSigners"], | ||
// parsed Stake account | ||
["value", "data", "parsed", "info", "stake", "delegation", "warmupCooldownRate"], | ||
// parsed Sysvar rent account | ||
["value", "data", "parsed", "info", "exemptionThreshold"], | ||
["value", "data", "parsed", "info", "burnPercent"], | ||
// parsed Vote account | ||
["value", "data", "parsed", "info", "commission"], | ||
["value", "data", "parsed", "info", "votes", KEYPATH_WILDCARD, "confirmationCount"] | ||
], | ||
getBlockTime: [[]], | ||
getInflationReward: [[KEYPATH_WILDCARD, "commission"]], | ||
getRecentPerformanceSamples: [[KEYPATH_WILDCARD, "samplePeriodSecs"]], | ||
getTokenLargestAccounts: [ | ||
["value", KEYPATH_WILDCARD, "decimals"], | ||
["value", KEYPATH_WILDCARD, "uiAmount"] | ||
], | ||
getTransaction: [ | ||
["meta", "preTokenBalances", KEYPATH_WILDCARD, "accountIndex"], | ||
["meta", "preTokenBalances", KEYPATH_WILDCARD, "uiTokenAmount", "decimals"], | ||
["meta", "postTokenBalances", KEYPATH_WILDCARD, "accountIndex"], | ||
["meta", "postTokenBalances", KEYPATH_WILDCARD, "uiTokenAmount", "decimals"], | ||
["meta", "rewards", KEYPATH_WILDCARD, "commission"], | ||
["meta", "innerInstructions", KEYPATH_WILDCARD, "index"], | ||
["meta", "innerInstructions", KEYPATH_WILDCARD, "instructions", KEYPATH_WILDCARD, "programIdIndex"], | ||
["meta", "innerInstructions", KEYPATH_WILDCARD, "instructions", KEYPATH_WILDCARD, "accounts", KEYPATH_WILDCARD], | ||
["transaction", "message", "addressTableLookups", KEYPATH_WILDCARD, "writableIndexes", KEYPATH_WILDCARD], | ||
["transaction", "message", "addressTableLookups", KEYPATH_WILDCARD, "readonlyIndexes", KEYPATH_WILDCARD], | ||
["transaction", "message", "instructions", KEYPATH_WILDCARD, "programIdIndex"], | ||
["transaction", "message", "instructions", KEYPATH_WILDCARD, "accounts", KEYPATH_WILDCARD], | ||
["transaction", "message", "header", "numReadonlySignedAccounts"], | ||
["transaction", "message", "header", "numReadonlyUnsignedAccounts"], | ||
["transaction", "message", "header", "numRequiredSignatures"] | ||
], | ||
getVoteAccounts: [ | ||
["current", KEYPATH_WILDCARD, "commission"], | ||
["delinquent", KEYPATH_WILDCARD, "commission"] | ||
] | ||
}; | ||
@@ -81,3 +157,4 @@ | ||
// Upcast the value to `bigint` unless an allowed keypath is present. | ||
allowedKeypaths.length === 0) { | ||
allowedKeypaths.length === 0 && // Only try to upcast an Integer to `bigint` | ||
Number.isInteger(value)) { | ||
return BigInt(value); | ||
@@ -121,4 +198,48 @@ } else { | ||
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 |
@@ -0,3 +1,3 @@ | ||
import { KeyPath } from './response-patcher'; | ||
import { createSolanaRpcApi } from './rpc-methods'; | ||
import { KeyPath } from './response-patcher'; | ||
/** | ||
@@ -4,0 +4,0 @@ * These are keypaths at the end of which you will find a numeric value that should *not* be upcast |
@@ -0,5 +1,5 @@ | ||
import { KeyPathWildcard } from './response-patcher-types'; | ||
import { createSolanaRpcApi } from './rpc-methods'; | ||
import { KeyPathWildcard } from './response-patcher-types'; | ||
export type KeyPath = ReadonlyArray<KeyPathWildcard | number | string | KeyPath>; | ||
export declare function patchResponseForSolanaLabsRpc<T>(rawResponse: unknown, methodName?: keyof ReturnType<typeof createSolanaRpcApi>): T; | ||
//# sourceMappingURL=response-patcher.d.ts.map |
@@ -17,2 +17,15 @@ export type Commitment = 'confirmed' | 'finalized' | 'processed'; | ||
}>; | ||
export type TransactionVersion = 'legacy' | 0; | ||
export type Base58EncodedBytes = string & { | ||
readonly __base58EncodedBytes: unique symbol; | ||
}; | ||
export type Base64EncodedBytes = string & { | ||
readonly __base64EncodedBytes: unique symbol; | ||
}; | ||
export type Base64EncodedZStdCompressedBytes = string & { | ||
readonly __base64EncodedZStdCompressedBytes: unique symbol; | ||
}; | ||
export type Base58EncodedDataResponse = [Base58EncodedBytes, 'base58']; | ||
export type Base64EncodedDataResponse = [Base64EncodedBytes, 'base64']; | ||
export type Base64EncodedZStdCompressedDataResponse = [Base64EncodedZStdCompressedBytes, 'base64+zstd']; | ||
//# sourceMappingURL=common.d.ts.map |
import { Base58EncodedAddress } from '@solana/keys'; | ||
import { Commitment, DataSlice, LamportsUnsafeBeyond2Pow53Minus1, Slot, U64UnsafeBeyond2Pow53Minus1 } from './common'; | ||
type Base58EncodedBytes = string & { | ||
readonly __base58EncodedBytes: unique symbol; | ||
}; | ||
type Base64EncodedBytes = string & { | ||
readonly __base64EncodedBytes: unique symbol; | ||
}; | ||
type Base64EncodedZStdCompressedBytes = string & { | ||
readonly __base64EncodedZStdCompressedBytes: unique symbol; | ||
}; | ||
type Base58EncodedDataResponse = [Base58EncodedBytes, 'base58']; | ||
type Base64EncodedDataResponse = [Base64EncodedBytes, 'base64']; | ||
type Base64EncodedZStdCompressedDataResponse = [Base64EncodedZStdCompressedBytes, 'base64+zstd']; | ||
import { Base58EncodedBytes, Base58EncodedDataResponse, Base64EncodedDataResponse, Base64EncodedZStdCompressedDataResponse, Commitment, DataSlice, LamportsUnsafeBeyond2Pow53Minus1, Slot, U64UnsafeBeyond2Pow53Minus1 } from './common'; | ||
type GetAccountInfoApiResponseBase = Readonly<{ | ||
@@ -16,0 +4,0 @@ context: Readonly<{ |
@@ -1,2 +0,2 @@ | ||
import { U64UnsafeBeyond2Pow53Minus1, Commitment, Slot } from './common'; | ||
import { Commitment, Slot, U64UnsafeBeyond2Pow53Minus1 } from './common'; | ||
type GetBlockHeightApiResponse = U64UnsafeBeyond2Pow53Minus1; | ||
@@ -3,0 +3,0 @@ export interface GetBlockHeightApi { |
@@ -1,2 +0,2 @@ | ||
import { Slot, Commitment } from './common'; | ||
import { Commitment, Slot } from './common'; | ||
type GetBlocksApiResponse = Slot[]; | ||
@@ -3,0 +3,0 @@ export interface GetBlocksApi { |
@@ -1,2 +0,2 @@ | ||
import { U64UnsafeBeyond2Pow53Minus1, Commitment, Slot } from './common'; | ||
import { Commitment, Slot, U64UnsafeBeyond2Pow53Minus1 } from './common'; | ||
type GetTransactionCountApiResponse = U64UnsafeBeyond2Pow53Minus1; | ||
@@ -3,0 +3,0 @@ export interface GetTransactionCountApi { |
@@ -7,2 +7,5 @@ import { IRpcApi } from '@solana/rpc-transport/dist/types/json-rpc-types'; | ||
import { GetBlocksApi } from './getBlocks'; | ||
import { GetBlockTimeApi } from './getBlockTime'; | ||
import { GetEpochInfoApi } from './getEpochInfo'; | ||
import { GetEpochScheduleApi } from './getEpochSchedule'; | ||
import { GetFirstAvailableBlockApi } from './getFirstAvailableBlock'; | ||
@@ -13,13 +16,20 @@ import { GetInflationRewardApi } from './getInflationReward'; | ||
import { GetMaxShredInsertSlotApi } from './getMaxShredInsertSlot'; | ||
import { GetRecentPerformanceSamplesApi } from './getRecentPerformanceSamples'; | ||
import { GetSignaturesForAddressApi } from './getSignaturesForAddress'; | ||
import { GetSlotApi } from './getSlot'; | ||
import { GetSlotLeadersApi } from './getSlotLeaders'; | ||
import { GetStakeMinimumDelegationApi } from './getStakeMinimumDelegation'; | ||
import { GetSupplyApi } from './getSupply'; | ||
import { GetTokenLargestAccountsApi } from './getTokenLargestAccounts'; | ||
import { GetTransactionApi } from './getTransaction'; | ||
import { GetTransactionCountApi } from './getTransactionCount'; | ||
import { GetVoteAccountsApi } from './getVoteAccounts'; | ||
import { IsBlockhashValidApi } from './isBlockhashValid'; | ||
import { MinimumLedgerSlotApi } from './minimumLedgerSlot'; | ||
import { GetEpochInfoApi } from './getEpochInfo'; | ||
type Config = Readonly<{ | ||
onIntegerOverflow?: (methodName: string, keyPath: (number | string)[], value: bigint) => void; | ||
}>; | ||
export type SolanaRpcMethods = GetAccountInfoApi & GetBalanceApi & GetBlockHeightApi & GetBlockProductionApi & GetBlocksApi & GetFirstAvailableBlockApi & GetInflationRewardApi & GetLatestBlockhashApi & GetMaxRetransmitSlotApi & GetMaxShredInsertSlotApi & GetSlotApi & GetStakeMinimumDelegationApi & GetTransactionCountApi & MinimumLedgerSlotApi & GetEpochInfoApi; | ||
export type SolanaRpcMethods = GetAccountInfoApi & GetBalanceApi & GetBlockHeightApi & GetBlockProductionApi & GetBlocksApi & GetBlockTimeApi & GetEpochInfoApi & GetEpochScheduleApi & GetFirstAvailableBlockApi & GetInflationRewardApi & GetLatestBlockhashApi & GetMaxRetransmitSlotApi & GetMaxShredInsertSlotApi & GetRecentPerformanceSamplesApi & GetSignaturesForAddressApi & GetSlotApi & GetSlotLeadersApi & GetStakeMinimumDelegationApi & GetSupplyApi & GetTokenLargestAccountsApi & GetTransactionApi & GetTransactionCountApi & GetVoteAccountsApi & IsBlockhashValidApi & MinimumLedgerSlotApi; | ||
export declare function createSolanaRpcApi(config?: Config): IRpcApi<SolanaRpcMethods>; | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@solana/rpc-core", | ||
"version": "2.0.0-experimental.caf8d51", | ||
"version": "2.0.0-experimental.cb1a5a0", | ||
"description": "A library for making calls to the Solana JSON RPC API", | ||
@@ -49,10 +49,10 @@ "exports": { | ||
"dependencies": { | ||
"bs58": "^5.0.0", | ||
"@solana/keys": "2.0.0-experimental.caf8d51" | ||
"@metaplex-foundation/umi-serializers-encodings": "^0.8.2", | ||
"@solana/keys": "2.0.0-experimental.cb1a5a0" | ||
}, | ||
"devDependencies": { | ||
"@solana/eslint-config-solana": "^1.0.0", | ||
"@solana/eslint-config-solana": "^1.0.1", | ||
"@swc/core": "^1.3.18", | ||
"@swc/jest": "^0.2.23", | ||
"@types/jest": "^29.5.0", | ||
"@swc/jest": "^0.2.26", | ||
"@types/jest": "^29.5.2", | ||
"@typescript-eslint/eslint-plugin": "^5.57.1", | ||
@@ -65,14 +65,14 @@ "@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", | ||
"jest-runner-eslint": "^2.0.0", | ||
"jest-runner-eslint": "^2.1.0", | ||
"jest-runner-prettier": "^1.0.0", | ||
"postcss": "^8.4.12", | ||
"prettier": "^2.7.1", | ||
"prettier": "^2.8.8", | ||
"ts-node": "^10.9.1", | ||
"tsup": "6.7.0", | ||
"typescript": "^5.0.3", | ||
"typescript": "^5.0.4", | ||
"version-from-git": "^1.1.1", | ||
"@solana/rpc-transport": "2.0.0-experimental.caf8d51", | ||
"@solana/rpc-transport": "2.0.0-experimental.cb1a5a0", | ||
"build-scripts": "0.0.0", | ||
@@ -79,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
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
213030
2251
0
51
+ Added@metaplex-foundation/umi-serializers-encodings@^0.8.2
+ Added@metaplex-foundation/umi-options@0.8.9(transitive)
+ Added@metaplex-foundation/umi-public-keys@0.8.9(transitive)
+ Added@metaplex-foundation/umi-serializers@0.8.9(transitive)
+ Added@metaplex-foundation/umi-serializers-core@0.8.9(transitive)
+ Added@metaplex-foundation/umi-serializers-encodings@0.8.9(transitive)
+ Added@metaplex-foundation/umi-serializers-numbers@0.8.9(transitive)
+ Added@solana/keys@2.0.0-experimental.cb1a5a0(transitive)
- Removedbs58@^5.0.0
- Removed@solana/keys@2.0.0-experimental.caf8d51(transitive)
- Removedbase-x@4.0.0(transitive)
- Removedbs58@5.0.0(transitive)