@solana/web3.js 1.63.2 → 1.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.browser.cjs.js +45 -1
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +45 -1
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +45 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +42 -0
- package/lib/index.esm.js +45 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +45 -1
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +1 -1
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +45 -1
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +90 -0
package/lib/index.cjs.js
CHANGED
|
@@ -4518,6 +4518,28 @@ const GetBlockRpcResult = jsonRpcResult(superstruct.nullable(superstruct.type({
|
|
|
4518
4518
|
blockTime: superstruct.nullable(superstruct.number()),
|
|
4519
4519
|
blockHeight: superstruct.nullable(superstruct.number())
|
|
4520
4520
|
})));
|
|
4521
|
+
/**
|
|
4522
|
+
* Expected parsed JSON RPC response for the "getBlock" message
|
|
4523
|
+
*/
|
|
4524
|
+
|
|
4525
|
+
const GetParsedBlockRpcResult = jsonRpcResult(superstruct.nullable(superstruct.type({
|
|
4526
|
+
blockhash: superstruct.string(),
|
|
4527
|
+
previousBlockhash: superstruct.string(),
|
|
4528
|
+
parentSlot: superstruct.number(),
|
|
4529
|
+
transactions: superstruct.array(superstruct.type({
|
|
4530
|
+
transaction: ParsedConfirmedTransactionResult,
|
|
4531
|
+
meta: superstruct.nullable(ParsedConfirmedTransactionMetaResult),
|
|
4532
|
+
version: superstruct.optional(TransactionVersionStruct)
|
|
4533
|
+
})),
|
|
4534
|
+
rewards: superstruct.optional(superstruct.array(superstruct.type({
|
|
4535
|
+
pubkey: superstruct.string(),
|
|
4536
|
+
lamports: superstruct.number(),
|
|
4537
|
+
postBalance: superstruct.nullable(superstruct.number()),
|
|
4538
|
+
rewardType: superstruct.nullable(superstruct.string())
|
|
4539
|
+
}))),
|
|
4540
|
+
blockTime: superstruct.nullable(superstruct.number()),
|
|
4541
|
+
blockHeight: superstruct.nullable(superstruct.number())
|
|
4542
|
+
})));
|
|
4521
4543
|
/**
|
|
4522
4544
|
* Expected JSON RPC response for the "getConfirmedBlock" message
|
|
4523
4545
|
*
|
|
@@ -4652,7 +4674,7 @@ const LogsNotificationResult = superstruct.type({
|
|
|
4652
4674
|
|
|
4653
4675
|
/** @internal */
|
|
4654
4676
|
const COMMON_HTTP_HEADERS = {
|
|
4655
|
-
'solana-client': `js/${(_process$env$npm_pack = "1.
|
|
4677
|
+
'solana-client': `js/${(_process$env$npm_pack = "1.64.1") !== null && _process$env$npm_pack !== void 0 ? _process$env$npm_pack : 'UNKNOWN'}`
|
|
4656
4678
|
};
|
|
4657
4679
|
/**
|
|
4658
4680
|
* A connection to a fullnode JSON RPC endpoint
|
|
@@ -5857,6 +5879,28 @@ class Connection {
|
|
|
5857
5879
|
}))
|
|
5858
5880
|
};
|
|
5859
5881
|
}
|
|
5882
|
+
/**
|
|
5883
|
+
* Fetch parsed transaction details for a confirmed or finalized block
|
|
5884
|
+
*/
|
|
5885
|
+
|
|
5886
|
+
|
|
5887
|
+
async getParsedBlock(slot, rawConfig) {
|
|
5888
|
+
const {
|
|
5889
|
+
commitment,
|
|
5890
|
+
config
|
|
5891
|
+
} = extractCommitmentFromConfig(rawConfig);
|
|
5892
|
+
|
|
5893
|
+
const args = this._buildArgsAtLeastConfirmed([slot], commitment, 'jsonParsed', config);
|
|
5894
|
+
|
|
5895
|
+
const unsafeRes = await this._rpcRequest('getBlock', args);
|
|
5896
|
+
const res = superstruct.create(unsafeRes, GetParsedBlockRpcResult);
|
|
5897
|
+
|
|
5898
|
+
if ('error' in res) {
|
|
5899
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get block');
|
|
5900
|
+
}
|
|
5901
|
+
|
|
5902
|
+
return res.result;
|
|
5903
|
+
}
|
|
5860
5904
|
/*
|
|
5861
5905
|
* Returns the current block height of the node
|
|
5862
5906
|
*/
|