import { Address, Chain, PublicClient, Transport, WalletClient } from 'viem'; import { Prettify } from './types/utils'; import { WithTokenBridgeCreatorAddressOverride } from './types/createTokenBridgeTypes'; /** * This type is for the params of the feeRouterDeployChildToParentRewardRouter function */ export type FeeRouterDeployChildToParentRewardRouterParams = Prettify; orbitChainWalletClient: WalletClient; parentChainTargetAddress: Address; minDistributionInvervalSeconds?: bigint; rollup?: Address; parentChainTokenAddress?: Address; }>>; /** * This type is for the params of the feeRouterDeployChildToParentRewardRouter function */ export type FeeRouterDeployOpChildToParentRewardRouterParams = Prettify<{ childChainWalletClient: WalletClient; parentChainTargetAddress: Address; minDistributionInvervalSeconds?: bigint; parentChainTokenAddress?: Address; childChainTokenAddress?: Address; }>; /** * Deploys the ArbChildToParentRewardRouter smart contract and initializes it with the provided configuration. * * If the router is intended to route the native asset, there's no need to include the rollup and parentChainTokenAddress parameters. * * References: * - ArbChildToParentRewardRouter contract: https://github.com/OffchainLabs/fund-distribution-contracts/blob/main/src/FeeRouter/ArbChildToParentRewardRouter.sol * * Example: [Setup fee routing for the AEP](https://github.com/OffchainLabs/arbitrum-orbit-sdk/blob/main/examples/setup-aep-fee-router/index.ts) * * @param {FeeRouterDeployChildToParentRewardRouterParams} feeRouterDeployChildToParentRewardRouterParams {@link FeeRouterDeployChildToParentRewardRouterParams} * @param {PublicClient} feeRouterDeployChildToParentRewardRouterParams.parentChainPublicClient - The parent chain Viem public client * @param {WalletClient} feeRouterDeployChildToParentRewardRouterParams.orbitChainWalletClient - The orbit chain Viem wallet client (this account will deploy the contract) * @param {Address} feeRouterDeployChildToParentRewardRouterParams.parentChainTargetAddress - The address where funds will be sent in the parent chain * @param {bigint} feeRouterDeployChildToParentRewardRouterParams.minDistributionInvervalSeconds - [Optional] The number of seconds that needs to pass before funds can be sent again (to prevent griefing) * @param {Address} feeRouterDeployChildToParentRewardRouterParams.rollup - [Optional] If sending a token different than the native token of the Orbit chain, the Rollup contract address of the chain * @param {Address} feeRouterDeployChildToParentRewardRouterParams.parentChainTokenAddress - [Optional] If sending a token different than the native token of the Orbit chain, address of the token in the parent chain * * @returns Promise<0x${string}> - The hash of the deployment transaction * * @example * const childToParentRewardRouterDeploymentTransactionHash = await feeRouterDeployChildToParentRewardRouter({ * parentChainPublicClient, * orbitChainWalletClient, * parentChainTargetAddress, * }); * const childToParentRewardRouterDeploymentTransactionReceipt = * await nitroTestnodeL2Client.waitForTransactionReceipt({ * hash: childToParentRewardRouterDeploymentTransactionHash, * }); * const childToParentRewardRouterAddress = getAddress( * childToParentRewardRouterDeploymentTransactionReceipt.contractAddress as `0x${string}`, * ); */ export declare function feeRouterDeployChildToParentRewardRouter({ parentChainPublicClient, orbitChainWalletClient, parentChainTargetAddress, minDistributionInvervalSeconds, rollup, parentChainTokenAddress, tokenBridgeCreatorAddressOverride, }: FeeRouterDeployChildToParentRewardRouterParams): Promise<`0x${string}`>; /** * Deploys the OpChildToParentRewardRouter smart contract and initializes it with the provided configuration. * * If the router is intended to route the native asset, there's no need to include the rollup and parentChainTokenAddress parameters. * * References: * - OpChildToParentRewardRouter contract: https://github.com/OffchainLabs/fund-distribution-contracts/blob/main/src/FeeRouter/OpChildToParentRewardRouter.sol * * Example: [Setup fee routing for the AEP](https://github.com/OffchainLabs/arbitrum-orbit-sdk/blob/main/examples/setup-aep-fee-router/index.ts) * * @param {FeeRouterDeployChildToParentRewardRouterParams} feeRouterDeployChildToParentRewardRouterParams {@link FeeRouterDeployChildToParentRewardRouterParams} * @param {WalletClient} feeRouterDeployChildToParentRewardRouterParams.orbitChainWalletClient - The orbit chain Viem wallet client (this account will deploy the contract) * @param {Address} feeRouterDeployChildToParentRewardRouterParams.parentChainTargetAddress - The address where funds will be sent in the parent chain * @param {bigint} feeRouterDeployChildToParentRewardRouterParams.minDistributionInvervalSeconds - [Optional] The number of seconds that needs to pass before funds can be sent again (to prevent griefing) * @param {Address} feeRouterDeployChildToParentRewardRouterParams.parentChainTokenAddress - [Optional] If sending a token different than the native token of the Orbit chain, address of the token on the parent chain. Must be provided if childChainTokenAddress is provided. * @param {Address} feeRouterDeployChildToParentRewardRouterParams.childChainTokenAddress - [Optional] If sending a token different than the native token of the Orbit chain, address of the token on the child chain. Must be provided if parentChainTokenAddress is provided. * * @returns Promise<0x${string}> - The hash of the deployment transaction * * @example * const childToParentRewardRouterDeploymentTransactionHash = await feeRouterDeployOpChildToParentRewardRouter({ * parentChainPublicClient, * orbitChainWalletClient, * parentChainTargetAddress, * }); * const childToParentRewardRouterDeploymentTransactionReceipt = * await nitroTestnodeL2Client.waitForTransactionReceipt({ * hash: childToParentRewardRouterDeploymentTransactionHash, * }); * const childToParentRewardRouterAddress = getAddress( * childToParentRewardRouterDeploymentTransactionReceipt.contractAddress as `0x${string}`, * ); */ export declare function feeRouterDeployOpChildToParentRewardRouter({ childChainWalletClient, parentChainTargetAddress, minDistributionInvervalSeconds, parentChainTokenAddress, childChainTokenAddress, }: FeeRouterDeployOpChildToParentRewardRouterParams): Promise<`0x${string}`>;