import { Address , JsonRpcProvider } from "../basic" ; import { enumify , tidy } from "../utils" ; export type AddressBookEntry = { address : Address ; constructorArgs ? : Array < { name : string ; value : string ; } > ; txHash ? : string ; creationCodeHash ? : string ; runtimeCodeHash ? : string ; } ; export type AddressBook = { [ chainId ] : { [ contractName ] : AddressBookEntry ; } ; } ; export type AddressHistory = { [ chainId ] : { [ contractName ] : Address [ ] ; } ; } ; export type CriticalStateChannelAddresses = { ProxyFactory : Address ; MinimumViableMultisig : Address ; } ; export type ContractAddresses = CriticalStateChannelAddresses & { ChallengeRegistry : Address ; ConditionalTransactionDelegateTarget : Address ; DepositApp : Address ; WithdrawApp : Address ; HashLockTransferApp ? : Address ; IdentityApp : Address ; MultiAssetMultiPartyCoinTransferInterpreter : Address ; GraphSignedTransferApp ? : Address ; GraphBatchedTransferApp ? : Address ; SimpleLinkedTransferApp ? : Address ; SimpleSignedTransferApp ? : Address ; SimpleTwoPartySwapApp ? : Address ; SingleAssetTwoPartyCoinTransferInterpreter : Address ; TimeLockedPassThrough : Address ; Token ? : Address ; TwoPartyFixedOutcomeInterpreter : Address ; WithdrawInterpreter : Address ; } ; export interface NetworkContexts { [ chainId ] : NetworkContext ; } export interface NetworkContext { contractAddresses : ContractAddresses ; provider : JsonRpcProvider ; } export const EXPECTED_CONTRACT_NAMES_IN_NETWORK_CONTEXT = [ "ChallengeRegistry" , "ConditionalTransactionDelegateTarget" , "DepositApp" , "IdentityApp" , "MinimumViableMultisig" , "MultiAssetMultiPartyCoinTransferInterpreter" , "ProxyFactory" , "SingleAssetTwoPartyCoinTransferInterpreter" , "TimeLockedPassThrough" , "TwoPartyFixedOutcomeInterpreter" , "WithdrawInterpreter" , ] ; export const singleAssetSinglePartyCoinTransferEncoding = tidy ( `tuple(
  address to,
  uint256 amount
)` ) ; export const singleAssetTwoPartyCoinTransferEncoding = tidy ( `tuple(
  address to,
  uint256 amount
)[2]` ) ; export const multiAssetMultiPartyCoinTransferEncoding = tidy ( `tuple(
  address to,
  uint256 amount
)[][]` ) ; export const OutcomeType = enumify ( { TWO_PARTY_FIXED_OUTCOME : "TWO_PARTY_FIXED_OUTCOME" , MULTI_ASSET_MULTI_PARTY_COIN_TRANSFER : "MULTI_ASSET_MULTI_PARTY_COIN_TRANSFER" , SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER : "SINGLE_ASSET_TWO_PARTY_COIN_TRANSFER" , } ) ; export type OutcomeType = typeof OutcomeType [ keyof typeof OutcomeType ] ; export const CommitmentTarget = enumify ( { MULTISIG : "0" , SET_STATE : "1" , CANCEL_DISPUTE : "2" , } ) ;