@solana/web3.js 1.30.0 → 1.32.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/README.md +2 -2
- package/lib/index.browser.esm.js +1063 -1067
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +960 -965
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +45 -12
- package/lib/index.esm.js +955 -963
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +28829 -28847
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +31 -31
- package/lib/index.iife.min.js.map +1 -1
- package/module.flow.js +57 -13
- package/package.json +8 -13
- package/src/account.ts +1 -1
- package/src/connection.ts +64 -13
- package/src/keypair.ts +1 -1
- package/src/publickey.ts +7 -3
- package/src/secp256k1-program.ts +5 -5
- package/src/sysvar.ts +16 -4
- package/src/transaction.ts +4 -1
- package/src/vote-account.ts +104 -31
package/lib/index.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ declare module '@solana/web3.js' {
|
|
|
53
53
|
* Return the base-58 representation of the public key
|
|
54
54
|
*/
|
|
55
55
|
toBase58(): string;
|
|
56
|
+
toJSON(): string;
|
|
56
57
|
/**
|
|
57
58
|
* Return the byte array representation of the public key
|
|
58
59
|
*/
|
|
@@ -759,6 +760,7 @@ declare module '@solana/web3.js' {
|
|
|
759
760
|
export type TokenBalance = {
|
|
760
761
|
accountIndex: number;
|
|
761
762
|
mint: string;
|
|
763
|
+
owner?: string;
|
|
762
764
|
uiTokenAmount: TokenAmount;
|
|
763
765
|
};
|
|
764
766
|
/**
|
|
@@ -1188,6 +1190,15 @@ declare module '@solana/web3.js' {
|
|
|
1188
1190
|
/** Optional array of filters to apply to accounts */
|
|
1189
1191
|
filters?: GetProgramAccountsFilter[];
|
|
1190
1192
|
};
|
|
1193
|
+
/**
|
|
1194
|
+
* Configuration object for getMultipleAccounts
|
|
1195
|
+
*/
|
|
1196
|
+
export type GetMultipleAccountsConfig = {
|
|
1197
|
+
/** Optional commitment level */
|
|
1198
|
+
commitment?: Commitment;
|
|
1199
|
+
/** Optional encoding for account data (default base64) */
|
|
1200
|
+
encoding?: 'base64' | 'jsonParsed';
|
|
1201
|
+
};
|
|
1191
1202
|
/**
|
|
1192
1203
|
* Information describing an account
|
|
1193
1204
|
*/
|
|
@@ -1200,7 +1211,7 @@ declare module '@solana/web3.js' {
|
|
|
1200
1211
|
lamports: number;
|
|
1201
1212
|
/** Optional data assigned to the account */
|
|
1202
1213
|
data: T;
|
|
1203
|
-
/** Optional rent epoch
|
|
1214
|
+
/** Optional rent epoch info for account */
|
|
1204
1215
|
rentEpoch?: number;
|
|
1205
1216
|
};
|
|
1206
1217
|
/**
|
|
@@ -1348,7 +1359,7 @@ declare module '@solana/web3.js' {
|
|
|
1348
1359
|
export type FetchMiddleware = (
|
|
1349
1360
|
url: string,
|
|
1350
1361
|
options: any,
|
|
1351
|
-
fetch:
|
|
1362
|
+
fetch: (modifiedUrl: string, modifiedOptions: any) => void,
|
|
1352
1363
|
) => void;
|
|
1353
1364
|
/**
|
|
1354
1365
|
* Configuration for instantiating a Connection
|
|
@@ -1505,8 +1516,8 @@ declare module '@solana/web3.js' {
|
|
|
1505
1516
|
*/
|
|
1506
1517
|
getMultipleAccountsInfo(
|
|
1507
1518
|
publicKeys: PublicKey[],
|
|
1508
|
-
|
|
1509
|
-
): Promise<(AccountInfo<Buffer> | null)[]>;
|
|
1519
|
+
configOrCommitment?: GetMultipleAccountsConfig | Commitment,
|
|
1520
|
+
): Promise<(AccountInfo<Buffer | ParsedAccountData> | null)[]>;
|
|
1510
1521
|
/**
|
|
1511
1522
|
* Returns epoch activation information for a stake account that has been delegated
|
|
1512
1523
|
*/
|
|
@@ -1652,6 +1663,13 @@ declare module '@solana/web3.js' {
|
|
|
1652
1663
|
blockhash: Blockhash,
|
|
1653
1664
|
commitment?: Commitment,
|
|
1654
1665
|
): Promise<RpcResponseAndContext<FeeCalculator | null>>;
|
|
1666
|
+
/**
|
|
1667
|
+
* Fetch the fee for a message from the cluster, return with context
|
|
1668
|
+
*/
|
|
1669
|
+
getFeeForMessage(
|
|
1670
|
+
message: Message,
|
|
1671
|
+
commitment?: Commitment,
|
|
1672
|
+
): Promise<RpcResponseAndContext<number>>;
|
|
1655
1673
|
/**
|
|
1656
1674
|
* Fetch a recent blockhash from the cluster
|
|
1657
1675
|
* @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
|
|
@@ -2824,20 +2842,32 @@ declare module '@solana/web3.js' {
|
|
|
2824
2842
|
credits: number;
|
|
2825
2843
|
prevCredits: number;
|
|
2826
2844
|
};
|
|
2845
|
+
export type AuthorizedVoter = {
|
|
2846
|
+
epoch: number;
|
|
2847
|
+
authorizedVoter: PublicKey;
|
|
2848
|
+
};
|
|
2849
|
+
export type PriorVoter = {
|
|
2850
|
+
authorizedPubkey: PublicKey;
|
|
2851
|
+
epochOfLastAuthorizedSwitch: number;
|
|
2852
|
+
targetEpoch: number;
|
|
2853
|
+
};
|
|
2854
|
+
export type BlockTimestamp = {
|
|
2855
|
+
slot: number;
|
|
2856
|
+
timetamp: number;
|
|
2857
|
+
};
|
|
2827
2858
|
/**
|
|
2828
2859
|
* VoteAccount class
|
|
2829
2860
|
*/
|
|
2830
2861
|
export class VoteAccount {
|
|
2831
2862
|
nodePubkey: PublicKey;
|
|
2832
|
-
|
|
2833
|
-
authorizedWithdrawerPubkey: PublicKey;
|
|
2863
|
+
authorizedWithdrawer: PublicKey;
|
|
2834
2864
|
commission: number;
|
|
2835
|
-
votes: Array<Lockout>;
|
|
2836
2865
|
rootSlot: number | null;
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
epochCredits:
|
|
2866
|
+
votes: Lockout[];
|
|
2867
|
+
authorizedVoters: AuthorizedVoter[];
|
|
2868
|
+
priorVoters: PriorVoter[];
|
|
2869
|
+
epochCredits: EpochCredits[];
|
|
2870
|
+
lastTimestamp: BlockTimestamp;
|
|
2841
2871
|
/**
|
|
2842
2872
|
* Deserialize VoteAccount from the account data.
|
|
2843
2873
|
*
|
|
@@ -2850,11 +2880,14 @@ declare module '@solana/web3.js' {
|
|
|
2850
2880
|
}
|
|
2851
2881
|
|
|
2852
2882
|
export const SYSVAR_CLOCK_PUBKEY: PublicKey;
|
|
2883
|
+
export const SYSVAR_EPOCH_SCHEDULE_PUBKEY: PublicKey;
|
|
2884
|
+
export const SYSVAR_INSTRUCTIONS_PUBKEY: PublicKey;
|
|
2853
2885
|
export const SYSVAR_RECENT_BLOCKHASHES_PUBKEY: PublicKey;
|
|
2854
2886
|
export const SYSVAR_RENT_PUBKEY: PublicKey;
|
|
2855
2887
|
export const SYSVAR_REWARDS_PUBKEY: PublicKey;
|
|
2888
|
+
export const SYSVAR_SLOT_HASHES_PUBKEY: PublicKey;
|
|
2889
|
+
export const SYSVAR_SLOT_HISTORY_PUBKEY: PublicKey;
|
|
2856
2890
|
export const SYSVAR_STAKE_HISTORY_PUBKEY: PublicKey;
|
|
2857
|
-
export const SYSVAR_INSTRUCTIONS_PUBKEY: PublicKey;
|
|
2858
2891
|
|
|
2859
2892
|
export class SendTransactionError extends Error {
|
|
2860
2893
|
logs: string[] | undefined;
|