Function: fastExecute()
fastExecute():
StarknetPlugin<FastExecuteProviderMethods,FastExecuteAccountMethods>
Defined in: src/plugins/fast-execute/index.ts:45
FastExecute plugin - adds gaming-optimized transaction execution
Provides fastExecute() on accounts and fastWaitForTransaction() on providers for rapid successive transaction execution with minimal confirmation latency.
Requires:
- RPC 0.9 or later
- Provider initialized with BlockTag.PRE_CONFIRMED
Returns
StarknetPlugin<FastExecuteProviderMethods, FastExecuteAccountMethods>
Example
import { RpcProvider, Account } from 'starknet';
import { fastExecute } from 'starknet/plugins';
const provider = new RpcProvider({
nodeUrl: url,
blockIdentifier: BlockTag.PRE_CONFIRMED,
});
const account = new Account({ provider, address, signer });
const resp = await account.fastExecute(
call,
{ tip: recommendedTip },
{ retries: 30, retryInterval: 500 }
);
if (resp.isReady) {
// Next transaction can be sent immediately
}