@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.browser.cjs.js
CHANGED
|
@@ -4452,6 +4452,28 @@ const GetBlockRpcResult = jsonRpcResult(superstruct.nullable(superstruct.type({
|
|
|
4452
4452
|
blockTime: superstruct.nullable(superstruct.number()),
|
|
4453
4453
|
blockHeight: superstruct.nullable(superstruct.number())
|
|
4454
4454
|
})));
|
|
4455
|
+
/**
|
|
4456
|
+
* Expected parsed JSON RPC response for the "getBlock" message
|
|
4457
|
+
*/
|
|
4458
|
+
|
|
4459
|
+
const GetParsedBlockRpcResult = jsonRpcResult(superstruct.nullable(superstruct.type({
|
|
4460
|
+
blockhash: superstruct.string(),
|
|
4461
|
+
previousBlockhash: superstruct.string(),
|
|
4462
|
+
parentSlot: superstruct.number(),
|
|
4463
|
+
transactions: superstruct.array(superstruct.type({
|
|
4464
|
+
transaction: ParsedConfirmedTransactionResult,
|
|
4465
|
+
meta: superstruct.nullable(ParsedConfirmedTransactionMetaResult),
|
|
4466
|
+
version: superstruct.optional(TransactionVersionStruct)
|
|
4467
|
+
})),
|
|
4468
|
+
rewards: superstruct.optional(superstruct.array(superstruct.type({
|
|
4469
|
+
pubkey: superstruct.string(),
|
|
4470
|
+
lamports: superstruct.number(),
|
|
4471
|
+
postBalance: superstruct.nullable(superstruct.number()),
|
|
4472
|
+
rewardType: superstruct.nullable(superstruct.string())
|
|
4473
|
+
}))),
|
|
4474
|
+
blockTime: superstruct.nullable(superstruct.number()),
|
|
4475
|
+
blockHeight: superstruct.nullable(superstruct.number())
|
|
4476
|
+
})));
|
|
4455
4477
|
/**
|
|
4456
4478
|
* Expected JSON RPC response for the "getConfirmedBlock" message
|
|
4457
4479
|
*
|
|
@@ -4586,7 +4608,7 @@ const LogsNotificationResult = superstruct.type({
|
|
|
4586
4608
|
|
|
4587
4609
|
/** @internal */
|
|
4588
4610
|
const COMMON_HTTP_HEADERS = {
|
|
4589
|
-
'solana-client': `js/${(_process$env$npm_pack = "1.
|
|
4611
|
+
'solana-client': `js/${(_process$env$npm_pack = "1.64.1") !== null && _process$env$npm_pack !== void 0 ? _process$env$npm_pack : 'UNKNOWN'}`
|
|
4590
4612
|
};
|
|
4591
4613
|
/**
|
|
4592
4614
|
* A connection to a fullnode JSON RPC endpoint
|
|
@@ -5791,6 +5813,28 @@ class Connection {
|
|
|
5791
5813
|
}))
|
|
5792
5814
|
};
|
|
5793
5815
|
}
|
|
5816
|
+
/**
|
|
5817
|
+
* Fetch parsed transaction details for a confirmed or finalized block
|
|
5818
|
+
*/
|
|
5819
|
+
|
|
5820
|
+
|
|
5821
|
+
async getParsedBlock(slot, rawConfig) {
|
|
5822
|
+
const {
|
|
5823
|
+
commitment,
|
|
5824
|
+
config
|
|
5825
|
+
} = extractCommitmentFromConfig(rawConfig);
|
|
5826
|
+
|
|
5827
|
+
const args = this._buildArgsAtLeastConfirmed([slot], commitment, 'jsonParsed', config);
|
|
5828
|
+
|
|
5829
|
+
const unsafeRes = await this._rpcRequest('getBlock', args);
|
|
5830
|
+
const res = superstruct.create(unsafeRes, GetParsedBlockRpcResult);
|
|
5831
|
+
|
|
5832
|
+
if ('error' in res) {
|
|
5833
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get block');
|
|
5834
|
+
}
|
|
5835
|
+
|
|
5836
|
+
return res.result;
|
|
5837
|
+
}
|
|
5794
5838
|
/*
|
|
5795
5839
|
* Returns the current block height of the node
|
|
5796
5840
|
*/
|