@solana/web3.js 1.70.3 → 1.72.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 +35 -3
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +35 -3
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +35 -3
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +18 -2
- package/lib/index.esm.js +35 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +35 -3
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +2 -2
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +35 -3
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +38 -0
- package/src/transaction/legacy.ts +9 -4
package/lib/index.d.ts
CHANGED
|
@@ -1872,9 +1872,11 @@ declare module '@solana/web3.js' {
|
|
|
1872
1872
|
*/
|
|
1873
1873
|
addSignature(pubkey: PublicKey, signature: Buffer): void;
|
|
1874
1874
|
/**
|
|
1875
|
-
* Verify signatures of a
|
|
1875
|
+
* Verify signatures of a Transaction
|
|
1876
|
+
* Optional parameter specifies if we're expecting a fully signed Transaction or a partially signed one.
|
|
1877
|
+
* If no boolean is provided, we expect a fully signed Transaction by default.
|
|
1876
1878
|
*/
|
|
1877
|
-
verifySignatures(): boolean;
|
|
1879
|
+
verifySignatures(requireAllSignatures?: boolean): boolean;
|
|
1878
1880
|
/**
|
|
1879
1881
|
* Serialize the Transaction in the wire format.
|
|
1880
1882
|
*/
|
|
@@ -2321,6 +2323,16 @@ declare module '@solana/web3.js' {
|
|
|
2321
2323
|
/** post balance of the account in lamports */
|
|
2322
2324
|
postBalance: number;
|
|
2323
2325
|
};
|
|
2326
|
+
type InflationRate = {
|
|
2327
|
+
/** total inflation */
|
|
2328
|
+
total: number;
|
|
2329
|
+
/** inflation allocated to validators */
|
|
2330
|
+
validator: number;
|
|
2331
|
+
/** inflation allocated to the foundation */
|
|
2332
|
+
foundation: number;
|
|
2333
|
+
/** epoch for which these values are valid */
|
|
2334
|
+
epoch: number;
|
|
2335
|
+
};
|
|
2324
2336
|
/**
|
|
2325
2337
|
* Information about the current epoch
|
|
2326
2338
|
*/
|
|
@@ -3578,6 +3590,10 @@ declare module '@solana/web3.js' {
|
|
|
3578
3590
|
epoch?: number,
|
|
3579
3591
|
commitmentOrConfig?: Commitment | GetInflationRewardConfig,
|
|
3580
3592
|
): Promise<(InflationReward | null)[]>;
|
|
3593
|
+
/**
|
|
3594
|
+
* Fetch the specific inflation values for the current epoch
|
|
3595
|
+
*/
|
|
3596
|
+
getInflationRate(): Promise<InflationRate>;
|
|
3581
3597
|
/**
|
|
3582
3598
|
* Fetch the Epoch Info parameters
|
|
3583
3599
|
*/
|
package/lib/index.esm.js
CHANGED
|
@@ -1844,12 +1844,14 @@ class Transaction {
|
|
|
1844
1844
|
this.signatures[index].signature = Buffer.from(signature);
|
|
1845
1845
|
}
|
|
1846
1846
|
/**
|
|
1847
|
-
* Verify signatures of a
|
|
1847
|
+
* Verify signatures of a Transaction
|
|
1848
|
+
* Optional parameter specifies if we're expecting a fully signed Transaction or a partially signed one.
|
|
1849
|
+
* If no boolean is provided, we expect a fully signed Transaction by default.
|
|
1848
1850
|
*/
|
|
1849
1851
|
|
|
1850
1852
|
|
|
1851
|
-
verifySignatures() {
|
|
1852
|
-
return this._verifySignatures(this.serializeMessage(), true);
|
|
1853
|
+
verifySignatures(requireAllSignatures) {
|
|
1854
|
+
return this._verifySignatures(this.serializeMessage(), requireAllSignatures === undefined ? true : requireAllSignatures);
|
|
1853
1855
|
}
|
|
1854
1856
|
/**
|
|
1855
1857
|
* @internal
|
|
@@ -6213,6 +6215,16 @@ const GetInflationRewardResult = jsonRpcResult(array(nullable(type({
|
|
|
6213
6215
|
amount: number(),
|
|
6214
6216
|
postBalance: number()
|
|
6215
6217
|
}))));
|
|
6218
|
+
|
|
6219
|
+
/**
|
|
6220
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
6221
|
+
*/
|
|
6222
|
+
const GetInflationRateResult = type({
|
|
6223
|
+
total: number(),
|
|
6224
|
+
validator: number(),
|
|
6225
|
+
foundation: number(),
|
|
6226
|
+
epoch: number()
|
|
6227
|
+
});
|
|
6216
6228
|
/**
|
|
6217
6229
|
* Information about the current epoch
|
|
6218
6230
|
*/
|
|
@@ -6442,6 +6454,11 @@ function createRpcBatchRequest(client) {
|
|
|
6442
6454
|
|
|
6443
6455
|
|
|
6444
6456
|
const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
|
|
6457
|
+
/**
|
|
6458
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
6459
|
+
*/
|
|
6460
|
+
|
|
6461
|
+
const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
|
|
6445
6462
|
/**
|
|
6446
6463
|
* Expected JSON RPC response for the "getEpochInfo" message
|
|
6447
6464
|
*/
|
|
@@ -8392,6 +8409,21 @@ class Connection {
|
|
|
8392
8409
|
|
|
8393
8410
|
return res.result;
|
|
8394
8411
|
}
|
|
8412
|
+
/**
|
|
8413
|
+
* Fetch the specific inflation values for the current epoch
|
|
8414
|
+
*/
|
|
8415
|
+
|
|
8416
|
+
|
|
8417
|
+
async getInflationRate() {
|
|
8418
|
+
const unsafeRes = await this._rpcRequest('getInflationRate', []);
|
|
8419
|
+
const res = create(unsafeRes, GetInflationRateRpcResult);
|
|
8420
|
+
|
|
8421
|
+
if ('error' in res) {
|
|
8422
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');
|
|
8423
|
+
}
|
|
8424
|
+
|
|
8425
|
+
return res.result;
|
|
8426
|
+
}
|
|
8395
8427
|
/**
|
|
8396
8428
|
* Fetch the Epoch Info parameters
|
|
8397
8429
|
*/
|