@solana/web3.js 1.41.1 → 1.41.4
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 +593 -375
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +639 -422
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +610 -378
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +77 -26
- package/lib/index.esm.js +657 -426
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +12157 -12148
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +2 -24
- package/lib/index.iife.min.js.map +1 -1
- package/package.json +9 -5
- package/src/connection.ts +657 -486
- package/src/index.ts +1 -0
- package/src/system-program.ts +39 -10
package/lib/index.d.ts
CHANGED
|
@@ -527,6 +527,7 @@ declare module '@solana/web3.js' {
|
|
|
527
527
|
static populate(message: Message, signatures?: Array<string>): Transaction;
|
|
528
528
|
}
|
|
529
529
|
|
|
530
|
+
export type ClientSubscriptionId = number;
|
|
530
531
|
export type TokenAccountsFilter =
|
|
531
532
|
| {
|
|
532
533
|
mint: PublicKey;
|
|
@@ -2001,13 +2002,15 @@ declare module '@solana/web3.js' {
|
|
|
2001
2002
|
publicKey: PublicKey,
|
|
2002
2003
|
callback: AccountChangeCallback,
|
|
2003
2004
|
commitment?: Commitment,
|
|
2004
|
-
):
|
|
2005
|
+
): ClientSubscriptionId;
|
|
2005
2006
|
/**
|
|
2006
2007
|
* Deregister an account notification callback
|
|
2007
2008
|
*
|
|
2008
|
-
* @param id subscription id to deregister
|
|
2009
|
+
* @param id client subscription id to deregister
|
|
2009
2010
|
*/
|
|
2010
|
-
removeAccountChangeListener(
|
|
2011
|
+
removeAccountChangeListener(
|
|
2012
|
+
clientSubscriptionId: ClientSubscriptionId,
|
|
2013
|
+
): Promise<void>;
|
|
2011
2014
|
/**
|
|
2012
2015
|
* Register a callback to be invoked whenever accounts owned by the
|
|
2013
2016
|
* specified program change
|
|
@@ -2023,13 +2026,15 @@ declare module '@solana/web3.js' {
|
|
|
2023
2026
|
callback: ProgramAccountChangeCallback,
|
|
2024
2027
|
commitment?: Commitment,
|
|
2025
2028
|
filters?: GetProgramAccountsFilter[],
|
|
2026
|
-
):
|
|
2029
|
+
): ClientSubscriptionId;
|
|
2027
2030
|
/**
|
|
2028
2031
|
* Deregister an account notification callback
|
|
2029
2032
|
*
|
|
2030
|
-
* @param id subscription id to deregister
|
|
2033
|
+
* @param id client subscription id to deregister
|
|
2031
2034
|
*/
|
|
2032
|
-
removeProgramAccountChangeListener(
|
|
2035
|
+
removeProgramAccountChangeListener(
|
|
2036
|
+
clientSubscriptionId: ClientSubscriptionId,
|
|
2037
|
+
): Promise<void>;
|
|
2033
2038
|
/**
|
|
2034
2039
|
* Registers a callback to be invoked whenever logs are emitted.
|
|
2035
2040
|
*/
|
|
@@ -2037,26 +2042,30 @@ declare module '@solana/web3.js' {
|
|
|
2037
2042
|
filter: LogsFilter,
|
|
2038
2043
|
callback: LogsCallback,
|
|
2039
2044
|
commitment?: Commitment,
|
|
2040
|
-
):
|
|
2045
|
+
): ClientSubscriptionId;
|
|
2041
2046
|
/**
|
|
2042
2047
|
* Deregister a logs callback.
|
|
2043
2048
|
*
|
|
2044
|
-
* @param id subscription id to deregister.
|
|
2049
|
+
* @param id client subscription id to deregister.
|
|
2045
2050
|
*/
|
|
2046
|
-
removeOnLogsListener(
|
|
2051
|
+
removeOnLogsListener(
|
|
2052
|
+
clientSubscriptionId: ClientSubscriptionId,
|
|
2053
|
+
): Promise<void>;
|
|
2047
2054
|
/**
|
|
2048
2055
|
* Register a callback to be invoked upon slot changes
|
|
2049
2056
|
*
|
|
2050
2057
|
* @param callback Function to invoke whenever the slot changes
|
|
2051
2058
|
* @return subscription id
|
|
2052
2059
|
*/
|
|
2053
|
-
onSlotChange(callback: SlotChangeCallback):
|
|
2060
|
+
onSlotChange(callback: SlotChangeCallback): ClientSubscriptionId;
|
|
2054
2061
|
/**
|
|
2055
2062
|
* Deregister a slot notification callback
|
|
2056
2063
|
*
|
|
2057
|
-
* @param id subscription id to deregister
|
|
2064
|
+
* @param id client subscription id to deregister
|
|
2058
2065
|
*/
|
|
2059
|
-
removeSlotChangeListener(
|
|
2066
|
+
removeSlotChangeListener(
|
|
2067
|
+
clientSubscriptionId: ClientSubscriptionId,
|
|
2068
|
+
): Promise<void>;
|
|
2060
2069
|
/**
|
|
2061
2070
|
* Register a callback to be invoked upon slot updates. {@link SlotUpdate}'s
|
|
2062
2071
|
* may be useful to track live progress of a cluster.
|
|
@@ -2064,13 +2073,15 @@ declare module '@solana/web3.js' {
|
|
|
2064
2073
|
* @param callback Function to invoke whenever the slot updates
|
|
2065
2074
|
* @return subscription id
|
|
2066
2075
|
*/
|
|
2067
|
-
onSlotUpdate(callback: SlotUpdateCallback):
|
|
2076
|
+
onSlotUpdate(callback: SlotUpdateCallback): ClientSubscriptionId;
|
|
2068
2077
|
/**
|
|
2069
2078
|
* Deregister a slot update notification callback
|
|
2070
2079
|
*
|
|
2071
|
-
* @param id subscription id to deregister
|
|
2080
|
+
* @param id client subscription id to deregister
|
|
2072
2081
|
*/
|
|
2073
|
-
removeSlotUpdateListener(
|
|
2082
|
+
removeSlotUpdateListener(
|
|
2083
|
+
clientSubscriptionId: ClientSubscriptionId,
|
|
2084
|
+
): Promise<void>;
|
|
2074
2085
|
_buildArgs(
|
|
2075
2086
|
args: Array<any>,
|
|
2076
2087
|
override?: Commitment,
|
|
@@ -2089,7 +2100,7 @@ declare module '@solana/web3.js' {
|
|
|
2089
2100
|
signature: TransactionSignature,
|
|
2090
2101
|
callback: SignatureResultCallback,
|
|
2091
2102
|
commitment?: Commitment,
|
|
2092
|
-
):
|
|
2103
|
+
): ClientSubscriptionId;
|
|
2093
2104
|
/**
|
|
2094
2105
|
* Register a callback to be invoked when a transaction is
|
|
2095
2106
|
* received and/or processed.
|
|
@@ -2104,26 +2115,30 @@ declare module '@solana/web3.js' {
|
|
|
2104
2115
|
signature: TransactionSignature,
|
|
2105
2116
|
callback: SignatureSubscriptionCallback,
|
|
2106
2117
|
options?: SignatureSubscriptionOptions,
|
|
2107
|
-
):
|
|
2118
|
+
): ClientSubscriptionId;
|
|
2108
2119
|
/**
|
|
2109
2120
|
* Deregister a signature notification callback
|
|
2110
2121
|
*
|
|
2111
|
-
* @param id subscription id to deregister
|
|
2122
|
+
* @param id client subscription id to deregister
|
|
2112
2123
|
*/
|
|
2113
|
-
removeSignatureListener(
|
|
2124
|
+
removeSignatureListener(
|
|
2125
|
+
clientSubscriptionId: ClientSubscriptionId,
|
|
2126
|
+
): Promise<void>;
|
|
2114
2127
|
/**
|
|
2115
2128
|
* Register a callback to be invoked upon root changes
|
|
2116
2129
|
*
|
|
2117
2130
|
* @param callback Function to invoke whenever the root changes
|
|
2118
2131
|
* @return subscription id
|
|
2119
2132
|
*/
|
|
2120
|
-
onRootChange(callback: RootChangeCallback):
|
|
2133
|
+
onRootChange(callback: RootChangeCallback): ClientSubscriptionId;
|
|
2121
2134
|
/**
|
|
2122
2135
|
* Deregister a root notification callback
|
|
2123
2136
|
*
|
|
2124
|
-
* @param id subscription id to deregister
|
|
2137
|
+
* @param id client subscription id to deregister
|
|
2125
2138
|
*/
|
|
2126
|
-
removeRootChangeListener(
|
|
2139
|
+
removeRootChangeListener(
|
|
2140
|
+
clientSubscriptionId: ClientSubscriptionId,
|
|
2141
|
+
): Promise<void>;
|
|
2127
2142
|
}
|
|
2128
2143
|
|
|
2129
2144
|
export const BPF_LOADER_PROGRAM_ID: PublicKey;
|
|
@@ -2617,7 +2632,7 @@ declare module '@solana/web3.js' {
|
|
|
2617
2632
|
/** Account that will receive transferred lamports */
|
|
2618
2633
|
toPubkey: PublicKey;
|
|
2619
2634
|
/** Amount of lamports to transfer */
|
|
2620
|
-
lamports: number;
|
|
2635
|
+
lamports: number | bigint;
|
|
2621
2636
|
};
|
|
2622
2637
|
/**
|
|
2623
2638
|
* Assign system transaction params
|
|
@@ -2767,7 +2782,31 @@ declare module '@solana/web3.js' {
|
|
|
2767
2782
|
/** Account that will receive transferred lamports */
|
|
2768
2783
|
toPubkey: PublicKey;
|
|
2769
2784
|
/** Amount of lamports to transfer */
|
|
2770
|
-
lamports: number;
|
|
2785
|
+
lamports: number | bigint;
|
|
2786
|
+
/** Seed to use to derive the funding account address */
|
|
2787
|
+
seed: string;
|
|
2788
|
+
/** Program id to use to derive the funding account address */
|
|
2789
|
+
programId: PublicKey;
|
|
2790
|
+
};
|
|
2791
|
+
/** Decoded transfer system transaction instruction */
|
|
2792
|
+
export type DecodedTransferInstruction = {
|
|
2793
|
+
/** Account that will transfer lamports */
|
|
2794
|
+
fromPubkey: PublicKey;
|
|
2795
|
+
/** Account that will receive transferred lamports */
|
|
2796
|
+
toPubkey: PublicKey;
|
|
2797
|
+
/** Amount of lamports to transfer */
|
|
2798
|
+
lamports: bigint;
|
|
2799
|
+
};
|
|
2800
|
+
/** Decoded transferWithSeed system transaction instruction */
|
|
2801
|
+
export type DecodedTransferWithSeedInstruction = {
|
|
2802
|
+
/** Account that will transfer lamports */
|
|
2803
|
+
fromPubkey: PublicKey;
|
|
2804
|
+
/** Base public key to use to derive the funding account address */
|
|
2805
|
+
basePubkey: PublicKey;
|
|
2806
|
+
/** Account that will receive transferred lamports */
|
|
2807
|
+
toPubkey: PublicKey;
|
|
2808
|
+
/** Amount of lamports to transfer */
|
|
2809
|
+
lamports: bigint;
|
|
2771
2810
|
/** Seed to use to derive the funding account address */
|
|
2772
2811
|
seed: string;
|
|
2773
2812
|
/** Program id to use to derive the funding account address */
|
|
@@ -2792,13 +2831,15 @@ declare module '@solana/web3.js' {
|
|
|
2792
2831
|
/**
|
|
2793
2832
|
* Decode a transfer system instruction and retrieve the instruction params.
|
|
2794
2833
|
*/
|
|
2795
|
-
static decodeTransfer(
|
|
2834
|
+
static decodeTransfer(
|
|
2835
|
+
instruction: TransactionInstruction,
|
|
2836
|
+
): DecodedTransferInstruction;
|
|
2796
2837
|
/**
|
|
2797
2838
|
* Decode a transfer with seed system instruction and retrieve the instruction params.
|
|
2798
2839
|
*/
|
|
2799
2840
|
static decodeTransferWithSeed(
|
|
2800
2841
|
instruction: TransactionInstruction,
|
|
2801
|
-
):
|
|
2842
|
+
): DecodedTransferWithSeedInstruction;
|
|
2802
2843
|
/**
|
|
2803
2844
|
* Decode an allocate system instruction and retrieve the instruction params.
|
|
2804
2845
|
*/
|
|
@@ -2993,6 +3034,16 @@ declare module '@solana/web3.js' {
|
|
|
2993
3034
|
): TransactionInstruction;
|
|
2994
3035
|
}
|
|
2995
3036
|
|
|
3037
|
+
/**
|
|
3038
|
+
* Maximum over-the-wire size of a Transaction
|
|
3039
|
+
*
|
|
3040
|
+
* 1280 is IPv6 minimum MTU
|
|
3041
|
+
* 40 bytes is the size of the IPv6 header
|
|
3042
|
+
* 8 bytes is the size of the fragment header
|
|
3043
|
+
*/
|
|
3044
|
+
export const PACKET_DATA_SIZE: number;
|
|
3045
|
+
export const SIGNATURE_LENGTH_IN_BYTES = 64;
|
|
3046
|
+
|
|
2996
3047
|
export const VALIDATOR_INFO_KEY: PublicKey;
|
|
2997
3048
|
/**
|
|
2998
3049
|
* Info used to identity validators.
|