-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy patharbOwnerPublicActions.ts
More file actions
36 lines (31 loc) · 1.38 KB
/
arbOwnerPublicActions.ts
File metadata and controls
36 lines (31 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { Transport, Chain, PrepareTransactionRequestReturnType, PublicClient } from 'viem';
import {
arbOwnerReadContract,
ArbOwnerPublicFunctionName,
ArbOwnerReadContractParameters,
ArbOwnerReadContractReturnType,
} from '../arbOwnerReadContract';
import {
arbOwnerPrepareTransactionRequest,
ArbOwnerPrepareTransactionRequestFunctionName,
ArbOwnerPrepareTransactionRequestParameters,
} from '../arbOwnerPrepareTransactionRequest';
export type ArbOwnerPublicActions<TChain extends Chain | undefined = Chain | undefined> = {
arbOwnerReadContract: <TFunctionName extends ArbOwnerPublicFunctionName>(
args: ArbOwnerReadContractParameters<TFunctionName>,
) => Promise<ArbOwnerReadContractReturnType<TFunctionName>>;
arbOwnerPrepareTransactionRequest: <
TFunctionName extends ArbOwnerPrepareTransactionRequestFunctionName,
>(
args: ArbOwnerPrepareTransactionRequestParameters<TFunctionName>,
) => Promise<PrepareTransactionRequestReturnType<TChain> & { chainId: number }>;
};
export function arbOwnerPublicActions<
TTransport extends Transport = Transport,
TChain extends Chain | undefined = Chain | undefined,
>(client: PublicClient<TTransport, TChain>): ArbOwnerPublicActions<TChain> {
return {
arbOwnerReadContract: (args) => arbOwnerReadContract(client, args),
arbOwnerPrepareTransactionRequest: (args) => arbOwnerPrepareTransactionRequest(client, args),
};
}