import { utils } from '@wormhole-foundation/connect-sdk-solana';
import { toChainId } from '@wormhole-foundation/connect-sdk';
export function deriveForeignContractAddress(programId, chainId) {
    const chainIdBuf = Buffer.alloc(2);
    chainIdBuf.writeUInt16BE(toChainId(chainId));
    return utils.deriveAddress([Buffer.from('foreign_contract'), chainIdBuf], programId);
}
//# sourceMappingURL=foreignContract.js.map