import { PublicKey } from '@solana/web3.js' ; import { getAssociatedTokenAddress } from '../../../../tools/sdk/token/splToken' ; export function isYieldFarmingGovernance ( governancePk ) { const yfGovernances = [ 'EVhURne36yBfuTfqwn1W2hWdi6i3Vhau9n4FE8ehHbKM' , 'BB457CW2sN2BpEXzCCi3teaCnDT3hGPZDoCCutHb6BsQ' , ] ; return yfGovernances . includes ( governancePk . toBase58 ( ) ) ; } export function getRaySrmLpFarmUserAccount ( governancePk ) { switch ( governancePk . toBase58 ( ) ) { case 'EVhURne36yBfuTfqwn1W2hWdi6i3Vhau9n4FE8ehHbKM' : return new PublicKey ( '4wmxLsrtQh7KhyhKiDPpxLNfPn6o3QzD68mWdJrHHsuH' ) ; case 'BB457CW2sN2BpEXzCCi3teaCnDT3hGPZDoCCutHb6BsQ' : return new PublicKey ( 'CjvTxyoZPfSg1aDchw79RmwFfkuWb5v1obhCt4dfw9mq' ) ; default : throw new Error ( `User account is not defined for ${ governancePk . toBase58 ( ) }  governance` ) ; } } export function getRayFarmUserAccount ( governancePk ) { switch ( governancePk . toBase58 ( ) ) { case 'EVhURne36yBfuTfqwn1W2hWdi6i3Vhau9n4FE8ehHbKM' : return new PublicKey ( 'DuJMJz1ZDQx1QeGZSaYPRN9tNFFjcgGYNA8q7f58KYQG' ) ; case 'BB457CW2sN2BpEXzCCi3teaCnDT3hGPZDoCCutHb6BsQ' : return new PublicKey ( 'HPDnbMNypc2BPMMzm8PKNRtPm1xgkr8YfgdUePL8oNrb' ) ; default : throw new Error ( `User account is not defined for ${ governancePk . toBase58 ( ) }  governance` ) ; } } export async function getRAYGovernanceAta ( governancePk ) { let rayAta = await getAssociatedTokenAddress ( new PublicKey ( '4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R' ) , governancePk ) ; if ( governancePk . equals ( new PublicKey ( 'BB457CW2sN2BpEXzCCi3teaCnDT3hGPZDoCCutHb6BsQ' ) ) ) { rayAta = new PublicKey ( '8bVecpkd9gbK8VtYKHxjjL1uXnSevgdH8BAnuKjScacf' ) ; } return rayAta ; } export async function getSRMGovernanceAta ( governancePk ) { let srmAta = await getAssociatedTokenAddress ( new PublicKey ( 'SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt' ) , governancePk ) ; if ( governancePk . equals ( new PublicKey ( 'BB457CW2sN2BpEXzCCi3teaCnDT3hGPZDoCCutHb6BsQ' ) ) ) { srmAta = new PublicKey ( 'EfQU385sk18VwfVaxZ1aiDXfvHg9jdbzqGm9Qg7261wh' ) ; } return srmAta ; }