@solana/web3.js 1.63.1 → 1.64.0
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 +44 -0
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +44 -0
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +44 -0
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +42 -0
- package/lib/index.esm.js +44 -0
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +44 -0
- 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 +44 -0
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +90 -0
package/lib/index.iife.js
CHANGED
|
@@ -18050,6 +18050,28 @@ var solanaWeb3 = (function (exports) {
|
|
|
18050
18050
|
blockTime: nullable(number()),
|
|
18051
18051
|
blockHeight: nullable(number())
|
|
18052
18052
|
})));
|
|
18053
|
+
/**
|
|
18054
|
+
* Expected parsed JSON RPC response for the "getBlock" message
|
|
18055
|
+
*/
|
|
18056
|
+
|
|
18057
|
+
const GetParsedBlockRpcResult = jsonRpcResult(nullable(type({
|
|
18058
|
+
blockhash: string(),
|
|
18059
|
+
previousBlockhash: string(),
|
|
18060
|
+
parentSlot: number(),
|
|
18061
|
+
transactions: array(type({
|
|
18062
|
+
transaction: ParsedConfirmedTransactionResult,
|
|
18063
|
+
meta: nullable(ParsedConfirmedTransactionMetaResult),
|
|
18064
|
+
version: optional(TransactionVersionStruct)
|
|
18065
|
+
})),
|
|
18066
|
+
rewards: optional(array(type({
|
|
18067
|
+
pubkey: string(),
|
|
18068
|
+
lamports: number(),
|
|
18069
|
+
postBalance: nullable(number()),
|
|
18070
|
+
rewardType: nullable(string())
|
|
18071
|
+
}))),
|
|
18072
|
+
blockTime: nullable(number()),
|
|
18073
|
+
blockHeight: nullable(number())
|
|
18074
|
+
})));
|
|
18053
18075
|
/**
|
|
18054
18076
|
* Expected JSON RPC response for the "getConfirmedBlock" message
|
|
18055
18077
|
*
|
|
@@ -19389,6 +19411,28 @@ var solanaWeb3 = (function (exports) {
|
|
|
19389
19411
|
}))
|
|
19390
19412
|
};
|
|
19391
19413
|
}
|
|
19414
|
+
/**
|
|
19415
|
+
* Fetch parsed transaction details for a confirmed or finalized block
|
|
19416
|
+
*/
|
|
19417
|
+
|
|
19418
|
+
|
|
19419
|
+
async getParsedBlock(slot, rawConfig) {
|
|
19420
|
+
const {
|
|
19421
|
+
commitment,
|
|
19422
|
+
config
|
|
19423
|
+
} = extractCommitmentFromConfig(rawConfig);
|
|
19424
|
+
|
|
19425
|
+
const args = this._buildArgsAtLeastConfirmed([slot], commitment, 'jsonParsed', config);
|
|
19426
|
+
|
|
19427
|
+
const unsafeRes = await this._rpcRequest('getBlock', args);
|
|
19428
|
+
const res = create(unsafeRes, GetParsedBlockRpcResult);
|
|
19429
|
+
|
|
19430
|
+
if ('error' in res) {
|
|
19431
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get block');
|
|
19432
|
+
}
|
|
19433
|
+
|
|
19434
|
+
return res.result;
|
|
19435
|
+
}
|
|
19392
19436
|
/*
|
|
19393
19437
|
* Returns the current block height of the node
|
|
19394
19438
|
*/
|