@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.iife.js
CHANGED
|
@@ -18075,6 +18075,28 @@ var solanaWeb3 = (function (exports) {
|
|
|
18075
18075
|
blockTime: nullable(number()),
|
|
18076
18076
|
blockHeight: nullable(number())
|
|
18077
18077
|
})));
|
|
18078
|
+
/**
|
|
18079
|
+
* Expected parsed JSON RPC response for the "getBlock" message
|
|
18080
|
+
*/
|
|
18081
|
+
|
|
18082
|
+
const GetParsedBlockRpcResult = jsonRpcResult(nullable(type({
|
|
18083
|
+
blockhash: string(),
|
|
18084
|
+
previousBlockhash: string(),
|
|
18085
|
+
parentSlot: number(),
|
|
18086
|
+
transactions: array(type({
|
|
18087
|
+
transaction: ParsedConfirmedTransactionResult,
|
|
18088
|
+
meta: nullable(ParsedConfirmedTransactionMetaResult),
|
|
18089
|
+
version: optional(TransactionVersionStruct)
|
|
18090
|
+
})),
|
|
18091
|
+
rewards: optional(array(type({
|
|
18092
|
+
pubkey: string(),
|
|
18093
|
+
lamports: number(),
|
|
18094
|
+
postBalance: nullable(number()),
|
|
18095
|
+
rewardType: nullable(string())
|
|
18096
|
+
}))),
|
|
18097
|
+
blockTime: nullable(number()),
|
|
18098
|
+
blockHeight: nullable(number())
|
|
18099
|
+
})));
|
|
18078
18100
|
/**
|
|
18079
18101
|
* Expected JSON RPC response for the "getConfirmedBlock" message
|
|
18080
18102
|
*
|
|
@@ -18209,7 +18231,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
18209
18231
|
|
|
18210
18232
|
/** @internal */
|
|
18211
18233
|
const COMMON_HTTP_HEADERS = {
|
|
18212
|
-
'solana-client': `js/${(_process$env$npm_pack = "1.
|
|
18234
|
+
'solana-client': `js/${(_process$env$npm_pack = "1.64.1") !== null && _process$env$npm_pack !== void 0 ? _process$env$npm_pack : 'UNKNOWN'}`
|
|
18213
18235
|
};
|
|
18214
18236
|
/**
|
|
18215
18237
|
* A connection to a fullnode JSON RPC endpoint
|
|
@@ -19414,6 +19436,28 @@ var solanaWeb3 = (function (exports) {
|
|
|
19414
19436
|
}))
|
|
19415
19437
|
};
|
|
19416
19438
|
}
|
|
19439
|
+
/**
|
|
19440
|
+
* Fetch parsed transaction details for a confirmed or finalized block
|
|
19441
|
+
*/
|
|
19442
|
+
|
|
19443
|
+
|
|
19444
|
+
async getParsedBlock(slot, rawConfig) {
|
|
19445
|
+
const {
|
|
19446
|
+
commitment,
|
|
19447
|
+
config
|
|
19448
|
+
} = extractCommitmentFromConfig(rawConfig);
|
|
19449
|
+
|
|
19450
|
+
const args = this._buildArgsAtLeastConfirmed([slot], commitment, 'jsonParsed', config);
|
|
19451
|
+
|
|
19452
|
+
const unsafeRes = await this._rpcRequest('getBlock', args);
|
|
19453
|
+
const res = create(unsafeRes, GetParsedBlockRpcResult);
|
|
19454
|
+
|
|
19455
|
+
if ('error' in res) {
|
|
19456
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get block');
|
|
19457
|
+
}
|
|
19458
|
+
|
|
19459
|
+
return res.result;
|
|
19460
|
+
}
|
|
19417
19461
|
/*
|
|
19418
19462
|
* Returns the current block height of the node
|
|
19419
19463
|
*/
|