diff --git a/src/constants.ts b/src/constants.ts index 1d6a30ae..09bbd19f 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,5 +1,11 @@ import { parseEther } from 'viem'; +/** + * Approximate value necessary to pay for retryables fees for `createRollup`. + */ export const createRollupDefaultRetryablesFees = parseEther('0.125'); +/** + * Approximate value necessary to pay for retryables fees for `createTokenBridge`. + */ export const createTokenBridgeDefaultRetryablesFees = parseEther('0.02'); diff --git a/src/createRollupGetRetryablesFees.ts b/src/createRollupGetRetryablesFees.ts index 0ebf2148..a7e6e422 100644 --- a/src/createRollupGetRetryablesFees.ts +++ b/src/createRollupGetRetryablesFees.ts @@ -65,6 +65,16 @@ export type CreateRollupGetRetryablesFeesParams = { maxFeePerGasForRetryables?: bigint; }; +/** + * Fetch estimated retryables fees for `createRollup`. + * + * @param publicClient `PublicClient` for the parent chain. + * @param params.account Account used for deploying the rollup. + * @param params.nativeToken (Optional) The native token used for the rollup. Defaults to ETH. + * @param params.maxFeePerGasForRetryables (Optional) `maxFeePerGas` to use for retryables. Defaults to 0.1 Gwei. + * + * @returns Estimated fees. + */ export async function createRollupGetRetryablesFees( publicClient: PublicClient, { account, nativeToken, maxFeePerGasForRetryables }: CreateRollupGetRetryablesFeesParams, @@ -152,6 +162,16 @@ export async function createRollupGetRetryablesFees( publicClient: PublicClient, { account, nativeToken, maxFeePerGasForRetryables }: CreateRollupGetRetryablesFeesParams, diff --git a/src/index.ts b/src/index.ts index a95218d3..51e2f9b3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -150,6 +150,15 @@ import { scaleFrom18DecimalsToNativeTokenDecimals, scaleFromNativeTokenDecimalsTo18Decimals, } from './utils/decimals'; +import { + createRollupDefaultRetryablesFees, + createTokenBridgeDefaultRetryablesFees, +} from './constants'; +import { + CreateRollupGetRetryablesFeesParams, + createRollupGetRetryablesFees, + createRollupGetRetryablesFeesWithDefaults, +} from './createRollupGetRetryablesFees'; export { arbOwnerPublicActions, @@ -274,4 +283,11 @@ export { // scaleFrom18DecimalsToNativeTokenDecimals, scaleFromNativeTokenDecimalsTo18Decimals, + // + createRollupDefaultRetryablesFees, + createRollupGetRetryablesFees, + createRollupGetRetryablesFeesWithDefaults, + CreateRollupGetRetryablesFeesParams, + // + createTokenBridgeDefaultRetryablesFees, };