import { AppABIEncodings } from "@counterfactual/types" ; import { Zero } from "ethers/constants" ; import { bigNumberify , BigNumberish } from "ethers/utils" ; const singleAssetTwoPartyCoinTransferEncoding = `
tuple(address to, uint256 amount)[2]
` ; export const transferAbiEncodings = { stateEncoding : `
    tuple(
      uint8 stage,
      ${ singleAssetTwoPartyCoinTransferEncoding } transfers,
      uint256 turnNum,
      bool finalized
    )` , actionEncoding : `
    tuple(
      uint8 actionType,
      uint256 amount
    )` } ; export function validAction ( actionType = 0 , amount = 1 ) { return { actionType , amount } ; } export function initialTransferState ( senderAddr , receiverAddr , amount = 1 ) { return { stage : 0 , transfers : [ { amount : bigNumberify ( amount ) , to : senderAddr } , { to : receiverAddr , amount : Zero } ] , turnNum : 0 , finalized : false } ; }