File tree Expand file tree Collapse file tree 7 files changed +297
-0
lines changed
Expand file tree Collapse file tree 7 files changed +297
-0
lines changed Original file line number Diff line number Diff line change 1+ import {
2+ Address ,
3+ Chain ,
4+ PrepareTransactionRequestParameters ,
5+ PrepareTransactionRequestReturnType ,
6+ PublicClient ,
7+ Transport ,
8+ encodeFunctionData ,
9+ } from 'viem' ;
10+ import { arbOwner } from '../contracts' ;
11+ import { WithAccount } from '../types/Actions' ;
12+ import { Prettify } from '../types/utils' ;
13+
14+ export type AddChainOwnerParameters = Prettify <
15+ WithAccount < {
16+ newOwner : Address ;
17+ } >
18+ > ;
19+
20+ export type AddChainOwnerReturnType = PrepareTransactionRequestReturnType ;
21+
22+ function arbOwnerFunctionData ( { newOwner } : AddChainOwnerParameters ) {
23+ return encodeFunctionData ( {
24+ abi : arbOwner . abi ,
25+ functionName : 'addChainOwner' ,
26+ args : [ newOwner ] ,
27+ } ) ;
28+ }
29+
30+ export async function addChainOwner < TChain extends Chain | undefined > (
31+ client : PublicClient < Transport , TChain > ,
32+ args : AddChainOwnerParameters ,
33+ ) : Promise < AddChainOwnerReturnType > {
34+ const data = arbOwnerFunctionData ( args ) ;
35+
36+ return client . prepareTransactionRequest ( {
37+ to : arbOwner . address ,
38+ value : BigInt ( 0 ) ,
39+ chain : client . chain ,
40+ data,
41+ account : args . account ,
42+ } satisfies PrepareTransactionRequestParameters ) ;
43+ }
Original file line number Diff line number Diff line change 1+ import {
2+ Address ,
3+ Chain ,
4+ PrepareTransactionRequestParameters ,
5+ PrepareTransactionRequestReturnType ,
6+ PublicClient ,
7+ Transport ,
8+ encodeFunctionData ,
9+ } from 'viem' ;
10+ import { arbOwner } from '../contracts' ;
11+ import { WithAccount } from '../types/Actions' ;
12+ import { Prettify } from '../types/utils' ;
13+
14+ export type RemoveChainOwnerParameters = Prettify <
15+ WithAccount < {
16+ owner : Address ;
17+ } >
18+ > ;
19+
20+ export type RemoveChainOwnerReturnType = PrepareTransactionRequestReturnType ;
21+
22+ function arbOwnerFunctionData ( { owner } : RemoveChainOwnerParameters ) {
23+ return encodeFunctionData ( {
24+ abi : arbOwner . abi ,
25+ functionName : 'removeChainOwner' ,
26+ args : [ owner ] ,
27+ } ) ;
28+ }
29+
30+ export async function removeChainOwner < TChain extends Chain | undefined > (
31+ client : PublicClient < Transport , TChain > ,
32+ args : RemoveChainOwnerParameters ,
33+ ) : Promise < RemoveChainOwnerReturnType > {
34+ const data = arbOwnerFunctionData ( args ) ;
35+
36+ return client . prepareTransactionRequest ( {
37+ to : arbOwner . address ,
38+ value : BigInt ( 0 ) ,
39+ chain : client . chain ,
40+ data,
41+ account : args . account ,
42+ } satisfies PrepareTransactionRequestParameters ) ;
43+ }
Original file line number Diff line number Diff line change 1+ import {
2+ Chain ,
3+ PrepareTransactionRequestParameters ,
4+ PrepareTransactionRequestReturnType ,
5+ PublicClient ,
6+ Transport ,
7+ encodeFunctionData ,
8+ } from 'viem' ;
9+ import { arbOwner } from '../contracts' ;
10+ import { WithAccount } from '../types/Actions' ;
11+ import { Prettify } from '../types/utils' ;
12+
13+ export type SetMaxTxGasLimitParameters = Prettify <
14+ WithAccount < {
15+ limit : bigint ;
16+ } >
17+ > ;
18+
19+ export type SetMaxTxGasLimitReturnType = PrepareTransactionRequestReturnType ;
20+
21+ function arbOwnerFunctionData ( { limit } : SetMaxTxGasLimitParameters ) {
22+ return encodeFunctionData ( {
23+ abi : arbOwner . abi ,
24+ functionName : 'setMaxTxGasLimit' ,
25+ args : [ limit ] ,
26+ } ) ;
27+ }
28+
29+ export async function setL1PricingRewardRecipient < TChain extends Chain | undefined > (
30+ client : PublicClient < Transport , TChain > ,
31+ args : SetMaxTxGasLimitParameters ,
32+ ) : Promise < SetMaxTxGasLimitReturnType > {
33+ const data = arbOwnerFunctionData ( args ) ;
34+
35+ return client . prepareTransactionRequest ( {
36+ to : arbOwner . address ,
37+ value : BigInt ( 0 ) ,
38+ chain : client . chain ,
39+ data,
40+ account : args . account ,
41+ } satisfies PrepareTransactionRequestParameters ) ;
42+ }
Original file line number Diff line number Diff line change 1+ import {
2+ Chain ,
3+ PrepareTransactionRequestParameters ,
4+ PrepareTransactionRequestReturnType ,
5+ PublicClient ,
6+ Transport ,
7+ encodeFunctionData ,
8+ } from 'viem' ;
9+ import { arbOwner } from '../contracts' ;
10+ import { WithAccount } from '../types/Actions' ;
11+ import { Prettify } from '../types/utils' ;
12+
13+ export type SetParentPricePerUnitParameters = Prettify <
14+ WithAccount < {
15+ pricePerUnit : bigint ;
16+ } >
17+ > ;
18+
19+ export type SetParentPricePerUnitReturnType = PrepareTransactionRequestReturnType ;
20+
21+ function arbOwnerFunctionData ( { pricePerUnit } : SetParentPricePerUnitParameters ) {
22+ return encodeFunctionData ( {
23+ abi : arbOwner . abi ,
24+ functionName : 'setL1PricePerUnit' ,
25+ args : [ pricePerUnit ] ,
26+ } ) ;
27+ }
28+
29+ export async function setParentPricePerUnit < TChain extends Chain | undefined > (
30+ client : PublicClient < Transport , TChain > ,
31+ args : SetParentPricePerUnitParameters ,
32+ ) : Promise < SetParentPricePerUnitReturnType > {
33+ const data = arbOwnerFunctionData ( args ) ;
34+
35+ return client . prepareTransactionRequest ( {
36+ to : arbOwner . address ,
37+ value : BigInt ( 0 ) ,
38+ chain : client . chain ,
39+ data,
40+ account : args . account ,
41+ } satisfies PrepareTransactionRequestParameters ) ;
42+ }
Original file line number Diff line number Diff line change 1+ import {
2+ Chain ,
3+ PrepareTransactionRequestParameters ,
4+ PrepareTransactionRequestReturnType ,
5+ PublicClient ,
6+ Transport ,
7+ encodeFunctionData ,
8+ } from 'viem' ;
9+ import { arbOwner } from '../contracts' ;
10+ import { WithAccount } from '../types/Actions' ;
11+ import { Prettify } from '../types/utils' ;
12+
13+ export type SetParentPricingRewardRateParameters = Prettify <
14+ WithAccount < {
15+ weiPerUnit : bigint ;
16+ } >
17+ > ;
18+
19+ export type SetParentPricingRewardRateReturnType = PrepareTransactionRequestReturnType ;
20+
21+ function arbOwnerFunctionData ( { weiPerUnit } : SetParentPricingRewardRateParameters ) {
22+ return encodeFunctionData ( {
23+ abi : arbOwner . abi ,
24+ functionName : 'setL1PricingRewardRate' ,
25+ args : [ weiPerUnit ] ,
26+ } ) ;
27+ }
28+
29+ export async function setParentPricingRewardRate < TChain extends Chain | undefined > (
30+ client : PublicClient < Transport , TChain > ,
31+ args : SetParentPricingRewardRateParameters ,
32+ ) : Promise < SetParentPricingRewardRateReturnType > {
33+ const data = arbOwnerFunctionData ( args ) ;
34+
35+ return client . prepareTransactionRequest ( {
36+ to : arbOwner . address ,
37+ value : BigInt ( 0 ) ,
38+ chain : client . chain ,
39+ data,
40+ account : args . account ,
41+ } satisfies PrepareTransactionRequestParameters ) ;
42+ }
Original file line number Diff line number Diff line change 1+ import {
2+ Address ,
3+ Chain ,
4+ PrepareTransactionRequestParameters ,
5+ PrepareTransactionRequestReturnType ,
6+ PublicClient ,
7+ Transport ,
8+ encodeFunctionData ,
9+ } from 'viem' ;
10+ import { arbOwner } from '../contracts' ;
11+ import { WithAccount } from '../types/Actions' ;
12+ import { Prettify } from '../types/utils' ;
13+
14+ export type SetParentPricingRewardRecipientParameters = Prettify <
15+ WithAccount < {
16+ recipient : Address ;
17+ } >
18+ > ;
19+
20+ export type SetParentPricingRewardRecipientReturnType = PrepareTransactionRequestReturnType ;
21+
22+ function arbOwnerFunctionData ( { recipient } : SetParentPricingRewardRecipientParameters ) {
23+ return encodeFunctionData ( {
24+ abi : arbOwner . abi ,
25+ functionName : 'setL1PricingRewardRecipient' ,
26+ args : [ recipient ] ,
27+ } ) ;
28+ }
29+
30+ export async function setParentPricingRewardRecipient < TChain extends Chain | undefined > (
31+ client : PublicClient < Transport , TChain > ,
32+ args : SetParentPricingRewardRecipientParameters ,
33+ ) : Promise < SetParentPricingRewardRecipientReturnType > {
34+ const data = arbOwnerFunctionData ( args ) ;
35+
36+ return client . prepareTransactionRequest ( {
37+ to : arbOwner . address ,
38+ value : BigInt ( 0 ) ,
39+ chain : client . chain ,
40+ data,
41+ account : args . account ,
42+ } satisfies PrepareTransactionRequestParameters ) ;
43+ }
Original file line number Diff line number Diff line change 1+ import {
2+ Chain ,
3+ PrepareTransactionRequestParameters ,
4+ PrepareTransactionRequestReturnType ,
5+ PublicClient ,
6+ Transport ,
7+ encodeFunctionData ,
8+ } from 'viem' ;
9+ import { arbOwner } from '../contracts' ;
10+ import { WithAccount } from '../types/Actions' ;
11+ import { Prettify } from '../types/utils' ;
12+
13+ export type SetSpeedLimitParameters = Prettify <
14+ WithAccount < {
15+ limit : bigint ;
16+ } >
17+ > ;
18+
19+ export type SetSpeedLimitReturnType = PrepareTransactionRequestReturnType ;
20+
21+ function arbOwnerFunctionData ( { limit } : SetSpeedLimitParameters ) {
22+ return encodeFunctionData ( {
23+ abi : arbOwner . abi ,
24+ functionName : 'setSpeedLimit' ,
25+ args : [ limit ] ,
26+ } ) ;
27+ }
28+
29+ export async function setSpeedLimit < TChain extends Chain | undefined > (
30+ client : PublicClient < Transport , TChain > ,
31+ args : SetSpeedLimitParameters ,
32+ ) : Promise < SetSpeedLimitReturnType > {
33+ const data = arbOwnerFunctionData ( args ) ;
34+
35+ return client . prepareTransactionRequest ( {
36+ to : arbOwner . address ,
37+ value : BigInt ( 0 ) ,
38+ chain : client . chain ,
39+ data,
40+ account : args . account ,
41+ } satisfies PrepareTransactionRequestParameters ) ;
42+ }
You can’t perform that action at this time.
0 commit comments