@@ -145,16 +145,22 @@ function notificationResultAndContext(resultDescription: any) {
145145/**
146146 * The level of commitment desired when querying state
147147 * <pre>
148- * 'max': Query the most recent block which has been finalized by the cluster
149- * 'recent': Query the most recent block which has reached 1 confirmation by the connected node
150- * 'root': Query the most recent block which has been rooted by the connected node
151- * 'single': Query the most recent block which has reached 1 confirmation by the cluster
152- * 'singleGossip': Query the most recent block which has reached 1 confirmation according to votes seen in gossip
148+ * 'processed': Query the most recent block which has reached 1 confirmation by the connected node
149+ * 'confirmed': Query the most recent block which has reached 1 confirmation by the cluster
150+ * 'finalized': Query the most recent block which has been finalized by the cluster
153151 * </pre>
154152 *
155- * @typedef {'max ' | 'recent ' | 'root' | 'single' | 'singleGossip ' } Commitment
153+ * @typedef {'processed ' | 'confirmed ' | 'finalized ' } Commitment
156154 */
157- export type Commitment = 'max' | 'recent' | 'root' | 'single' | 'singleGossip' ;
155+ export type Commitment =
156+ | 'processed'
157+ | 'confirmed'
158+ | 'finalized'
159+ | 'recent' // Deprecated as of v1.5.5
160+ | 'single' // Deprecated as of v1.5.5
161+ | 'singleGossip' // Deprecated as of v1.5.5
162+ | 'root' // Deprecated as of v1.5.5
163+ | 'max' ; // Deprecated as of v1.5.5
158164
159165/**
160166 * Filter for largest accounts query
@@ -2291,13 +2297,16 @@ export class Connection {
22912297
22922298 let timeoutMs = 60 * 1000 ;
22932299 switch ( subscriptionCommitment ) {
2300+ case 'processed' :
22942301 case 'recent' :
22952302 case 'single' :
2303+ case 'confirmed' :
22962304 case 'singleGossip' : {
22972305 timeoutMs = 30 * 1000 ;
22982306 break ;
22992307 }
23002308 // exhaust enums to ensure full coverage
2309+ case 'finalized' :
23012310 case 'max' :
23022311 case 'root' :
23032312 }
@@ -2876,7 +2885,7 @@ export class Connection {
28762885 try {
28772886 const startTime = Date . now ( ) ;
28782887 for ( let i = 0 ; i < 50 ; i ++ ) {
2879- const { blockhash} = await this . getRecentBlockhash ( 'max ' ) ;
2888+ const { blockhash} = await this . getRecentBlockhash ( 'finalized ' ) ;
28802889
28812890 if ( this . _blockhashInfo . recentBlockhash != blockhash ) {
28822891 this . _blockhashInfo = {
0 commit comments