import { utils } from "@project-serum/anchor"; import { PublicKey } from "@solana/web3.js"; import { QUARRY_ADDRESSES } from "../../constants"; export const findTransferWrapperAddress = async ( base: PublicKey, programID: PublicKey = QUARRY_ADDRESSES.TransferWrapper ): Promise<[PublicKey, number]> => { return await PublicKey.findProgramAddress( [Buffer.from(utils.bytes.utf8.encode("TransferWrapper")), base.toBytes()], programID ); }; export const findTransfererAddress = async ( wrapper: PublicKey, authority: PublicKey, programID: PublicKey = QUARRY_ADDRESSES.TransferWrapper ): Promise<[PublicKey, number]> => { return await PublicKey.findProgramAddress( [ Buffer.from(utils.bytes.utf8.encode("Transferer")), wrapper.toBytes(), authority.toBytes(), ], programID ); };