-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
514f628
commit 505da4d
Showing
5 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Chain, PublicClient, ReadContractReturnType, Transport } from 'viem'; | ||
import { arbOwnerPublic } from '../contracts'; | ||
|
||
type ArbOwnerPublicABI = typeof arbOwnerPublic.abi; | ||
export type GetAllChainOwnersParameters = void; | ||
|
||
export type GetAllChainOwnersReturnType = ReadContractReturnType< | ||
ArbOwnerPublicABI, | ||
'getAllChainOwners' | ||
>; | ||
|
||
export async function getAllChainOwners<TChain extends Chain | undefined>( | ||
client: PublicClient<Transport, TChain>, | ||
): Promise<GetAllChainOwnersReturnType> { | ||
return client.readContract({ | ||
abi: arbOwnerPublic.abi, | ||
functionName: 'getAllChainOwners', | ||
address: arbOwnerPublic.address, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Chain, PublicClient, ReadContractReturnType, Transport } from 'viem'; | ||
import { arbOwnerPublic } from '../contracts'; | ||
|
||
type ArbOwnerPublicABI = typeof arbOwnerPublic.abi; | ||
export type GetInfraFeeAccountParameters = void; | ||
|
||
export type GetInfraFeeAccountReturnType = ReadContractReturnType< | ||
ArbOwnerPublicABI, | ||
'getInfraFeeAccount' | ||
>; | ||
|
||
export async function getInfraFeeAccount<TChain extends Chain | undefined>( | ||
client: PublicClient<Transport, TChain>, | ||
): Promise<GetInfraFeeAccountReturnType> { | ||
return client.readContract({ | ||
abi: arbOwnerPublic.abi, | ||
functionName: 'getInfraFeeAccount', | ||
address: arbOwnerPublic.address, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Chain, PublicClient, ReadContractReturnType, Transport } from 'viem'; | ||
import { arbOwnerPublic } from '../contracts'; | ||
|
||
type ArbOwnerPublicABI = typeof arbOwnerPublic.abi; | ||
export type GetNetworkFeeAccountParameters = void; | ||
|
||
export type GetNetworkFeeAccountReturnType = ReadContractReturnType< | ||
ArbOwnerPublicABI, | ||
'getNetworkFeeAccount' | ||
>; | ||
|
||
export async function getNetworkFeeAccount<TChain extends Chain | undefined>( | ||
client: PublicClient<Transport, TChain>, | ||
): Promise<GetNetworkFeeAccountReturnType> { | ||
return client.readContract({ | ||
abi: arbOwnerPublic.abi, | ||
functionName: 'getNetworkFeeAccount', | ||
address: arbOwnerPublic.address, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Chain, PublicClient, ReadContractReturnType, Transport } from 'viem'; | ||
import { arbOwnerPublic } from '../contracts'; | ||
|
||
type ArbOwnerPublicABI = typeof arbOwnerPublic.abi; | ||
export type GetScheduledUpgradeParameters = void; | ||
|
||
type GetScheduledUpgradeRawReturnType = ReadContractReturnType< | ||
ArbOwnerPublicABI, | ||
'getScheduledUpgrade' | ||
>; | ||
export type GetScheduledUpgradeReturnType = { | ||
arbosVersion: GetScheduledUpgradeRawReturnType[0]; | ||
scheduledForTimestamp: GetScheduledUpgradeRawReturnType[1]; | ||
}; | ||
|
||
export async function getScheduledUpgrade<TChain extends Chain | undefined>( | ||
client: PublicClient<Transport, TChain>, | ||
): Promise<GetScheduledUpgradeReturnType> { | ||
const [arbosVersion, scheduledForTimestamp] = await client.readContract({ | ||
abi: arbOwnerPublic.abi, | ||
functionName: 'getScheduledUpgrade', | ||
address: arbOwnerPublic.address, | ||
}); | ||
return { | ||
arbosVersion, | ||
scheduledForTimestamp, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Address, Chain, PublicClient, ReadContractReturnType, Transport } from 'viem'; | ||
import { arbOwnerPublic } from '../contracts'; | ||
|
||
type ArbOwnerPublicABI = typeof arbOwnerPublic.abi; | ||
export type IsChainOwnerParameters = { | ||
address: Address; | ||
}; | ||
|
||
export type IsChainOwnerReturnType = ReadContractReturnType<ArbOwnerPublicABI, 'isChainOwner'>; | ||
|
||
export async function isChainOwner<TChain extends Chain | undefined>( | ||
client: PublicClient<Transport, TChain>, | ||
args: IsChainOwnerParameters, | ||
): Promise<IsChainOwnerReturnType> { | ||
return client.readContract({ | ||
abi: arbOwnerPublic.abi, | ||
functionName: 'isChainOwner', | ||
address: arbOwnerPublic.address, | ||
args: [args.address], | ||
}); | ||
} |