@solana/web3.js 1.71.0 → 1.73.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 +34 -2
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +34 -2
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +34 -2
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +23 -0
- package/lib/index.esm.js +34 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +34 -2
- 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 +34 -2
- package/lib/index.native.js.map +1 -1
- package/package.json +5 -5
- package/src/connection.ts +49 -0
package/lib/index.d.ts
CHANGED
|
@@ -2322,6 +2322,18 @@ declare module '@solana/web3.js' {
|
|
|
2322
2322
|
amount: number;
|
|
2323
2323
|
/** post balance of the account in lamports */
|
|
2324
2324
|
postBalance: number;
|
|
2325
|
+
/** vote account commission when the reward was credited */
|
|
2326
|
+
commission?: number | null;
|
|
2327
|
+
};
|
|
2328
|
+
type InflationRate = {
|
|
2329
|
+
/** total inflation */
|
|
2330
|
+
total: number;
|
|
2331
|
+
/** inflation allocated to validators */
|
|
2332
|
+
validator: number;
|
|
2333
|
+
/** inflation allocated to the foundation */
|
|
2334
|
+
foundation: number;
|
|
2335
|
+
/** epoch for which these values are valid */
|
|
2336
|
+
epoch: number;
|
|
2325
2337
|
};
|
|
2326
2338
|
/**
|
|
2327
2339
|
* Information about the current epoch
|
|
@@ -2641,6 +2653,8 @@ declare module '@solana/web3.js' {
|
|
|
2641
2653
|
postBalance: number | null;
|
|
2642
2654
|
/** Type of reward received */
|
|
2643
2655
|
rewardType: string | null;
|
|
2656
|
+
/** Vote account commission when the reward was credited, only present for voting and staking rewards */
|
|
2657
|
+
commission?: number | null;
|
|
2644
2658
|
}>;
|
|
2645
2659
|
/** The unix timestamp of when the block was processed */
|
|
2646
2660
|
blockTime: number | null;
|
|
@@ -2682,6 +2696,8 @@ declare module '@solana/web3.js' {
|
|
|
2682
2696
|
postBalance: number | null;
|
|
2683
2697
|
/** Type of reward received */
|
|
2684
2698
|
rewardType: string | null;
|
|
2699
|
+
/** Vote account commission when the reward was credited, only present for voting and staking rewards */
|
|
2700
|
+
commission?: number | null;
|
|
2685
2701
|
}>;
|
|
2686
2702
|
/** The unix timestamp of when the block was processed */
|
|
2687
2703
|
blockTime: number | null;
|
|
@@ -2744,6 +2760,8 @@ declare module '@solana/web3.js' {
|
|
|
2744
2760
|
postBalance: number | null;
|
|
2745
2761
|
/** Type of reward received */
|
|
2746
2762
|
rewardType: string | null;
|
|
2763
|
+
/** Vote account commission when the reward was credited, only present for voting and staking rewards */
|
|
2764
|
+
commission?: number | null;
|
|
2747
2765
|
}>;
|
|
2748
2766
|
/** The unix timestamp of when the block was processed */
|
|
2749
2767
|
blockTime: number | null;
|
|
@@ -2796,6 +2814,7 @@ declare module '@solana/web3.js' {
|
|
|
2796
2814
|
lamports: number;
|
|
2797
2815
|
postBalance: number | null;
|
|
2798
2816
|
rewardType: string | null;
|
|
2817
|
+
commission?: number | null;
|
|
2799
2818
|
}>;
|
|
2800
2819
|
/** The unix timestamp of when the block was processed */
|
|
2801
2820
|
blockTime: number | null;
|
|
@@ -3580,6 +3599,10 @@ declare module '@solana/web3.js' {
|
|
|
3580
3599
|
epoch?: number,
|
|
3581
3600
|
commitmentOrConfig?: Commitment | GetInflationRewardConfig,
|
|
3582
3601
|
): Promise<(InflationReward | null)[]>;
|
|
3602
|
+
/**
|
|
3603
|
+
* Fetch the specific inflation values for the current epoch
|
|
3604
|
+
*/
|
|
3605
|
+
getInflationRate(): Promise<InflationRate>;
|
|
3583
3606
|
/**
|
|
3584
3607
|
* Fetch the Epoch Info parameters
|
|
3585
3608
|
*/
|
package/lib/index.esm.js
CHANGED
|
@@ -6213,8 +6213,19 @@ const GetInflationRewardResult = jsonRpcResult(array(nullable(type({
|
|
|
6213
6213
|
epoch: number(),
|
|
6214
6214
|
effectiveSlot: number(),
|
|
6215
6215
|
amount: number(),
|
|
6216
|
-
postBalance: number()
|
|
6216
|
+
postBalance: number(),
|
|
6217
|
+
commission: optional(nullable(number()))
|
|
6217
6218
|
}))));
|
|
6219
|
+
|
|
6220
|
+
/**
|
|
6221
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
6222
|
+
*/
|
|
6223
|
+
const GetInflationRateResult = type({
|
|
6224
|
+
total: number(),
|
|
6225
|
+
validator: number(),
|
|
6226
|
+
foundation: number(),
|
|
6227
|
+
epoch: number()
|
|
6228
|
+
});
|
|
6218
6229
|
/**
|
|
6219
6230
|
* Information about the current epoch
|
|
6220
6231
|
*/
|
|
@@ -6444,6 +6455,11 @@ function createRpcBatchRequest(client) {
|
|
|
6444
6455
|
|
|
6445
6456
|
|
|
6446
6457
|
const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
|
|
6458
|
+
/**
|
|
6459
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
6460
|
+
*/
|
|
6461
|
+
|
|
6462
|
+
const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
|
|
6447
6463
|
/**
|
|
6448
6464
|
* Expected JSON RPC response for the "getEpochInfo" message
|
|
6449
6465
|
*/
|
|
@@ -6903,7 +6919,8 @@ const RewardsResult = type({
|
|
|
6903
6919
|
pubkey: string(),
|
|
6904
6920
|
lamports: number(),
|
|
6905
6921
|
postBalance: nullable(number()),
|
|
6906
|
-
rewardType: nullable(string())
|
|
6922
|
+
rewardType: nullable(string()),
|
|
6923
|
+
commission: optional(nullable(number()))
|
|
6907
6924
|
});
|
|
6908
6925
|
/**
|
|
6909
6926
|
* Expected JSON RPC response for the "getBlock" message
|
|
@@ -8394,6 +8411,21 @@ class Connection {
|
|
|
8394
8411
|
|
|
8395
8412
|
return res.result;
|
|
8396
8413
|
}
|
|
8414
|
+
/**
|
|
8415
|
+
* Fetch the specific inflation values for the current epoch
|
|
8416
|
+
*/
|
|
8417
|
+
|
|
8418
|
+
|
|
8419
|
+
async getInflationRate() {
|
|
8420
|
+
const unsafeRes = await this._rpcRequest('getInflationRate', []);
|
|
8421
|
+
const res = create(unsafeRes, GetInflationRateRpcResult);
|
|
8422
|
+
|
|
8423
|
+
if ('error' in res) {
|
|
8424
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');
|
|
8425
|
+
}
|
|
8426
|
+
|
|
8427
|
+
return res.result;
|
|
8428
|
+
}
|
|
8397
8429
|
/**
|
|
8398
8430
|
* Fetch the Epoch Info parameters
|
|
8399
8431
|
*/
|