Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 6482d0d

Browse files
authoredJun 29, 2022
feat: add minContextSlot configuration to (almost) all web3.js methods (#26296)
* feat: add `minContextSlot` config to `getAccountInfo` * feat: add `minContextSlot` config to `getBalance` * feat: add `minContextSlot` config to `getBlockHeight`` * feat: add `minContextSlot` config to `getEpochInfo` * feat: add `minContextSlot` config to `getInflationReward` * feat: add `minContextSlot` config to `getLatestBlockhash` * feat: add `minContextSlot` config to `getMultipleAccounts` * feat: add `minContextSlot` config to `getProgramAccounts` * feat: add `minContextSlot` config to `getSignaturesForAddress` * feat: add `minContextSlot` config to `getSlot` * feat: add `minContextSlot` config to `getSlotLeader` * feat: add `minContextSlot` config to `getStakeActivation` * feat: add `minContextSlot` config to `getTokenAccountsByOwner` * feat: add `minContextSlot` config to `getTransactionCount` * feat: add `minContextSlot` config to `sendTransaction`
1 parent 6e009d8 commit 6482d0d

File tree

3 files changed

+271
-73
lines changed

3 files changed

+271
-73
lines changed
 

‎src/connection.ts

+269-73
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ export type SendOptions = {
228228
preflightCommitment?: Commitment;
229229
/** Maximum number of times for the RPC node to retry sending the transaction to the leader. */
230230
maxRetries?: number;
231+
/** The minimum slot that the request can be evaluated at */
232+
minContextSlot?: number;
231233
};
232234

233235
/**
@@ -242,6 +244,8 @@ export type ConfirmOptions = {
242244
preflightCommitment?: Commitment;
243245
/** Maximum number of times for the RPC node to retry sending the transaction to the leader. */
244246
maxRetries?: number;
247+
/** The minimum slot that the request can be evaluated at */
248+
minContextSlot?: number;
245249
};
246250

247251
/**
@@ -272,6 +276,8 @@ export type SignaturesForAddressOptions = {
272276
until?: TransactionSignature;
273277
/** Maximum transaction signatures to return (between 1 and 1,000, default: 1,000). */
274278
limit?: number;
279+
/** The minimum slot that the request can be evaluated at */
280+
minContextSlot?: number;
275281
};
276282

277283
/**
@@ -297,6 +303,23 @@ export type BlockheightBasedTransactionConfirmationStrategy = {
297303
signature: TransactionSignature;
298304
} & BlockhashWithExpiryBlockHeight;
299305

306+
/** @internal */
307+
function extractCommitmentFromConfig<TConfig>(
308+
commitmentOrConfig?: Commitment | ({commitment?: Commitment} & TConfig),
309+
) {
310+
let commitment: Commitment | undefined;
311+
let config: Omit<TConfig, 'commitment'> | undefined;
312+
if (typeof commitmentOrConfig === 'string') {
313+
commitment = commitmentOrConfig;
314+
} else if (commitmentOrConfig) {
315+
const {commitment: specifiedCommitment, ...specifiedConfig} =
316+
commitmentOrConfig;
317+
commitment = specifiedCommitment;
318+
config = specifiedConfig;
319+
}
320+
return {commitment, config};
321+
}
322+
300323
/**
301324
* @internal
302325
*/
@@ -399,6 +422,88 @@ export type Finality = 'confirmed' | 'finalized';
399422
*/
400423
export type LargestAccountsFilter = 'circulating' | 'nonCirculating';
401424

425+
/**
426+
* Configuration object for changing `getAccountInfo` query behavior
427+
*/
428+
export type GetAccountInfoConfig = {
429+
/** The level of commitment desired */
430+
commitment?: Commitment;
431+
/** The minimum slot that the request can be evaluated at */
432+
minContextSlot?: number;
433+
};
434+
435+
/**
436+
* Configuration object for changing `getBalance` query behavior
437+
*/
438+
export type GetBalanceConfig = {
439+
/** The level of commitment desired */
440+
commitment?: Commitment;
441+
/** The minimum slot that the request can be evaluated at */
442+
minContextSlot?: number;
443+
};
444+
445+
/**
446+
* Configuration object for changing `getBlockHeight` query behavior
447+
*/
448+
export type GetBlockHeightConfig = {
449+
/** The level of commitment desired */
450+
commitment?: Commitment;
451+
/** The minimum slot that the request can be evaluated at */
452+
minContextSlot?: number;
453+
};
454+
455+
/**
456+
* Configuration object for changing `getEpochInfo` query behavior
457+
*/
458+
export type GetEpochInfoConfig = {
459+
/** The level of commitment desired */
460+
commitment?: Commitment;
461+
/** The minimum slot that the request can be evaluated at */
462+
minContextSlot?: number;
463+
};
464+
465+
/**
466+
* Configuration object for changing `getInflationReward` query behavior
467+
*/
468+
export type GetInflationRewardConfig = {
469+
/** The level of commitment desired */
470+
commitment?: Commitment;
471+
/** An epoch for which the reward occurs. If omitted, the previous epoch will be used */
472+
epoch?: number;
473+
/** The minimum slot that the request can be evaluated at */
474+
minContextSlot?: number;
475+
};
476+
477+
/**
478+
* Configuration object for changing `getLatestBlockhash` query behavior
479+
*/
480+
export type GetLatestBlockhashConfig = {
481+
/** The level of commitment desired */
482+
commitment?: Commitment;
483+
/** The minimum slot that the request can be evaluated at */
484+
minContextSlot?: number;
485+
};
486+
487+
/**
488+
* Configuration object for changing `getSlot` query behavior
489+
*/
490+
export type GetSlotConfig = {
491+
/** The level of commitment desired */
492+
commitment?: Commitment;
493+
/** The minimum slot that the request can be evaluated at */
494+
minContextSlot?: number;
495+
};
496+
497+
/**
498+
* Configuration object for changing `getSlotLeader` query behavior
499+
*/
500+
export type GetSlotLeaderConfig = {
501+
/** The level of commitment desired */
502+
commitment?: Commitment;
503+
/** The minimum slot that the request can be evaluated at */
504+
minContextSlot?: number;
505+
};
506+
402507
/**
403508
* Configuration object for changing `getLargestAccounts` query behavior
404509
*/
@@ -1949,6 +2054,8 @@ export type GetProgramAccountsConfig = {
19492054
dataSlice?: DataSlice;
19502055
/** Optional array of filters to apply to accounts */
19512056
filters?: GetProgramAccountsFilter[];
2057+
/** The minimum slot that the request can be evaluated at */
2058+
minContextSlot?: number;
19522059
};
19532060

19542061
/**
@@ -1959,6 +2066,8 @@ export type GetParsedProgramAccountsConfig = {
19592066
commitment?: Commitment;
19602067
/** Optional array of filters to apply to accounts */
19612068
filters?: GetProgramAccountsFilter[];
2069+
/** The minimum slot that the request can be evaluated at */
2070+
minContextSlot?: number;
19622071
};
19632072

19642073
/**
@@ -1967,8 +2076,40 @@ export type GetParsedProgramAccountsConfig = {
19672076
export type GetMultipleAccountsConfig = {
19682077
/** Optional commitment level */
19692078
commitment?: Commitment;
1970-
/** Optional encoding for account data (default base64) */
1971-
encoding?: 'base64' | 'jsonParsed';
Has conversations. Original line has conversations.
2079+
/** The minimum slot that the request can be evaluated at */
2080+
minContextSlot?: number;
2081+
};
2082+
2083+
/**
2084+
* Configuration object for `getStakeActivation`
2085+
*/
2086+
export type GetStakeActivationConfig = {
2087+
/** Optional commitment level */
2088+
commitment?: Commitment;
2089+
/** Epoch for which to calculate activation details. If parameter not provided, defaults to current epoch */
2090+
epoch?: number;
2091+
/** The minimum slot that the request can be evaluated at */
2092+
minContextSlot?: number;
2093+
};
2094+
2095+
/**
2096+
* Configuration object for `getStakeActivation`
2097+
*/
2098+
export type GetTokenAccountsByOwnerConfig = {
2099+
/** Optional commitment level */
2100+
commitment?: Commitment;
2101+
/** The minimum slot that the request can be evaluated at */
2102+
minContextSlot?: number;
2103+
};
2104+
2105+
/**
2106+
* Configuration object for `getStakeActivation`
2107+
*/
2108+
export type GetTransactionCountConfig = {
2109+
/** Optional commitment level */
2110+
commitment?: Commitment;
2111+
/** The minimum slot that the request can be evaluated at */
2112+
minContextSlot?: number;
19722113
};
19732114

19742115
/**
@@ -2377,9 +2518,17 @@ export class Connection {
23772518
*/
23782519
async getBalanceAndContext(
23792520
publicKey: PublicKey,
2380-
commitment?: Commitment,
2521+
commitmentOrConfig?: Commitment | GetBalanceConfig,
23812522
): Promise<RpcResponseAndContext<number>> {
2382-
const args = this._buildArgs([publicKey.toBase58()], commitment);
2523+
/** @internal */
2524+
const {commitment, config} =
2525+
extractCommitmentFromConfig(commitmentOrConfig);
2526+
const args = this._buildArgs(
2527+
[publicKey.toBase58()],
2528+
commitment,
2529+
undefined /* encoding */,
2530+
config,
2531+
);
23832532
const unsafeRes = await this._rpcRequest('getBalance', args);
23842533
const res = create(unsafeRes, jsonRpcResultAndContext(number()));
23852534
if ('error' in res) {
@@ -2398,9 +2547,9 @@ export class Connection {
23982547
*/
23992548
async getBalance(
24002549
publicKey: PublicKey,
2401-
commitment?: Commitment,
2550+
commitmentOrConfig?: Commitment | GetBalanceConfig,
24022551
): Promise<number> {
2403-
return await this.getBalanceAndContext(publicKey, commitment)
2552+
return await this.getBalanceAndContext(publicKey, commitmentOrConfig)
24042553
.then(x => x.value)
24052554
.catch(e => {
24062555
throw new Error(
@@ -2522,20 +2671,22 @@ export class Connection {
25222671
async getTokenAccountsByOwner(
25232672
ownerAddress: PublicKey,
25242673
filter: TokenAccountsFilter,
2525-
commitment?: Commitment,
2674+
commitmentOrConfig?: Commitment | GetTokenAccountsByOwnerConfig,
25262675
): Promise<
25272676
RpcResponseAndContext<
25282677
Array<{pubkey: PublicKey; account: AccountInfo<Buffer>}>
25292678
>
25302679
> {
2680+
const {commitment, config} =
2681+
extractCommitmentFromConfig(commitmentOrConfig);
25312682
let _args: any[] = [ownerAddress.toBase58()];
25322683
if ('mint' in filter) {
25332684
_args.push({mint: filter.mint.toBase58()});
25342685
} else {
25352686
_args.push({programId: filter.programId.toBase58()});
25362687
}
25372688

2538-
const args = this._buildArgs(_args, commitment, 'base64');
2689+
const args = this._buildArgs(_args, commitment, 'base64', config);
25392690
const unsafeRes = await this._rpcRequest('getTokenAccountsByOwner', args);
25402691
const res = create(unsafeRes, GetTokenAccountsByOwner);
25412692
if ('error' in res) {
@@ -2627,9 +2778,16 @@ export class Connection {
26272778
*/
26282779
async getAccountInfoAndContext(
26292780
publicKey: PublicKey,
2630-
commitment?: Commitment,
2781+
commitmentOrConfig?: Commitment | GetAccountInfoConfig,
26312782
): Promise<RpcResponseAndContext<AccountInfo<Buffer> | null>> {
2632-
const args = this._buildArgs([publicKey.toBase58()], commitment, 'base64');
2783+
const {commitment, config} =
2784+
extractCommitmentFromConfig(commitmentOrConfig);
2785+
const args = this._buildArgs(
2786+
[publicKey.toBase58()],
2787+
commitment,
2788+
'base64',
2789+
config,
2790+
);
26332791
const unsafeRes = await this._rpcRequest('getAccountInfo', args);
26342792
const res = create(
26352793
unsafeRes,
@@ -2681,10 +2839,13 @@ export class Connection {
26812839
*/
26822840
async getAccountInfo(
26832841
publicKey: PublicKey,
2684-
commitment?: Commitment,
2842+
commitmentOrConfig?: Commitment | GetAccountInfoConfig,
26852843
): Promise<AccountInfo<Buffer> | null> {
26862844
try {
2687-
const res = await this.getAccountInfoAndContext(publicKey, commitment);
2845+
const res = await this.getAccountInfoAndContext(
2846+
publicKey,
2847+
commitmentOrConfig,
2848+
);
26882849
return res.value;
26892850
} catch (e) {
26902851
throw new Error(
@@ -2698,10 +2859,12 @@ export class Connection {
26982859
*/
26992860
async getMultipleAccountsInfoAndContext(
27002861
publicKeys: PublicKey[],
2701-
commitment?: Commitment,
2862+
commitmentOrConfig?: Commitment | GetMultipleAccountsConfig,
27022863
): Promise<RpcResponseAndContext<(AccountInfo<Buffer> | null)[]>> {
2864+
const {commitment, config} =
2865+
extractCommitmentFromConfig(commitmentOrConfig);
27032866
const keys = publicKeys.map(key => key.toBase58());
2704-
const args = this._buildArgs([keys], commitment, 'base64');
2867+
const args = this._buildArgs([keys], commitment, 'base64', config);
27052868
const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);
27062869
const res = create(
27072870
unsafeRes,
@@ -2720,11 +2883,11 @@ export class Connection {
27202883
*/
27212884
async getMultipleAccountsInfo(
27222885
publicKeys: PublicKey[],
2723-
commitment?: Commitment,
2886+
commitmentOrConfig?: Commitment | GetMultipleAccountsConfig,
27242887
): Promise<(AccountInfo<Buffer> | null)[]> {
27252888
const res = await this.getMultipleAccountsInfoAndContext(
27262889
publicKeys,
2727-
commitment,
2890+
commitmentOrConfig,
27282891
);
27292892
return res.value;
27302893
}
@@ -2734,14 +2897,19 @@ export class Connection {
27342897
*/
27352898
async getStakeActivation(
27362899
publicKey: PublicKey,
2737-
commitment?: Commitment,
2900+
commitmentOrConfig?: Commitment | GetStakeActivationConfig,
27382901
epoch?: number,
27392902
): Promise<StakeActivationData> {
2903+
const {commitment, config} =
2904+
extractCommitmentFromConfig(commitmentOrConfig);
27402905
const args = this._buildArgs(
27412906
[publicKey.toBase58()],
27422907
commitment,
2743-
undefined,
2744-
epoch !== undefined ? {epoch} : undefined,
2908+
undefined /* encoding */,
2909+
{
2910+
...config,
2911+
epoch: epoch != null ? epoch : config?.epoch,
2912+
},
27452913
);
27462914

27472915
const unsafeRes = await this._rpcRequest('getStakeActivation', args);
@@ -2765,31 +2933,14 @@ export class Connection {
27652933
programId: PublicKey,
27662934
configOrCommitment?: GetProgramAccountsConfig | Commitment,
27672935
): Promise<Array<{pubkey: PublicKey; account: AccountInfo<Buffer>}>> {
2768-
const extra: Pick<GetProgramAccountsConfig, 'dataSlice' | 'filters'> = {};
2769-
2770-
let commitment;
2771-
let encoding;
2772-
if (configOrCommitment) {
2773-
if (typeof configOrCommitment === 'string') {
2774-
commitment = configOrCommitment;
2775-
} else {
2776-
commitment = configOrCommitment.commitment;
2777-
encoding = configOrCommitment.encoding;
2778-
2779-
if (configOrCommitment.dataSlice) {
2780-
extra.dataSlice = configOrCommitment.dataSlice;
2781-
}
2782-
if (configOrCommitment.filters) {
2783-
extra.filters = configOrCommitment.filters;
2784-
}
2785-
}
2786-
}
2787-
2936+
const {commitment, config} =
2937+
extractCommitmentFromConfig(configOrCommitment);
2938+
const {encoding, ...configWithoutEncoding} = config || {};
27882939
const args = this._buildArgs(
27892940
[programId.toBase58()],
27902941
commitment,
27912942
encoding || 'base64',
2792-
extra,
2943+
configWithoutEncoding,
27932944
);
27942945
const unsafeRes = await this._rpcRequest('getProgramAccounts', args);
27952946
const res = create(unsafeRes, jsonRpcResult(array(KeyedAccountInfoResult)));
@@ -2818,26 +2969,13 @@ export class Connection {
28182969
account: AccountInfo<Buffer | ParsedAccountData>;
28192970
}>
28202971
> {
2821-
const extra: Pick<GetParsedProgramAccountsConfig, 'filters'> = {};
2822-
2823-
let commitment;
2824-
if (configOrCommitment) {
2825-
if (typeof configOrCommitment === 'string') {
2826-
commitment = configOrCommitment;
2827-
} else {
2828-
commitment = configOrCommitment.commitment;
2829-
2830-
if (configOrCommitment.filters) {
2831-
extra.filters = configOrCommitment.filters;
2832-
}
2833-
}
2834-
}
2835-
2972+
const {commitment, config} =
2973+
extractCommitmentFromConfig(configOrCommitment);
28362974
const args = this._buildArgs(
28372975
[programId.toBase58()],
28382976
commitment,
28392977
'jsonParsed',
2840-
extra,
2978+
config,
28412979
);
28422980
const unsafeRes = await this._rpcRequest('getProgramAccounts', args);
28432981
const res = create(
@@ -3025,8 +3163,17 @@ export class Connection {
30253163
/**
30263164
* Fetch the current slot that the node is processing
30273165
*/
3028-
async getSlot(commitment?: Commitment): Promise<number> {
3029-
const args = this._buildArgs([], commitment);
3166+
async getSlot(
3167+
commitmentOrConfig?: Commitment | GetSlotConfig,
3168+
): Promise<number> {
3169+
const {commitment, config} =
3170+
extractCommitmentFromConfig(commitmentOrConfig);
3171+
const args = this._buildArgs(
3172+
[],
3173+
commitment,
3174+
undefined /* encoding */,
3175+
config,
3176+
);
30303177
const unsafeRes = await this._rpcRequest('getSlot', args);
30313178
const res = create(unsafeRes, jsonRpcResult(number()));
30323179
if ('error' in res) {
@@ -3038,8 +3185,17 @@ export class Connection {
30383185
/**
30393186
* Fetch the current slot leader of the cluster
30403187
*/
3041-
async getSlotLeader(commitment?: Commitment): Promise<string> {
3042-
const args = this._buildArgs([], commitment);
3188+
async getSlotLeader(
3189+
commitmentOrConfig?: Commitment | GetSlotLeaderConfig,
3190+
): Promise<string> {
3191+
const {commitment, config} =
3192+
extractCommitmentFromConfig(commitmentOrConfig);
3193+
const args = this._buildArgs(
3194+
[],
3195+
commitment,
3196+
undefined /* encoding */,
3197+
config,
3198+
);
30433199
const unsafeRes = await this._rpcRequest('getSlotLeader', args);
30443200
const res = create(unsafeRes, jsonRpcResult(string()));
30453201
if ('error' in res) {
@@ -3105,8 +3261,17 @@ export class Connection {
31053261
/**
31063262
* Fetch the current transaction count of the cluster
31073263
*/
3108-
async getTransactionCount(commitment?: Commitment): Promise<number> {
3109-
const args = this._buildArgs([], commitment);
3264+
async getTransactionCount(
3265+
commitmentOrConfig?: Commitment | GetTransactionCountConfig,
3266+
): Promise<number> {
3267+
const {commitment, config} =
3268+
extractCommitmentFromConfig(commitmentOrConfig);
3269+
const args = this._buildArgs(
3270+
[],
3271+
commitment,
3272+
undefined /* encoding */,
3273+
config,
3274+
);
31103275
const unsafeRes = await this._rpcRequest('getTransactionCount', args);
31113276
const res = create(unsafeRes, jsonRpcResult(number()));
31123277
if ('error' in res) {
@@ -3149,14 +3314,17 @@ export class Connection {
31493314
async getInflationReward(
31503315
addresses: PublicKey[],
31513316
epoch?: number,
3152-
commitment?: Commitment,
3317+
commitmentOrConfig?: Commitment | GetInflationRewardConfig,
31533318
): Promise<(InflationReward | null)[]> {
3319+
const {commitment, config} =
3320+
extractCommitmentFromConfig(commitmentOrConfig);
31543321
const args = this._buildArgs(
31553322
[addresses.map(pubkey => pubkey.toBase58())],
31563323
commitment,
3157-
undefined,
3324+
undefined /* encoding */,
31583325
{
3159-
epoch,
3326+
...config,
3327+
epoch: epoch != null ? epoch : config?.epoch,
31603328
},
31613329
);
31623330
const unsafeRes = await this._rpcRequest('getInflationReward', args);
@@ -3170,8 +3338,17 @@ export class Connection {
31703338
/**
31713339
* Fetch the Epoch Info parameters
31723340
*/
3173-
async getEpochInfo(commitment?: Commitment): Promise<EpochInfo> {
3174-
const args = this._buildArgs([], commitment);
3341+
async getEpochInfo(
3342+
commitmentOrConfig?: Commitment | GetEpochInfoConfig,
3343+
): Promise<EpochInfo> {
3344+
const {commitment, config} =
3345+
extractCommitmentFromConfig(commitmentOrConfig);
3346+
const args = this._buildArgs(
3347+
[],
3348+
commitment,
3349+
undefined /* encoding */,
3350+
config,
3351+
);
31753352
const unsafeRes = await this._rpcRequest('getEpochInfo', args);
31763353
const res = create(unsafeRes, GetEpochInfoRpcResult);
31773354
if ('error' in res) {
@@ -3344,10 +3521,10 @@ export class Connection {
33443521
* @return {Promise<BlockhashWithExpiryBlockHeight>}
33453522
*/
33463523
async getLatestBlockhash(
3347-
commitment?: Commitment,
3524+
commitmentOrConfig?: Commitment | GetLatestBlockhashConfig,
33483525
): Promise<BlockhashWithExpiryBlockHeight> {
33493526
try {
3350-
const res = await this.getLatestBlockhashAndContext(commitment);
3527+
const res = await this.getLatestBlockhashAndContext(commitmentOrConfig);
33513528
return res.value;
33523529
} catch (e) {
33533530
throw new Error('failed to get recent blockhash: ' + e);
@@ -3359,9 +3536,16 @@ export class Connection {
33593536
* @return {Promise<BlockhashWithExpiryBlockHeight>}
33603537
*/
33613538
async getLatestBlockhashAndContext(
3362-
commitment?: Commitment,
3539+
commitmentOrConfig?: Commitment | GetLatestBlockhashConfig,
33633540
): Promise<RpcResponseAndContext<BlockhashWithExpiryBlockHeight>> {
3364-
const args = this._buildArgs([], commitment);
3541+
const {commitment, config} =
3542+
extractCommitmentFromConfig(commitmentOrConfig);
3543+
const args = this._buildArgs(
3544+
[],
3545+
commitment,
3546+
undefined /* encoding */,
3547+
config,
3548+
);
33653549
const unsafeRes = await this._rpcRequest('getLatestBlockhash', args);
33663550
const res = create(unsafeRes, GetLatestBlockhashRpcResult);
33673551
if ('error' in res) {
@@ -3433,8 +3617,17 @@ export class Connection {
34333617
/*
34343618
* Returns the current block height of the node
34353619
*/
3436-
async getBlockHeight(commitment?: Commitment): Promise<number> {
3437-
const args = this._buildArgs([], commitment);
3620+
async getBlockHeight(
3621+
commitmentOrConfig?: Commitment | GetBlockHeightConfig,
3622+
): Promise<number> {
3623+
const {commitment, config} =
3624+
extractCommitmentFromConfig(commitmentOrConfig);
3625+
const args = this._buildArgs(
3626+
[],
3627+
commitment,
3628+
undefined /* encoding */,
3629+
config,
3630+
);
34383631
const unsafeRes = await this._rpcRequest('getBlockHeight', args);
34393632
const res = create(unsafeRes, jsonRpcResult(number()));
34403633
if ('error' in res) {
@@ -4250,6 +4443,9 @@ export class Connection {
42504443
if (options && options.maxRetries) {
42514444
config.maxRetries = options.maxRetries;
42524445
}
4446+
if (options && options.minContextSlot != null) {
4447+
config.minContextSlot = options.minContextSlot;
4448+
}
42534449
if (skipPreflight) {
42544450
config.skipPreflight = skipPreflight;
42554451
}

‎src/util/send-and-confirm-raw-transaction.ts

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export async function sendAndConfirmRawTransaction(
6868
const sendOptions = options && {
6969
skipPreflight: options.skipPreflight,
7070
preflightCommitment: options.preflightCommitment || options.commitment,
71+
minContextSlot: options.minContextSlot,
7172
};
7273

7374
const signature = await connection.sendRawTransaction(

‎src/util/send-and-confirm-transaction.ts

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export async function sendAndConfirmTransaction(
2525
skipPreflight: options.skipPreflight,
2626
preflightCommitment: options.preflightCommitment || options.commitment,
2727
maxRetries: options.maxRetries,
28+
minContextSlot: options.minContextSlot,
2829
};
2930

3031
const signature = await connection.sendTransaction(

0 commit comments

Comments
 (0)
This repository has been archived.