@solana/web3.js 1.41.0 → 1.41.3

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.d.ts CHANGED
@@ -338,14 +338,6 @@ declare module '@solana/web3.js' {
338
338
  * Transaction signature as base-58 encoded string
339
339
  */
340
340
  export type TransactionSignature = string;
341
- /**
342
- * Maximum over-the-wire size of a Transaction
343
- *
344
- * 1280 is IPv6 minimum MTU
345
- * 40 bytes is the size of the IPv6 header
346
- * 8 bytes is the size of the fragment header
347
- */
348
- export const PACKET_DATA_SIZE: number;
349
341
  /**
350
342
  * Account metadata used to define instructions
351
343
  */
@@ -535,6 +527,7 @@ declare module '@solana/web3.js' {
535
527
  static populate(message: Message, signatures?: Array<string>): Transaction;
536
528
  }
537
529
 
530
+ export type ClientSubscriptionId = number;
538
531
  export type TokenAccountsFilter =
539
532
  | {
540
533
  mint: PublicKey;
@@ -2009,13 +2002,15 @@ declare module '@solana/web3.js' {
2009
2002
  publicKey: PublicKey,
2010
2003
  callback: AccountChangeCallback,
2011
2004
  commitment?: Commitment,
2012
- ): number;
2005
+ ): ClientSubscriptionId;
2013
2006
  /**
2014
2007
  * Deregister an account notification callback
2015
2008
  *
2016
- * @param id subscription id to deregister
2009
+ * @param id client subscription id to deregister
2017
2010
  */
2018
- removeAccountChangeListener(id: number): Promise<void>;
2011
+ removeAccountChangeListener(
2012
+ clientSubscriptionId: ClientSubscriptionId,
2013
+ ): Promise<void>;
2019
2014
  /**
2020
2015
  * Register a callback to be invoked whenever accounts owned by the
2021
2016
  * specified program change
@@ -2031,13 +2026,15 @@ declare module '@solana/web3.js' {
2031
2026
  callback: ProgramAccountChangeCallback,
2032
2027
  commitment?: Commitment,
2033
2028
  filters?: GetProgramAccountsFilter[],
2034
- ): number;
2029
+ ): ClientSubscriptionId;
2035
2030
  /**
2036
2031
  * Deregister an account notification callback
2037
2032
  *
2038
- * @param id subscription id to deregister
2033
+ * @param id client subscription id to deregister
2039
2034
  */
2040
- removeProgramAccountChangeListener(id: number): Promise<void>;
2035
+ removeProgramAccountChangeListener(
2036
+ clientSubscriptionId: ClientSubscriptionId,
2037
+ ): Promise<void>;
2041
2038
  /**
2042
2039
  * Registers a callback to be invoked whenever logs are emitted.
2043
2040
  */
@@ -2045,26 +2042,30 @@ declare module '@solana/web3.js' {
2045
2042
  filter: LogsFilter,
2046
2043
  callback: LogsCallback,
2047
2044
  commitment?: Commitment,
2048
- ): number;
2045
+ ): ClientSubscriptionId;
2049
2046
  /**
2050
2047
  * Deregister a logs callback.
2051
2048
  *
2052
- * @param id subscription id to deregister.
2049
+ * @param id client subscription id to deregister.
2053
2050
  */
2054
- removeOnLogsListener(id: number): Promise<void>;
2051
+ removeOnLogsListener(
2052
+ clientSubscriptionId: ClientSubscriptionId,
2053
+ ): Promise<void>;
2055
2054
  /**
2056
2055
  * Register a callback to be invoked upon slot changes
2057
2056
  *
2058
2057
  * @param callback Function to invoke whenever the slot changes
2059
2058
  * @return subscription id
2060
2059
  */
2061
- onSlotChange(callback: SlotChangeCallback): number;
2060
+ onSlotChange(callback: SlotChangeCallback): ClientSubscriptionId;
2062
2061
  /**
2063
2062
  * Deregister a slot notification callback
2064
2063
  *
2065
- * @param id subscription id to deregister
2064
+ * @param id client subscription id to deregister
2066
2065
  */
2067
- removeSlotChangeListener(id: number): Promise<void>;
2066
+ removeSlotChangeListener(
2067
+ clientSubscriptionId: ClientSubscriptionId,
2068
+ ): Promise<void>;
2068
2069
  /**
2069
2070
  * Register a callback to be invoked upon slot updates. {@link SlotUpdate}'s
2070
2071
  * may be useful to track live progress of a cluster.
@@ -2072,13 +2073,15 @@ declare module '@solana/web3.js' {
2072
2073
  * @param callback Function to invoke whenever the slot updates
2073
2074
  * @return subscription id
2074
2075
  */
2075
- onSlotUpdate(callback: SlotUpdateCallback): number;
2076
+ onSlotUpdate(callback: SlotUpdateCallback): ClientSubscriptionId;
2076
2077
  /**
2077
2078
  * Deregister a slot update notification callback
2078
2079
  *
2079
- * @param id subscription id to deregister
2080
+ * @param id client subscription id to deregister
2080
2081
  */
2081
- removeSlotUpdateListener(id: number): Promise<void>;
2082
+ removeSlotUpdateListener(
2083
+ clientSubscriptionId: ClientSubscriptionId,
2084
+ ): Promise<void>;
2082
2085
  _buildArgs(
2083
2086
  args: Array<any>,
2084
2087
  override?: Commitment,
@@ -2097,7 +2100,7 @@ declare module '@solana/web3.js' {
2097
2100
  signature: TransactionSignature,
2098
2101
  callback: SignatureResultCallback,
2099
2102
  commitment?: Commitment,
2100
- ): number;
2103
+ ): ClientSubscriptionId;
2101
2104
  /**
2102
2105
  * Register a callback to be invoked when a transaction is
2103
2106
  * received and/or processed.
@@ -2112,26 +2115,30 @@ declare module '@solana/web3.js' {
2112
2115
  signature: TransactionSignature,
2113
2116
  callback: SignatureSubscriptionCallback,
2114
2117
  options?: SignatureSubscriptionOptions,
2115
- ): number;
2118
+ ): ClientSubscriptionId;
2116
2119
  /**
2117
2120
  * Deregister a signature notification callback
2118
2121
  *
2119
- * @param id subscription id to deregister
2122
+ * @param id client subscription id to deregister
2120
2123
  */
2121
- removeSignatureListener(id: number): Promise<void>;
2124
+ removeSignatureListener(
2125
+ clientSubscriptionId: ClientSubscriptionId,
2126
+ ): Promise<void>;
2122
2127
  /**
2123
2128
  * Register a callback to be invoked upon root changes
2124
2129
  *
2125
2130
  * @param callback Function to invoke whenever the root changes
2126
2131
  * @return subscription id
2127
2132
  */
2128
- onRootChange(callback: RootChangeCallback): number;
2133
+ onRootChange(callback: RootChangeCallback): ClientSubscriptionId;
2129
2134
  /**
2130
2135
  * Deregister a root notification callback
2131
2136
  *
2132
- * @param id subscription id to deregister
2137
+ * @param id client subscription id to deregister
2133
2138
  */
2134
- removeRootChangeListener(id: number): Promise<void>;
2139
+ removeRootChangeListener(
2140
+ clientSubscriptionId: ClientSubscriptionId,
2141
+ ): Promise<void>;
2135
2142
  }
2136
2143
 
2137
2144
  export const BPF_LOADER_PROGRAM_ID: PublicKey;
@@ -3001,6 +3008,16 @@ declare module '@solana/web3.js' {
3001
3008
  ): TransactionInstruction;
3002
3009
  }
3003
3010
 
3011
+ /**
3012
+ * Maximum over-the-wire size of a Transaction
3013
+ *
3014
+ * 1280 is IPv6 minimum MTU
3015
+ * 40 bytes is the size of the IPv6 header
3016
+ * 8 bytes is the size of the fragment header
3017
+ */
3018
+ export const PACKET_DATA_SIZE: number;
3019
+ export const SIGNATURE_LENGTH_IN_BYTES = 64;
3020
+
3004
3021
  export const VALIDATOR_INFO_KEY: PublicKey;
3005
3022
  /**
3006
3023
  * Info used to identity validators.